Compare commits

...

2 commits

Author SHA1 Message Date
b0942bd174
Revert "log to file"
This reverts commit 1a8d940a90.
2025-04-12 11:36:18 +02:00
553753218e
pass vars separately 2025-04-12 11:33:59 +02:00
6 changed files with 5 additions and 20 deletions

1
.gitignore vendored
View file

@ -12,4 +12,3 @@ result*
*screenshot.png *screenshot.png
output output
todo todo
log/

View file

@ -1,6 +1,5 @@
{ {
config, config,
lib,
... ...
}: }:
let let
@ -56,11 +55,6 @@ in
COMPRESS_OFFLINE = true; COMPRESS_OFFLINE = true;
LIBSASS_OUTPUT_STYLE = "compressed"; LIBSASS_OUTPUT_STYLE = "compressed";
}; };
environment = {
TF_VARS = lib.strings.toJSON {
ssh_private_key_file = config.age.secrets.panel-ssh-key.path;
};
};
secrets = { secrets = {
SECRET_KEY = config.age.secrets.panel-secret-key.path; SECRET_KEY = config.age.secrets.panel-secret-key.path;
}; };

View file

@ -31,7 +31,6 @@ in
DATABASE_URL = "sqlite:///${toString ./src}/db.sqlite3"; DATABASE_URL = "sqlite:///${toString ./src}/db.sqlite3";
# locally: use a fixed relative reference, so we can use our newest files without copying to the store # locally: use a fixed relative reference, so we can use our newest files without copying to the store
REPO_DIR = toString ../.; REPO_DIR = toString ../.;
LOGGING_DIR = "../log";
}; };
shellHook = '' shellHook = ''
ln -sf ${sources.htmx}/dist/htmx.js src/panel/static/htmx.min.js ln -sf ${sources.htmx}/dist/htmx.js src/panel/static/htmx.min.js

View file

@ -13,5 +13,5 @@
pkgs.gnugrep # used in terraform-nixos pkgs.gnugrep # used in terraform-nixos
(import ../launch/tf.nix { inherit lib pkgs; }) (import ../launch/tf.nix { inherit lib pkgs; })
]; ];
TF_VARS = lib.strings.toJSON { }; SSH_PRIVATE_KEY_FILE = "";
} }

View file

@ -30,7 +30,7 @@ let
(builtins.toFile "extra-settings.py" cfg.extra-settings) (builtins.toFile "extra-settings.py" cfg.extra-settings)
]; ];
REPO_DIR = import ../../launch/tf-env.nix { inherit lib pkgs; }; REPO_DIR = import ../../launch/tf-env.nix { inherit lib pkgs; };
LOGGING_DIR = "/var/log/${name}"; SSH_PRIVATE_KEY_FILE = config.age.secrets.panel-ssh-key.path;
}; };
python-environment = pkgs.python3.withPackages ( python-environment = pkgs.python3.withPackages (

View file

@ -176,9 +176,6 @@ COMPRESS_PRECOMPILERS = [
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
logging_dir = env["LOGGING_DIR"]
os.makedirs(logging_dir, mode=0o700, exist_ok=True)
LOGGING = { LOGGING = {
"version": 1, "version": 1,
"disable_existing_loggers": False, "disable_existing_loggers": False,
@ -213,15 +210,10 @@ LOGGING = {
"filters": ["require_debug_false"], "filters": ["require_debug_false"],
"class": "django.utils.log.AdminEmailHandler", "class": "django.utils.log.AdminEmailHandler",
}, },
"file": {
"level": "INFO",
"class": "logging.FileHandler",
"filename": f"{logging_dir}/info.log",
},
}, },
"loggers": { "loggers": {
"django": { "django": {
"handlers": ["console", "mail_admins", "file"], "handlers": ["console", "mail_admins"],
"level": "INFO", "level": "INFO",
}, },
"django.server": { "django.server": {
@ -259,5 +251,6 @@ bin_path=env['BIN_PATH']
# to deploy this should be specified, for dev just use a relative path. # to deploy this should be specified, for dev just use a relative path.
repo_dir = env["REPO_DIR"] repo_dir = env["REPO_DIR"]
ENV_VARS = json.loads(env["TF_VARS"]) | { ENV_VARS = {
"ssh_private_key_file": env["SSH_PRIVATE_KEY_FILE"],
} }