weblate: 5.6.2 -> 5.7

Changelog: https://github.com/WeblateOrg/weblate/releases/tag/weblate-5.7

Also had to rework django-compressor settings and aligned them more
closely with the official docs:
https://cheat.readthedocs.io/en/latest/django/compressor.html
This commit is contained in:
Kerstin Humm
2024-08-19 16:10:40 +02:00
committed by Valentin Gagarin
parent 59e82ebc7d
commit f5bb4b807c
2 changed files with 19 additions and 21 deletions
+11 -4
View File
@@ -42,9 +42,10 @@ let
SESSION_COOKIE_SECURE = ENABLE_HTTPS
DATA_DIR = "${dataDir}"
CACHE_DIR = f"{DATA_DIR}/cache"
STATIC_ROOT = "${finalPackage.static}/static"
STATIC_ROOT = "${finalPackage.static}"
MEDIA_ROOT = "/var/lib/weblate/media"
COMPRESS_ROOT = "${finalPackage.static}/compressor-cache"
COMPRESS_ROOT = "${finalPackage.static}"
COMPRESS_OFFLINE = True
DEBUG = False
DATABASES = {
@@ -86,6 +87,13 @@ let
VCS_BACKENDS = ("weblate.vcs.git.GitRepository",)
SITE_URL = "https://{}".format(SITE_DOMAIN)
# WebAuthn
OTP_WEBAUTHN_RP_NAME = SITE_TITLE
OTP_WEBAUTHN_RP_ID = SITE_DOMAIN.split(":")[0]
OTP_WEBAUTHN_ALLOWED_ORIGINS = [SITE_URL]
''
+ lib.optionalString cfg.smtp.enable ''
ADMINS = (("Weblate Admin", "${cfg.smtp.user}"),)
@@ -205,8 +213,7 @@ in
locations = {
"= /favicon.ico".alias = "${finalPackage}/${python.sitePackages}/weblate/static/favicon.ico";
"/static/".alias = "${finalPackage.static}/static/";
"/static/CACHE/".alias = "${finalPackage.static}/compressor-cache/CACHE/";
"/static/".alias = "${finalPackage.static}/";
"/media/".alias = "/var/lib/weblate/media/";
"/".proxyPass = "http://unix:///run/weblate.socket";
};
+8 -17
View File
@@ -34,7 +34,7 @@ let
in
python.pkgs.buildPythonApplication rec {
pname = "weblate";
version = "5.6.2";
version = "5.7";
pyproject = true;
@@ -47,7 +47,7 @@ python.pkgs.buildPythonApplication rec {
owner = "WeblateOrg";
repo = "weblate";
rev = "weblate-${version}";
sha256 = "sha256-t/hnigsKjdWCkUd8acNWhYVFmZ7oGn74+12347MkFgM=";
sha256 = "sha256-h5+0lOMD+H0ehtZ0bngA9bI5va1I5KjZH9boaEtXJPo=";
};
patches = [
@@ -55,27 +55,15 @@ python.pkgs.buildPythonApplication rec {
./cache.lock.patch
];
# Relax dependency constraints
# mistletoe: https://github.com/WeblateOrg/weblate/commit/50df46a25dda2b7b39de86d4c65ecd7a685f62e6
# borgbackup: https://github.com/WeblateOrg/weblate/commit/355c81c977c59948535a98a35a5c05d7e6909703
# django-crispy-forms: https://github.com/WeblateOrg/weblate/commit/7b341c523ed9b3b41ecfbc5c92dd6156992e4f32
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"mistletoe>=1.3.0,<1.4"' '"mistletoe>=1.3.0,<1.5"' \
--replace '"borgbackup>=1.2.5,<1.3"' '"borgbackup>=1.2.5,<1.5"' \
--replace '"django-crispy-forms>=2.1,<2.3"' '"django-crispy-forms>=2.1,<2.4"'
'';
build-system = with python.pkgs; [ setuptools ];
# Build static files into a separate output
postBuild =
let
staticSettings = writeText "static_settings.py" ''
STATIC_ROOT = os.environ["static"] + "/static"
COMPRESS_ENABLED = True
DEBUG = False
STATIC_ROOT = os.environ["static"]
COMPRESS_OFFLINE = True
COMPRESS_ROOT = os.environ["static"] + "/compressor-cache"
# So we don't need postgres dependencies
DATABASES = {}
'';
@@ -99,6 +87,7 @@ python.pkgs.buildPythonApplication rec {
cryptography
cssselect
cython
cyrtranslit
diff-match-patch
django-appconf
django-celery-beat
@@ -107,6 +96,8 @@ python.pkgs.buildPythonApplication rec {
django-crispy-forms
django-filter
django-redis
django-otp
django-otp-webauthn
django
djangorestframework
filelock
@@ -117,7 +108,6 @@ python.pkgs.buildPythonApplication rec {
iniparse
jsonschema
lxml
misaka
mistletoe
nh3
openpyxl
@@ -131,6 +121,7 @@ python.pkgs.buildPythonApplication rec {
pyparsing
python-dateutil
python-redis-lock
qrcode
rapidfuzz
redis
requests