try initialising mysql db
This commit is contained in:
parent
bc63307993
commit
cb16f19b58
|
@ -37,10 +37,20 @@ in
|
||||||
default = "seafile";
|
default = "seafile";
|
||||||
description = "Database user name. Not required for sqlite.";
|
description = "Database user name. Not required for sqlite.";
|
||||||
};
|
};
|
||||||
dbname = mkOption {
|
dbnameSeafile = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = "seafile";
|
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 {
|
passwordFile = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
|
@ -74,11 +84,11 @@ 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;
|
||||||
|
@ -239,7 +249,7 @@ in
|
||||||
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
|
||||||
# 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}"
|
||||||
|
|
||||||
# seafile.conf generation
|
# seafile.conf generation
|
||||||
|
|
||||||
|
@ -254,8 +264,19 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ln -s ${pkgs.seafile-server} seafile-server
|
ln -sf ${pkgs.seafile-server} seafile-server
|
||||||
./seafile-server/seafile-server-latest/bin/seafile-admin setup
|
./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;
|
User = cfg.user;
|
||||||
|
|
Loading…
Reference in a new issue