nextcloud: disable /updater location (substitute html)
This commit is contained in:
@@ -31,6 +31,11 @@ let
|
|||||||
auth-passthru.mkServiceAccountTokenFP linuxUserOfService;
|
auth-passthru.mkServiceAccountTokenFP linuxUserOfService;
|
||||||
oauthClientSecretFP =
|
oauthClientSecretFP =
|
||||||
auth-passthru.mkOAuth2ClientSecretFP linuxUserOfService;
|
auth-passthru.mkOAuth2ClientSecretFP linuxUserOfService;
|
||||||
|
|
||||||
|
updater-page-substitute =
|
||||||
|
pkgs.runCommandNoCC "nextcloud-updater-page-substitute" { } ''
|
||||||
|
install -m644 ${./updater.html} -DT $out/index.html
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.selfprivacy.modules.nextcloud = with lib; {
|
options.selfprivacy.modules.nextcloud = with lib; {
|
||||||
@@ -232,6 +237,14 @@ in
|
|||||||
locations."~ \\.php(?:$|/)".extraConfig = ''
|
locations."~ \\.php(?:$|/)".extraConfig = ''
|
||||||
error_page 500 502 503 504 ${pkgs.nginx}/html/50x.html;
|
error_page 500 502 503 504 ${pkgs.nginx}/html/50x.html;
|
||||||
'';
|
'';
|
||||||
|
locations."^~ /updater/" = {
|
||||||
|
alias = updater-page-substitute + "/";
|
||||||
|
extraConfig = ''
|
||||||
|
error_page 410 /index.html;
|
||||||
|
# otherwise, nginx returns 405 for POST requests to static content
|
||||||
|
error_page 405 =200 $uri;
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
# the following part is active only when "auth" module is enabled
|
# the following part is active only when "auth" module is enabled
|
||||||
|
9
sp-modules/nextcloud/updater.html
Normal file
9
sp-modules/nextcloud/updater.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<!-- index.html -->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head><title>Updater Disabled</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>This page is not available</h1>
|
||||||
|
<p>Since NixOS manages updates, this page is disabled.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user