mob next [ci-skip] [ci skip] [skip ci]
lastFile:modules/nixos/think-backend-gtcm.nix
This commit is contained in:
@@ -1,234 +0,0 @@
|
||||
|
||||
# 2025-11-24 13:55:37.811567
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 13:56:20.311688
|
||||
+print("ls ")
|
||||
|
||||
# 2025-11-24 13:56:54.776584
|
||||
+print(node1.execute("ls"))
|
||||
|
||||
# 2025-11-24 13:58:28.668534
|
||||
+print(node1.execute("systemctl list-units --state=running"))
|
||||
|
||||
# 2025-11-24 13:58:54.403671
|
||||
+print(node1.execute("systemctl list-units --state=running")[1])
|
||||
|
||||
# 2025-11-24 14:04:23.706300
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-24 14:05:12.009677
|
||||
+print(node1.execute("ls /run/phpfpm")[1])
|
||||
|
||||
# 2025-11-24 14:05:18.190057
|
||||
+print(node1.execute("ls /run/")[1])
|
||||
|
||||
# 2025-11-24 14:06:13.672107
|
||||
+print(node1.execute("systemctl status phpfpm")[1])
|
||||
|
||||
# 2025-11-24 14:06:30.998281
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai")[1])
|
||||
|
||||
# 2025-11-24 14:06:46.415493
|
||||
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai")[1])
|
||||
|
||||
# 2025-11-24 14:07:04.587586
|
||||
+print(node1.execute("journalctl -u phpfpm-think-greaterchiangmai")[1])
|
||||
|
||||
# 2025-11-24 14:07:23.281828
|
||||
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 14:25:55.937596
|
||||
+sta
|
||||
|
||||
# 2025-11-24 14:26:00.037215
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 14:26:31.056466
|
||||
+print(node1.execute("systemctl restart phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 14:26:41.419197
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 14:28:23.086227
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 14:34:38.031180
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 14:35:05.524404
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-24 15:28:41.942140
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 15:38:58.983582
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 15:39:05.916438
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-24 15:40:35.187547
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 15:41:03.024846
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-24 15:45:28.552055
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 15:55:45.706557
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 15:56:20.761495
|
||||
+print(node1.execute("composer")[1])
|
||||
|
||||
# 2025-11-24 15:58:05.766218
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 15:58:41.171176
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 16:04:34.457301
|
||||
+start_all()
|
||||
|
||||
# 2025-11-24 16:18:15.123805
|
||||
+print(node1.execute("systemctl status phpfpm-think-greaterchiangmai.service")[1])
|
||||
|
||||
# 2025-11-24 16:26:24.656220
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 10:47:30.543608
|
||||
+print(node1.execute("ls -al /run/")[1])
|
||||
|
||||
# 2025-11-25 10:47:47.291394
|
||||
+print(node1.execute("ls -al /run/think-gtcm")[1])
|
||||
|
||||
# 2025-11-25 10:51:09.769262
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 11:00:34.699136
|
||||
+print(node1.execute("ls -al /run/think-gtcm")[1])
|
||||
|
||||
# 2025-11-25 11:05:01.639108
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 11:05:52.361090
|
||||
+print(node1.execute("ls -al /run/think-gtcm")[1])
|
||||
|
||||
# 2025-11-25 11:06:02.844430
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 11:13:23.088862
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost")[1])
|
||||
|
||||
# 2025-11-25 11:14:01.467493
|
||||
+print(node1.execute("ls -al /run/phpfpm/")[1])
|
||||
|
||||
# 2025-11-25 11:16:13.687663
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 11:16:49.608807
|
||||
+print(node1.execute("ls -al /run/phpfpm/")[1])
|
||||
|
||||
# 2025-11-25 11:16:53.334603
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost")[1])
|
||||
|
||||
# 2025-11-25 11:17:04.779069
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 11:25:12.482960
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 11:25:51.342181
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 11:40:18.001245
|
||||
+print(node1.execute("ls -al /var/lib/")[1])
|
||||
|
||||
# 2025-11-25 11:40:37.001361
|
||||
+print(node1.execute("ls -al /var/lib/think.greaterchiangmai.com")[1])
|
||||
|
||||
# 2025-11-25 11:40:54.438752
|
||||
+print(node1.execute("cat /var/lib/think.greaterchiangmai.com/.env")[1])
|
||||
|
||||
# 2025-11-25 11:41:19.519497
|
||||
+print(node1.execute("ls -al /var/lib/think.greaterchiangmai.com/storage")[1])
|
||||
|
||||
# 2025-11-25 11:41:42.426706
|
||||
+print(node1.execute("ls -al /var/lib/think.greaterchiangmai.com/storage/framework")[1])
|
||||
|
||||
# 2025-11-25 11:41:46.387743
|
||||
+print(node1.execute("ls -al /var/lib/think.greaterchiangmai.com/storage/framework/cache")[1])
|
||||
|
||||
# 2025-11-25 11:41:58.617088
|
||||
+print(node1.execute("ls -al /var/lib/think.greaterchiangmai.com/public")[1])
|
||||
|
||||
# 2025-11-25 12:02:32.221565
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 12:05:35.375896
|
||||
+print(node1.execute("php")[1])
|
||||
|
||||
# 2025-11-25 12:06:20.909218
|
||||
+print(node1.execute("gtcm")[1])
|
||||
|
||||
# 2025-11-25 12:06:51.242291
|
||||
+print(node1.execute("gtcm config:cache")[1])
|
||||
|
||||
# 2025-11-25 12:07:17.385975
|
||||
+print(node1.execute("gtcm view:cache")[1])
|
||||
|
||||
# 2025-11-25 12:07:24.634055
|
||||
+print(node1.execute("gtcm view:clear")[1])
|
||||
|
||||
# 2025-11-25 12:08:50.031451
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 12:09:24.686449
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 12:12:31.634657
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 12:13:32.195413
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 12:57:53.552844
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 12:58:35.119916
|
||||
+print(node1.execute("curl localhost")[1])
|
||||
|
||||
# 2025-11-25 13:03:51.177495
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost")[1])
|
||||
|
||||
# 2025-11-25 13:04:11.541577
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost/")[1])
|
||||
|
||||
# 2025-11-25 13:04:16.055561
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost/asdfasdkfj")[1])
|
||||
|
||||
# 2025-11-25 13:04:27.300525
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost/web")[1])
|
||||
|
||||
# 2025-11-25 13:04:34.302473
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost")[1])
|
||||
|
||||
# 2025-11-25 13:06:02.700710
|
||||
+print(node1.execute("artisan")[1])
|
||||
|
||||
# 2025-11-25 13:06:09.844650
|
||||
+print(node1.execute("gtcm")[1])
|
||||
|
||||
# 2025-11-25 13:21:23.388725
|
||||
+start_all()
|
||||
|
||||
# 2025-11-25 13:22:15.869361
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost")[1])
|
||||
|
||||
# 2025-11-25 13:40:50.043328
|
||||
+print(node1.execute("curl -H 'Host: think.greaterchiangmai.com' localhost/category/chiangmai")[1])
|
||||
|
||||
# 2025-11-25 13:41:54.180205
|
||||
+print(node1.execute("journalctl -u phpfpm-think-gtcm")[1])
|
||||
@@ -5,7 +5,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.think-backcend-greaterchiangmai;
|
||||
cfg = config.services.think-backend-greaterchiangmai;
|
||||
think-backend-gtcm = pkgs.think-backend-gtcm.override { dataDir = cfg.dataDir; };
|
||||
defaultUser = "gtcm";
|
||||
defaultGroup = "gtcm";
|
||||
@@ -124,7 +124,7 @@ in
|
||||
};
|
||||
users.groups.${cfg.group} = { };
|
||||
|
||||
services.phpfpm.pools.think-be-gtcm = {
|
||||
services.phpfpm.pools.think-backend-gtcm = {
|
||||
inherit (cfg) user group;
|
||||
phpPackage = php;
|
||||
settings = {
|
||||
@@ -148,10 +148,10 @@ in
|
||||
artisan-be
|
||||
];
|
||||
|
||||
systemd.services.think-be-gtcm-setup = {
|
||||
systemd.services.think-backend-gtcm-setup = {
|
||||
description = "think-backend.greaterchiangmai installation";
|
||||
requiredBy = [ "phpfpm-think-be-gtcm.service" ];
|
||||
before = [ "phpfpm-think-be-gtcm.service" ];
|
||||
requiredBy = [ "phpfpm-think-backend-gtcm.service" ];
|
||||
before = [ "phpfpm-think-backend-gtcm.service" ];
|
||||
requires = [ "mysql.service" ];
|
||||
after = [ "mysql.service" ];
|
||||
serviceConfig = {
|
||||
@@ -160,7 +160,7 @@ in
|
||||
User = cfg.user;
|
||||
UMask = 77;
|
||||
WorkingDirectory = "${think-backend-gtcm}";
|
||||
RuntimeDirectory = "think-be-gtcm/cache";
|
||||
RuntimeDirectory = "think-backend-gtcm/cache";
|
||||
RuntimeDirectoryMode = 700;
|
||||
};
|
||||
path = [ pkgs.replace-secret ];
|
||||
@@ -204,7 +204,7 @@ in
|
||||
null
|
||||
]
|
||||
)) cfg.settings;
|
||||
gtcmEnv = pkgs.writeText "gtcm.env" (gtcmEnvVars filteredConfig);
|
||||
gtcmEnv = pkgs.writeText "gtcm-be.env" (gtcmEnvVars filteredConfig);
|
||||
in
|
||||
''
|
||||
# error handling
|
||||
@@ -253,7 +253,6 @@ in
|
||||
index = "index.php";
|
||||
tryFiles = "$uri $uri/ /index.php?$query_string";
|
||||
};
|
||||
|
||||
"~ \\.php$".extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."think-backend-gtcm".socket};
|
||||
'';
|
||||
|
||||
@@ -285,22 +285,6 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
virtualHosts."${cfg.backendDomain}" = {
|
||||
root = "${think-backend-gtcm}/public";
|
||||
locations = {
|
||||
"/" = {
|
||||
index = "index.php";
|
||||
tryFiles = "$uri $uri/ /index.php?$query_string";
|
||||
};
|
||||
|
||||
"~ \\.php$".extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools."think-backend-gtcm".socket};
|
||||
'';
|
||||
"~ \\.(js|css|gif|png|ico|jpg|jpeg)$" = {
|
||||
extraConfig = "expires 365d;";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.mysql = {
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
nodes =
|
||||
let
|
||||
settings = {
|
||||
APP_SERVICES_CACHE = "/run/think-gtcm/cache/services.php";
|
||||
APP_PACKAGES_CACHE = "/run/think-gtcm/cache/packages.php";
|
||||
APP_CONFIG_CACHE = "/run/think-gtcm/cache/config.php";
|
||||
APP_ROUTES_CACHE = "/run/think-gtcm/cache/routes-v7.php";
|
||||
APP_EVENTS_CACHE = "/run/think-gtcm/cache/events.php";
|
||||
|
||||
DB_CONNECTION = "mysql";
|
||||
DB_HOST = "localhost";
|
||||
@@ -67,17 +62,29 @@
|
||||
imports = [ self.nixosModules.think-gtcm ];
|
||||
services.think-greaterchiangmai = {
|
||||
enable = true;
|
||||
settings = settings;
|
||||
settings = settings // {
|
||||
APP_SERVICES_CACHE = "/run/think-gtcm/cache/services.php";
|
||||
APP_PACKAGES_CACHE = "/run/think-gtcm/cache/packages.php";
|
||||
APP_CONFIG_CACHE = "/run/think-gtcm/cache/config.php";
|
||||
APP_ROUTES_CACHE = "/run/think-gtcm/cache/routes-v7.php";
|
||||
APP_EVENTS_CACHE = "/run/think-gtcm/cache/events.php";
|
||||
};
|
||||
};
|
||||
};
|
||||
backend1 =
|
||||
{ self, pkgs, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ self.overlays.packagesOverlay ];
|
||||
imports = [ self.nixosModules.think-be-gtcm ];
|
||||
imports = [ self.nixosModules.think-backend-gtcm ];
|
||||
services.think-backend-greaterchiangmai = {
|
||||
enable = true;
|
||||
settings = settings;
|
||||
settings = settings // {
|
||||
APP_SERVICES_CACHE = "/run/think-backend-gtcm/cache/services.php";
|
||||
APP_PACKAGES_CACHE = "/run/think-backend-gtcm/cache/packages.php";
|
||||
APP_CONFIG_CACHE = "/run/think-backend-gtcm/cache/config.php";
|
||||
APP_ROUTES_CACHE = "/run/think-backend-gtcm/cache/routes-v7.php";
|
||||
APP_EVENTS_CACHE = "/run/think-backend-gtcm/cache/events.php";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -89,7 +96,7 @@
|
||||
gtcm1.wait_for_open_port(80)
|
||||
output = gtcm1.succeed("curl localhost")
|
||||
|
||||
backend1.wait_for_unit("phpfpm-think-gtcm")
|
||||
backend1.wait_for_unit("phpfpm-think-backend-gtcm")
|
||||
backend1.wait_for_open_port(80)
|
||||
output = backend1.succeed("curl localhost")
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user