org: migrate to hackens.org

This commit is contained in:
sinavir 2023-12-20 19:53:09 +01:00
parent eabf2556bd
commit db5c4008b8
6 changed files with 67 additions and 45 deletions

View file

@ -18,6 +18,7 @@
./orga ./orga
./secrets ./secrets
./static-sites.nix ./static-sites.nix
./legacy-redir.nix
./webpass.nix ./webpass.nix
]; ];

View file

@ -1,12 +1,12 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
services.nginx.virtualHosts."new.hackens.org" = { services.nginx.virtualHosts."hackens.org" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
}; };
# Si tu as des problèmes un jour, vide le cache avant tout # Si tu as des problèmes un jour, vide le cache avant tout
services.dokuwiki.sites."new.hackens.org" = { services.dokuwiki.sites."hackens.org" = {
enable = true; enable = true;
settings = { settings = {
template = "bootstrap3"; template = "bootstrap3";

View file

@ -0,0 +1,55 @@
{
services.nginx.virtualHosts = {
"www.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org$request_uri;
'';
};
"new.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org$request_uri;
'';
};
"pass.new.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://pass.hackens.org$request_uri;
'';
};
"known.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org/known$request_uri;
'';
};
"prez.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org/prez$request_uri;
'';
};
"pub.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org/pub$request_uri;
'';
};
"2048.hackens.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
return 301 $scheme://hackens.org/2048$request_uri;
'';
};
};
}

View file

@ -17,7 +17,7 @@ in
]; ];
services.nginx = { services.nginx = {
enable = true; enable = true;
virtualHosts."new.hackens.org" = { virtualHosts."hackens.org" = {
locations = { locations = {
"/orga" = { "/orga" = {
proxyPass = "http://localhost:51666/orga"; proxyPass = "http://localhost:51666/orga";
@ -34,7 +34,7 @@ in
assets = assets; assets = assets;
settings = { settings = {
HACKENS_ORGA_DEBUG = "0"; HACKENS_ORGA_DEBUG = "0";
HACKENS_ORGA_ALLOWED_HOSTS = [ "new.hackens.org" ]; HACKENS_ORGA_ALLOWED_HOSTS = [ "hackens.org" ];
HACKENS_ORGA_SECRET_KEY._file = config.age.secrets.django.path; HACKENS_ORGA_SECRET_KEY._file = config.age.secrets.django.path;
HACKENS_ORGA_DB_FILE = "/var/lib/hackens-orga/db.sqlite3"; HACKENS_ORGA_DB_FILE = "/var/lib/hackens-orga/db.sqlite3";
}; };

View file

@ -1,7 +1,6 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
sites = [ sites = [
"/NdS"
"/2048" "/2048"
"/prez" "/prez"
"/known" "/known"
@ -12,50 +11,17 @@ in
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"new.hackens.org" = { "hackens.org" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations = lib.genAttrs sites (name: { locations = lib.genAttrs sites (name: {
root = "/var/www"; root = "/var/www";
extraConfig = "autoindex on;"; extraConfig = ''
autoindex on;
charset utf-8;
'';
}); });
}; };
# Legacy redirections
#"known.hackens.org" = {
# forceSSL = true;
# enableACME = true;
# extraConfig = ''
# return 301 $scheme://hackens.org/known$request_uri;
# '';
#};
#"nds.hackens.org" = {
# forceSSL = true;
# enableACME = true;
# extraConfig = ''
# return 301 $scheme://hackens.org/known$request_uri;
# '';
#};
#"prez.hackens.org" = {
# forceSSL = true;
# enableACME = true;
# extraConfig = ''
# return 301 $scheme://hackens.org/prez$request_uri;
# '';
#};
#"pub.hackens.org" = {
# forceSSL = true;
# enableACME = true;
# extraConfig = ''
# return 301 $scheme://hackens.org/pub$request_uri;
# '';
#};
#"2048.hackens.org" = {
# forceSSL = true;
# enableACME = true;
# extraConfig = ''
# return 301 $scheme://hackens.org/2048$request_uri;
# '';
#};
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];

View file

@ -8,7 +8,7 @@
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
config = { config = {
DOMAIN = "https://pass.new.hackens.org"; DOMAIN = "https://pass.hackens.org";
WEBSOCKET_ENABLED = true; WEBSOCKET_ENABLED = true;
WEBSOCKET_PORT = 10500; WEBSOCKET_PORT = 10500;
SIGNUPS_DOMAINS_WHITELIST = "ens.fr,ens.psl.eu"; SIGNUPS_DOMAINS_WHITELIST = "ens.fr,ens.psl.eu";
@ -21,7 +21,7 @@
}; };
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts."pass.new.hackens.org" = { services.nginx.virtualHosts."pass.hackens.org" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {