Compare commits
No commits in common. "6c33d36fc5b78dcc0077e785d993f3ff856cae28" and "97f9561631df8946d63499b68f161610b6188ed9" have entirely different histories.
6c33d36fc5
...
97f9561631
3 changed files with 11 additions and 58 deletions
|
@ -22,7 +22,7 @@ let
|
||||||
# to create a CACHE folder/file in the CWD.
|
# to create a CACHE folder/file in the CWD.
|
||||||
# and if I fix that, then static content no
|
# and if I fix that, then static content no
|
||||||
# longer wants to load.
|
# longer wants to load.
|
||||||
DEBUG = false;
|
DEBUG = true;
|
||||||
DATABASES.default = {
|
DATABASES.default = {
|
||||||
ENGINE = "django.db.backends.postgresql";
|
ENGINE = "django.db.backends.postgresql";
|
||||||
NAME = "wger";
|
NAME = "wger";
|
||||||
|
@ -43,6 +43,7 @@ let
|
||||||
MEDIA_ROOT = "${statedir}/media";
|
MEDIA_ROOT = "${statedir}/media";
|
||||||
MEDIA_URL = "/media/";
|
MEDIA_URL = "/media/";
|
||||||
|
|
||||||
|
|
||||||
# EMAIL
|
# EMAIL
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend";
|
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend";
|
||||||
EMAIL_HOST = config.mine.shared.settings.mail.domain_smtp;
|
EMAIL_HOST = config.mine.shared.settings.mail.domain_smtp;
|
||||||
|
@ -53,12 +54,6 @@ let
|
||||||
EMAIL_FROM_ADDRESS = wger_settings.EMAIL_FROM;
|
EMAIL_FROM_ADDRESS = wger_settings.EMAIL_FROM;
|
||||||
EMAIL_PAGE_DOMAIN = SITE_URL;
|
EMAIL_PAGE_DOMAIN = SITE_URL;
|
||||||
|
|
||||||
# Cache - Redis
|
|
||||||
DJANGO_CACHE_BACKEND = "django_redis.cache.RedisCache";
|
|
||||||
DJANGO_CACHE_LOCATION = "${config.services.redis.servers.wger.unixSocket}";
|
|
||||||
DJANGO_CACHE_TIMEOUT = 1296000; # in seconds - 60*60*24*15, 15 Days
|
|
||||||
DJANGO_CACHE_CLIENT_CLASS = "django_redis.client.DefaultClient";
|
|
||||||
|
|
||||||
# setup allowed hosts
|
# setup allowed hosts
|
||||||
CSRF_TRUSTED_ORIGINS = [ "https://${svc_domain}" ];
|
CSRF_TRUSTED_ORIGINS = [ "https://${svc_domain}" ];
|
||||||
ALLOWED_HOSTS = [ svc_domain ];
|
ALLOWED_HOSTS = [ svc_domain ];
|
||||||
|
@ -67,11 +62,6 @@ let
|
||||||
RECAPTCHA_PUBLIC_KEY = "";
|
RECAPTCHA_PUBLIC_KEY = "";
|
||||||
RECAPTCHA_PRIVATE_KEY = "";
|
RECAPTCHA_PRIVATE_KEY = "";
|
||||||
USE_RECAPTCHA = false;
|
USE_RECAPTCHA = false;
|
||||||
|
|
||||||
# does not work
|
|
||||||
STATIC_ROOT = "${wgerpkgs}/share/static";
|
|
||||||
COMPRESS_ROOT = STATIC_ROOT;
|
|
||||||
COMPRESS_OFFLINE = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wger_settings_file = pkgs.writeText "settings.json" (builtins.toJSON wger_settings);
|
wger_settings_file = pkgs.writeText "settings.json" (builtins.toJSON wger_settings);
|
||||||
|
@ -115,10 +105,9 @@ in {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
EnvironmentFile = config.age.secrets.wger-env.path;
|
EnvironmentFile = config.age.secrets.wger-env.path;
|
||||||
|
|
||||||
Restart = "on-failure";
|
# ensure it does not try to create `/CACHE`
|
||||||
RestartSec = "5s";
|
|
||||||
|
|
||||||
PrivateTmp = "yes";
|
PrivateTmp = "yes";
|
||||||
|
WorkingDirectory = "/tmp";
|
||||||
|
|
||||||
User = "wger";
|
User = "wger";
|
||||||
Group = "wger";
|
Group = "wger";
|
||||||
|
@ -160,11 +149,6 @@ in {
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
# setup redis
|
|
||||||
services.redis.servers.wger = {
|
|
||||||
enable = true;
|
|
||||||
user = wger_user;
|
|
||||||
};
|
|
||||||
|
|
||||||
# setup users
|
# setup users
|
||||||
users.users."${wger_user}"= {
|
users.users."${wger_user}"= {
|
||||||
|
@ -186,8 +170,7 @@ in {
|
||||||
proxyPass = "http://localhost:${builtins.toString port}";
|
proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
};
|
};
|
||||||
|
|
||||||
# locations."/static".proxyPass = "http://localhost:${builtins.toString port}";
|
locations."/static".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
locations."/static".root = "${wgerpkgs}/share";
|
|
||||||
locations."/media".proxyPass = "http://localhost:${builtins.toString port}";
|
locations."/media".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
locations."/api".proxyPass = "http://localhost:${builtins.toString port}";
|
locations."/api".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
python3,
|
python3,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
callPackage,
|
callPackage,
|
||||||
writeText,
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -80,37 +79,8 @@ in python3.pkgs.buildPythonApplication rec {
|
||||||
cp manage.py wger/manage.py
|
cp manage.py wger/manage.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# fixup compressed files
|
|
||||||
postBuild = let
|
|
||||||
staticSettings = writeText "static_settings.py" ''
|
|
||||||
DEBUG = False
|
|
||||||
STATIC_ROOT = os.environ["static"]
|
|
||||||
COMPRESS_OFFLINE = True
|
|
||||||
# So we don't need postgres dependencies
|
|
||||||
DATABASES = {}
|
|
||||||
'';
|
|
||||||
in ''
|
|
||||||
# copy over static yarn things
|
|
||||||
# cp -a ${frontend}/static/yarn $out/${python3.sitePackages}/wger/core/static
|
|
||||||
cp -a ${frontend}/static/yarn wger/core/static
|
|
||||||
|
|
||||||
python3 -m wger.tasks create-settings -s $PWD/tmp_settings.py
|
|
||||||
cat ${staticSettings} >> $PWD/tmp_settings.py
|
|
||||||
mkdir tmpstatic
|
|
||||||
pushd tmpstatic
|
|
||||||
|
|
||||||
static=. WGER_SETTINGS=../tmp_settings.py python3 ../manage.py collectstatic --no-input
|
|
||||||
static=. WGER_SETTINGS=../tmp_settings.py python3 ../manage.py compress --force
|
|
||||||
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
rm -rf $out/${python3.sitePackages}/wger/core/static
|
cp -a ${frontend}/static/yarn $out/${python3.sitePackages}/wger/core/static
|
||||||
cp -a tmpstatic $out/${python3.sitePackages}/wger/core/static
|
|
||||||
|
|
||||||
mkdir $out/share
|
|
||||||
cp -a $out/${python3.sitePackages}/wger/core/static $out/share
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
pythonImportsCheck = [
|
pythonImportsCheck = [
|
||||||
|
|
|
@ -8,11 +8,11 @@ in sources // {
|
||||||
src = sources.nixpkgs;
|
src = sources.nixpkgs;
|
||||||
name = "nixpkgs-patched";
|
name = "nixpkgs-patched";
|
||||||
patches = [
|
patches = [
|
||||||
# tmp - lldap: 0.5.1-unstable-2024-10-30 -> 0.6.1
|
# tmp - lldap: 0.5.1-unstable-2024-08-09 -> 0.5.1-unstable-2024-10-30
|
||||||
(pkgs.fetchpatch {
|
# (pkgs.fetchpatch {
|
||||||
url = "https://github.com/NixOS/nixpkgs/pull/359835.patch";
|
# url = "https://github.com/NixOS/nixpkgs/pull/352840.patch";
|
||||||
sha256 = "sha256-2C9l4v9MaUJyiaB+kslTsSjsqTZ7RlcfMNlRzZblMik=";
|
# sha256 = "sha256-O4zxn4AgUrggCkqUEkmVsUAbMTL/Jhki6Q+j1mhHWLw=";
|
||||||
})
|
# })
|
||||||
# tmp - stalwart-mail.webadmin: pin wasm-bindgen-cli version
|
# tmp - stalwart-mail.webadmin: pin wasm-bindgen-cli version
|
||||||
# (pkgs.fetchpatch {
|
# (pkgs.fetchpatch {
|
||||||
# url = "https://github.com/NixOS/nixpkgs/pull/353360.patch";
|
# url = "https://github.com/NixOS/nixpkgs/pull/353360.patch";
|
||||||
|
|
Loading…
Reference in a new issue