This commit is contained in:
Danilo Reyes
2026-02-05 10:41:29 -06:00
parent 3517e394c6
commit cb1776d670

View File

@@ -38,7 +38,7 @@ let
in in
{ {
options.my.servers = { options.my.servers = {
nextcloud = setup.mkOptions "nextcloud" "cloud" 80; nextcloud = setup.mkOptions "nextcloud" "cloud" 8081;
collabora = setup.mkOptions "collabora" "collabora" 9980; collabora = setup.mkOptions "collabora" "collabora" 9980;
go-vod.enable = lib.mkEnableOption "Go-VOD video transcoding service"; go-vod.enable = lib.mkEnableOption "Go-VOD video transcoding service";
}; };
@@ -68,116 +68,100 @@ in
; ;
}; };
}; };
services = { services.nextcloud = {
nextcloud = { enable = true;
enable = true; https = false; # vps
https = false; # vps package = pkgs.nextcloud32;
package = pkgs.nextcloud32; appstoreEnable = true;
appstoreEnable = true; configureRedis = true;
configureRedis = true; extraAppsEnable = true;
extraAppsEnable = true; enableImagemagick = true;
enableImagemagick = true; maxUploadSize = "4096M";
maxUploadSize = "4096M"; hostName = cfg.host;
hostName = cfg.host; caching = {
caching = { redis = true;
redis = true; memcached = true;
memcached = true; apcu = true;
apcu = true; };
}; config = {
config = { adminpassFile = config.sops.secrets.nextcloud-adminpass.path;
adminpassFile = config.sops.secrets.nextcloud-adminpass.path; dbtype = "pgsql";
dbtype = "pgsql"; dbhost = config.my.postgresSocket;
dbhost = config.my.postgresSocket; dbname = "nextcloud";
dbname = "nextcloud"; };
}; phpOptions = {
phpOptions = { catch_workers_output = "yes";
catch_workers_output = "yes"; display_errors = "stderr";
display_errors = "stderr"; error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT";
error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT"; expose_php = "Off";
expose_php = "Off"; preview_max_x = 2048;
preview_max_x = 2048; preview_max_y = 2048;
preview_max_y = 2048; short_open_tag = "Off";
short_open_tag = "Off"; "opcache.enable_cli" = "1";
"opcache.enable_cli" = "1"; "opcache.fast_shutdown" = "1";
"opcache.fast_shutdown" = "1"; "opcache.interned_strings_buffer" = "16";
"opcache.interned_strings_buffer" = "16"; "opcache.jit" = "1255";
"opcache.jit" = "1255"; "opcache.jit_buffer_size" = "256M";
"opcache.jit_buffer_size" = "256M"; "opcache.max_accelerated_files" = "10000";
"opcache.max_accelerated_files" = "10000"; "opcache.huge_code_pages" = "1";
"opcache.huge_code_pages" = "1"; "opcache.enable_file_override" = "1";
"opcache.enable_file_override" = "1"; "opcache.memory_consumption" = "256";
"opcache.memory_consumption" = "256"; "opcache.revalidate_freq" = "60";
"opcache.revalidate_freq" = "60"; "opcache.save_comments" = "1";
"opcache.save_comments" = "1"; "opcache.validate_timestamps" = "0";
"opcache.validate_timestamps" = "0"; "openssl.cafile" = "/etc/ssl/certs/ca-certificates.crt";
"openssl.cafile" = "/etc/ssl/certs/ca-certificates.crt"; };
}; settings = {
settings = { log_type = "file";
log_type = "file"; loglevel = 1;
loglevel = 1; trusted_proxies = [
trusted_proxies = [ config.my.localhost
config.my.localhost config.my.localhost6
config.my.localhost6 config.my.ips.router
config.my.ips.router config.my.ips.wg-vps
config.my.ips.wg-vps ];
]; trusted_domains = [
trusted_domains = [ cfg.host
cfg.host config.my.ips.${config.networking.hostName}
config.my.ips.${config.networking.hostName} "localhost"
"localhost" "cloud.rotehaare.art"
"cloud.rotehaare.art" ];
]; overwriteprotocol = "https";
overwriteprotocol = "https"; "overwrite.cli.url" = "${cfg.url}";
"overwrite.cli.url" = "${cfg.url}"; forwarded_for_headers = [ "HTTP_X_FORWARDED_FOR" ];
forwarded_for_headers = [ "HTTP_X_FORWARDED_FOR" ]; default_phone_region = "MX";
default_phone_region = "MX"; allow_local_remote_servers = true;
allow_local_remote_servers = true; mail_smtpmode = "sendmail";
mail_smtpmode = "sendmail"; mail_sendmailmode = "pipe";
mail_sendmailmode = "pipe"; preview_ffmpeg_path = "${pkgs.ffmpeg}/bin/ffmpeg";
preview_ffmpeg_path = "${pkgs.ffmpeg}/bin/ffmpeg"; "memories.exiftool" = "${exiftool}/bin/exiftool";
"memories.exiftool" = "${exiftool}/bin/exiftool"; "memories.ffmpeg_path" = "${pkgs.ffmpeg}/bin/ffmpeg";
"memories.ffmpeg_path" = "${pkgs.ffmpeg}/bin/ffmpeg"; "memories.ffprobe_path" = "${pkgs.ffmpeg}/bin/ffprobe";
"memories.ffprobe_path" = "${pkgs.ffmpeg}/bin/ffprobe"; enabledPreviewProviders = [
enabledPreviewProviders = [ "OC\\Preview\\AVI"
"OC\\Preview\\AVI" "OC\\Preview\\BMP"
"OC\\Preview\\BMP" "OC\\Preview\\GIF"
"OC\\Preview\\GIF" "OC\\Preview\\HEIC"
"OC\\Preview\\HEIC" "OC\\Preview\\Image"
"OC\\Preview\\Image" "OC\\Preview\\JPEG"
"OC\\Preview\\JPEG" "OC\\Preview\\Krita"
"OC\\Preview\\Krita" "OC\\Preview\\MKV"
"OC\\Preview\\MKV" "OC\\Preview\\MP3"
"OC\\Preview\\MP3" "OC\\Preview\\MP4"
"OC\\Preview\\MP4" "OC\\Preview\\MarkDown"
"OC\\Preview\\MarkDown" "OC\\Preview\\Movie"
"OC\\Preview\\Movie" "OC\\Preview\\OpenDocument"
"OC\\Preview\\OpenDocument" "OC\\Preview\\PNG"
"OC\\Preview\\PNG" "OC\\Preview\\TIFF"
"OC\\Preview\\TIFF" "OC\\Preview\\TXT"
"OC\\Preview\\TXT" "OC\\Preview\\XBitmap"
"OC\\Preview\\XBitmap"
];
};
phpExtraExtensions = all: [
all.pdlib
all.bz2
];
};
nginx.virtualHosts.${cfg.host} = {
forceSSL = false;
enableACME = false;
http2 = false;
listen = [
{
addr = config.my.ips.wg-server;
port = 8081;
}
{
addr = config.my.localhost;
port = 8081;
}
]; ];
}; };
phpExtraExtensions = all: [
all.pdlib
all.bz2
];
}; };
virtualisation.oci-containers.containers = { virtualisation.oci-containers.containers = {
go-vod = lib.mkIf config.my.servers.go-vod.enable { go-vod = lib.mkIf config.my.servers.go-vod.enable {
@@ -254,10 +238,10 @@ in
my.servers.nextcloud.useDefaultProxy = false; my.servers.nextcloud.useDefaultProxy = false;
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"${cfg.host}" = { "${cfg.host}" = {
forceSSL = true; forceSSL = false;
enableACME = true; enableACME = false;
http2 = true; http2 = false;
default = true; default = false;
serverAliases = [ "cloud.rotehaare.art" ]; serverAliases = [ "cloud.rotehaare.art" ];
extraConfig = '' extraConfig = ''
add_header X-XSS-Protection "1; mode=block" always; add_header X-XSS-Protection "1; mode=block" always;
@@ -272,11 +256,6 @@ in
"~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+|.+/richdocumentscode/proxy).php(?:$|/)" = "~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+|.+/richdocumentscode/proxy).php(?:$|/)" =
{ }; { };
}; };
}
// lib.optionalAttrs cfg.enable {
forceSSL = false;
enableACME = false;
http2 = false;
listen = [ listen = [
{ {
addr = config.my.ips.wg-server; addr = config.my.ips.wg-server;