Compare commits

..

No commits in common. "6a69fe46729fde144533e59dba41c35da17b8769" and "4fd0a02f81627c2e0c4052e1a4baa5d6160920ea" have entirely different histories.

View file

@ -9,7 +9,7 @@ let
# Shared environment variables for both services # Shared environment variables for both services
commonEnv = { commonEnv = {
NODE_ENV = cfg.mode; NODE_ENV = "production";
LOG_LEVEL = cfg.logLevel; LOG_LEVEL = cfg.logLevel;
HOSTNAME = cfg.hostname; HOSTNAME = cfg.hostname;
@ -117,15 +117,6 @@ in
description = "Logging level for lamassu-server"; description = "Logging level for lamassu-server";
}; };
mode = mkOption {
type = types.enum [ "production" "development" ];
default = "development";
description = ''
Run in production or development mode.
Development mode uses port 3001 for admin UI registration URLs.
'';
};
skip2FA = mkOption { skip2FA = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -279,8 +270,6 @@ in
CI = "true"; CI = "true";
CC = "${pkgs.stdenv.cc}/bin/cc"; CC = "${pkgs.stdenv.cc}/bin/cc";
CXX = "${pkgs.stdenv.cc}/bin/c++"; CXX = "${pkgs.stdenv.cc}/bin/c++";
# Use content-addressable store to reduce disk usage
npm_config_cache = "${cfg.dataDir}/.npm-cache";
}; };
serviceConfig = { serviceConfig = {
@ -296,8 +285,6 @@ in
ProtectHome = true; ProtectHome = true;
NoNewPrivileges = true; NoNewPrivileges = true;
ReadWritePaths = [ cfg.dataDir ]; ReadWritePaths = [ cfg.dataDir ];
# node-gyp needs writable /tmp for native module compilation
PrivateTmp = true;
}; };
script = '' script = ''
@ -411,7 +398,6 @@ in
export POSTGRES_HOST="127.0.0.1" POSTGRES_PORT="5432" export POSTGRES_HOST="127.0.0.1" POSTGRES_PORT="5432"
export POSTGRES_DB="${cfg.database.name}" POSTGRES_USER="${cfg.database.user}" POSTGRES_PASSWORD="$DB_PASSWORD" export POSTGRES_DB="${cfg.database.name}" POSTGRES_USER="${cfg.database.user}" POSTGRES_PASSWORD="$DB_PASSWORD"
export HOSTNAME="${cfg.hostname}" SKIP_2FA="${if cfg.skip2FA then "true" else "false"}" export HOSTNAME="${cfg.hostname}" SKIP_2FA="${if cfg.skip2FA then "true" else "false"}"
export NODE_ENV="${cfg.mode}"
sudo -E -u ${cfg.user} ${pkgs.nodejs_22}/bin/node ${cfg.dataDir}/source/packages/server/bin/lamassu-register "$@" sudo -E -u ${cfg.user} ${pkgs.nodejs_22}/bin/node ${cfg.dataDir}/source/packages/server/bin/lamassu-register "$@"
'') '')
]; ];