From 508769f12e30d0d062073388670945da5521acb2 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 6 Jan 2024 17:14:55 +0100 Subject: [PATCH] chore: update erpnext version to 15+ --- modules/erpnext.nix | 57 +++++---------------------------------------- srcs/pin.nix | 6 ++--- 2 files changed, 9 insertions(+), 54 deletions(-) diff --git a/modules/erpnext.nix b/modules/erpnext.nix index ced0bba..1a347b1 100644 --- a/modules/erpnext.nix +++ b/modules/erpnext.nix @@ -114,12 +114,6 @@ in }; }; - socketIoPort = mkOption { - type = types.port; - default = 9000; - description = lib.mdDoc "Local socket.io HTTP server port."; - }; - webserver = { bindAddress = mkOption { type = types.str; @@ -199,10 +193,8 @@ in db_port = "${toString cfg.database.port}"; db_name = "${cfg.database.name}"; db_password = "#NIXOS_ERPNEXT_DB_USER_PASSWORD#"; - redis_cache = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=1"; - redis_queue = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=2"; - redis_socketio = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=0"; - socketio_port = "${toString cfg.socketIoPort}"; + redis_cache = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=0"; + redis_queue = "redis://${cfg.redis.host}:${toString cfg.redis.port}?db=1"; }; 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}" ]; - 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.virtualHosts."${cfg.domain}" = mkIf (cfg.caddy != null) (lib.mkMerge [ cfg.caddy @@ -312,12 +287,6 @@ in root * ${pkgs.frappe-erpnext-assets}/share/sites 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} ''; @@ -330,7 +299,6 @@ in after = [ "mysql.service" "redis.service" - "redis-socketio.service" "systemd-tmpfiles-setup.service" ]; description = "ERPNext web server"; @@ -347,6 +315,9 @@ in pkgs.replace-secret ]; }; + path = [ + pkgs.mariadb-client + ]; environment = { PYTHON_PATH = "${penv}/${pkgs.python3.sitePackages}"; }; @@ -387,7 +358,7 @@ in --chdir="${cfg.benchDir}/sites" \ --bind=${cfg.webserver.bindAddress}:${toString cfg.webserver.bindPort} \ --threads=4 \ - --workers=3 \ + --workers=2 \ --worker-class=gthread \ --worker-tmp-dir=/dev/shm \ --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 = { enable = true; after = [ "erpnext-web.service" ]; diff --git a/srcs/pin.nix b/srcs/pin.nix index 174caf4..dbb13ec 100644 --- a/srcs/pin.nix +++ b/srcs/pin.nix @@ -1,11 +1,11 @@ { benchVersion = "5.19.0"; - erpnextVersion = "14.58.1"; + erpnextVersion = "15.9.1"; frappeVersion = "15.8.1"; hashes = { "benchSrcHash" = "sha256-y8nx4vFVQggwGv2MWQ88WczgVbPxPybZV38FF5u5aWI="; - "erpnextSrcHash" = "sha256-HeeNd7dAlbppR2gPPmohKqpUUoMx5f0Kgsd7wZtUHp8="; - "erpnextYarnHash" = "0rjqlw0lff1wwbzl62g8nnjlhz3km2km3vqj2dccawpi4q2kh6jn"; + "erpnextSrcHash" = "sha256-nkXN0PTcWt1nSy3eRdBF2h0WMdAC79qWzaj9kXRsG2I="; + "erpnextYarnHash" = "1farnqrfnzshpbpx4nyarw13g8m3389ix3hrc4661xxm887lz5fv"; "frappeSrcHash" = "sha256-FDUUNbULPmMY6dDgbMHrxXD8pK1AP+T7kG7mY9MmMDg="; "frappeYarnHash" = "0rj2v69siagwjz632hyaii5ni24fp434cznaxpi8978fq07qx6l9"; };