mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
hugo
This commit is contained in:
parent
a7aea77480
commit
51b9fc4d1b
13 changed files with 77 additions and 46 deletions
|
|
@ -9,6 +9,9 @@ let
|
|||
lib.optionalAttrs (publicIPv4 != null) { A = [ (ttl hour1 (a publicIPv4)) ]; } //
|
||||
lib.optionalAttrs (publicIPv6 != null) { AAAA = [ (ttl hour1 (aaaa publicIPv6)) ]; })
|
||||
networkingConfig;
|
||||
vps2 = {
|
||||
A = [ "184.174.32.252" ];
|
||||
};
|
||||
in
|
||||
with hostsToDns;
|
||||
# vps1 contains root noratrieb.dev
|
||||
|
|
@ -34,6 +37,13 @@ let
|
|||
pronouns.TXT = [
|
||||
"she/her"
|
||||
];
|
||||
docker = vps2;
|
||||
|
||||
vps2 = vps2; # TODO REMOVE
|
||||
|
||||
hugo-chat = vps1 // {
|
||||
subdomains.api = vps1;
|
||||
};
|
||||
|
||||
test1.A = vps1.A ++ vps3.A;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,72 +0,0 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
dockerLogin = {
|
||||
registry = "docker.nilstrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
};
|
||||
in
|
||||
{
|
||||
age.secrets.hugochat_db_password.file = ../../secrets/hugochat_db_password.age;
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
hugo_chat_client:
|
||||
container_name: hugo-chat-client
|
||||
image: "docker.nilstrieb.dev/hugo-chat-client:63bd1922"
|
||||
restart: always
|
||||
ports:
|
||||
- "5002:80"
|
||||
*/
|
||||
hugo-chat-client = {
|
||||
image = "docker.nilstrieb.dev/hugo-chat-client:63bd1922";
|
||||
login = dockerLogin;
|
||||
ports = [ "5002:80" ];
|
||||
};
|
||||
/*
|
||||
hugo_chat_server:
|
||||
container_name: hugo-chat-server
|
||||
image: "docker.nilstrieb.dev/hugo-chat-server:63bd1922"
|
||||
ports:
|
||||
- "5001:8080"
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: "jdbc:postgresql://hugo-chat-db:5432/hugochat"
|
||||
SPRING_DATASOURCE_PASSWORD: "${HUGO_CHAT_DB_PASSWORD}"
|
||||
networks:
|
||||
- hugo-chat
|
||||
*/
|
||||
hugo-chat-server = {
|
||||
image = "docker.nilstrieb.dev/hugo-chat-server:63bd1922";
|
||||
ports = [ "5001:80" ];
|
||||
environment = {
|
||||
SPRING_DATASOURCE_URL = "jdbc:postgresql://vps1.local:5432/hugochat";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
login = dockerLogin;
|
||||
};
|
||||
|
||||
/*
|
||||
hugo_chat_db:
|
||||
container_name: hugo-chat-db
|
||||
image: "postgres:latest"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/hugo-chat/data:/var/lib/postgresql/data"
|
||||
environment:
|
||||
POSTGRES_PASSWORD: "${HUGO_CHAT_DB_PASSWORD}"
|
||||
PGDATA: "/var/lib/postgresql/data/pgdata"
|
||||
networks:
|
||||
- hugo-chat
|
||||
*/
|
||||
hugo-chat-db = {
|
||||
image = "postgres:16";
|
||||
ports = [ "5001:80" ];
|
||||
volumes = [ "/var/lib/hugo-chat/data:/var/lib/postgresql/data" ];
|
||||
environment = {
|
||||
POSTGRES_PASSWORD = "\${HUGO_CHAT_DB_PASSWORD}";
|
||||
PGDATA = "/var/lib/postgresql/data/pgdata";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -27,3 +27,30 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
hugo-chat.noratrieb.dev {
|
||||
reverse_proxy * vps1.local:5002
|
||||
}
|
||||
|
||||
api.cors-school.noratrieb.dev {
|
||||
import cors https://cors-school.noratrieb.dev "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization"
|
||||
reverse_proxy * vps1.local:5001
|
||||
}
|
||||
|
||||
################################################################
|
||||
# deadname redirects
|
||||
nilstrieb.dev {
|
||||
redir https://noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
||||
blog.nilstrieb.dev {
|
||||
redir https://blog.noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
||||
hugo-chat.nilstrieb.dev {
|
||||
redir https://hugo-chat.noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
||||
api.hugo-chat.nilstrieb.dev {
|
||||
redir https://api.hugo-chat.noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
enable = true;
|
||||
configFile = pkgs.writeText "Caddyfile"
|
||||
(
|
||||
builtins.readFile ./Caddyfile +
|
||||
''
|
||||
${config.networking.hostName}.infra.noratrieb.dev {
|
||||
root * ${./debugging-page}
|
||||
|
|
@ -16,15 +15,7 @@
|
|||
|
||||
${
|
||||
if name == "vps1" then
|
||||
''
|
||||
nilstrieb.dev {
|
||||
redir https://noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
||||
blog.nilstrieb.dev {
|
||||
redir https://blog.noratrieb.dev{uri} permanent
|
||||
}
|
||||
|
||||
builtins.readFile ./Caddyfile + ''
|
||||
noratrieb.dev {
|
||||
root * ${website {inherit pkgs slides blog;}}
|
||||
file_server
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_16;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
{ config, ... }: {
|
||||
age.secrets.widetom_bot_token.file = ../../secrets/widetom_bot_token.age;
|
||||
age.secrets.widetom_config_toml.file = ../../secrets/widetom_config_toml.age;
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
container_name: widetom
|
||||
image: "docker.nilstrieb.dev/widetom:33d17387"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/widetom:/app/config"
|
||||
environment:
|
||||
CONFIG_PATH: /app/config/config.toml
|
||||
BOT_TOKEN_PATH: /app/config/bot_token
|
||||
*/
|
||||
widetom = {
|
||||
image = "docker.nilstrieb.dev/widetom:33d17387";
|
||||
volumes = [
|
||||
"${config.age.secrets.widetom_config_toml.path}:/config.toml"
|
||||
"${config.age.secrets.widetom_bot_token.path}:/token"
|
||||
];
|
||||
environment = {
|
||||
CONFIG_PATH = "/config.toml";
|
||||
BOT_TOKEN_PATH = "/token";
|
||||
};
|
||||
login = {
|
||||
registry = "docker.nilstrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue