Compare commits

...

3 commits

Author SHA1 Message Date
f177aec01d Add new webhook 2022-10-14 01:40:22 +02:00
1d477a8169 Use env 2022-09-28 03:50:46 +02:00
64f548dd3c Add internet-login 2022-09-22 01:46:14 +02:00
14 changed files with 64 additions and 34 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name gitea
set -l container_volumes_dir ~/volumes/$container_name

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name hedgedoc
set -l container_volumes_dir ~/volumes/$container_name

27
containers/internet_login.fish Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env fish
set -l container_name internet-login
set -l container_volumes_dir ~/volumes/$container_name
buildah rm builder &>/dev/null
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest
buildah run builder -- dnf upgrade -y
buildah run builder -- dnf install -y iputils
buildah run builder -- dnf autoremove -y
buildah run builder -- dnf clean all
if systemctl --user is-enabled container-$container_name
systemctl --user disable --now container-$container_name
end
if podman image exists $container_name
podman rmi $container_name
end
buildah commit --rm builder $container_name
podman-default-create \
$container_name \
-v $container_volumes_dir:/volumes/script:Z,ro \
localhost/$container_name:latest \
/volumes/script/login.sh monitor

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name limesurvey
set -l container_volumes_dir ~/volumes/$container_name

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name nextcloud
set -l container_volumes_dir ~/volumes/$container_name

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name nginx
set -l container_volumes_dir ~/volumes/$container_name

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l image docker.io/rustdesk/rustdesk-server:latest

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name traefik
set -l container_volumes_dir ~/volumes/$container_name

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
if test -z $argv[1]
echo "A container number as an argument is required!"

View file

@ -1,33 +1,25 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l container_name webhook
set -l container_volumes_dir ~/volumes/$container_name
set -l repo_dir ~/code/webhook
buildah rm compiler &>/dev/null
buildah from --pull --name compiler docker.io/library/golang:alpine
buildah copy compiler $repo_dir /src
buildah config --workingdir /src -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=0 compiler
buildah run compiler -- go get -u
buildah run compiler -- go build -o /main
set -l repo_dir ~/code/git-webhook-client
buildah rm builder &>/dev/null
buildah from --pull --name builder docker.io/library/node:slim
buildah copy --from compiler builder /main /webhook/main
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest
buildah rm compiler
buildah copy builder $container_volumes_dir/bin/* /usr/local/bin
buildah copy builder $repo_dir/config.json /webhook
buildah run builder -- apt update
buildah run builder -- apt dist-upgrade -y
buildah run builder -- apt install -y git-lfs
buildah run builder -- apt clean
buildah run builder -- dnf upgrade -y
buildah run builder -- dnf install -y cargo git-lfs sqlite-devel npm
buildah run builder -- dnf autoremove -y
buildah run builder -- dnf clean all
buildah run builder -- git lfs install
buildah config --workingdir /webhook -e GIN_MODE=release -e GIN_PORT=80 builder
buildah config --cmd /webhook/main builder
buildah run builder -- curl -Ls https://github.com/getzola/zola/releases/latest/download/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz -o zola.tar.gz
buildah run builder -- tar -xzvf zola.tar.gz
buildah run builder -- rm zola.tar.gz
buildah run builder -- mv zola /usr/local/bin
buildah config --workingdir /volumes/src -e ROCKET_ADDRESS=0.0.0.0 -e ROCKET_PORT=80 -e DATABASE_URL=/volumes/db/db.sqlite builder
buildah config --cmd 'cargo run -r' builder
if systemctl --user is-enabled container-$container_name
systemctl --user disable --now container-$container_name
@ -42,6 +34,8 @@ buildah commit --rm builder $container_name
podman-default-create \
$container_name \
--network traefik \
-v ~/volumes/nginx/sites:/volumes/sites:z \
-v $repo_dir:/volumes/src:Z \
-v $container_volumes_dir/db:/volumes/db:Z \
-v $container_volumes_dir/repos:/volumes/repos:Z \
-v ~/volumes/nginx/sites:/volumes/sites:z \
localhost/$container_name:latest

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
if podman image exists ttyd
if not podman rmi ttyd

View file

@ -1,4 +1,4 @@
#!/usr/bin/fish
#!/usr/bin/env fish
set -l user mo
set -l user_home /home/$user

View file

@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
import subprocess
from pathlib import Path

View file

@ -41,6 +41,11 @@ http:
service: limesurvey
tls:
certResolver: le
to_webhook:
rule: Host(`webhook.mo8it.xyz`)
service: webhook
tls:
certResolver: le
services:
xueyue_li_art:
@ -75,3 +80,7 @@ http:
loadBalancer:
servers:
- url: http://limesurvey:8080
webhook:
loadBalancer:
servers:
- url: http://webhook