mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 08:45:02 +01:00
hugo
This commit is contained in:
parent
a7aea77480
commit
51b9fc4d1b
13 changed files with 77 additions and 46 deletions
4
.github/workflows/build.yaml
vendored
4
.github/workflows/build.yaml
vendored
|
|
@ -21,10 +21,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
steps:
|
||||
- name: Login to docker.nilstrieb.dev
|
||||
- name: Login to docker.noratrieb.dev
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: docker.nilstrieb.dev
|
||||
registry: docker.noratrieb.dev
|
||||
username: ${{ secrets.DOCKER_NILSTRIEB_DEV_USER }}
|
||||
password: ${{ secrets.DOCKER_NILSTRIEB_DEV_PASSWORD }}
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ storage:
|
|||
enabled: true
|
||||
http:
|
||||
addr: 0.0.0.0:5000
|
||||
host: https://docker.nilstrieb.dev
|
||||
host: https://docker.noratrieb.dev
|
||||
draintimeout: 60s
|
||||
headers:
|
||||
X-Content-Type-Options: [nosniff]
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ echo "Latest commit of $APP is $CURRENT_COMMIT"
|
|||
echo "**Commit: \`$CURRENT_COMMIT\`**" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
if [ "$APP" = "hugo-chat" ]; then
|
||||
IMAGE_PREFIX="docker.nilstrieb.dev/hugo-chat"
|
||||
IMAGE_PREFIX="docker.noratrieb.dev/hugo-chat"
|
||||
SERVER_FULL_NAME="$IMAGE_PREFIX-server:$CURRENT_COMMIT"
|
||||
CLIENT_FULL_NAME="$IMAGE_PREFIX-client:$CURRENT_COMMIT"
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ if [ "$APP" = "hugo-chat" ]; then
|
|||
fi
|
||||
|
||||
if [ "$APP" = "cors" ]; then
|
||||
IMAGE_PREFIX="docker.nilstrieb.dev/cors-school"
|
||||
IMAGE_PREFIX="docker.noratrieb.dev/cors-school"
|
||||
SERVER_FULL_NAME="$IMAGE_PREFIX-server:$CURRENT_COMMIT"
|
||||
CLIENT_FULL_NAME="$IMAGE_PREFIX-client:$CURRENT_COMMIT"
|
||||
BOT_FULL_NAME="$IMAGE_PREFIX-bot:$CURRENT_COMMIT"
|
||||
|
|
@ -70,7 +70,7 @@ if [ "$APP" = "dockerolat" ]; then
|
|||
APP="openolat"
|
||||
fi
|
||||
|
||||
IMAGE_PREFIX="docker.nilstrieb.dev/$APP"
|
||||
IMAGE_PREFIX="docker.noratrieb.dev/$APP"
|
||||
IMAGE_FULL_NAME="$IMAGE_PREFIX:$CURRENT_COMMIT"
|
||||
|
||||
docker build . -t "$IMAGE_FULL_NAME"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
dockerLogin = {
|
||||
registry = "docker.nilstrieb.dev";
|
||||
registry = "docker.noratrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
};
|
||||
|
|
@ -13,20 +13,20 @@ in
|
|||
/*
|
||||
hugo_chat_client:
|
||||
container_name: hugo-chat-client
|
||||
image: "docker.nilstrieb.dev/hugo-chat-client:63bd1922"
|
||||
image: "docker.noratrieb.dev/hugo-chat-client:63bd1922"
|
||||
restart: always
|
||||
ports:
|
||||
- "5002:80"
|
||||
*/
|
||||
hugo-chat-client = {
|
||||
image = "docker.nilstrieb.dev/hugo-chat-client:63bd1922";
|
||||
image = "docker.noratrieb.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"
|
||||
image: "docker.noratrieb.dev/hugo-chat-server:63bd1922"
|
||||
ports:
|
||||
- "5001:8080"
|
||||
environment:
|
||||
|
|
@ -36,10 +36,10 @@ in
|
|||
- hugo-chat
|
||||
*/
|
||||
hugo-chat-server = {
|
||||
image = "docker.nilstrieb.dev/hugo-chat-server:63bd1922";
|
||||
image = "docker.noratrieb.dev/hugo-chat-server:63bd1922";
|
||||
ports = [ "5001:80" ];
|
||||
environment = {
|
||||
SPRING_DATASOURCE_URL = "jdbc:postgresql://vps1.local:5432/hugochat";
|
||||
SPRING_DATASOURCE_URL = "jdbc:postgresql://vps1.local:5003/hugochat";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
login = dockerLogin;
|
||||
|
|
@ -60,7 +60,7 @@ in
|
|||
*/
|
||||
hugo-chat-db = {
|
||||
image = "postgres:16";
|
||||
ports = [ "5001:80" ];
|
||||
ports = [ "5003:80" ];
|
||||
volumes = [ "/var/lib/hugo-chat/data:/var/lib/postgresql/data" ];
|
||||
environment = {
|
||||
POSTGRES_PASSWORD = "\${HUGO_CHAT_DB_PASSWORD}";
|
||||
|
|
@ -69,4 +69,9 @@ in
|
|||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
system.activationScripts.makeHugoChatDir = lib.stringAfter [ "var" ] ''
|
||||
mkdir -p /var/lib/hugo-chat/data
|
||||
'';
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
container_name: widetom
|
||||
image: "docker.nilstrieb.dev/widetom:33d17387"
|
||||
image: "docker.noratrieb.dev/widetom:33d17387"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/widetom:/app/config"
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
BOT_TOKEN_PATH: /app/config/bot_token
|
||||
*/
|
||||
widetom = {
|
||||
image = "docker.nilstrieb.dev/widetom:33d17387";
|
||||
image = "docker.noratrieb.dev/widetom:33d17387";
|
||||
volumes = [
|
||||
"${config.age.secrets.widetom_config_toml.path}:/config.toml"
|
||||
"${config.age.secrets.widetom_bot_token.path}:/token"
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
BOT_TOKEN_PATH = "/token";
|
||||
};
|
||||
login = {
|
||||
registry = "docker.nilstrieb.dev";
|
||||
registry = "docker.noratrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
};
|
||||
|
|
@ -134,13 +134,14 @@
|
|||
'';
|
||||
};
|
||||
|
||||
vps1 = { name, nodes, modulesPath, config, ... }: {
|
||||
vps1 = { name, nodes, modulesPath, config, lib, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./modules/contabo
|
||||
./modules/wg-mesh
|
||||
./modules/ingress
|
||||
./modules/widetom
|
||||
./apps/widetom
|
||||
./apps/hugo-chat
|
||||
];
|
||||
|
||||
age.secrets.docker_registry_password.file = ./secrets/docker_registry_password.age;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,4 +1,4 @@
|
|||
vps:
|
||||
hosts:
|
||||
vps2:
|
||||
ansible_host: vps2.nilstrieb.dev
|
||||
ansible_host: vps2.noratrieb.dev
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ www.nilstrieb.dev {
|
|||
docker.nilstrieb.dev {
|
||||
reverse_proxy * localhost:5000
|
||||
}
|
||||
docker.noratrieb.dev {
|
||||
reverse_proxy * localhost:5000
|
||||
}
|
||||
|
||||
api.hugo-chat.nilstrieb.dev {
|
||||
import cors https://hugo-chat.nilstrieb.dev "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ services:
|
|||
- prometheus
|
||||
killua:
|
||||
container_name: killua
|
||||
image: "docker.nilstrieb.dev/killua-bot:ac8203d2"
|
||||
image: "docker.noratrieb.dev/killua-bot:ac8203d2"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/killua:/app/config"
|
||||
|
|
@ -30,7 +30,7 @@ services:
|
|||
KILLUA_JSON_PATH: /app/config/trivia_questions.json
|
||||
cargo_bisect_rustc_service:
|
||||
container_name: cargo-bisect-rustc-service
|
||||
image: "docker.nilstrieb.dev/cargo-bisect-rustc-service:316a4044"
|
||||
image: "docker.noratrieb.dev/cargo-bisect-rustc-service:316a4044"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/bisect-rustc-service/db.sqlite:/home/bisector/db.sqlite"
|
||||
|
|
@ -54,7 +54,7 @@ services:
|
|||
- hugo-chat
|
||||
hugo_chat_server:
|
||||
container_name: hugo-chat-server
|
||||
image: "docker.nilstrieb.dev/hugo-chat-server:63bd1922"
|
||||
image: "docker.noratrieb.dev/hugo-chat-server:63bd1922"
|
||||
ports:
|
||||
- "5001:8080"
|
||||
environment:
|
||||
|
|
@ -64,7 +64,7 @@ services:
|
|||
- hugo-chat
|
||||
hugo_chat_client:
|
||||
container_name: hugo-chat-client
|
||||
image: "docker.nilstrieb.dev/hugo-chat-client:63bd1922"
|
||||
image: "docker.noratrieb.dev/hugo-chat-client:63bd1922"
|
||||
restart: always
|
||||
ports:
|
||||
- "5002:80"
|
||||
|
|
@ -89,7 +89,7 @@ services:
|
|||
memory: 500M
|
||||
karin_bot:
|
||||
container_name: karin-bot
|
||||
image: "docker.nilstrieb.dev/discord-court-bot:921be642"
|
||||
image: "docker.noratrieb.dev/discord-court-bot:921be642"
|
||||
restart: always
|
||||
env_file:
|
||||
- "/apps/karin-bot/.env"
|
||||
|
|
@ -117,7 +117,7 @@ services:
|
|||
- cors-school
|
||||
cors_school_server:
|
||||
container_name: cors-school-server
|
||||
image: "docker.nilstrieb.dev/cors-school-server:bef75a80"
|
||||
image: "docker.noratrieb.dev/cors-school-server:bef75a80"
|
||||
restart: always
|
||||
env_file:
|
||||
# DATABASE_URL=postgres://postgres:PASSWORD@cors-school-db/davinci
|
||||
|
|
@ -131,13 +131,13 @@ services:
|
|||
- "5003:8080"
|
||||
cors_school_client:
|
||||
container_name: cors-school-client
|
||||
image: "docker.nilstrieb.dev/cors-school-client:bef75a80"
|
||||
image: "docker.noratrieb.dev/cors-school-client:bef75a80"
|
||||
restart: always
|
||||
ports:
|
||||
- "5004:80"
|
||||
cors_school_bot:
|
||||
container_name: cors-school-bot
|
||||
image: "docker.nilstrieb.dev/cors-school-bot:bef75a80"
|
||||
image: "docker.noratrieb.dev/cors-school-bot:bef75a80"
|
||||
restart: always
|
||||
volumes:
|
||||
# DISCORD_TOKEN=
|
||||
|
|
@ -187,7 +187,7 @@ services:
|
|||
- openolat-network
|
||||
openolat:
|
||||
container_name: openolat
|
||||
image: "docker.nilstrieb.dev/openolat:69b3c8b6"
|
||||
image: "docker.noratrieb.dev/openolat:69b3c8b6"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/openolat/olatdata:/home/openolat/olatdata"
|
||||
|
|
@ -203,7 +203,7 @@ services:
|
|||
- openolat-network
|
||||
uptime:
|
||||
container_name: uptime
|
||||
image: "docker.nilstrieb.dev/uptime:50d15bc4"
|
||||
image: "docker.noratrieb.dev/uptime:50d15bc4"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/uptime:/app/config"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue