nextcloud: add nextcloud but wrong folder

This commit is contained in:
Ingolf Wagner 2020-03-04 00:14:21 +08:00
parent def58984bf
commit c4179be09e
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 75 additions and 1 deletions

View file

@ -38,5 +38,15 @@
iptables -t nat -A PREROUTING ! -i tinc.private -p tcp -m tcp --dport 22 -j REDIRECT --to-ports 0 iptables -t nat -A PREROUTING ! -i tinc.private -p tcp -m tcp --dport 22 -j REDIRECT --to-ports 0
''; '';
# enable all subdomains to be reached to make nginx rules easier
services.dnsmasq = with lib; {
enable = true;
extraConfig = ''
${concatStringsSep "\n"
(flip mapAttrsToList config.module.cluster.services.tinc."private".hosts
(name: attrs: "address=/.${name}.private/${attrs.tincIp}"))}
'';
};
} }

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }: { { config, lib, pkgs, ... }: {
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 4443 ];
networking.firewall.allowedUDPPorts = [ 80 443 4443 ];
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -130,6 +131,56 @@
}; };
}; };
"nextcloud.ingolf-wagner.de" = {
listen = [
{
addr = "0.0.0.0";
port = 4443;
ssl = true;
}
{
addr = "0.0.0.0";
port = 80;
ssl = false;
}
];
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://nextcloud.workhorse.private";
extraConfig = ''
sub_filter "http://nextcloud.ingolf-wagner.de" "https://nextcloud.ingolf-wagner.de";
# used for view/edit office file via Office Online Server
client_max_body_size 0;
'';
};
};
"nextcloud.gaykraft.com" = {
listen = [
{
addr = "0.0.0.0";
port = 4443;
ssl = true;
}
{
addr = "0.0.0.0";
port = 80;
ssl = false;
}
];
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://nextcloud.workhorse.private";
extraConfig = ''
sub_filter "http://nextcloud.gaykraft.com" "https://nextcloud.gaykraft.com";
# used for view/edit office file via Office Online Server
client_max_body_size 0;
'';
};
};
"seafile.gaykraft.com" = { "seafile.gaykraft.com" = {
listen = [ listen = [
{ {

View file

@ -24,6 +24,7 @@
./transmission.nix ./transmission.nix
./weechat.nix ./weechat.nix
./wetten.nix ./wetten.nix
./nextcloud.nix
]; ];

View file

@ -0,0 +1,12 @@
{
services.nextcloud = {
enable = true;
autoUpdateApps.enable = true;
config.adminpassFile = toString <secrets/nextcloud/rootpassword>;
#home = "/home/nextcloud";
nginx.enable = true;
hostName = "nextcloud.workhorse.private";
logLevel = 0;
config.extraTrustedDomains = [ "nextcloud.gaykraft.com" ];
};
}