Sync from homebox

This commit is contained in:
Thord Johansson 2024-12-08 12:48:35 +01:00
parent a5a47c94b4
commit 55746dadf4
25 changed files with 217 additions and 86 deletions

2
.gitignore vendored
View file

@ -15,3 +15,5 @@ volumes/
!*.md
!.gitignore
.env
nginx-proxy/letsencrypt

2
code-tunnel/build.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker build -t $USER/code-tunnel .

View file

@ -0,0 +1,11 @@
services:
tunnel:
# image needs to be built first; run build.sh
image: ${USER}/code-tunnel:latest
container_name: code-tunnel
network_mode: host
volumes:
- /home/thord/docker:/home/workspace/docker
- /home/thord/source:/home/workspace/source
- ./.user_logged_in:/root/.user_logged_in
working_dir: /home/workspace

24
code-tunnel/start.sh Normal file
View file

@ -0,0 +1,24 @@
#!/bin/sh
# File to check if the user login has already been done
FLAG_FILE="/root/.user_logged_in"
# Check if the flag file exists
if [ ! -f "$FLAG_FILE" ]; then
# First command that might require user input
code tunnel user login --provider microsoft
# Check if the previous command succeeded
if [ $? -eq 0 ]; then
# Create the flag file to indicate successful login
touch "$FLAG_FILE"
else
echo "Setup failed."
exit 1
fi
else
echo "User already logged in. Skipping login step."
fi
# Run the second command
code tunnel

View file

@ -1,14 +1,14 @@
version: '3'
services:
gpt-ai:
image: gpt-ai
container_name: gpt-ai
ports:
- 2101:2101
network_mode: 'host'
environment:
- TZ=Europe/Stockholm
volumes:
- ./instance:/usr/src/app/instance
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2101/connect"]
test: ["CMD", "curl", "-f", "http://192.168.1.100:2101/connect"]
interval: 30s
timeout: 10s
retries: 3
retries: 3

2
gpt-ai/rebuild-image.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
git -C source pull && docker build -t gpt-ai source && docker compose up -d

View file

@ -1,14 +1,13 @@
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- ${HOMEASSISTANT_PATH}/config:/config
- /docker/storage/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
devices:
- '/dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_7cf0ee91b8d8ed11a8216b6162c613ac-if00-port0:/dev/ttyUSB0'
# devices:
# - '/dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_7cf0ee91b8d8ed11a8216b6162c613ac-if00-port0:/dev/ttyUSB0'
restart: unless-stopped
privileged: true
network_mode: host

View file

@ -5,27 +5,27 @@ services:
#user: 1000:1000
network_mode: 'host'
volumes:
- /mnt/data/storage/jellyfin/config:/config
- /mnt/data/storage/jellyfin/cache:/cache
- media:/media
- /mnt/data/downloads/complete:/downloads
#ports:
# - "8096:8096/tcp"
# - "8920:8920/tcp"
# - "1900:1900/udp"
# - "7359:7359/udp"
- /docker/storage/jellyfin/config:/config
- /docker/storage/jellyfin/cache:/cache
# - shows:/media/shows
- /docker/media:/media
- /docker/downloads/complete:/downloads
ports:
- "8096:8096/tcp"
- "8920:8920/tcp"
- "1900:1900/udp"
- "7359:7359/udp"
restart: 'unless-stopped'
# Optional - alternative address used for autodiscovery
#environment:
# - JELLYFIN_PublishedServerUrl=http://example.com
# - JELLYFIN_PublishedServerUrl=https://jellyfin
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
media:
shows:
driver_opts:
type: "nfs"
o: "addr=192.168.1.100,nfsvers=4"
device: ":/mnt/data/media/"
o: "addr=192.168.1.101,sync,soft,rw,nfsvers=4"
device: ":/docker/Shows"

View file

@ -1,5 +1,3 @@
version: '3.1'
services:
db:
@ -8,7 +6,7 @@ services:
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- /mnt/data/mysql:/var/lib/mysql
- /docker/mysql:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MARIADB_DATABASE=${MARIADB_DATABASE}

View file

@ -1,8 +1,8 @@
services:
minecraft-server:
volumes:
- /mnt/data/minecraft/server:/data
- /mnt/data/minecraft/mods/server:/data/mods
- /docker/minecraft/server:/data:rw,z
- /docker/minecraft/mods/server:/data/mods:rw,z
environment:
- TYPE=FABRIC
- MEMORY=4G
@ -11,7 +11,8 @@ services:
- MOTD=Hej och välkommen!
ports:
- '25565:25565'
- '8123:8123' # dynmap
- '25575:25575' # rcon
- '9123:8123' # dynmap (redirect, 8123 conflicts with HA)
container_name: minecraft
image: itzg/minecraft-server

2
minecraft/list-mods.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
ferium list | awk '{$1=$2=""; print $0}' | sed '1,2d' | pr -3t -W110

View file

@ -1,5 +0,0 @@
unsupported_mods=(
"distant"
"mod-loading"
"sound-physics-remastered"
)

View file

@ -1,46 +1,101 @@
#!/bin/bash
#echo "Stopping container..."
docker-compose down
if [ $? -ne 0 ]; then
exit $?
if [ ! -z "$1" ]; then
ferium add $1
if [ $? -ne 0 ]; then
exit $?
fi
fi
echo "Container stopped"
SERVER_DATA_PATH="./data/"
CONTAINER_NAME="minecraft"
LOG_LINES_CHECK=20
#echo "Stopping container..."
if podman ps --filter "name=minecraft" --format "{{.Names}}" | grep -q "minecraft"; then
podman-compose --podman-stop-args="-t 15" down # just in case "$CONTAINER_NAME" wasn't the container name...
if [ $? -ne 0 ]; then
exit $?
fi
echo "Container stopped"
else
echo "Container '$CONTAINER_NAME' not found, continuing."
fi
THIS_DIR="$PWD"
cd $SERVER_DATA_PATH
echo "Performing upgrade..."
sleep 2
# Function to upgrade ferium and copy mods
upgrade_mods() {
rm mods/*.jar &&
#rm -f mods/staging/*.jar &&
ferium upgrade &&
rm mods/server/*.jar &&
rm mods/client/*.jar &&
cp mods/*.jar mods/server/ &&
cp mods/*.jar mods/client/ &&
chown -R thord:docker mods/*
echo "Cleaning mod directories..." &&
rm -f mods/server/*.jar &&
rm -f mods/client/*.jar &&
echo "Copying new mod files..."
cp mods/staging/*.jar mods/server/ &&
cp mods/staging/*.jar mods/client/ &&
#echo "Adjusting ownership..."
chown -R $USER:$USER mods/*
chmod -R 755 mods/*
}
remove_unsupported_mod() {
remove_clientside_mod() {
local mod_name="$1"
find ./mods/server/ -maxdepth 1 -iname "${mod_name}*.jar" -exec rm {} \; && \
echo "Removed non-server mod: $mod_name"
find $SERVER_DATA_PATH/mods/server/ -maxdepth 1 -iname "*${mod_name}*.jar" -exec rm {} \;
if [ $? -eq 0 ]; then
echo "Removed non-server mod: $mod_name"
else
echo "Client-side mod '$mod_name' not found (OK)"
fi
}
# Call the functions
upgrade_mods
# List of unsupported mods to remove
source unsupported.sh
# Loop through unsupported mods and remove them
for mod in "${unsupported_mods[@]}"; do
remove_unsupported_mod "$mod"
done
# Loop through clientside mods and remove them serverside
cd $THIS_DIR # Go back to compose dir
while IFS= read -r mod; do
remove_clientside_mod "$mod"
done < "./client-only-mods.list"
echo "Starting container"
docker-compose up -d
podman-compose up -d
echo ""
echo "Monitoring startup for 10 seconds..."
start_time=$(date +%s)
timeout=8
crashed=0
sleep 2
while true; do
if podman logs $CONTAINER_NAME | tail -n $LOG_LINES_CHECK | grep "server failed"; then
crashed=1
break
fi
# Check if 5 seconds have passed
current_time=$(date +%s)
if [[ $(($current_time - $start_time)) -ge $timeout ]]; then
break
fi
# Sleep briefly to avoid tight loop
sleep 1
done
if [ $crashed == 1 ]; then
echo "--------------------------------------------------------------------"
podman logs $CONTAINER_NAME | tail -n $LOG_LINES_CHECK
else
echo "All seems OK for now."
fi

View file

@ -9,8 +9,8 @@ services:
- 8080:80
volumes:
- app:/var/www/html
- /mnt/data/nextcloud/files:/var/www/html/data
- /mnt/data/nextcloud/config:/var/www/html/config
- /docker/nextcloud/files:/var/www/html/data
- /docker/nextcloud/config:/var/www/html/config
environment:
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}

View file

@ -1,4 +1,3 @@
version: "3"
# Remember to run: docker network create proxy
@ -19,7 +18,7 @@ services:
DB_SQLITE_FILE: "/data/database.sqlite"
DISABLE_IPV6: "true"
volumes:
- /mnt/data/storage/nginx-proxy/data:/data
- /mnt/data/storage/nginx-proxy/letsencrypt:/etc/letsencrypt
- /docker/storage/nginx-proxy/data:/data
- /docker/storage/nginx-proxy/letsencrypt:/etc/letsencrypt
networks:
- proxy

View file

@ -3,7 +3,7 @@ version: '3.3'
services:
run:
volumes:
- /mnt/data/storage/owncast:/app/data
- /docker/storage/owncast:/app/data
ports:
- '8085:8080'
- '1935:1935'

View file

@ -1,5 +1,3 @@
version: "3.8"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
@ -18,8 +16,8 @@ services:
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- '/mnt/data/storage/pihole/etc-pihole:/etc/pihole'
- '/mnt/data/storage/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
- '/docker/storage/pihole/etc-pihole:/etc/pihole'
- '/docker/storage/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed

View file

@ -1,4 +1,3 @@
version: '3.8'
services:
pingvin-share:
container_name: pingvin-share
@ -9,6 +8,10 @@ services:
volumes:
- "./data:/opt/app/backend/data"
- "./data/images:/opt/app/frontend/public/img"
networks:
proxy:
external: true
# Optional: If you add ClamAV, uncomment the following to have ClamAV start first.
# depends_on:
# clamav:

View file

@ -1,6 +1,5 @@
# APPNICENAME=Stash
# APPDESCRIPTION=An organizer for your ****, written in Go
version: '3.4'
services:
stash:
@ -28,8 +27,8 @@ services:
- /etc/localtime:/etc/localtime:ro
## Adjust below paths (the left part) to your liking.
## E.g. you can change ./config:/root/.stash to ./stash:/root/.stash
- /mnt/data/storage/stash-meta/config:/root/.stash
- /mnt/data/storage/stash-meta/metadata:/metadata
- /mnt/data/storage/stash-meta/cache:/cache
- /mnt/data/storage/stash-meta/generated:/generated
- /mnt/data/storage/stash:/data
- /docker/storage/stash-meta/config:/root/.stash
- /docker/storage/stash-meta/metadata:/metadata
- /docker/storage/stash-meta/cache:/cache
- /docker/storage/stash-meta/generated:/generated
- /docker/storage/stash:/data

View file

@ -8,12 +8,13 @@ services:
- PGID=1000
- TZ=Etc/UTC
volumes:
- /mnt/data/storage/syncthing/config:/config
- /mnt/data/storage/syncthing/data:/data
- /docker/storage/syncthing/config:/config
- /docker/storage/syncthing/data:/data
# - /path/to/data2:/data2
ports:
- 8384:8384
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp
#ports:
# - 8384:8384
# - 22000:22000/tcp
# - 22000:22000/udp
# - 21027:21027/udp
network_mode: host
restart: unless-stopped

View file

@ -14,8 +14,8 @@ services:
- PEERPORT= #optional
- HOST_WHITELIST= #optional
volumes:
- /mnt/data/storage/transmission:/config
- /mnt/data/downloads:/downloads
- /docker/storage/transmission:/config
- /docker/downloads:/downloads
ports:
- 9091:9091
- 51413:51413

View file

@ -0,0 +1,19 @@
services:
valheim-server:
# container_name: valheim-server
cap_add:
- sys_nice
stop_grace_period: 120s
ports:
- 2456-2457:2456-2457/udp
volumes:
- /docker/valheim-server/config:/config
- /docker/valheim-server/data:/opt/valheim
environment:
- SERVER_NAME=Palheim
- WORLD_NAME=Grovelands
- SERVER_PASS=systemofpurrs
- SERVER_PUBLIC=false
- RESTART_IF_IDLE=true
- TZ=Europe/Stockholm
image: ghcr.io/lloesche/valheim-server

View file

@ -1,9 +1,8 @@
version: '3.3'
services:
server:
container_name: vaultwarden
volumes:
- /mnt/data/storage/vaultwarden:/data
- /docker/storage/vaultwarden:/data
ports:
- '5080:80'
image: 'vaultwarden/server:latest'

8
whisper/transcribe.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
docker run \
-v "$PWD/models:/app/models" \
-v "$PWD/testdata:/app/testdata" \
ghcr.io/appleboy/go-whisper:latest \
--model /app/models/ggml-small.bin \
--audio-path /app/testdata/jfk.wav

View file

@ -0,0 +1,14 @@
name: yacht-gui
services:
yacht:
container_name: yacht-gui
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- yacht:/config
image: selfhostedpro/yacht
volumes:
yacht:
external: true
name: yacht