Compare commits

...

7 Commits

Author SHA1 Message Date
Giulio De Pasquale
6a5552b56e architect: Enable runas and lezzo nix modules 2022-12-09 15:39:24 +01:00
Giulio De Pasquale
c5cf59c32c nginx: Removed service skeleton as multiple domains are not needed anymore 2022-12-09 15:38:55 +01:00
Giulio De Pasquale
b64b8ae792 matrix: Remove 404 on root because runas.rocks is online 2022-12-09 15:36:52 +01:00
Giulio De Pasquale
735f1c2bae jellyfin: Add giulio pc to whitelisted devices 2022-12-09 15:36:32 +01:00
Giulio De Pasquale
449813fb5f helix: Added svelte and web langservers 2022-12-09 15:35:57 +01:00
Giulio De Pasquale
82ea0222f3 Runas and lezzo websites 2022-12-09 15:35:32 +01:00
Giulio De Pasquale
7a8bacb5df wireguard: Changed germano public key 2022-12-05 12:40:59 +01:00
8 changed files with 118 additions and 27 deletions

View File

@ -37,6 +37,8 @@ in {
../../cachix.nix
./docker.nix
./keycloak.nix
./lezzo.nix
./runas.nix
];
time.timeZone = "Europe/Rome";

View File

@ -19,7 +19,7 @@ in
nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
extraConfig = auth_block { access_role = "jellyfin"; } +
extraConfig = auth_block { access_role = "jellyfin"; whitelisted_ips = [ network.giuliopc-wg ]; } +
''
# External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
#add_header Content-Security-Policy "default-src https: data: blob: http://image.tmdb.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com/cv/js/sender/v1/cast_sender.js https://www.gstatic.com/eureka/clank/95/cast_sender.js https://www.gstatic.com/eureka/clank/96/cast_sender.js https://www.gstatic.com/eureka/clank/97/cast_sender.js https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";

45
hosts/architect/lezzo.nix Normal file
View File

@ -0,0 +1,45 @@
{ services, pkgs, lib, makeBinPath, ... }:
let
domain = "lezzo.org";
lezzo_root = "/var/lib/lezzo.org";
service_name = "lezzo-pull";
network = import ./network.nix;
mkStartScript = name: pkgs.writeShellScript "${name}.sh" ''
set -euo pipefail
cd ${lezzo_root}
git pull origin master --rebase
'';
in
{
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
root = lezzo_root;
locations."/.git" = { return = "404"; };
};
systemd = {
services.${service_name} = {
path = [ pkgs.git ];
enable = true;
serviceConfig = {
Type = "oneshot";
ExecStart = mkStartScript "${service_name}";
};
};
timers.${service_name} = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Unit = "${service_name}.service";
};
};
};
networking.extraHosts = ''
${network.architect-lan} ${domain}
${network.architect-wg} ${domain}
'';
}

View File

@ -97,9 +97,9 @@ in
return 200 '${builtins.toJSON client}';
'';
locations."/".extraConfig = ''
return 404;
'';
# locations."/".extraConfig = ''
# return 404;
# '';
# forward all Matrix API calls to the synapse Matrix homeserver
locations."/_matrix" = {

View File

@ -1,24 +1,6 @@
{ services, pkgs, lib, ... }:
let
serviceSkeleton = { default ? false }: {
inherit default;
enableACME = true;
forceSSL = true;
root = "/var/lib/nginx/error_pages";
extraConfig = "error_page 404 /index.htm;";
locations = {
"/" = { return = "404"; };
"/index.htm" = { };
"/style.css" = { };
"/wat.jpg" = { };
};
};
in {
{
services.nginx = {
enable = true;
package = pkgs.openresty;
@ -27,8 +9,23 @@ in {
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."architect.devs.giugl.io" = serviceSkeleton { default = true; };
virtualHosts."runas.rocks" = serviceSkeleton {};
virtualHosts."architect.devs.giugl.io" = {
default = true;
enableACME = true;
forceSSL = true;
root = "/var/lib/nginx/error_pages";
extraConfig = "error_page 404 /index.htm;";
locations = {
"/" = { return = "404"; };
"/index.htm" = { };
"/style.css" = { };
"/wat.jpg" = { };
};
};
appendHttpConfig =
let

45
hosts/architect/runas.nix Normal file
View File

@ -0,0 +1,45 @@
{ services, pkgs, lib, makeBinPath, ... }:
let
domain = "runas.rocks";
runas_root = "/var/lib/runas.rocks/dist";
service_name = "runas.rocks-pull";
network = import ./network.nix;
mkStartScript = name: pkgs.writeShellScript "${name}.sh" ''
set -euo pipefail
cd ${runas_root}
git pull origin master --rebase
'';
in
{
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
locations."/".root = runas_root;
locations."/.git" = { return = "404"; };
};
systemd = {
services.${service_name} = {
path = [ pkgs.git ];
enable = true;
serviceConfig = {
Type = "oneshot";
ExecStart = mkStartScript "${service_name}";
};
};
timers.${service_name} = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Unit = "${service_name}.service";
};
};
};
networking.extraHosts = ''
${network.architect-lan} ${domain}
${network.architect-wg} ${domain}
'';
}

View File

@ -153,7 +153,7 @@ with import ./network.nix; {
{
# germano
allowedIPs = [ germano-wg ];
publicKey = "gi4o+pZWKItzVs7vY8fvXh98jX6CNeCwc1YDzhc3mA4=";
publicKey = "LJ0DHY1sFVLQb3ngUGGH0HxbDOPb9KCUPSaYcjr5Uiw=";
}
{

View File

@ -33,7 +33,9 @@
rnix-lsp
python310Packages.python-lsp-server
texlab
nodePackages.vscode-langservers-extracted
nodePackages.typescript
nodePackages.svelte-language-server
];
};
}