Only use ID from original ccnet.conf and generate the rest oneself
This commit is contained in:
parent
929eb447a4
commit
9420e101b5
|
@ -102,6 +102,17 @@ in
|
||||||
description = "listening http port for Seahub web interface";
|
description = "listening http port for Seahub web interface";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
externalPort = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 443;
|
||||||
|
description = "external port under which Seahub is reachable from the outside. Possibly the external port of a reverse proxy like nginx.";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableTLS = mkEnableOption {
|
||||||
|
default = true;
|
||||||
|
description = "whether to use TLS and HTTPS for communication";
|
||||||
|
};
|
||||||
|
|
||||||
openFirewall = mkEnableOption {
|
openFirewall = mkEnableOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = "whether to open up the firewall ports for ccnet, seafile-server and seahub";
|
description = "whether to open up the firewall ports for ccnet, seafile-server and seahub";
|
||||||
|
@ -140,11 +151,19 @@ in
|
||||||
${pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./conf -n 'TEMPLATENAME' -H 'TEMPLATEHOST' -P 'TEMPLATEPORT'
|
${pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./conf -n 'TEMPLATENAME' -H 'TEMPLATEHOST' -P 'TEMPLATEPORT'
|
||||||
mv ./conf/ccnet.conf{,.template}
|
mv ./conf/ccnet.conf{,.template}
|
||||||
fi
|
fi
|
||||||
# substitute actual config values to template and symlink config file
|
|
||||||
${pkgs.gnused}/bin/sed -e 's|TEMPLATENAME|${cfg.name}|g; s|TEMPLATEHOST|${cfg.domainName}|; s|TEMPLATEPORT|${toString cfg.ccnetPort}|' ./conf/ccnet.conf.template > ./conf/ccnet.conf
|
# generate actual ccnet config file
|
||||||
|
echo "[General]" > ./conf/ccnet.conf
|
||||||
|
grep "^ID =" ./conf/ccnet.conf.template >> ./conf/ccnet.conf
|
||||||
|
echo 'USER_NAME = ${cfg.name}
|
||||||
|
NAME = ${cfg.name}
|
||||||
|
# outside URL
|
||||||
|
SERVICE_URL = http${if cfg.enableTLS then "s" else ""}://${cfg.domainName}:${toString cfg.externalPort}
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
Port = ${toString cfg.ccnetPort}' >> ./conf/ccnet.conf
|
||||||
|
|
||||||
ln -s ${pkgs.seafile-server} seafile-server
|
ln -s ${pkgs.seafile-server} seafile-server
|
||||||
#${pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./ccnet -H "${cfg.domainName}" -P ${toString cfg.ccnetPort} -n "${cfg.name}"
|
|
||||||
./seafile-server/seafile-server-latest/bin/seafile-admin setup
|
./seafile-server/seafile-server-latest/bin/seafile-admin setup
|
||||||
''}")
|
''}")
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue