freifunk: add nginx

This commit is contained in:
Astro 2020-04-14 20:58:04 +02:00
parent 89cad8060a
commit cc0761579f
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<h1>Chaos Computer Club Dresden</h1>
<h2>Router zu Freifunk Dresden</h2>
<ul>
<li><a href="https://www.c3d2.de/">Homepage</a></li>
<li><a href="https://www.c3d2.de/space.html">Räumlichkeiten</a></li>
<li><a href="https://gitea.c3d2.de/C3D2/nix-config/src/branch/master/hosts/containers/freifunk/configuration.nix">Konfiguration dieses Servers</a></li>
<li><a href="http://grafana.hq.c3d2.ffdd/">Lokales Grafana über Freifunk</a></ul>
</ul>

View File

@ -0,0 +1,50 @@
{
"version": "15",
"timestamp": "1586882346",
"data": {
"firmware": {
"version": "0.0.0",
"DISTRIB_ID": "NixOS",
"DISTRIB_RELEASE": "20.03",
"DISTRIB_REVISION": "",
"DISTRIB_CODENAME": "",
"DISTRIB_TARGET": "x86_64",
"DISTRIB_DESCRIPTION": "NixOS 20.03"
},
"system": {
"uptime": "0 0",
"uname": "Linux 5.3.18",
"nameserver": [
],
"date": "Tue Apr 14 18:39:06 CEST 2020",
"cpuinfo": "Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz",
"cpucount": "40",
"bmxd": "bmxd",
"essid": "ZW public",
"node_type": "router",
"splash": 0,
"email_notification": 0,
"autoupdate": 0,
"available_flash_size": "16T",
"bmxd_restart_counter": 0
},
"common": {
"city": "Dresden",
"node": "51073",
"domain": "freifunk-dresden.de",
"ip": "10.200.200.74",
"network_id": "1206"
},
"gps": {
"latitude": 51.0810624,
"longitude": 13.7285866,
"altitude": 100
},
"contact": {
"name": "C3D2",
"location": "Zentralwerk Haus B Souterrain",
"email": "astro%40spaceboyz.net",
"note": ""
}
}
}

View File

@ -196,6 +196,54 @@ in {
'';
};
services.nginx = {
enable = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts =
let
aliasFile = path: {
alias = path;
extraConfig = ''
etag off;
add_header etag "\"${builtins.substring 11 32 path}\"";
'';
};
in {
"c3d2.ffdd" = {
default = true;
root = <this-host/assets>;
locations = {
"/".index = "index.html";
"/sysinfo-json.cgi".extraConfig = ''
add_header Content-Type "application/json;charset=UTF-8";
'';
};
};
"storage.hq.c3d2.ffdd" = {
locations = {
"/".proxyPass = "http://storage.hq.c3d2.de/";
};
};
"grafana.hq.c3d2.ffdd" = {
locations = {
"/" = {
proxyPass = "https://grafana.hq.c3d2.de/";
extraConfig = ''
proxy_ssl_server_name on;
'';
};
};
};
"influxdb.hq.c3d2.ffdd" = {
locations = {
"/".proxyPass = "http://grafana.hq.c3d2.de:8086/";
};
};
};
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you

View File

@ -16,6 +16,7 @@ let
url = "https://github.com/NixOS/nixpkgs.git";
};
nixos-config.file = toString (./hosts + "/${path}/configuration.nix");
this-host.file = toString (./hosts + "/${path}");
lib.file = toString ./lib;
secrets.file = toString ./secrets;
"host-registry.nix".file = toString ./host-registry.nix;