Skip to content

Commit

Permalink
Merge pull request #7952 from madhavajay/madhava/headscale_dockerfile2
Browse files Browse the repository at this point in the history
Cleanup headscale dockerfile
  • Loading branch information
madhavajay authored Jul 18, 2023
2 parents 4b651b6 + a1fcc5c commit 18d9b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
11 changes: 4 additions & 7 deletions packages/grid/vpn/headscale.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ RUN curl -o /usr/local/bin/waitforit -sSL https://github.com/maxcnunes/waitforit
chmod +x /usr/local/bin/waitforit

ENV HEADSCALE_VERSION="0.22.3"
RUN --mount=type=cache,target=/root/.cache if [ $(uname -m) != "x86_64" ]; then \
curl -o /bin/headscale -sSL "https://github.com/juanfont/headscale/releases/download/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux_arm64"; \
fi

RUN --mount=type=cache,target=/root/.cache if [ $(uname -m) == "x86_64" ]; then \
curl -o /bin/headscale -sSL "https://github.com/juanfont/headscale/releases/download/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux_amd64"; \
fi
ENV GITHUB_URL="https://github.com/juanfont/headscale/releases/download"
ENV HEADSCALE_URL="${GITHUB_URL}/v${HEADSCALE_VERSION}/headscale_${HEADSCALE_VERSION}_linux"
RUN [ $(uname -m) != "x86_64" ] && curl -o /bin/headscale -sSL "${HEADSCALE_URL}_arm64" || true
RUN [ $(uname -m) == "x86_64" ] && curl -o /bin/headscale -sSL "${HEADSCALE_URL}_amd64" || true

RUN chmod +x /bin/headscale

Expand Down
13 changes: 3 additions & 10 deletions packages/grid/vpn/headscale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ export NETWORK_NAME="${1}"
# start server in background
headscale serve&

# Wait for headscale to start
# wait for headscale to start
waitforit -address=http://localhost:8080/health -status=200 -timeout=60 -- echo "server started"

# create users
headscale users create $NETWORK_NAME || true

#
# headscale -u omnet preauthkeys create -o json

# kill background process
# pgrep headscale | xargs kill -9

# # start in foreground
# headscale serve
flask run -p 4000 --host=0.0.0.0
# run api
flask run -p 4000 --host=0.0.0.0

0 comments on commit 18d9b25

Please sign in to comment.