m 3 deluge: implement auth
This commit is contained in:
parent
ccf521e4a4
commit
75ff0e4937
@ -5,12 +5,13 @@ with config.krebs.lib;
|
|||||||
let
|
let
|
||||||
cfg_daemon = config.makefu.deluge;
|
cfg_daemon = config.makefu.deluge;
|
||||||
homedir = cfg_daemon.homedir;
|
homedir = cfg_daemon.homedir;
|
||||||
|
delugedir = "${homedir}/.config/deluge";
|
||||||
cfg_web = config.makefu.deluge.web;
|
cfg_web = config.makefu.deluge.web;
|
||||||
core_conf = pkgs.writeText "deluge-core-cfg" ''
|
core_conf = pkgs.writeText "deluge-core-cfg" ''
|
||||||
{
|
{
|
||||||
"file": 1,
|
"file": 1,
|
||||||
"format": 1
|
"format": 1
|
||||||
}${builtins.toJSON (recursiveUpdate default_core_cfg cfg_daemon.cfg)}
|
}${builtins.toJSON (default_core_cfg // cfg_daemon.cfg)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
default_core_cfg = {
|
default_core_cfg = {
|
||||||
@ -145,9 +146,11 @@ let
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.pythonPackages.deluge}/bin/deluged -d";
|
ExecStart = "${pkgs.pythonPackages.deluge}/bin/deluged -d";
|
||||||
ExecStartPre = pkgs.writeDash "deluged-init" ''
|
ExecStartPre = let
|
||||||
mkdir -p ${homedir}/.config/deluge
|
in pkgs.writeDash "deluged-init" ''
|
||||||
cp ${core_conf} ${homedir}/.config/deluge/core.conf
|
mkdir -p ${delugedir}
|
||||||
|
echo ${shell.escape cfg_daemon.auth} > ${delugedir}/auth
|
||||||
|
cp -f ${core_conf} ${delugedir}/core.conf
|
||||||
'';
|
'';
|
||||||
Restart = "on-success";
|
Restart = "on-success";
|
||||||
User = "deluge";
|
User = "deluge";
|
||||||
|
Loading…
Reference in New Issue
Block a user