mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 02:41:35 +01:00
Update dev vm and module
This commit is contained in:
@@ -20,9 +20,20 @@
|
|||||||
password = "dev";
|
password = "dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [ "d /var/www/archtika-websites 0777 root root -" ];
|
systemd.tmpfiles.settings = {
|
||||||
|
"10-archtika" = {
|
||||||
|
"/var/www/archtika-websites" = {
|
||||||
|
d = {
|
||||||
|
mode = "0777";
|
||||||
|
user = "root";
|
||||||
|
group = "root";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
msize = 65536;
|
||||||
graphics = false;
|
graphics = false;
|
||||||
memorySize = 2048;
|
memorySize = 2048;
|
||||||
cores = 2;
|
cores = 2;
|
||||||
@@ -51,23 +62,13 @@
|
|||||||
services = {
|
services = {
|
||||||
postgresql = {
|
postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.postgresql_16;
|
|
||||||
/*
|
|
||||||
PL/Perl:
|
|
||||||
overrideAttrs (
|
|
||||||
finalAttrs: previousAttrs: {
|
|
||||||
buildInputs = previousAttrs.buildInputs ++ [ pkgs.perl ];
|
|
||||||
configureFlags = previousAttrs.configureFlags ++ [ "--with-perl" ];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
ensureDatabases = [ "archtika" ];
|
ensureDatabases = [ "archtika" ];
|
||||||
authentication = lib.mkForce ''
|
authentication = lib.mkForce ''
|
||||||
local all all trust
|
local all all trust
|
||||||
host all all all trust
|
host all all all trust
|
||||||
'';
|
'';
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
extraPlugins = with pkgs.postgresql16Packages; [ pgjwt ];
|
extensions = ps: with ps; [ pgjwt ];
|
||||||
};
|
};
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -105,7 +106,6 @@
|
|||||||
|
|
||||||
systemd.services.postgresql = {
|
systemd.services.postgresql = {
|
||||||
path = with pkgs; [
|
path = with pkgs; [
|
||||||
# Tar and gzip are needed for tar.gz exports
|
|
||||||
gnutar
|
gnutar
|
||||||
gzip
|
gzip
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -177,14 +177,14 @@ in
|
|||||||
"postgres://${user}@127.0.0.1:${toString config.services.postgresql.settings.port}/${cfg.databaseName}";
|
"postgres://${user}@127.0.0.1:${toString config.services.postgresql.settings.port}/${cfg.databaseName}";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
JWT_SECRET=$(tr -dc "A-Za-z0-9" < /dev/urandom | head -c64)
|
JWT_SECRET=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c64)
|
||||||
|
|
||||||
psql ${dbUrl "postgres"} \
|
psql ${dbUrl "postgres"} \
|
||||||
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.jwt_secret\" TO '$JWT_SECRET'" \
|
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.jwt_secret\" TO '$JWT_SECRET'" \
|
||||||
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.website_max_storage_size\" TO ${toString cfg.settings.maxWebsiteStorageSize}" \
|
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.website_max_storage_size\" TO ${toString cfg.settings.maxWebsiteStorageSize}" \
|
||||||
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.website_max_number_user\" TO ${toString cfg.settings.maxUserWebsites}"
|
-c "ALTER DATABASE ${cfg.databaseName} SET \"app.website_max_number_user\" TO ${toString cfg.settings.maxUserWebsites}"
|
||||||
|
|
||||||
dbmate --url ${dbUrl "postgres"}?sslmode=disable --migrations-dir ${cfg.package}/rest-api/db/migrations up
|
${pkgs.dbmate} --url ${dbUrl "postgres"}?sslmode=disable --migrations-dir ${cfg.package}/rest-api/db/migrations up
|
||||||
|
|
||||||
PGRST_SERVER_CORS_ALLOWED_ORIGINS="https://${cfg.domain}" \
|
PGRST_SERVER_CORS_ALLOWED_ORIGINS="https://${cfg.domain}" \
|
||||||
PGRST_ADMIN_SERVER_PORT=${toString cfg.apiAdminPort} \
|
PGRST_ADMIN_SERVER_PORT=${toString cfg.apiAdminPort} \
|
||||||
|
|||||||
Reference in New Issue
Block a user