Compare commits

..

2 commits

Author SHA1 Message Date
June 1dd8651bda
Update wiki links to point to wiki.hamburg.ccc.de 2024-01-22 23:15:03 +01:00
June 394f4fe562
Deploy new website under hamburg.ccc.de
Make next.hamburg.ccc.de hamburg.ccc.de and add redirects to handle URLs
of the old website deployment properly.
Also redirect the old spaceapi endpoint to the new one.

Add staging.hamburg.ccc.de for hosting upcoming changes (PRs).
Also give it a robots.txt, since its contents don't need to show up in
search engines.

Add www.hamburg.ccc.de and let it redirect to hamburg.ccc.de.
2024-01-22 23:08:38 +01:00
7 changed files with 151 additions and 10 deletions

View file

@ -33,7 +33,7 @@
"links": [ "links": [
{ {
"name": "Wiki", "name": "Wiki",
"url": "https://wiki.ccchh.net" "url": "https://wiki.hamburg.ccc.de"
}, },
{ {
"name": "Git (Forgejo)", "name": "Git (Forgejo)",

View file

@ -28,7 +28,7 @@
]; ];
locations."/" = { locations."/" = {
return = "302 https://wiki.ccchh.net/club:c3cat:start"; return = "302 https://wiki.hamburg.ccc.de/club:c3cat:start";
}; };
extraConfig = '' extraConfig = ''

View file

@ -5,7 +5,9 @@
./branding-resources.hamburg.ccc.de.nix ./branding-resources.hamburg.ccc.de.nix
./c3cat.de.nix ./c3cat.de.nix
./element.hamburg.ccc.de.nix ./element.hamburg.ccc.de.nix
./next.hamburg.ccc.de.nix ./hamburg.ccc.de.nix
./spaceapi.hamburg.ccc.de.nix ./spaceapi.hamburg.ccc.de.nix
./staging.hamburg.ccc.de.nix
./www.hamburg.ccc.de.nix
]; ];
} }

View file

@ -49,7 +49,7 @@
"auth_header_logo_url": "https://branding-resources.hamburg.ccc.de/logo/ccchh-logo-no-background.png", "auth_header_logo_url": "https://branding-resources.hamburg.ccc.de/logo/ccchh-logo-no-background.png",
"auth_footer_links": [ "auth_footer_links": [
{ "text": "Website", "url": "https://hamburg.ccc.de/" }, { "text": "Website", "url": "https://hamburg.ccc.de/" },
{ "text": "Wiki", "url": "https://wiki.ccchh.net/" }, { "text": "Wiki", "url": "https://wiki.hamburg.ccc.de/" },
{ "text": "Status", "url": "https://status.ccchh.net/status/main" } { "text": "Status", "url": "https://status.ccchh.net/status/main" }
] ]
} }

View file

@ -0,0 +1,87 @@
{ pkgs, ... }:
{
services.nginx.virtualHosts = {
"acme-hamburg.ccc.de" = {
enableACME = true;
serverName = "hamburg.ccc.de";
listen = [
{
addr = "0.0.0.0";
port = 31820;
}
];
};
"hamburg.ccc.de" = {
forceSSL = true;
useACMEHost = "hamburg.ccc.de";
listen = [
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
proxyProtocol = true;
}
];
root = "/var/www/hamburg.ccc.de/";
# Redirect the old spaceapi endpoint to the new one.
locations."/dooris/status.json" = {
return = "302 https://spaceapi.hamburg.ccc.de/";
};
# Redirect pages starting with 4 digits for redirecting the old blog
# article URLs.
# We want to redirect /yyyy/mm/dd/slug to /blog/yyyy/mm/dd/slug, but we
# just match the first 4 digits for simplicity.
locations."~ \"^/[\\d]{4}\"" = {
return = "302 https://$host/blog$request_uri";
};
# Redirect pages, which previously lived on the old website, to their
# successors in the wiki.
locations."/club/satzung" = {
return = "302 https://wiki.hamburg.ccc.de/verein:offizielles:satzung";
};
locations."/club/hausordnung" = {
return = "302 https://wiki.hamburg.ccc.de/verein:offizielles:hausordnung";
};
locations."/club/vertrauenspersonen" = {
return = "302 https://wiki.hamburg.ccc.de/verein:offizielles:vertrauenspersonen";
};
locations."/club/beitragsordnung" = {
return = "302 https://wiki.hamburg.ccc.de/verein:offizielles:beitragsordnung";
};
locations."/club/mitgliedschaft" = {
return = "302 https://wiki.hamburg.ccc.de/verein:offizielles:foemi-formular";
};
locations."/club/geschichte" = {
return = "302 https://wiki.hamburg.ccc.de/club:geschichte";
};
extraConfig = ''
# Make use of the ngx_http_realip_module to set the $remote_addr and
# $remote_port to the client address and client port, when using proxy
# protocol.
# First set our proxy protocol proxy as trusted.
set_real_ip_from 172.31.17.140;
# Then tell the realip_module to get the addreses from the proxy protocol
# header.
real_ip_header proxy_protocol;
'';
};
};
users.users.ccchh-website-deploy = {
isNormalUser = true;
group = "ccchh-website-deploy";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILX847OMjYC+he1nbV37rrdCQVGINFY43CwLjZDM9iyb ccchh website deployment key"
];
};
users.groups.ccchh-website-deploy = { };
}

View file

@ -2,9 +2,9 @@
{ {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"acme-next.hamburg.ccc.de" = { "acme-staging.hamburg.ccc.de" = {
enableACME = true; enableACME = true;
serverName = "next.hamburg.ccc.de"; serverName = "staging.hamburg.ccc.de";
listen = [ listen = [
{ {
@ -14,9 +14,9 @@
]; ];
}; };
"next.hamburg.ccc.de" = { "staging.hamburg.ccc.de" = {
forceSSL = true; forceSSL = true;
useACMEHost = "next.hamburg.ccc.de"; useACMEHost = "staging.hamburg.ccc.de";
listen = [ listen = [
{ {
@ -27,7 +27,13 @@
} }
]; ];
root = "/var/www/next.hamburg.ccc.de/"; root = "/var/www/staging.hamburg.ccc.de/";
# Disallow *, since this is staging and doesn't need to be in any search
# results.
locations."/robots.txt" = {
return = "200 \"User-agent: *\\nDisallow: *\\n\"";
};
extraConfig = '' extraConfig = ''
# Make use of the ngx_http_realip_module to set the $remote_addr and # Make use of the ngx_http_realip_module to set the $remote_addr and
@ -46,7 +52,7 @@
isNormalUser = true; isNormalUser = true;
group = "ccchh-website-deploy"; group = "ccchh-website-deploy";
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILX847OMjYC+he1nbV37rrdCQVGINFY43CwLjZDM9iyb next.hamburg.ccc.de deployment key" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILX847OMjYC+he1nbV37rrdCQVGINFY43CwLjZDM9iyb ccchh website deployment key"
]; ];
}; };
users.groups.ccchh-website-deploy = { }; users.groups.ccchh-website-deploy = { };

View file

@ -0,0 +1,46 @@
{ pkgs, ... }:
{
services.nginx.virtualHosts = {
"acme-www.hamburg.ccc.de" = {
enableACME = true;
serverName = "www.hamburg.ccc.de";
listen = [
{
addr = "0.0.0.0";
port = 31820;
}
];
};
"www.hamburg.ccc.de" = {
forceSSL = true;
useACMEHost = "www.hamburg.ccc.de";
listen = [
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
proxyProtocol = true;
}
];
locations."/" = {
return = "302 https://hamburg.ccc.de$request_uri";
};
extraConfig = ''
# Make use of the ngx_http_realip_module to set the $remote_addr and
# $remote_port to the client address and client port, when using proxy
# protocol.
# First set our proxy protocol proxy as trusted.
set_real_ip_from 172.31.17.140;
# Then tell the realip_module to get the addreses from the proxy protocol
# header.
real_ip_header proxy_protocol;
'';
};
};
}