From 6f767a3b612c60d55c2672f2b3381ce8cd47a079 Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Sun, 8 Jun 2025 12:51:36 +0300 Subject: [PATCH 1/5] add build-docker actions workflow --- .dockerignore | 2 ++ .github/workflows/build-docker.yml | 46 ++++++++++++++++++++++++++++++ src/server.properties | 10 +++---- 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/build-docker.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fdd05c5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +src/logs +src/whitelist.json diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..04b167f --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,46 @@ +--- + +on: + push: + branches: + - main + - develop + +jobs: + build-docker: + runs-on: ubuntu-latest + env: + registry: gitea.cuqmbr.xyz + steps: + - name: Login to Docker Container Registry + uses: docker/login-action@v3 + with: + registry: ${{env.registry}} + username: ${{vars.DOCKER_USER}} + password: ${{secrets.DOCKER_TOKEN}} + - name: Checkout repository + uses: actions/checkout@v4 + # https://github.com/actions/checkout/issues/1830 + # https://gitea.com/gitea/act_runner/issues/164 + - name: Checkout lfs + run: | + git lfs install --local + AUTH=$(git config --local http.${{ github.server_url }}/.extraheader) + git config --local --unset http.${{ github.server_url }}/.extraheader + git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH" + git lfs pull + - 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: + context: . + file: ./Dockerfile + platforms: linux/arm64,linux/amd64 + push: true + # TODO: split tag names into multiple lines + tags: | + ${{env.registry}}/${{github.repository_owner}}/${{github.event.repository.name}}/${{github.ref_name}}:${{github.sha}} + ${{env.registry}}/${{github.repository_owner}}/${{github.event.repository.name}}/${{github.ref_name}}:latest diff --git a/src/server.properties b/src/server.properties index acbf67f..47ef43b 100644 --- a/src/server.properties +++ b/src/server.properties @@ -1,6 +1,6 @@ #For explaination of what each of the options does, please visit: #https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties -#Sun Jun 08 11:50:59 EEST 2025 +#Sun Jun 08 12:44:19 EEST 2025 allow-chat=true allow-flight=false bungee-guard=false @@ -8,8 +8,8 @@ bungeecord=false default-gamemode=adventure enforce-whitelist=false forwarding-secrets=_PROXY_SECRET_ -handshake-verbose=true -level-dimension=minecraft\:overworld +handshake-verbose=false +level-dimension=minecraft\:the_end level-name=world;spawn.schem log-player-ip-addresses=true max-players=-1 @@ -21,10 +21,10 @@ resource-pack-prompt={"text"\:"","extra"\:[{"text"\:"Install server resource pac resource-pack-sha1= server-ip=0.0.0.0 server-port=25565 +tab-header="Bebrashield Limbo" tab-footer= -tab-header= ticks-per-second=5 velocity-modern=true version=Limbo\! -view-distance=6 +view-distance=2 world-spawn=world;20.5;17;22.5;-90;0 From 81231a26b9330eced2d1607791d77cb58d1ad588 Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Wed, 23 Jul 2025 21:25:32 +0300 Subject: [PATCH 2/5] relpace LOOHP's limbo to NanoLimbo --- .dockerignore | 1 - .gitignore | 18 +--- Dockerfile | 4 +- src/Limbo-0.7.10-ALPHA-1.21.1.jar | 3 - src/NanoLimbo-1.9.7-all.jar | 3 + src/permission.yml | 14 --- src/plugins/bStats/config.yml | 7 -- src/run.bat | 2 +- src/run.sh | 2 +- src/server.properties | 30 ------- src/settings.yml | 137 ++++++++++++++++++++++++++++++ src/spawn.schem | 3 - 12 files changed, 144 insertions(+), 80 deletions(-) delete mode 100644 src/Limbo-0.7.10-ALPHA-1.21.1.jar create mode 100644 src/NanoLimbo-1.9.7-all.jar delete mode 100644 src/permission.yml delete mode 100644 src/plugins/bStats/config.yml delete mode 100644 src/server.properties create mode 100644 src/settings.yml delete mode 100644 src/spawn.schem diff --git a/.dockerignore b/.dockerignore index fdd05c5..a7f73e9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ src/logs -src/whitelist.json diff --git a/.gitignore b/.gitignore index 1d76db5..a7f73e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1 @@ -*/cache -*/libraries -*/logs -*/versions -*/plugins/.paper-remapped - -*/world -*/world_nether -*/world_the_end - -*/.console_history - -*/banned-ips.json -*/banned-players.json -*/ops.json -*/whitelist.json -*/usercache.json +src/logs diff --git a/Dockerfile b/Dockerfile index e523c0e..89723af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,6 @@ RUN mkdir ${DATA_PATH} RUN mkdir ${DATA_PATH}/logs && \ ln -sf ${DATA_PATH}/logs ${CONFIG_PATH} -RUN touch ${DATA_PATH}/whitelist.json && \ - ln -sf ${DATA_PATH}/whitelist.json ${CONFIG_PATH} VOLUME ${DATA_PATH} @@ -25,5 +23,5 @@ WORKDIR ${WORKDIR_PATH}/config EXPOSE 25565/tcp CMD \ - sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" server.properties && \ + sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" settings.yml && \ java -Xms${MEMORY} -Xmx${MEMORY} -jar *.jar --nogui diff --git a/src/Limbo-0.7.10-ALPHA-1.21.1.jar b/src/Limbo-0.7.10-ALPHA-1.21.1.jar deleted file mode 100644 index 803602b..0000000 --- a/src/Limbo-0.7.10-ALPHA-1.21.1.jar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dc528599c08df1766c29a15da646df5d586b791d5c52255170746fc51563c120 -size 8493423 diff --git a/src/NanoLimbo-1.9.7-all.jar b/src/NanoLimbo-1.9.7-all.jar new file mode 100644 index 0000000..b98f13a --- /dev/null +++ b/src/NanoLimbo-1.9.7-all.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6046e8346858bfbbd14e9b39d8d8535bf25b7d18408b623842e4c24238f2f687 +size 3971634 diff --git a/src/permission.yml b/src/permission.yml deleted file mode 100644 index 0f5a839..0000000 --- a/src/permission.yml +++ /dev/null @@ -1,14 +0,0 @@ -groups: - # admin: - # - limboserver.stop - # - limboserver.kick - # - limboserver.say - # - limboserver.gamemode - default: - - limboserver.spawn - - limboserver.chat - # - limboserver.version - -players: - # LOOHP: - # - admin diff --git a/src/plugins/bStats/config.yml b/src/plugins/bStats/config.yml deleted file mode 100644 index 23e317e..0000000 --- a/src/plugins/bStats/config.yml +++ /dev/null @@ -1,7 +0,0 @@ -#bStats collects some data for plugin authors like how many servers are using their plugins. -#To honor their work, you should not disable it. -#This has nearly no effect on the server performance! -#Check out https://bStats.org/ to learn more :) -enabled: false -serverUuid: f7c31857-e3e6-4807-856c-4fe187149590 -logFailedRequests: false diff --git a/src/run.bat b/src/run.bat index 6324766..20ef6e9 100755 --- a/src/run.bat +++ b/src/run.bat @@ -1,3 +1,3 @@ @echo off -java -Xms1G -Xmx1G -jar *.jar --nogui +java -Xms1G -Xmx1G -jar NanoLimbo-1.9.7-all.jar --nogui pause diff --git a/src/run.sh b/src/run.sh index 41dad80..482b2fa 100755 --- a/src/run.sh +++ b/src/run.sh @@ -1,3 +1,3 @@ #!/bin/sh -java -Xms1G -Xmx1G -jar *.jar --nogui +java -Xms1G -Xmx1G -jar NanoLimbo-1.9.7-all.jar --nogui diff --git a/src/server.properties b/src/server.properties deleted file mode 100644 index 47ef43b..0000000 --- a/src/server.properties +++ /dev/null @@ -1,30 +0,0 @@ -#For explaination of what each of the options does, please visit: -#https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties -#Sun Jun 08 12:44:19 EEST 2025 -allow-chat=true -allow-flight=false -bungee-guard=false -bungeecord=false -default-gamemode=adventure -enforce-whitelist=false -forwarding-secrets=_PROXY_SECRET_ -handshake-verbose=false -level-dimension=minecraft\:the_end -level-name=world;spawn.schem -log-player-ip-addresses=true -max-players=-1 -motd={"text"\:"","extra"\:[{"text"\:"Limbo Server\!","color"\:"yellow"}]} -reduced-debug-info=true -required-resource-pack=false -resource-pack= -resource-pack-prompt={"text"\:"","extra"\:[{"text"\:"Install server resource pack\!","color"\:"yellow"}]} -resource-pack-sha1= -server-ip=0.0.0.0 -server-port=25565 -tab-header="Bebrashield Limbo" -tab-footer= -ticks-per-second=5 -velocity-modern=true -version=Limbo\! -view-distance=2 -world-spawn=world;20.5;17;22.5;-90;0 diff --git a/src/settings.yml b/src/settings.yml new file mode 100644 index 0000000..976bb8d --- /dev/null +++ b/src/settings.yml @@ -0,0 +1,137 @@ +# +# NanoLimbo configuration +# + +# Server's host address and port. Set ip empty to use public address +bind: + ip: '0.0.0.0' + port: 25565 + +# Max number of players can join to server +# Set -1 to make it infinite +maxPlayers: 100 + +# Server's data in servers list +ping: + description: '{"text": "&9NanoLimbo"}' + version: 'NanoLimbo' + # Return static protocol version number in ping result + # By default, its -1 to return the client version if it supported + # https://wiki.vg/Protocol_version_numbers + protocol: -1 + +# Available dimensions: OVERWORLD, NETHER, THE_END +dimension: THE_END + +# Whether to display the player in the player list +# For 1.16.5 clients, the player list will be sent even if disabled, to avoid crash +playerList: + enable: false + username: 'NanoLimbo' + +# Whether to display header and footer in player list +# For 1.8+ clients +headerAndFooter: + enable: false + header: '{"text": "&eWelcome!"}' + footer: '{"text": "&9NanoLimbo"}' + +# Setup player's game mode +# 0 - Survival +# 1 - Creative (hide HP and food bar) +# 2 - Adventure +# 3 - Spectator (hide all UI bars) +# Spectator works on 1.8+ clients +gameMode: 3 + +# Remove secure-chat toast +# For 1.20.5+ clients +secureProfile: false + +# Server name which is shown under F3 +# For 1.13+ clients +brandName: + enable: false + content: 'NanoLimbo' + +# Message sends when player joins to the server +joinMessage: + enable: false + text: '{"text": "&eWelcome to the Limbo!"}' + +# BossBar displays when player joins to the server +# For 1.9+ clients +bossBar: + enable: false + text: '{"text": "Welcome to the Limbo!"}' + health: 1.0 + # Available colors: PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE + color: PINK + # Available divisions: SOLID, DASHES_6, DASHES_10, DASHES_12, DASHES_20 + division: SOLID + +# Display title and subtitle +# For 1.8+ clients +title: + enable: false + # Set title text value empty, if you need only subtitle + title: '{"text": "&9&lWelcome!"}' + # Set subtitle text value empty, if you need only title + subtitle: '{"text": "&6NanoLimbo"}' + # Fade in time in ticks (1 sec = 20 ticks) + fadeIn: 10 + # Stay time in ticks + stay: 200 + # Fade out time in ticks + fadeOut: 10 + +# Player info forwarding support. +# Available types: +# - NONE +# - LEGACY +# - MODERN +# - BUNGEE_GUARD +# Don't use secret if you do not use MODERN type +infoForwarding: + type: MODERN + secret: '_PROXY_SECRET_' + tokens: + - '' + +# Read timeout for connections in milliseconds +readTimeout: 30000 + +# Define log level. For production, I'd recommend to use level 2 +# Log levels: +# 0 - Display only errors +# 1 - Display errors, warnings +# 2 - Display errors, warnings, info +# 3 - Display errors, warnings, info, debug +debugLevel: 2 + +# Warning! Do not touch params of this block if you are not completely sure what is this! +netty: + # Use a Linux native transport type, if it possible + useEpoll: true + # EventLoopGroup threads count + threads: + bossGroup: 1 + workerGroup: 4 + +# Options to check incoming traffic and kick potentially malicious connections. +# Take into account that player can send many small packets, for example, just moving mouse. +traffic: + # If true, then additional handler will be added to the channel pipeline + enable: true + # Max packet size in bytes + # Unlimited if -1 + maxPacketSize: 8192 + # The interval to measure packets over + # Lowering this value will limit peak packets from players which would target people with bad connections + # Raising this value will allow higher peak packet rates, which will help with people who have poor connections + # Ignored if -1.0 + interval: 7.0 + # The maximum packets per second for players + # It is measured over the configured interval + # Ignored if -1.0 + maxPacketRate: 500.0 diff --git a/src/spawn.schem b/src/spawn.schem deleted file mode 100644 index 4c431de..0000000 --- a/src/spawn.schem +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dde72add1e579739a8f816708d1f2efae9198bc9d6ca99a236972f53b712f6e6 -size 6609 From 84c1134853a80d61094ad5487f223746007d716e Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Wed, 6 Aug 2025 21:54:58 +0300 Subject: [PATCH 3/5] add unicode locale generation to Dockerfile before the change, unicode characters were displayed in console as question marks --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 89723af..46766c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,13 @@ RUN mkdir ${DATA_PATH} RUN mkdir ${DATA_PATH}/logs && \ ln -sf ${DATA_PATH}/logs ${CONFIG_PATH} +# Generate unicode locale so that cyrillic characters display properly +RUN apt-get update -y && apt-get install -y locales && \ + echo en_US.UTF-8 UTF-8 > /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales +ENV LANG en_US.UTF-8 + + VOLUME ${DATA_PATH} From 3a94541de7f2fc764e9cfdbb1167ea37000f487c Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Tue, 12 Aug 2025 19:16:05 +0300 Subject: [PATCH 4/5] rearranged Dockerfile statements and add remove cache after locale installation --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 46766c7..39348d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,19 +15,22 @@ RUN mkdir ${DATA_PATH}/logs && \ # Generate unicode locale so that cyrillic characters display properly RUN apt-get update -y && apt-get install -y locales && \ echo en_US.UTF-8 UTF-8 > /etc/locale.gen && \ - dpkg-reconfigure --frontend=noninteractive locales + dpkg-reconfigure --frontend=noninteractive locales && \ + rm -Rf var/lib/apt/lists/* ENV LANG en_US.UTF-8 VOLUME ${DATA_PATH} +EXPOSE 25565/tcp + + ENV MEMORY=1G ENV PROXY_SECRET=change_me -WORKDIR ${WORKDIR_PATH}/config -EXPOSE 25565/tcp +WORKDIR ${WORKDIR_PATH}/config CMD \ sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" settings.yml && \ From 89b19b820d0c758cedbe95529c42a22f4f726ff9 Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Tue, 12 Aug 2025 19:16:39 +0300 Subject: [PATCH 5/5] add uid/gid selection to run application as in Dockerfile --- Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 39348d8..1ef47de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,5 +33,18 @@ ENV PROXY_SECRET=change_me WORKDIR ${WORKDIR_PATH}/config CMD \ + # Create and switch to user with desired UID and GID. + # All processes that create/change files in ${DATA_PATH} + # must be run under this user. + groupadd -g ${GID} worker && \ + useradd -M -g ${GID} -u ${UID} worker && \ + chmod -R o-rwx ${WORKDIR_PATH} && \ + + # Add proxy secret sed -i "s/_PROXY_SECRET_/${PROXY_SECRET}/g" settings.yml && \ - java -Xms${MEMORY} -Xmx${MEMORY} -jar *.jar --nogui + + # Change UID and GID of used files to desired values. + chown -R worker:worker ${WORKDIR_PATH} && \ + + # Launch + su worker -c "java -Xms${MEMORY} -Xmx${MEMORY} -jar *.jar --nogui"