pyload-ng: add declarative user management patch

This commit is contained in:
Bruno BELANYI 2023-12-23 22:53:29 +01:00
parent 7f10f17211
commit c751c1f9a9
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,15 @@
diff --git a/src/pyload/core/__init__.py b/src/pyload/core/__init__.py
index 4324fc700..f7fcd66ec 100644
--- a/src/pyload/core/__init__.py
+++ b/src/pyload/core/__init__.py
@@ -46,8 +46,8 @@ class Exit(Exception):
# improve external scripts
class Core:
LOCALE_DOMAIN = APPID
- DEFAULT_USERNAME = APPID
- DEFAULT_PASSWORD = APPID
+ DEFAULT_USERNAME = os.getenv("PYLOAD_DEFAULT_USERNAME", APPID)
+ DEFAULT_PASSWORD = os.getenv("PYLOAD_DEFAULT_PASSWORD", APPID)
DEFAULT_DATADIR = os.path.join(
os.getenv("APPDATA") or USERHOMEDIR, "pyLoad" if os.name == "nt" else ".pyload"
)

View File

@ -10,6 +10,11 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-1lPIKkZESonDaVCnac0iUu/gCqXVDBhNZrk5S0eC6F0="; hash = "sha256-1lPIKkZESonDaVCnac0iUu/gCqXVDBhNZrk5S0eC6F0=";
}; };
patches = [
# Makes it possible to change the default username/password in the module
./declarative-default-user.patch
];
postPatch = '' postPatch = ''
# relax version bounds # relax version bounds
sed -i 's/\([A-z0-9]*\)~=.*$/\1/' setup.cfg sed -i 's/\([A-z0-9]*\)~=.*$/\1/' setup.cfg