Merge pull request #245357 from onny/nextcloud-fix-test
nixos/tests/nextcloud: Fix tests, fix broken webdav url
This commit is contained in:
commit
1b623f27b0
|
@ -14,12 +14,12 @@ in {
|
||||||
client = { ... }: {
|
client = { ... }: {
|
||||||
services.davfs2.enable = true;
|
services.davfs2.enable = true;
|
||||||
system.activationScripts.davfs2-secrets = ''
|
system.activationScripts.davfs2-secrets = ''
|
||||||
echo "http://nextcloud/remote.php/webdav/ ${adminuser} ${adminpass}" > /tmp/davfs2-secrets
|
echo "http://nextcloud/remote.php/dav/files/${adminuser} ${adminuser} ${adminpass}" > /tmp/davfs2-secrets
|
||||||
chmod 600 /tmp/davfs2-secrets
|
chmod 600 /tmp/davfs2-secrets
|
||||||
'';
|
'';
|
||||||
virtualisation.fileSystems = {
|
virtualisation.fileSystems = {
|
||||||
"/mnt/dav" = {
|
"/mnt/dav" = {
|
||||||
device = "http://nextcloud/remote.php/webdav/";
|
device = "http://nextcloud/remote.php/dav/files/${adminuser}";
|
||||||
fsType = "davfs";
|
fsType = "davfs";
|
||||||
options = let
|
options = let
|
||||||
davfs2Conf = (pkgs.writeText "davfs2.conf" "secrets /tmp/davfs2-secrets");
|
davfs2Conf = (pkgs.writeText "davfs2.conf" "secrets /tmp/davfs2-secrets");
|
||||||
|
@ -70,7 +70,7 @@ in {
|
||||||
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
|
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/dav/files/${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
||||||
|
|
|
@ -33,7 +33,7 @@ in {
|
||||||
withRcloneEnv = host: pkgs.writeScript "with-rclone-env" ''
|
withRcloneEnv = host: pkgs.writeScript "with-rclone-env" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_URL="http://${host}/remote.php/webdav/"
|
export RCLONE_CONFIG_NEXTCLOUD_URL="http://${host}/remote.php/dav/files/${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
args@{ nextcloudVersion ? 27, ... }:
|
args@{ nextcloudVersion ? 27, ... }:
|
||||||
(import ../make-test-python.nix ({ pkgs, ...}: let
|
(import ../make-test-python.nix ({ pkgs, ...}: let
|
||||||
username = "custom_admin_username";
|
adminuser = "custom_admin_username";
|
||||||
# This will be used both for redis and postgresql
|
# This will be used both for redis and postgresql
|
||||||
pass = "hunter2";
|
pass = "hunter2";
|
||||||
# Don't do this at home, use a file outside of the nix store instead
|
# Don't do this at home, use a file outside of the nix store instead
|
||||||
|
@ -34,9 +34,9 @@ in {
|
||||||
config = {
|
config = {
|
||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
dbname = "nextcloud";
|
dbname = "nextcloud";
|
||||||
dbuser = username;
|
dbuser = adminuser;
|
||||||
dbpassFile = passFile;
|
dbpassFile = passFile;
|
||||||
adminuser = username;
|
adminuser = adminuser;
|
||||||
adminpassFile = passFile;
|
adminpassFile = passFile;
|
||||||
};
|
};
|
||||||
secretFile = "/etc/nextcloud-secrets.json";
|
secretFile = "/etc/nextcloud-secrets.json";
|
||||||
|
@ -66,9 +66,9 @@ in {
|
||||||
systemd.services.postgresql.postStart = pkgs.lib.mkAfter ''
|
systemd.services.postgresql.postStart = pkgs.lib.mkAfter ''
|
||||||
password=$(cat ${passFile})
|
password=$(cat ${passFile})
|
||||||
${config.services.postgresql.package}/bin/psql <<EOF
|
${config.services.postgresql.package}/bin/psql <<EOF
|
||||||
CREATE ROLE ${username} WITH LOGIN PASSWORD '$password' CREATEDB;
|
CREATE ROLE ${adminuser} WITH LOGIN PASSWORD '$password' CREATEDB;
|
||||||
CREATE DATABASE nextcloud;
|
CREATE DATABASE nextcloud;
|
||||||
GRANT ALL PRIVILEGES ON DATABASE nextcloud TO ${username};
|
GRANT ALL PRIVILEGES ON DATABASE nextcloud TO ${adminuser};
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -89,9 +89,9 @@ in {
|
||||||
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
|
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/dav/files/${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_USER="${username}"
|
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${pass})"
|
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${pass})"
|
||||||
"''${@}"
|
"''${@}"
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -49,7 +49,7 @@ in {
|
||||||
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
|
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/dav/files/${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
||||||
|
|
|
@ -60,7 +60,7 @@ in {
|
||||||
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
|
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/dav/files/${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
export RCLONE_CONFIG_NEXTCLOUD_USER="${adminuser}"
|
||||||
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
|
||||||
|
|
Loading…
Reference in a new issue