forked from axeman/erpnext-nix
chore: update erpnext version to 15+
This commit is contained in:
parent
7805dd7205
commit
508769f12e
|
@ -114,12 +114,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
socketIoPort = mkOption {
|
|
||||||
type = types.port;
|
|
||||||
default = 9000;
|
|
||||||
description = lib.mdDoc "Local socket.io HTTP server port.";
|
|
||||||
};
|
|
||||||
|
|
||||||
webserver = {
|
webserver = {
|
||||||
bindAddress = mkOption {
|
bindAddress = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -199,10 +193,8 @@ in
|
||||||
db_port = "${toString cfg.database.port}";
|
db_port = "${toString cfg.database.port}";
|
||||||
db_name = "${cfg.database.name}";
|
db_name = "${cfg.database.name}";
|
||||||
db_password = "#NIXOS_ERPNEXT_DB_USER_PASSWORD#";
|
db_password = "#NIXOS_ERPNEXT_DB_USER_PASSWORD#";
|
||||||
redis_cache = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=1";
|
redis_cache = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=0";
|
||||||
redis_queue = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=2";
|
redis_queue = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=1";
|
||||||
redis_socketio = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=0";
|
|
||||||
socketio_port = "${toString cfg.socketIoPort}";
|
|
||||||
};
|
};
|
||||||
commonSiteConfigFile = pkgs.writeText "erpnext-common_site_config.json" (builtins.toJSON commonSiteConfig);
|
commonSiteConfigFile = pkgs.writeText "erpnext-common_site_config.json" (builtins.toJSON commonSiteConfig);
|
||||||
|
|
||||||
|
@ -286,23 +278,6 @@ in
|
||||||
"d '${cfg.benchDir}/sites' 0750 ${cfg.user} ${config.users.users.${cfg.user}.group}"
|
"d '${cfg.benchDir}/sites' 0750 ${cfg.user} ${config.users.users.${cfg.user}.group}"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.erpnext-nodejs-socketio = {
|
|
||||||
enable = true;
|
|
||||||
after = [ "erpnext-web.service" ];
|
|
||||||
wantedBy = [ "erpnext-web.service" ];
|
|
||||||
partOf = [ "erpnext-web.service" ];
|
|
||||||
description = "ERPNext Node.js HTTP server for socket.io ";
|
|
||||||
confinement = {
|
|
||||||
enable = true;
|
|
||||||
packages = [ pkgs.nodejs ];
|
|
||||||
};
|
|
||||||
serviceConfig = defaultServiceConfig // {
|
|
||||||
ExecStart = ''
|
|
||||||
${pkgs.nodejs}/bin/node ${cfg.benchDir}/apps/frappe/socketio.js
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.caddy.enable = mkIf (cfg.caddy != null) true;
|
services.caddy.enable = mkIf (cfg.caddy != null) true;
|
||||||
services.caddy.virtualHosts."${cfg.domain}" = mkIf (cfg.caddy != null) (lib.mkMerge [
|
services.caddy.virtualHosts."${cfg.domain}" = mkIf (cfg.caddy != null) (lib.mkMerge [
|
||||||
cfg.caddy
|
cfg.caddy
|
||||||
|
@ -312,12 +287,6 @@ in
|
||||||
root * ${pkgs.frappe-erpnext-assets}/share/sites
|
root * ${pkgs.frappe-erpnext-assets}/share/sites
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
handle /socket.io/* {
|
|
||||||
reverse_proxy :${toString cfg.socketIoPort} {
|
|
||||||
header_up X-Frappe-Site-Name "${cfg.domain}"
|
|
||||||
header_up Origin "{scheme}://${cfg.domain}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reverse_proxy :${toString cfg.webserver.bindPort}
|
reverse_proxy :${toString cfg.webserver.bindPort}
|
||||||
'';
|
'';
|
||||||
|
@ -330,7 +299,6 @@ in
|
||||||
after = [
|
after = [
|
||||||
"mysql.service"
|
"mysql.service"
|
||||||
"redis.service"
|
"redis.service"
|
||||||
"redis-socketio.service"
|
|
||||||
"systemd-tmpfiles-setup.service"
|
"systemd-tmpfiles-setup.service"
|
||||||
];
|
];
|
||||||
description = "ERPNext web server";
|
description = "ERPNext web server";
|
||||||
|
@ -347,6 +315,9 @@ in
|
||||||
pkgs.replace-secret
|
pkgs.replace-secret
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
path = [
|
||||||
|
pkgs.mariadb-client
|
||||||
|
];
|
||||||
environment = {
|
environment = {
|
||||||
PYTHON_PATH = "${penv}/${pkgs.python3.sitePackages}";
|
PYTHON_PATH = "${penv}/${pkgs.python3.sitePackages}";
|
||||||
};
|
};
|
||||||
|
@ -387,7 +358,7 @@ in
|
||||||
--chdir="${cfg.benchDir}/sites" \
|
--chdir="${cfg.benchDir}/sites" \
|
||||||
--bind=${cfg.webserver.bindAddress}:${toString cfg.webserver.bindPort} \
|
--bind=${cfg.webserver.bindAddress}:${toString cfg.webserver.bindPort} \
|
||||||
--threads=4 \
|
--threads=4 \
|
||||||
--workers=3 \
|
--workers=2 \
|
||||||
--worker-class=gthread \
|
--worker-class=gthread \
|
||||||
--worker-tmp-dir=/dev/shm \
|
--worker-tmp-dir=/dev/shm \
|
||||||
--timeout=120 \
|
--timeout=120 \
|
||||||
|
@ -412,22 +383,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.erpnext-queue-default = {
|
|
||||||
enable = true;
|
|
||||||
after = [ "erpnext-web.service" ];
|
|
||||||
wantedBy = [ "erpnext-web.service" ];
|
|
||||||
partOf = [ "erpnext-web.service" ];
|
|
||||||
description = "ERPNext default queue server";
|
|
||||||
confinement = {
|
|
||||||
enable = true;
|
|
||||||
packages = [ penv ];
|
|
||||||
};
|
|
||||||
serviceConfig = defaultServiceConfig // {
|
|
||||||
ExecStart = ''
|
|
||||||
${penv}/bin/bench worker --queue default
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.erpnext-queue-long = {
|
systemd.services.erpnext-queue-long = {
|
||||||
enable = true;
|
enable = true;
|
||||||
after = [ "erpnext-web.service" ];
|
after = [ "erpnext-web.service" ];
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
benchVersion = "5.19.0";
|
benchVersion = "5.19.0";
|
||||||
erpnextVersion = "14.58.1";
|
erpnextVersion = "15.9.1";
|
||||||
frappeVersion = "15.8.1";
|
frappeVersion = "15.8.1";
|
||||||
hashes = {
|
hashes = {
|
||||||
"benchSrcHash" = "sha256-y8nx4vFVQggwGv2MWQ88WczgVbPxPybZV38FF5u5aWI=";
|
"benchSrcHash" = "sha256-y8nx4vFVQggwGv2MWQ88WczgVbPxPybZV38FF5u5aWI=";
|
||||||
"erpnextSrcHash" = "sha256-HeeNd7dAlbppR2gPPmohKqpUUoMx5f0Kgsd7wZtUHp8=";
|
"erpnextSrcHash" = "sha256-nkXN0PTcWt1nSy3eRdBF2h0WMdAC79qWzaj9kXRsG2I=";
|
||||||
"erpnextYarnHash" = "0rjqlw0lff1wwbzl62g8nnjlhz3km2km3vqj2dccawpi4q2kh6jn";
|
"erpnextYarnHash" = "1farnqrfnzshpbpx4nyarw13g8m3389ix3hrc4661xxm887lz5fv";
|
||||||
"frappeSrcHash" = "sha256-FDUUNbULPmMY6dDgbMHrxXD8pK1AP+T7kG7mY9MmMDg=";
|
"frappeSrcHash" = "sha256-FDUUNbULPmMY6dDgbMHrxXD8pK1AP+T7kG7mY9MmMDg=";
|
||||||
"frappeYarnHash" = "0rj2v69siagwjz632hyaii5ni24fp434cznaxpi8978fq07qx6l9";
|
"frappeYarnHash" = "0rj2v69siagwjz632hyaii5ni24fp434cznaxpi8978fq07qx6l9";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue