diff --git a/caddy/.env.example b/caddy/.env.example index dcd2dfb..ce1f668 100644 --- a/caddy/.env.example +++ b/caddy/.env.example @@ -46,3 +46,7 @@ IMMICH_DOMAIN= IMMICH_CRT= IMMICH_KEY= +############# Uptime Kuma ############# +UPTIME_KUMA_DOMAIN= +UPTIME_KUMA_CRT= +UPTIME_KUMA_KEY= diff --git a/caddy/Caddyfile b/caddy/Caddyfile index a1c13b0..3742c4b 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -171,6 +171,24 @@ } } +############## uptime-kuma ############## +{$UPTIME_KUMA_DOMAIN} { + tls /etc/ssl/custom/{$UPTIME_KUMA_CRT} /etc/ssl/custom/{$UPTIME_KUMA_KEY} + + request_body { + max_size 1024MB + } + + reverse_proxy http://uptime_kuma:3001 { + header_up X-Real-IP {http.request.header.Cf-Connecting-Ip} + header_up X-Forwarded-For {http.request.header.Cf-Connecting-Ip} + header_up X-Country-Code {http.request.header.Cf-Ipcountry} + header_up X-Forwarded-Proto {http.request.scheme} + header_up Host {http.request.host} + header_up -CF-* + } +} + import Caddyfile.private diff --git a/glance/assets/uptime_kuma.png b/glance/assets/uptime_kuma.png new file mode 100644 index 0000000..2adfffc Binary files /dev/null and b/glance/assets/uptime_kuma.png differ diff --git a/glance/config/home.yml b/glance/config/home.yml index c60c40e..11df182 100644 --- a/glance/config/home.yml +++ b/glance/config/home.yml @@ -35,6 +35,9 @@ - title: photos.aykhans.me url: https://photos.aykhans.me/ icon: /assets/immich.png + - title: up.aykhans.me + url: https://up.aykhans.me/ + icon: /assets/uptime_kuma.png - title: aykhans.me url: https://aykhans.me/ icon: /assets/ghost.png @@ -45,12 +48,14 @@ - type: releases cache: 1d - collapse-after: 3 + collapse-after: 5 # Without authentication the Github API allows for up to 60 requests per hour. You can create a # read-only token from your Github account settings and use it here to increase the limit. token: ${GITHUB_TOKEN} repositories: - caddyserver/caddy + - louislam/uptime-kuma + - immich-app/immich - glanceapp/glance - go-gitea/gitea - drakkan/sftpgo diff --git a/main.sh b/main.sh index f778cce..626005e 100755 --- a/main.sh +++ b/main.sh @@ -62,6 +62,7 @@ generate_env_files() { cp --update=none ./glance/.env.example ./glance/.env cp --update=none ./ghost/.env.example ./ghost/.env cp --update=none ./immich/.env.example ./immich/.env + cp --update=none ./uptime_kuma/.env.example ./uptime_kuma/.env cp --update=none ./caddy/Caddyfile.private.example ./caddy/Caddyfile.private # cp --update=none ./slash/.env.example ./slash/.env # cp --update=none ./grafana/.env.example ./grafana/.env @@ -182,6 +183,15 @@ start_services() { exit 1 fi + echo "Starting uptime kuma..." + $DOCKER_COMPOSE_COMMAND -f ./uptime_kuma/docker-compose.yml up -d + if [ $? -eq 0 ]; then + print_success "Uptime kuma started successfully." + else + print_error "failed to start Uptime kuma!" + exit 1 + fi + echo "Starting caddy..." $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml up -d if [ $? -eq 0 ]; then @@ -301,6 +311,15 @@ stop_services() { exit 1 fi + echo "Stopping uptime kuma..." + $DOCKER_COMPOSE_COMMAND -f ./uptime_kuma/docker-compose.yml down + if [ $? -eq 0 ]; then + print_success "Uptime kuma stopped successfully." + else + print_error "failed to stop Uptime kuma!" + exit 1 + fi + echo "Stopping caddy..." $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml down if [ $? -eq 0 ]; then diff --git a/uptime_kuma/.env.example b/uptime_kuma/.env.example new file mode 100644 index 0000000..43484f2 --- /dev/null +++ b/uptime_kuma/.env.example @@ -0,0 +1 @@ +CADDY_DOMAIN=sub.example.com diff --git a/uptime_kuma/.gitignore b/uptime_kuma/.gitignore new file mode 100644 index 0000000..394be19 --- /dev/null +++ b/uptime_kuma/.gitignore @@ -0,0 +1,2 @@ +/data/* +!.gitkeep diff --git a/uptime_kuma/data/.gitkeep b/uptime_kuma/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/uptime_kuma/docker-compose.yml b/uptime_kuma/docker-compose.yml new file mode 100644 index 0000000..17cb3e1 --- /dev/null +++ b/uptime_kuma/docker-compose.yml @@ -0,0 +1,18 @@ +networks: + caddy: + name: caddy + driver: bridge + external: true + +services: + uptime-kuma: + image: louislam/uptime-kuma:1 + container_name: uptime_kuma + restart: unless-stopped + volumes: + - ./data/app:/app/data + networks: + - caddy + labels: + caddy: ${CADDY_DOMAIN} + caddy.reverse_proxy: "* {{upstreams 3001}}"