diff --git a/Dockerfile.alpine-musl b/Dockerfile.alpine-musl index 41cc71c..85c4e3f 100644 --- a/Dockerfile.alpine-musl +++ b/Dockerfile.alpine-musl @@ -1,6 +1,8 @@ # Alpine-based MUSL static binary builder for C-Relay # Produces truly portable binaries with zero runtime dependencies +ARG DEBUG_BUILD=false + FROM alpine:3.19 AS builder # Install build dependencies @@ -98,9 +100,19 @@ RUN cd nostr_core_lib && \ COPY src/ /build/src/ COPY Makefile /build/Makefile -# Build c-relay with full static linking and debug symbols (only rebuilds when src/ changes) +# Build c-relay with full static linking (only rebuilds when src/ changes) # Disable fortification to avoid __*_chk symbols that don't exist in MUSL -RUN gcc -static -g -O0 -DDEBUG -Wall -Wextra -std=c99 \ +# Use conditional compilation flags based on DEBUG_BUILD argument +RUN if [ "$DEBUG_BUILD" = "true" ]; then \ + CFLAGS="-g -O0 -DDEBUG"; \ + STRIP_CMD=""; \ + echo "Building with DEBUG symbols enabled"; \ + else \ + CFLAGS="-O2"; \ + STRIP_CMD="strip /build/c_relay_static"; \ + echo "Building optimized production binary"; \ + fi && \ + gcc -static $CFLAGS -Wall -Wextra -std=c99 \ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 \ -I. -Ic_utils_lib/src -Inostr_core_lib -Inostr_core_lib/nostr_core \ -Inostr_core_lib/cjson -Inostr_core_lib/nostr_websocket \ @@ -111,10 +123,8 @@ RUN gcc -static -g -O0 -DDEBUG -Wall -Wextra -std=c99 \ c_utils_lib/libc_utils.a \ nostr_core_lib/libnostr_core_x64.a \ -lwebsockets -lssl -lcrypto -lsqlite3 -lsecp256k1 \ - -lcurl -lz -lpthread -lm -ldl - -# DO NOT strip - we need debug symbols for debugging -# RUN strip /build/c_relay_static + -lcurl -lz -lpthread -lm -ldl && \ + eval "$STRIP_CMD" # Verify it's truly static RUN echo "=== Binary Information ===" && \ diff --git a/api/index.css b/api/index.css index 2e7dbbe..1972bab 100644 --- a/api/index.css +++ b/api/index.css @@ -22,6 +22,23 @@ --tab-border-opacity-logged-in: 0.1; } +/* Dark Mode Overrides */ +body.dark-mode { + --primary-color: #ffffff; + --secondary-color: #000000; + --accent-color: #ff0000; + --muted-color: #222222; + --border-color: var(--muted-color); + + + --tab-bg-logged-out: #000000; + --tab-color-logged-out: #ffffff; + --tab-border-logged-out: #ffffff; + --tab-bg-logged-in: #000000; + --tab-color-logged-in: #ffffff; + --tab-border-logged-in: #00ffff; +} + * { margin: 0; padding: 0; @@ -65,6 +82,86 @@ body { text-align: left; } +.relay-info { + text-align: center; + flex: 1; +} + +.relay-name { + font-size: 14px; + font-weight: bold; + color: var(--primary-color); + margin-bottom: 2px; +} + +.relay-pubkey-container { + border: 1px solid transparent; + border-radius: var(--border-radius); + padding: 4px; + margin-top: 4px; + cursor: pointer; + transition: border-color 0.2s ease; + background-color: var(--secondary-color); +} + +.relay-pubkey-container:hover { + border-color: var(--border-color); +} + +.relay-pubkey-container.copied { + border-color: var(--accent-color); + animation: flash-accent 0.5s ease-in-out; +} + +.relay-pubkey { + font-size: 8px; + color: var(--primary-color); + font-family: "Courier New", Courier, monospace; + line-height: 1.2; + white-space: pre-line; + text-align: center; +} + +@keyframes flash-accent { + 0% { border-color: var(--accent-color); } + 50% { border-color: var(--accent-color); } + 100% { border-color: transparent; } +} + +.relay-description { + font-size: 10px; + color: var(--primary-color); + margin-bottom: 0; +} + +.header-title { + margin: 0; + font-size: 24px; + font-weight: bolder; + color: var(--primary-color); + border: none; + padding: 0; + text-align: left; + display: flex; + gap: 2px; +} + +.relay-letter { + position: relative; + display: inline-block; + transition: all 0.05s ease; +} + +.relay-letter.underlined::after { + content: ''; + position: absolute; + bottom: -2px; + left: 0; + right: 0; + height: 2px; + background-color: var(--accent-color); +} + .header-user-name { display: block; font-weight: 500; @@ -76,6 +173,7 @@ body { .profile-area { display: flex; + flex-direction: column; align-items: center; position: relative; cursor: pointer; @@ -85,6 +183,14 @@ body { margin-left: auto; } +.admin-label { + font-size: 10px; + color: var(--primary-color); + font-weight: normal; + margin-bottom: 4px; + text-align: center; +} + .profile-container { display: flex; flex-direction: column; @@ -127,13 +233,13 @@ body { .logout-btn { width: 100%; - padding: 10px 15px; + padding: 5px 10px; background: none; border: none; color: var(--primary-color); text-align: left; cursor: pointer; - font-size: 14px; + font-size: 10px; font-family: var(--font-family); border-radius: var(--border-radius); transition: background-color 0.2s ease; @@ -253,10 +359,10 @@ button:active { } button:disabled { - background-color: #ccc; - color: var(--muted-color); + background-color: var(--muted-color); + color: var(--primary-color); cursor: not-allowed; - border-color: #ccc; + border-color: var(--muted-color); } /* Flash animation for refresh button */ @@ -344,6 +450,10 @@ button:disabled { font-size: 10px; } +.config-table tbody tr:hover { + background-color: rgba(0, 0, 0, 0.05); +} + .config-table-container { overflow-x: auto; max-width: 100%; @@ -351,12 +461,13 @@ button:disabled { .config-table th { font-weight: bold; - height: 40px; /* Double the default height */ - line-height: 40px; /* Center text vertically */ + height: 24px; /* Base height for tbody rows */ + line-height: 24px; /* Center text vertically */ } -.config-table tr:hover { - background-color: var(--muted-color); +.config-table td { + height: 16px; /* 50% taller than tbody rows would be */ + line-height: 16px; /* Center text vertically */ } /* Inline config value inputs - remove borders and padding to fit seamlessly in table cells */ @@ -694,12 +805,6 @@ button:disabled { transition: all 0.2s ease; } - -.flex-section { - flex: 1; - min-width: 300px; -} - @media (max-width: 700px) { body { padding: 10px; diff --git a/api/index.html b/api/index.html index 19a19aa..80137f6 100644 --- a/api/index.html +++ b/api/index.html @@ -10,21 +10,38 @@ -
-
-
RELAY
-
+ +