···
node ~/dist/server/tools/peertube.js $@
+
nginxCommonHeaders = lib.optionalString cfg.enableWebHttps ''
+
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
+
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
+
add_header Alt-Svc 'h3=":443"; ma=86400';
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, OPTIONS';
add_header Access-Control-Allow-Headers 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
···
systemd.services.peertube-init-db = lib.mkIf cfg.database.createLocally {
description = "Initialization database for PeerTube daemon";
after = [ "network.target" "postgresql.service" ];
+
requires = [ "postgresql.service" ];
psqlSetupCommands = pkgs.writeText "peertube-init.sql" ''
···
systemd.services.peertube = {
description = "PeerTube daemon";
after = [ "network.target" ]
+
++ lib.optional cfg.redis.createLocally "redis-peertube.service"
+
++ lib.optionals cfg.database.createLocally [ "postgresql.service" "peertube-init-db.service" ];
+
requires = lib.optional cfg.redis.createLocally "redis-peertube.service"
++ lib.optionals cfg.database.createLocally [ "postgresql.service" "peertube-init-db.service" ];
wantedBy = [ "multi-user.target" ];
···
client_max_body_size 12G;
add_header X-File-Maximum-Size 8G always;
+
'' + lib.optionalString cfg.enableWebHttps ''
+
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
+
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
+
add_header Alt-Svc 'h3=":443"; ma=86400';
···
add_header X-File-Maximum-Size 4M always;
+
'' + lib.optionalString cfg.enableWebHttps ''
+
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
+
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
+
add_header Alt-Svc 'h3=":443"; ma=86400';
···
add_header Cache-Control 'public, max-age=604800, immutable';
+
'' + lib.optionalString cfg.enableWebHttps ''
+
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
+
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
+
add_header Alt-Svc 'h3=":443"; ma=86400';
···
rewrite ^/static/webseed/(.*)$ /$1 break;
+
extraConfig = lib.optionalString cfg.enableWebHttps ''
+
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';