diff --git a/README.md b/README.md index 924eff4..33c9393 100644 --- a/README.md +++ b/README.md @@ -79,13 +79,13 @@ curl.exe -H "X-Ngino-Token: change-me" ` Server options: -- `--token ` or `REVERSE_LLAMA_TOKEN`: optional shared token. If set, proxy calls must authenticate with `X-Ngino-Token`, `Authorization: Bearer `, or the `/token//...` path prefix. +- `--token ` or `NGINO_TOKEN`: optional shared token. If set, proxy calls must authenticate with `X-Ngino-Token`, `Authorization: Bearer `, or the `/token//...` path prefix. - `--tunnel-path `: defaults to `/_ngino/tunnel`. - `--status-path `: defaults to `/_ngino/status`. -- `--chunk-size ` or `REVERSE_LLAMA_CHUNK_SIZE`: defaults to `65536`. -- `--embedding-cache-path ` or `REVERSE_LLAMA_EMBEDDING_CACHE_PATH`: SQLite cache file for embedding vectors. Defaults to `App_Data\embedding-cache.sqlite` under the server app directory. -- `--management-database-path ` or `REVERSE_LLAMA_MANAGEMENT_DATABASE_PATH`: SQLite database for admin user keys, client keys, client disable state, and request/model metrics. Defaults to `App_Data\management.sqlite` under the server app directory. -- `--secure-cookies` or `REVERSE_LLAMA_SECURE_COOKIES`: set to `false` to allow admin auth cookies over plain HTTP (for local development). Defaults to `true`. +- `--chunk-size ` or `NGINO_CHUNK_SIZE`: defaults to `65536`. +- `--embedding-cache-path ` or `NGINO_EMBEDDING_CACHE_PATH`: SQLite cache file for embedding vectors. Defaults to `App_Data\embedding-cache.sqlite` under the server app directory. +- `--management-database-path ` or `NGINO_MANAGEMENT_DATABASE_PATH`: SQLite database for admin user keys, client keys, client disable state, and request/model metrics. Defaults to `App_Data\management.sqlite` under the server app directory. +- `--secure-cookies` or `NGINO_SECURE_COOKIES`: set to `false` to allow admin auth cookies over plain HTTP (for local development). Defaults to `true`. Admin UI: @@ -96,13 +96,13 @@ Admin UI: Client options: -- `--server ` or `REVERSE_LLAMA_SERVER`: server base URL, for example `http://your-server:5050`. -- `--upstream ` or `REVERSE_LLAMA_UPSTREAM`: local Ollama URL, defaults to `http://localhost:11434`. -- `--token ` or `REVERSE_LLAMA_TOKEN`: optional shared token. -- `--client-id ` or `REVERSE_LLAMA_CLIENT_ID`: identifies this machine on the server; defaults to the machine name. -- `--tunnel-path ` or `REVERSE_LLAMA_TUNNEL_PATH`: defaults to `/_ngino/tunnel`. -- `--reconnect-delay ` or `REVERSE_LLAMA_RECONNECT_DELAY_SECONDS`: defaults to `5`. -- `--chunk-size ` or `REVERSE_LLAMA_CHUNK_SIZE`: defaults to `65536`. +- `--server ` or `NGINO_SERVER`: server base URL, for example `http://your-server:5050`. +- `--upstream ` or `NGINO_UPSTREAM`: local Ollama URL, defaults to `http://localhost:11434`. +- `--token ` or `NGINO_TOKEN`: optional shared token. +- `--client-id ` or `NGINO_CLIENT_ID`: identifies this machine on the server; defaults to the machine name. +- `--tunnel-path ` or `NGINO_TUNNEL_PATH`: defaults to `/_ngino/tunnel`. +- `--reconnect-delay ` or `NGINO_RECONNECT_DELAY_SECONDS`: defaults to `5`. +- `--chunk-size ` or `NGINO_CHUNK_SIZE`: defaults to `65536`. The token is accepted as `X-Ngino-Token`, as `Authorization: Bearer `, or as a path prefix like `/token//api/tags` or `/token//clients/{id}/v1`. The Bearer form lets OpenAI-compatible clients (e.g. n8n's OpenAI nodes pointed at `/clients/{id}/v1`) authenticate with their API-key field. The path-token form is useful for clients that cannot send custom headers. The server strips its own token header/Bearer value and removes the path prefix before forwarding; any other `Authorization` value is forwarded untouched. diff --git a/deploy/install-client.sh b/deploy/install-client.sh index cb63dbb..95174d8 100755 --- a/deploy/install-client.sh +++ b/deploy/install-client.sh @@ -265,7 +265,7 @@ info "Client installed to $INSTALL_DIR." # ── Write environment file (avoids shell injection in unit file) ───────────── ENV_DIR="/etc/ngino-client" mkdir -p "$ENV_DIR" -printf 'REVERSE_LLAMA_TOKEN=%s\n' "$TOKEN" > "$ENV_DIR/env" +printf 'NGINO_TOKEN=%s\n' "$TOKEN" > "$ENV_DIR/env" chmod 600 "$ENV_DIR/env" info "Environment file written to $ENV_DIR/env (mode 0600)." diff --git a/src/Ngino.Client/ClientOptions.cs b/src/Ngino.Client/ClientOptions.cs index e540e4b..3d4c4f3 100644 --- a/src/Ngino.Client/ClientOptions.cs +++ b/src/Ngino.Client/ClientOptions.cs @@ -47,13 +47,13 @@ internal sealed class ClientOptions return new ClientOptions { - Server = ReadUri(values, "server", "REVERSE_LLAMA_SERVER", "http://localhost:5001"), - Upstream = ReadUri(values, "upstream", "REVERSE_LLAMA_UPSTREAM", "http://localhost:11434"), - TunnelPath = NormalizePath(Read(values, "tunnel-path", "REVERSE_LLAMA_TUNNEL_PATH") ?? ProtocolConstants.DefaultTunnelPath), - Token = Read(values, "token", "REVERSE_LLAMA_TOKEN"), - ClientId = Read(values, "client-id", "REVERSE_LLAMA_CLIENT_ID") ?? Environment.MachineName.ToLowerInvariant(), - ReconnectDelay = TimeSpan.FromSeconds(ReadInt(values, 5, "reconnect-delay", "REVERSE_LLAMA_RECONNECT_DELAY_SECONDS")), - ChunkSize = ReadInt(values, 64 * 1024, "chunk-size", "REVERSE_LLAMA_CHUNK_SIZE") + Server = ReadUri(values, "server", "NGINO_SERVER", "http://localhost:5001"), + Upstream = ReadUri(values, "upstream", "NGINO_UPSTREAM", "http://localhost:11434"), + TunnelPath = NormalizePath(Read(values, "tunnel-path", "NGINO_TUNNEL_PATH") ?? ProtocolConstants.DefaultTunnelPath), + Token = Read(values, "token", "NGINO_TOKEN"), + ClientId = Read(values, "client-id", "NGINO_CLIENT_ID") ?? Environment.MachineName.ToLowerInvariant(), + ReconnectDelay = TimeSpan.FromSeconds(ReadInt(values, 5, "reconnect-delay", "NGINO_RECONNECT_DELAY_SECONDS")), + ChunkSize = ReadInt(values, 64 * 1024, "chunk-size", "NGINO_CHUNK_SIZE") }; } diff --git a/src/Ngino.Protocol/ProtocolConstants.cs b/src/Ngino.Protocol/ProtocolConstants.cs index a3ce956..cf12645 100644 --- a/src/Ngino.Protocol/ProtocolConstants.cs +++ b/src/Ngino.Protocol/ProtocolConstants.cs @@ -6,5 +6,5 @@ public static class ProtocolConstants public const string DefaultTunnelPath = "/_ngino/tunnel"; public const string TokenHeader = "X-Ngino-Token"; public const string ClientIdHeader = "X-Ngino-Client-Id"; - public const string ReplacedCloseDescription = "reverse-llama-replaced"; + public const string ReplacedCloseDescription = "ngino-replaced"; } diff --git a/src/Ngino.Server/AdminEndpoints.cs b/src/Ngino.Server/AdminEndpoints.cs index d1b01d8..6ab9b66 100644 --- a/src/Ngino.Server/AdminEndpoints.cs +++ b/src/Ngino.Server/AdminEndpoints.cs @@ -587,7 +587,7 @@ internal static class AdminEndpoints : "
" + HtmlEncode(error) + "
"; var loginAction = "/admin/login" + (returnUrl != "/admin" ? "?returnUrl=" + Uri.EscapeDataString(returnUrl) : ""); - return "\n\n\n\n\nReverse Llama - Login\n\n\n\n
\n

Reverse Llama Admin

\n" + errorHtml + "\n
\n\n\n\n\n\n\n\n
\n
\n\n"; + return "\n\n\n\n\nNgino - Login\n\n\n\n
\n

Ngino Admin

\n" + errorHtml + "\n
\n\n\n\n\n\n\n\n
\n
\n\n"; } private static string SetupPage(string? error, string? antiforgeryToken) @@ -596,7 +596,7 @@ internal static class AdminEndpoints ? "" : "
" + HtmlEncode(error) + "
"; - return "\n\n\n\n\nReverse Llama - Initial Setup\n\n\n\n
\n

Reverse Llama

\n

Initial Setup - Create Admin Account

\n" + errorHtml + "\n
\n\n\n\n\n\n\n\n\n\n\n
\n
\n\n\n"; + return "\n\n\n\n\nNgino - Initial Setup\n\n\n\n
\n

Ngino

\n

Initial Setup - Create Admin Account

\n" + errorHtml + "\n
\n\n\n\n\n\n\n\n\n\n\n
\n
\n\n\n"; } private static string? HtmlEncode(string? value) => diff --git a/src/Ngino.Server/ServerSettings.cs b/src/Ngino.Server/ServerSettings.cs index 5c20d9f..4d9dc01 100644 --- a/src/Ngino.Server/ServerSettings.cs +++ b/src/Ngino.Server/ServerSettings.cs @@ -31,30 +31,30 @@ internal sealed class ServerSettings { StatusPath = NormalizePath(Read(configuration, "Ngino:StatusPath", "status-path") ?? ProtocolConstants.DefaultStatusPath), TunnelPath = NormalizePath(Read(configuration, "Ngino:TunnelPath", "tunnel-path") ?? ProtocolConstants.DefaultTunnelPath), - Token = Read(configuration, "Ngino:Token", "token") ?? Environment.GetEnvironmentVariable("REVERSE_LLAMA_TOKEN"), - ClientToken = Read(configuration, "Ngino:ClientToken", "client-token") ?? Environment.GetEnvironmentVariable("REVERSE_LLAMA_CLIENT_TOKEN"), - ChunkSize = ReadInt(configuration, 64 * 1024, "Ngino:ChunkSize", "chunk-size", "REVERSE_LLAMA_CHUNK_SIZE"), + Token = Read(configuration, "Ngino:Token", "token") ?? Environment.GetEnvironmentVariable("NGINO_TOKEN"), + ClientToken = Read(configuration, "Ngino:ClientToken", "client-token") ?? Environment.GetEnvironmentVariable("NGINO_CLIENT_TOKEN"), + ChunkSize = ReadInt(configuration, 64 * 1024, "Ngino:ChunkSize", "chunk-size", "NGINO_CHUNK_SIZE"), EmbeddingCachePath = Read( configuration, "Ngino:EmbeddingCachePath", "embedding-cache-path", - "REVERSE_LLAMA_EMBEDDING_CACHE_PATH"), + "NGINO_EMBEDDING_CACHE_PATH"), ManagementDatabasePath = Read( configuration, "Ngino:ManagementDatabasePath", "management-database-path", - "REVERSE_LLAMA_MANAGEMENT_DATABASE_PATH"), - SecureCookies = ReadBool(configuration, true, "Ngino:SecureCookies", "secure-cookies", "REVERSE_LLAMA_SECURE_COOKIES"), + "NGINO_MANAGEMENT_DATABASE_PATH"), + SecureCookies = ReadBool(configuration, true, "Ngino:SecureCookies", "secure-cookies", "NGINO_SECURE_COOKIES"), Keycloak = new KeycloakSettings { - Authority = Read(configuration, "Authentication:Keycloak:Authority", "REVERSE_LLAMA_KEYCLOAK_AUTHORITY"), - ClientId = Read(configuration, "Authentication:Keycloak:ClientId", "REVERSE_LLAMA_KEYCLOAK_CLIENT_ID"), - ClientSecret = Read(configuration, "Authentication:Keycloak:ClientSecret", "REVERSE_LLAMA_KEYCLOAK_CLIENT_SECRET"), + Authority = Read(configuration, "Authentication:Keycloak:Authority", "NGINO_KEYCLOAK_AUTHORITY"), + ClientId = Read(configuration, "Authentication:Keycloak:ClientId", "NGINO_KEYCLOAK_CLIENT_ID"), + ClientSecret = Read(configuration, "Authentication:Keycloak:ClientSecret", "NGINO_KEYCLOAK_CLIENT_SECRET"), RequireHttpsMetadata = ReadBool( configuration, true, "Authentication:Keycloak:RequireHttpsMetadata", - "REVERSE_LLAMA_KEYCLOAK_REQUIRE_HTTPS_METADATA") + "NGINO_KEYCLOAK_REQUIRE_HTTPS_METADATA") }, Cors = new CorsSettings {