feat(kadenios): Fix build of static files and restore cas.eleves.ens.fr for authens
Some checks failed
build configuration / build_vault01 (push) Successful in 1m33s
build configuration / build_rescue01 (push) Successful in 1m35s
build configuration / build_compute01 (push) Successful in 1m43s
build configuration / build_storage01 (push) Successful in 1m47s
lint / check (push) Successful in 24s
build configuration / build_web02 (push) Successful in 1m35s
build configuration / build_web01 (push) Failing after 2m9s
build configuration / push_to_cache (push) Has been skipped

This commit is contained in:
Tom Hubrecht 2024-07-28 14:29:54 +02:00
parent 1216a0a780
commit be128f6c3a
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 38 additions and 40 deletions

View file

@ -1,11 +0,0 @@
diff --git a/src/authens/utils.py b/src/authens/utils.py
index 7306506..36063b6 100644
--- a/src/authens/utils.py
+++ b/src/authens/utils.py
@@ -16,7 +16,7 @@ def get_cas_client(request):
service_url=urlunparse(
(request.scheme, request.get_host(), request.path, "", "", "")
),
- server_url="https://cas.eleves.ens.fr/",
+ server_url="https://cas-eleves.dgnum.eu/",
)

View file

@ -7,7 +7,7 @@
}:
let
inherit (lib) mapAttrsToList;
inherit (lib) mapAttrsToList optionals;
port = 9888;
@ -18,45 +18,56 @@ let
pkgs.python3.override {
packageOverrides = _: _: {
inherit (nix-pkgs)
authens
django-background-tasks
django-browser-reload
django-bulma-forms
django-translated-fields
loadcredential
;
authens = nix-pkgs.authens.overridePythonAttrs (_: {
patches = [ ./01-authens-cas-url.patch ];
});
};
};
pythonEnv = python3.withPackages (ps: [
ps.django
pythonEnv =
{
debug ? false,
}:
python3.withPackages (
ps:
[
ps.django
ps.gunicorn
ps.gunicorn
ps.markdown
ps.numpy
ps.networkx
ps.psycopg
ps.markdown
ps.numpy
ps.networkx
ps.psycopg
ps.authens
ps.django-background-tasks
ps.django-bulma-forms
ps.django-translated-fields
ps.loadcredential
]);
ps.authens
ps.django-background-tasks
ps.django-bulma-forms
ps.django-translated-fields
ps.loadcredential
]
++ (optionals debug [
ps.django-browser-reload
ps.django-debug-toolbar
])
);
manage = pkgs.writeShellApplication {
name = "kadenios-manage";
runtimeInputs = [ pythonEnv ];
runtimeInputs = path ++ [
config.systemd.package
pkgs.util-linux
];
text = ''
MainPID=0
eval "$(${lib.getExe' config.systemd.package "systemctl"} show -pMainPID django-kadenios.service)"
MainPID=$(systemctl show -p MainPID --value django-kadenios.service)
${lib.getExe' pkgs.util-linux "nsenter"} -e -a -t "$MainPID" -G follow -S follow python ${sources.kadenios}/manage.py "$@"
nsenter -e -a -t "$MainPID" -G follow -S follow python ${sources.kadenios}/manage.py "$@"
'';
};
@ -65,7 +76,7 @@ let
src = sources.kadenios;
nativeBuildInputs = [ pythonEnv ];
nativeBuildInputs = [ (pythonEnv { debug = true; }) ];
configurePhase = ''
export KADENIOS_STATIC_ROOT=$out/static
@ -95,6 +106,8 @@ let
KADENIOS_FROM_EMAIL = "Kadenios <vote@infra.dgnum.eu>";
KADENIOS_SERVER_EMAIL = "kadenios@infra.dgnum.eu";
};
path = [ (pythonEnv { }) ];
in
{
@ -118,9 +131,7 @@ in
User = "kadenios";
};
inherit environment;
path = [ pythonEnv ];
inherit environment path;
script = ''
python3 ${sources.kadenios}/manage.py migrate
@ -149,9 +160,7 @@ in
WorkingDirectory = sources.kadenios;
};
inherit environment;
path = [ pythonEnv ];
inherit environment path;
script = ''
python3 manage.py process_tasks