3
0
Fork 0
forked from mirrors/nixpkgs

nixos/invoiceplane: Enable clean url

This commit is contained in:
Jonas Heinrich 2022-11-07 20:36:57 +01:00 committed by Yt
parent 59f6a93082
commit f7f9442695
2 changed files with 9 additions and 9 deletions

View file

@ -25,6 +25,7 @@ let
ENCRYPTION_KEY= ENCRYPTION_KEY=
ENCRYPTION_CIPHER=AES-256 ENCRYPTION_CIPHER=AES-256
SETUP_COMPLETED=false SETUP_COMPLETED=false
REMOVE_INDEXPHP=true
''; '';
extraConfig = hostName: cfg: pkgs.writeText "extraConfig.php" '' extraConfig = hostName: cfg: pkgs.writeText "extraConfig.php" ''
@ -331,7 +332,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = user; User = user;
ExecStart = "${pkgs.curl}/bin/curl --header 'Host: ${hostName}' http://localhost/index.php/invoices/cron/recur/${cfg.cron.key}"; ExecStart = "${pkgs.curl}/bin/curl --header 'Host: ${hostName}' http://localhost/invoices/cron/recur/${cfg.cron.key}";
}; };
}) })
)) eachSite); )) eachSite);
@ -344,9 +345,8 @@ in
virtualHosts = mapAttrs' (hostName: cfg: ( virtualHosts = mapAttrs' (hostName: cfg: (
nameValuePair "http://${hostName}" { nameValuePair "http://${hostName}" {
extraConfig = '' extraConfig = ''
root * ${pkg hostName cfg} root * ${pkg hostName cfg}
file_server file_server
php_fastcgi unix/${config.services.phpfpm.pools."invoiceplane-${hostName}".socket} php_fastcgi unix/${config.services.phpfpm.pools."invoiceplane-${hostName}".socket}
''; '';
} }

View file

@ -46,37 +46,37 @@ import ./make-test-python.nix ({ pkgs, ... }:
with subtest("Finish InvoicePlane setup"): with subtest("Finish InvoicePlane setup"):
machine.succeed( machine.succeed(
f"curl -sSfL --cookie-jar cjar {site_name}/index.php/setup/language" f"curl -sSfL --cookie-jar cjar {site_name}/setup/language"
) )
csrf_token = machine.succeed( csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'" "grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
) )
machine.succeed( machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&ip_lang=english&btn_continue=Continue' {site_name}/index.php/setup/language" f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&ip_lang=english&btn_continue=Continue' {site_name}/setup/language"
) )
csrf_token = machine.succeed( csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'" "grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
) )
machine.succeed( machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/index.php/setup/prerequisites" f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/prerequisites"
) )
csrf_token = machine.succeed( csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'" "grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
) )
machine.succeed( machine.succeed(
f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/index.php/setup/configure_database" f"curl -sSfL --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/configure_database"
) )
csrf_token = machine.succeed( csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'" "grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
) )
machine.succeed( machine.succeed(
f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/index.php/setup/install_tables" f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/install_tables"
) )
csrf_token = machine.succeed( csrf_token = machine.succeed(
"grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'" "grep ip_csrf_cookie cjar | cut -f 7 | tr -d '\n'"
) )
machine.succeed( machine.succeed(
f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/index.php/setup/upgrade_tables" f"curl -sSfl --cookie cjar --cookie-jar cjar -d '_ip_csrf={csrf_token}&btn_continue=Continue' {site_name}/setup/upgrade_tables"
) )
''; '';
}) })