mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-01-23 02:34:43 +00:00
145-crashes-upon-boot-and-for-some-reason-tries-loading-caddy-stuff-im-not-using-caddy
* removed unused test docker profiles, changed default docker port * updated readme
This commit is contained in:
parent
a6e53bae9c
commit
a2cd992778
8 changed files with 9 additions and 192 deletions
|
|
@ -37,8 +37,8 @@ ENV PROJECT_NAME="headscale-ui"
|
|||
# URL for the github/git location
|
||||
ENV PROJECT_URL="https://github.com/gurucomputing/headscale-ui"
|
||||
# Ports that caddy will run on
|
||||
ENV HTTP_PORT="80"
|
||||
ENV HTTPS_PORT="443"
|
||||
ENV HTTP_PORT="8080"
|
||||
ENV HTTPS_PORT="8443"
|
||||
|
||||
# Production Web Server port. Runs a self signed SSL certificate
|
||||
EXPOSE 443
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
http_port 80
|
||||
https_port 443
|
||||
}
|
||||
|
||||
https://headscale-test.local {
|
||||
tls internal
|
||||
reverse_proxy /web* https://headscale-test-frontend {
|
||||
transport http {
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
}
|
||||
|
||||
reverse_proxy * http://headscale-test-backend:8080
|
||||
}
|
||||
|
||||
:80 {
|
||||
reverse_proxy /web* https://headscale-test-frontend {
|
||||
transport http {
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
}
|
||||
|
||||
reverse_proxy * http://headscale-test-backend:8080
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
services:
|
||||
headscale-test-backend:
|
||||
image: headscale/headscale:latest-alpine
|
||||
container_name: headscale-test-backend
|
||||
security_opt:
|
||||
- label:disable
|
||||
# volumes:
|
||||
# - ./container-config:/etc/headscale
|
||||
# - ./container-data/data:/var/lib/headscale
|
||||
entrypoint: |
|
||||
sh -c "mkdir -p /var/lib/headscale;
|
||||
mkdir -p /etc/headscale;
|
||||
touch /var/lib/headscale/db.sqlite;
|
||||
wget --output-document /etc/headscale/config.yaml https://raw.githubusercontent.com/juanfont/headscale/main/config-example.yaml
|
||||
sed -i 's|http://127.0.0.1:8080|https://headscale-test.local|g' /etc/headscale/config.yaml;
|
||||
headscale serve"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
|
||||
headscale-test-frontend:
|
||||
image: ghcr.io/gurucomputing/headscale-ui:latest
|
||||
container_name: headscale-test-frontend
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
|
||||
headscale-test-proxy:
|
||||
image: headscale-test-proxy:latest
|
||||
build: .
|
||||
container_name: headscale-test-proxy
|
||||
ports:
|
||||
- 8080:80
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
aliases:
|
||||
- headscale-test.local
|
||||
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
external: true
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
FROM alpine:latest
|
||||
|
||||
# environment variables
|
||||
ENV XDG_DATA_HOME=/data/
|
||||
|
||||
# Set the staging environment
|
||||
WORKDIR /staging/scripts
|
||||
WORKDIR /staging
|
||||
|
||||
# Copy across the scripts folder
|
||||
COPY scripts/* ./scripts/
|
||||
# Copy default caddy config from project root
|
||||
COPY ./Caddyfile /staging/Caddyfile
|
||||
# Set permissions for all scripts. We do not want normal users to have write
|
||||
# access to the scripts
|
||||
RUN chown -R 0:0 scripts
|
||||
RUN chmod -R 755 scripts
|
||||
|
||||
# Build the image. This build runs as root
|
||||
RUN /staging/scripts/1-image-build.sh
|
||||
|
||||
# Tell docker that all future commands should run as the appuser user
|
||||
# USER appuser
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
ENTRYPOINT /bin/sh /staging/scripts/2-initialise.sh
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
# temporarily set the caddy home to staging
|
||||
export XDG_DATA_HOME=/staging
|
||||
|
||||
# create the group and user
|
||||
addgroup -S appgroup && adduser -D appuser -G appgroup
|
||||
|
||||
# install caddy plus dependencies
|
||||
apk add --no-cache caddy nss-tools
|
||||
|
||||
# install tailscale
|
||||
echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
|
||||
apk add -U --no-cache tailscale
|
||||
rc-update add tailscale
|
||||
|
||||
# do a dry run of caddy to install the certificates
|
||||
caddy start
|
||||
caddy trust -adapter caddyfile -config /staging/Caddyfile
|
||||
caddy stop
|
||||
|
||||
# set the caddy directory to the non-root user
|
||||
# commented out for now as we need root anyway for tailscale
|
||||
# chown -R 1000:1000 /staging/caddy
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#----#
|
||||
# placeholder for testing
|
||||
# while true; do sleep 1; done
|
||||
#----#
|
||||
|
||||
# copy everything from staging
|
||||
if [ ! -f /data/Caddyfile ];
|
||||
then
|
||||
echo "no Caddyfile detected, copying across default config"
|
||||
cp /staging/Caddyfile /data/Caddyfile
|
||||
fi
|
||||
|
||||
if [ ! -f /data/caddy ];
|
||||
then
|
||||
echo "no caddy directory detected, copying across default config"
|
||||
cp -r /staging/caddy /data/caddy
|
||||
fi
|
||||
|
||||
# start caddy
|
||||
echo "Starting Caddy"
|
||||
/usr/sbin/caddy run --adapter caddyfile --config /data/Caddyfile
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
services:
|
||||
headscale-worker-1:
|
||||
image: headscale-test-proxy:latest
|
||||
container_name: headscale-worker-1
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
entrypoint: |
|
||||
sh -c "tailscaled --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 &
|
||||
tailscale up --authkey=$PREAUTH_KEY --login-server=https://headscale-test.local;
|
||||
/etc/init.d/tailscale start
|
||||
while true; do sleep 1; done"
|
||||
headscale-worker-2:
|
||||
image: headscale-test-proxy:latest
|
||||
container_name: headscale-worker-2
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
entrypoint: |
|
||||
sh -c "tailscaled --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 &
|
||||
tailscale up --authkey=$PREAUTH_KEY --login-server=https://headscale-test.local;
|
||||
/etc/init.d/tailscale start
|
||||
while true; do sleep 1; done"
|
||||
headscale-worker-3:
|
||||
image: headscale-test-proxy:latest
|
||||
container_name: headscale-worker-3
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
entrypoint: |
|
||||
sh -c "tailscaled --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 &
|
||||
tailscale up --authkey=$PREAUTH_KEY --login-server=https://headscale-test.local --advertise-routes=10.30.10.1/32,10.30.10.2/32,10.30.10.3/32;
|
||||
/etc/init.d/tailscale start
|
||||
while true; do sleep 1; done"
|
||||
|
||||
networks:
|
||||
headscale-ui-test-network:
|
||||
external: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue