Add host configuration for backend server and update documentation
- Introduced a new `host` option in `flake.nix` to specify the server's bind address, defaulting to `0.0.0.0`. - Updated `run.sh` to use the `HOST` environment variable for server binding. - Modified `config.py` to read the `HOST` from environment variables, defaulting to `0.0.0.0`. - Enhanced `README.md` with instructions for setting up the `HOST` variable and clarified access details for development and production modes. - Adjusted `vite.config.ts` to allow frontend access from other computers by default.
This commit is contained in:
@@ -104,6 +104,7 @@
|
||||
# The run.sh script will read from files at runtime
|
||||
envVars = [
|
||||
"PORT=${toString cfg.port}"
|
||||
"HOST=${cfg.host}"
|
||||
"POSTGRES_SOCKET_PATH=${cfg.postgresSocketPath}"
|
||||
] ++ [
|
||||
# API keys - if path, pass as-is; if string, pass directly
|
||||
@@ -131,6 +132,12 @@
|
||||
description = "Port to bind the backend server";
|
||||
};
|
||||
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0";
|
||||
description = "Host address to bind the server (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only)";
|
||||
};
|
||||
|
||||
postgresSocketPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/run/postgresql";
|
||||
|
||||
Reference in New Issue
Block a user