Merge pull request #72 from privatevoid-net/pr-flake-update

`flake.lock`: Update
This commit is contained in:
hercules-ci[bot] 2023-04-14 22:12:41 +00:00 committed by GitHub
commit d1b328996c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 137 deletions

View file

@ -306,11 +306,11 @@
"pre-commit-hooks-nix": "pre-commit-hooks-nix" "pre-commit-hooks-nix": "pre-commit-hooks-nix"
}, },
"locked": { "locked": {
"lastModified": 1680449544, "lastModified": 1680964619,
"narHash": "sha256-Vvf7JlX/wZFJNhCaB9QqmqQbhgmuZ2QRoMXgpPy/0B4=", "narHash": "sha256-RMFgr7qWyw/dxGC8JKhlpnywpu2zzJL9qg4F2qV91HQ=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-agent", "repo": "hercules-ci-agent",
"rev": "7f046e522aa3f37e3e9d0558869c056d4dff1ed6", "rev": "af59f3fe94fae65532e118e60c1b48f1a2a54a9a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -416,11 +416,11 @@
}, },
"nix-filter": { "nix-filter": {
"locked": { "locked": {
"lastModified": 1678109515, "lastModified": 1681154353,
"narHash": "sha256-C2X+qC80K2C1TOYZT8nabgo05Dw2HST/pSn6s+n6BO8=", "narHash": "sha256-MCJ5FHOlbfQRFwN0brqPbCunLEVw05D/3sRVoNVt2tI=",
"owner": "numtide", "owner": "numtide",
"repo": "nix-filter", "repo": "nix-filter",
"rev": "aa9ff6ce4a7f19af6415fb3721eaa513ea6c763c", "rev": "f529f42792ade8e32c4be274af6b6d60857fbee7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -457,11 +457,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1678293141, "lastModified": 1680213900,
"narHash": "sha256-lLlQHaR0y+q6nd6kfpydPTGHhl1rS9nU9OQmztzKOYs=", "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c90c4025bb6e0c4eaf438128a3b2640314b1c58d", "rev": "e3652e0735fbec227f342712f180f4f21f0594f2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -473,11 +473,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1673800717, "lastModified": 1678872516,
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -489,11 +489,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1680724564, "lastModified": 1681349002,
"narHash": "sha256-eeUUGOTKTelYKDbUxKs0V7GUa186L2fym7jM2QQ4Oss=", "narHash": "sha256-9Ckc2WvSwuYrPfk3ZXgPasM1ir/cgs6UV0EpIWyPGZE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "36adaa6aaa6b03e59102df0c1b12cdc3f23fd112", "rev": "2b1bba76a13ed39c7abc0a6e8f74f9e168cf3c7c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -532,11 +532,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1678376203, "lastModified": 1680170909,
"narHash": "sha256-3tyYGyC8h7fBwncLZy5nCUjTJPrHbmNwp47LlNLOHSM=", "narHash": "sha256-FtKU/edv1jFRr/KwUxWTYWXEyj9g8GBrHntC2o8oFI8=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "1a20b9708962096ec2481eeb2ddca29ed747770a", "rev": "29dbe1efaa91c3a415d8b45d62d48325a4748816",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -546,12 +546,15 @@
} }
}, },
"repin-flake-utils": { "repin-flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1680776469, "lastModified": 1681202837,
"narHash": "sha256-3CXUDK/3q/kieWtdsYpDOBJw3Gw4Af6x+2EiSnIkNQw=", "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "411e8764155aa9354dbcd6d5faaeb97e9e3dce24", "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -578,6 +581,21 @@
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"repin-flake-utils": "repin-flake-utils" "repin-flake-utils": "repin-flake-utils"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -59,7 +59,8 @@ in
environment = { environment = {
NODE_ENV = "production"; NODE_ENV = "production";
DATA_DIR = dataDir; # immense stupidity: uptime-kuma expects this path to end in a slash
DATA_DIR = "${dataDir}/";
UPTIME_KUMA_HOST = link.ipv4; UPTIME_KUMA_HOST = link.ipv4;
UPTIME_KUMA_PORT = link.portStr; UPTIME_KUMA_PORT = link.portStr;
UPTIME_KUMA_HIDE_LOG = lib.concatStringsSep "," [ UPTIME_KUMA_HIDE_LOG = lib.concatStringsSep "," [

View file

@ -52,7 +52,6 @@ in
uptime-kuma.runtime-bugfixes = { uptime-kuma.runtime-bugfixes = {
patches = [ patches = [
./uptime-kuma/chmod-database.patch ./uptime-kuma/chmod-database.patch
./uptime-kuma/data-dir-concat-with-slash.patch
]; ];
}; };

View file

@ -1,38 +0,0 @@
diff --git a/server/database.js b/server/database.js
index 575827f3..8e288095 100644
--- a/server/database.js
+++ b/server/database.js
@@ -87,20 +87,20 @@ class Database {
*/
static init(args) {
// Data Directory (must be end with "/")
- Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/";
+ Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data";
// Plugin feature is working only if the dataDir = "./data";
- if (Database.dataDir !== "./data/") {
+ if (Database.dataDir !== "./data") {
log.warn("PLUGIN", "Warning: In order to enable plugin feature, you need to use the default data directory: ./data/");
PluginsManager.disable = true;
}
- Database.path = Database.dataDir + "kuma.db";
+ Database.path = Database.dataDir + "/kuma.db";
if (! fs.existsSync(Database.dataDir)) {
fs.mkdirSync(Database.dataDir, { recursive: true });
}
- Database.uploadDir = Database.dataDir + "upload/";
+ Database.uploadDir = Database.dataDir + "/upload/";
if (! fs.existsSync(Database.uploadDir)) {
fs.mkdirSync(Database.uploadDir, { recursive: true });
@@ -455,7 +455,7 @@ class Database {
static backup(version) {
if (! this.backupPath) {
log.info("db", "Backing up the database");
- this.backupPath = this.dataDir + "kuma.db.bak" + version;
+ this.backupPath = this.dataDir + "/kuma.db.bak" + version;
fs.copyFileSync(Database.path, this.backupPath);
const shmPath = Database.path + "-shm";

View file

@ -9,10 +9,10 @@
}, },
"pre_releases": false, "pre_releases": false,
"version_upper_bound": null, "version_upper_bound": null,
"version": "v2.2.4", "version": "v2.2.6",
"revision": "a6fb44e1abe9ad48136dee8e7d053e639f37bedc", "revision": "f6694031a1581af171ffe1658138dfcf344d6c6c",
"url": "https://api.github.com/repos/cinnyapp/cinny/tarball/v2.2.4", "url": "https://api.github.com/repos/cinnyapp/cinny/tarball/v2.2.6",
"hash": "0m7y1hzsdmlhp39hdv2fazhm07kskgb5qf2khhyxrs8nlas4fbha" "hash": "0zq26wpdh96clabw3nzmbv2fl6kiky39m6n843jap239mxpf1bqd"
}, },
"excalidraw": { "excalidraw": {
"type": "Git", "type": "Git",
@ -22,9 +22,9 @@
"repo": "excalidraw" "repo": "excalidraw"
}, },
"branch": "master", "branch": "master",
"revision": "ac4c8b3ca798c486a3c86ad71eb4d16352a486be", "revision": "ca3be2c678dfc5fae50d005fdcfe3b8c84fc2544",
"url": "https://github.com/excalidraw/excalidraw/archive/ac4c8b3ca798c486a3c86ad71eb4d16352a486be.tar.gz", "url": "https://github.com/excalidraw/excalidraw/archive/ca3be2c678dfc5fae50d005fdcfe3b8c84fc2544.tar.gz",
"hash": "03gyrg9ykm6cw2bhw1a8f30yhazr4bsfahmi03fpbcb80v3q2vvz" "hash": "1p9d63x1n9dqkz8f3rcwkm20yjrgb9ycq22z9458lwi2qx1rbngl"
}, },
"searxng": { "searxng": {
"type": "Git", "type": "Git",
@ -34,9 +34,9 @@
"repo": "searxng" "repo": "searxng"
}, },
"branch": "master", "branch": "master",
"revision": "9dc36965bbb118db64c0bf2d3f54389d4d484670", "revision": "b07e44e55270b390b503003600d72b785adab1b9",
"url": "https://github.com/searxng/searxng/archive/9dc36965bbb118db64c0bf2d3f54389d4d484670.tar.gz", "url": "https://github.com/searxng/searxng/archive/b07e44e55270b390b503003600d72b785adab1b9.tar.gz",
"hash": "0h5dvnrp3v88mgv9snccsrqsvy20mi3sga7s408fmid2n248ws8k" "hash": "13vv4pq76i5a56ivcnm62lca4w5hsg2yfzkr88c8g6bsdhzw6s4w"
}, },
"stevenblack-hosts": { "stevenblack-hosts": {
"type": "GitRelease", "type": "GitRelease",
@ -47,10 +47,10 @@
}, },
"pre_releases": false, "pre_releases": false,
"version_upper_bound": null, "version_upper_bound": null,
"version": "3.12.15", "version": "3.12.19",
"revision": "0cfed81116bf22d3719fffe5b08b72eab115b3e1", "revision": "e8f0271c8c69a7e60d034f84c1195e628972ea3e",
"url": "https://api.github.com/repos/StevenBlack/hosts/tarball/3.12.15", "url": "https://api.github.com/repos/StevenBlack/hosts/tarball/3.12.19",
"hash": "10b0y5wpbylpl4snczfg0dw9cr6dkb5iryqzx3vqm822p7kmg0qy" "hash": "1yqjc3qpckxi9qgjd180p3hgavq3hgi4r2mzgj7ws8n5js6qxjwx"
}, },
"tempo": { "tempo": {
"type": "GitRelease", "type": "GitRelease",

View file

@ -11,7 +11,7 @@ let
src = fetchzip { src = fetchzip {
name = "cinny-tarball-${version}"; name = "cinny-tarball-${version}";
url = "https://github.com/${repo.owner}/${repo.repo}/releases/download/${cinny.version}/cinny-${cinny.version}.tar.gz"; url = "https://github.com/${repo.owner}/${repo.repo}/releases/download/${cinny.version}/cinny-${cinny.version}.tar.gz";
sha256 = "sha256-zMvCpjt74U8Fsuw8husaXtcccD5eF4wknOw0YWT9b/M="; sha256 = "sha256-5g8Xva0lIE2Ng/guPlcrEsddfliltBJqouPEIUMdIKE=";
}; };
buildCommand = '' buildCommand = ''

View file

@ -1,55 +0,0 @@
diff --git a/requirements.txt b/requirements.txt
index 2de33f4baa..947a88433f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
certifi==2022.12.7
babel==2.11.0
-flask-babel==2.0.0
+flask-babel==3.0.0
flask==2.2.2
jinja2==3.1.2
lxml==4.9.2
diff --git a/searx/locales.py b/searx/locales.py
index 8547e7fa7b..9e06bf39d4 100644
--- a/searx/locales.py
+++ b/searx/locales.py
@@ -86,7 +86,7 @@ def get_translations():
use_translation = flask.request.form.get('use-translation')
if use_translation in ADDITIONAL_TRANSLATIONS:
babel_ext = flask_babel.current_app.extensions['babel']
- return Translations.load(next(babel_ext.translation_directories), use_translation)
+ return Translations.load(babel_ext.translation_directories[0], use_translation)
return _flask_babel_get_translations()
diff --git a/searx/webapp.py b/searx/webapp.py
index d4206ca16b..d9ca3941cd 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -160,8 +160,6 @@
app.jinja_env.filters['group_engines_in_tab'] = group_engines_in_tab # pylint: disable=no-member
app.secret_key = settings['server']['secret_key']
-babel = Babel(app)
-
timeout_text = gettext('timeout')
parsing_error_text = gettext('parsing error')
http_protocol_error_text = gettext('HTTP protocol error')
@@ -211,13 +209,15 @@ class ExtendedRequest(flask.Request):
request = typing.cast(ExtendedRequest, flask.request)
-@babel.localeselector
def get_locale():
locale = localeselector()
logger.debug("%s uses locale `%s`", urllib.parse.quote(request.url), locale)
return locale
+babel = Babel(app, locale_selector=get_locale)
+
+
def _get_browser_language(req, lang_list):
for lang in req.headers.get("Accept-Language", "en").split(","):
if ';' in lang:

View file

@ -1,13 +1,8 @@
--- b/requirements.txt --- b/requirements.txt
+++ a/requirements.txt +++ a/requirements.txt
@@ -1,6 +1,6 @@ @@ -3,1 +3,1 @@
certifi==2022.12.7
babel==2.11.0
+flask-babel==2.0.0 +flask-babel==2.0.0
-flask-babel==3.0.1 -flask-babel==3.0.1
flask==2.2.3
jinja2==3.1.2
lxml==4.9.2
--- b/searx/locales.py --- b/searx/locales.py
+++ a/searx/locales.py +++ a/searx/locales.py
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@