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
./secrets
./static-sites.nix
./legacy-redir.nix
./webpass.nix
];

View file

@ -1,12 +1,12 @@
{ config, pkgs, lib, ... }: {
services.nginx.virtualHosts."new.hackens.org" = {
services.nginx.virtualHosts."hackens.org" = {
enableACME = true;
forceSSL = true;
};
# 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;
settings = {
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 = {
enable = true;
virtualHosts."new.hackens.org" = {
virtualHosts."hackens.org" = {
locations = {
"/orga" = {
proxyPass = "http://localhost:51666/orga";
@ -34,7 +34,7 @@ in
assets = assets;
settings = {
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_DB_FILE = "/var/lib/hackens-orga/db.sqlite3";
};

View file

@ -1,7 +1,6 @@
{ pkgs, lib, ... }:
let
sites = [
"/NdS"
"/2048"
"/prez"
"/known"
@ -12,50 +11,17 @@ in
services.nginx.enable = true;
services.nginx.virtualHosts = {
"new.hackens.org" = {
"hackens.org" = {
forceSSL = true;
enableACME = true;
locations = lib.genAttrs sites (name: {
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 ];

View file

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