try initialising mysql db

mainline
Trolli Schmittlauch 2020-12-22 12:17:03 +01:00
parent bc63307993
commit cb16f19b58
1 changed files with 31 additions and 10 deletions

View File

@ -37,10 +37,20 @@ in
default = "seafile";
description = "Database user name. Not required for sqlite.";
};
dbname = mkOption {
dbnameSeafile = mkOption {
type = types.nullOr types.str;
default = "seafile";
description = "Database name. Not required for sqlite.";
description = "Database name for Seafile server. Not required for sqlite.";
};
dbnameCcnet = mkOption {
type = types.nullOr types.str;
default = "seafile";
description = "Database name for Ccnet server. Not required for sqlite.";
};
dbnameSeahub = mkOption {
type = types.nullOr types.str;
default = "seafile";
description = "Database name for Seahub web interface. Not required for sqlite.";
};
passwordFile = mkOption {
type = types.nullOr types.str;
@ -74,11 +84,11 @@ in
description = "Group account under which the Seafile server runs.";
};
# name = mkOption {
# type = types.str;
# default = "Seafile";
# description = "name of the Seafile instance, will show up in client and web interface";
# };
name = mkOption {
type = types.str;
default = "Seafile";
description = "name of the Seafile instance, will show up in client and web interface";
};
domainName = mkOption {
type = types.str;
@ -239,7 +249,7 @@ in
echo "[General]" > ./conf/ccnet.conf
grep "^ID =" ./ccnet/ccnet.conf.template >> ./conf/ccnet.conf
# 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}"
# seafile.conf generation
@ -254,8 +264,19 @@ in
}
ln -s ${pkgs.seafile-server} seafile-server
./seafile-server/seafile-server-latest/bin/seafile-admin setup
ln -sf ${pkgs.seafile-server} seafile-server
./seafile-server/setup-seafile-mysql.sh \
-n "${cfg.name}" \
-i "${cfg.domainName}" \
-p "${toString cfg.fileserverPort}" \
-d "${cfg.storagePath}" \
-o "${cfg.db.host}" \
-t "${toString cfg.db.dbport}" \
-u "${cfg.db.user}" \
-w "$DBPASS" \
-c "${cfg.db.dbnameCcnet}" \
-s "${cfg.db.dbnameSeafile}" \
-b "${cfg.db.dbnameSeahub}"
''}")
];
User = cfg.user;