ccnet port and name config have been removed upstream
This commit is contained in:
parent
7b150eefa3
commit
69cf92ddbe
|
@ -73,22 +73,22 @@ in
|
||||||
description = "Group account under which the Seafile server runs.";
|
description = "Group account under which the Seafile server runs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
name = mkOption {
|
# name = mkOption {
|
||||||
type = types.str;
|
# type = types.str;
|
||||||
default = "Seafile";
|
# default = "Seafile";
|
||||||
description = "name of the Seafile instance, will show up in client and web interface";
|
# description = "name of the Seafile instance, will show up in client and web interface";
|
||||||
};
|
# };
|
||||||
|
|
||||||
domainName = mkOption {
|
domainName = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "full domain name of the seafile instance";
|
description = "full domain name of the seafile instance";
|
||||||
};
|
};
|
||||||
|
|
||||||
ccnetPort = mkOption {
|
# ccnetPort = mkOption {
|
||||||
type = types.int;
|
# type = types.int;
|
||||||
default = 10001;
|
# default = 10001;
|
||||||
description = "listening port for ccnet server";
|
# description = "listening port for ccnet server";
|
||||||
};
|
# };
|
||||||
|
|
||||||
seafilePort = mkOption {
|
seafilePort = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
|
@ -197,21 +197,16 @@ in
|
||||||
# ccnet-init must only be run once per installation, as it also generates stateful key and ID
|
# ccnet-init must only be run once per installation, as it also generates stateful key and ID
|
||||||
# solution: invoke it once, use result as template
|
# solution: invoke it once, use result as template
|
||||||
if [ ! -e ./ccnet/mykey.peer ]; then
|
if [ ! -e ./ccnet/mykey.peer ]; then
|
||||||
${pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./ccnet -n 'TEMPLATENAME' -H 'TEMPLATEHOST' -P 'TEMPLATEPORT'
|
${pkgs.seafile-server.ccnet-server}/bin/ccnet-init -c ./ccnet -H 'TEMPLATEHOST'
|
||||||
mv ./ccnet/ccnet.conf{,.template}
|
mv ./ccnet/ccnet.conf{,.template}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# generate actual ccnet config file
|
# generate actual ccnet config file
|
||||||
echo "[General]" > ./conf/ccnet.conf
|
echo "[General]" > ./conf/ccnet.conf
|
||||||
grep "^ID =" ./ccnet/ccnet.conf.template >> ./conf/ccnet.conf
|
grep "^ID =" ./ccnet/ccnet.conf.template >> ./conf/ccnet.conf
|
||||||
echo 'USER_NAME = ${cfg.name}
|
|
||||||
NAME = ${cfg.name}
|
|
||||||
# outside URL
|
# outside URL
|
||||||
SERVICE_URL = http${if cfg.enableTLS then "s" else ""}://${cfg.domainName}:${toString cfg.externalPort}
|
SERVICE_URL = http${if cfg.enableTLS then "s" else ""}://${cfg.domainName}:${toString cfg.externalPort}
|
||||||
|
|
||||||
[Network]
|
|
||||||
Port = ${toString cfg.ccnetPort}' >> ./conf/ccnet.conf
|
|
||||||
|
|
||||||
# seafile.conf generation
|
# seafile.conf generation
|
||||||
|
|
||||||
echo '[library_trash]
|
echo '[library_trash]
|
||||||
|
@ -280,6 +275,7 @@ in
|
||||||
};
|
};
|
||||||
users.groups.${cfg.group}.members = [ cfg.user ];
|
users.groups.${cfg.group}.members = [ cfg.user ];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = with cfg; if openFirewall then [ ccnetPort seafilePort fileserverPort ] else [];
|
# ToDo: make sure ccnet is reachable
|
||||||
|
networking.firewall.allowedTCPPorts = with cfg; if openFirewall then [ seafilePort fileserverPort ] else [];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue