21 Commits

Author SHA1 Message Date
fdba02faed fix: bug not allowing set custom key.
All checks were successful
Docker Image CI / docker (push) Successful in 1m48s
2025-08-02 21:43:47 -07:00
b017fcd217 add version 1.10.1
All checks were successful
Docker Image CI / docker (push) Successful in 1m56s
2025-08-02 21:07:56 -07:00
b3e636e36a test
All checks were successful
Docker Image CI / docker (pull_request) Successful in 49s
Docker Image CI / docker (push) Successful in 1m57s
2025-08-02 09:00:58 -07:00
57172a3609 test
All checks were successful
Docker Image CI / docker (push) Successful in 1m49s
2025-08-02 08:56:50 -07:00
87686bf4f7 update: holesail 2.2.0
All checks were successful
Docker Image CI / docker (pull_request) Successful in 55s
Docker Image CI / docker (push) Successful in 2m1s
2025-07-30 15:02:15 -07:00
29e00d6002 Merge branch 'master' into 2.1.0
All checks were successful
Docker Image CI / docker (push) Successful in 3m3s
2025-07-22 21:00:12 -07:00
012cc74576 update to workflows .gitea
All checks were successful
Docker Image CI / docker (pull_request) Successful in 1m0s
Docker Image CI / docker (push) Successful in 3m26s
2025-07-22 20:43:06 -07:00
fd64e8f816 move action to gitea
All checks were successful
Docker Image CI / docker (push) Successful in 2m27s
2025-07-18 19:57:59 -07:00
21b21ce73c fix: fix my-mc command 2025-05-27 23:57:57 -07:00
4a7fbef176 test 2025-05-27 19:44:32 -07:00
a1ec0ba829 add KEY default value 2025-05-27 13:57:23 -07:00
6d78af4d3a fix: rename CONNECTOR envar to MY_MC_API_KEY 2025-05-27 13:46:23 -07:00
85428100c0 fix: --connector arg is renamed to --key 2025-05-27 13:33:42 -07:00
407cfcfb69 bump holesail version to 2.1.0 2025-05-25 06:38:01 -07:00
5e03c2c30d fix env UDP option 2025-05-14 01:13:43 -07:00
9c1d769ed8 add UDP environment variable 2025-05-13 18:24:58 -07:00
7989b82c04 handle ctrl-c now 2025-05-13 17:13:40 -07:00
b0e982ba6f feature: add secret my-mc.link mode 2025-05-10 20:57:13 -07:00
e83868695b fix action 2025-05-10 17:42:17 -07:00
b6e113fbef Add proper singal handling for quicker shutdown 2025-05-10 17:32:09 -07:00
b88e26100f bump holesail version to 2.0.3 and cleanup 2025-05-10 17:31:20 -07:00
5 changed files with 148 additions and 29 deletions

View File

@@ -0,0 +1,60 @@
name: Docker Image CI
on:
# schedule:
# - cron: "0 10 * * *"
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
anaxios/holesail
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Login to GHCR
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -1,23 +1,23 @@
FROM node:lts-slim AS base
WORKDIR /temp
COPY run.sh .
RUN chmod +x run.sh
RUN npm install -g holesail@1.10.1
ENV MODE server
ENV HOST 0.0.0.0
ENV PORT 8989
ENV PUBLIC true
ENV USERNAME admin
ENV PASSWORD admin
ENV ROLE user
ENV CONNECTOR ""
ENV FORCE ""
FROM base AS dev
#EXPOSE 8989
WORKDIR /
COPY run.sh .
COPY fetch-my-mc-connector.js .
RUN chmod +x run.sh
WORKDIR /data
ENV MODE=server
ENV HOST=0.0.0.0
ENV PORT=8989
ENV PUBLIC=true
ENV USERNAME=admin
ENV PASSWORD=admin
ENV ROLE=user
ENV KEY=""
ENV MY_MC_API_KEY=""
#ENV FORCE ""
ENTRYPOINT [ "/temp/run.sh" ]
CMD [ "/usr/bin/bash", "/run.sh" ]

View File

@@ -17,7 +17,7 @@ The following environment variables are available:
- HOST: The hostname or IP address to use for the client or server mode.
- PUBLIC: A boolean value indicating whether the server should use a public connetor string. Only applicable in server mode.
- FORCE: A boolean value indicating whether to force a short connector string of less than 32 chars. Only applicable in server and filemanager modes.
- CONNECTOR: A connector string used to identify the connection. Can be used in client, server, and filemanager modes.
- KEY: A string used to identify the connection. Can be used in client, server, and filemanager modes.
- USERNAME: The username to use for authentication in filemanager mode.
- PASSWORD: The password to use for authentication in filemanager mode.
- ROLE: The role to assign to the user in filemanager mode. Can be either admin or user.
@@ -41,7 +41,7 @@ docker run -d --name holesail \
-e MODE=server \
-e PORT=25565 \
-e HOST=minecraft \
-e CONNECTOR=very-super-secret \
-e KEY=very-super-secret \
-e PUBLIC=false \
--network holesail \
anaxios/holesail:latest
@@ -66,7 +66,7 @@ services:
PORT: 25565
HOST: minecraft
PUBLIC: false
CONNECTOR: very-super-secret
KEY: very-super-secret
networks:
- holesail
@@ -101,18 +101,17 @@ services:
holesail:
container_name: holesail
restart: unless-stopped
network_mode: "host"
ports:
- 8989:8989
image: anaxios/holesail:latest
environment:
MODE: client
PORT: 8989
HOST: 0.0.0.0
PUBLIC: false
CONNECTOR: very-super-secret
KEY: very-super-secret
```
**Note:** Client mode only works on Linux, and is incompatible with Windows and Mac.
### Filemanager Mode
In Filemanager mode, Holesail-docker serves a file manager interface. Example `docker-compose.yml` file:
@@ -131,7 +130,7 @@ services:
ROLE: user
USERNAME: admin
PASSWORD: admin
CONNECTOR: very-super-secret
KEY: very-super-secret
volumes:
- <host dir>:/data
```
@@ -153,7 +152,7 @@ services:
PORT: 25565
HOST: minecraft
PUBLIC: false
CONNECTOR: very-super-secret
KEY: very-super-secret
networks:
- holesail

17
fetch-my-mc-connector.js Normal file
View File

@@ -0,0 +1,17 @@
const apiKey = process.env.MY_MC_API_KEY;
const result = fetch('https://api.my-mc.link/my-hash',{
method: "GET",
headers: {
'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': apiKey}
})
.then(async response => {
const r = await response.json();
if (r.success == true) {
console.log(r.message);
} else {
throw new Error("failed to fetch holesail key");
}
}).catch(err => {
throw Error(err);
})

51
run.sh
View File

@@ -1,5 +1,9 @@
#!/bin/bash
#set -x
pid=0
CYAN="\033[1;96m"
RED="\033[0;91m"
GREEN="\033[0;92m"
@@ -21,20 +25,26 @@ success() {
print "$GREEN" "$1"
}
#get_connector_my_mc() {
# KEY="$(/usr/local/bin/node /fetch-my-mc-connector.js)"
#}
cmd_argument_builder () {
local args="";
case "$MODE" in
"client")
[[ "$PORT" ]] && args="$args --port $PORT";
[[ "$HOST" ]] && args="$args --host $HOST";
[[ "$CONNECTOR" ]] && args="$args $CONNECTOR";
[[ "$KEY" ]] && args="$args $KEY";
#[[ "$UDP" = "true" ]] && args="$args --udp";
;;
"server")
[[ "$PORT" ]] && args="$args --live $PORT";
[[ "$HOST" ]] && args="$args --host $HOST";
[[ "$PUBLIC" = "true" ]] && args="$args --public";
[[ "$FORCE" = "true" ]] && args="$args --force";
[[ "$CONNECTOR" ]] && args="$args --connector $CONNECTOR";
[[ "$KEY" ]] && args="$args --connector $KEY";
#[[ "$UDP" = "true" ]] && args="$args --udp";
;;
"filemanager")
args="--filemanager";
@@ -45,13 +55,35 @@ cmd_argument_builder () {
[[ "$PASSWORD" ]] && args="$args --password $PASSWORD";
[[ "$ROLE" = "admin" ]] && args="$args --role admin";
[[ "$ROLE" = "user" ]] && args="$args --role user";
[[ "$CONNECTOR" ]] && args="$args --connector $CONNECTOR";
[[ "$KEY" ]] && args="$args --key $KEY";
#[[ "$UDP" = "true" ]] && args="$args --udp";
;;
# "my-mc")
# #if ! get_connector_my_mc; then exit 1; fi
# [[ "$PORT" ]] && args="$args --port $PORT";
# [[ "$HOST" ]] && args="$args --host $HOST";
# [[ "$KEY" ]] && args="$args --connect $KEY";
# #[[ "$UDP" = "true" ]] && args="$args --udp";
# ;;
esac
printf "%s" "$args";
}
# SIGUSR1-handler
my_handler() {
echo "my_handler"
}
term_handler() {
if [ $pid -ne 0 ]; then
kill -SIGTERM "$pid"
wait "$pid"
fi
exit 143; # 128 + 15 -- SIGTERM
}
ARGS="$(cmd_argument_builder)"
@@ -60,5 +92,16 @@ if [[ ! $ARGS ]]; then
exit 1
fi
holesail $ARGS
# setup handlers
# on callback, kill the last background process, which is `tail -f /dev/null` and execute the specified handler
#trap 'kill ${!}; my_handler' SIGUSR1
trap 'kill ${!}; term_handler' SIGTERM SIGINT
# run application
/usr/local/bin/holesail $ARGS &
pid="$!"
# wait forever
while true; do
tail -f /dev/null & wait ${!}
done