Proxy Peertube behind Nginx

This commit is contained in:
Nicolas Jeannerod 2024-11-11 17:10:58 +01:00
parent 4f8ba4bf3c
commit 49473c43c8
Signed by: Niols
GPG key ID: 35DB9EC8886E1CB8

View file

@ -8,7 +8,7 @@ in
{ config, lib, pkgs, ... }:
lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) {
networking.firewall.allowedTCPPorts = [ 80 9000 ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.garage = {
ensureBuckets = {
@ -59,7 +59,6 @@ lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) {
# TODO: in most of nixpkgs, these are true by default. upstream that unless there's a good reason not to.
redis.createLocally = true;
database.createLocally = true;
configureNginx = true;
secrets.secretsFile = config.fediversity.temp.peertubeSecretsFile;
@ -96,4 +95,12 @@ lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) {
AWS_ACCESS_KEY_ID=${snakeoil_key.id}
AWS_SECRET_ACCESS_KEY=${snakeoil_key.secret}
'';
## Proxying through Nginx
services.peertube.configureNginx = true;
services.nginx.virtualHosts.${config.services.peertube.localDomain} = {
forceSSL = true;
enableACME = true;
};
}