Skip to content

Commit

Permalink
feat: add GitHub mirror and Go module proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Feb 6, 2024
1 parent 0e85df2 commit 29a223f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ We also provide Docker Compose files for both Linux and Windows containers at [w

### Environment variables

- `EULA`(`FALSE`): must be set to `TRUE` to accept the [Minecraft End User License Agreement](https://minecraft.net/terms).
- `VERSION`(`LATEST`): can be set to a specific [LeviLamina](https://github.com/LiteLDev/LeviLamina/tags) version or `LATEST` to automatically download the latest version.
- `PACKAGES`(``): can be set to a list of packages to install on first run. Each package must be a valid [lip specifier](https://docs.lippkg.com/commands/lip_install.html). Both local and remote lip teeth are supported. For local packages, you may need to mount the packages to the container.
- `EULA`: must be set to `TRUE` to accept the [Minecraft End User License Agreement](https://minecraft.net/terms).

- `GITHUB_MIRROR_URL`: can be set to a GitHub mirror URL to speed up the installation of LeviLamina. This is useful when you are behind a firewall or in a country with slow internet connection.

- `GO_MODULE_PROXY_URL`: can be set to a Go module proxy URL to speed up the installation of LeviLamina. This is useful when you are behind a firewall or in a country with slow internet connection.

- `PACKAGES`: can be set to a list of packages to install on first run. Each package must be a valid [lip specifier](https://docs.lippkg.com/commands/lip_install.html). Both local and remote lip teeth are supported. For local packages, you may need to mount the packages to the container.

- `VERSION` (`LATEST`): can be set to a specific [LeviLamina](https://github.com/LiteLDev/LeviLamina/tags) version or `LATEST` to automatically download the latest version.
1 change: 0 additions & 1 deletion windows/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ services:
image: ghcr.io/liteldev/levilamina-server:latest-windows
environment:
EULA: TRUE
VERSION: LATEST
ports:
- 19132:19132/udp
volumes:
Expand Down
13 changes: 9 additions & 4 deletions windows/entrypoint.cmd
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
@echo off
setlocal

if "%EULA%"=="" set "EULA=FALSE"
if "%PACKAGES%"=="" set "PACKAGES="
if "%VERSION%"=="" set "VERSION=LATEST"

set "EULA_UPPER=%EULA:~0,1%"
if /i not "%EULA_UPPER%"=="T" (
if not "%EULA%"=="TRUE" (
echo You must accept the Minecraft EULA to run the server
echo Set the environment variable EULA to TRUE to accept it
exit /b 1
)

if not exist "bedrock_server_mod.exe" (
if not "%GITHUB_MIRROR_URL%"=="" (
lip.exe config GitHubMirrorURL %GITHUB_MIRROR_URL%
)

if not "%GO_MODULE_PROXY_URL%"=="" (
lip.exe config GoModuleProxyURL %GO_MODULE_PROXY_URL%
)

if "%VERSION%"=="LATEST" (
lip.exe install -y github.com/LiteLDev/LeviLamina
) else (
Expand Down
1 change: 0 additions & 1 deletion wine/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ services:
image: ghcr.io/liteldev/levilamina-server:latest-wine
environment:
EULA: TRUE
VERSION: LATEST
ports:
- 19132:19132/udp
volumes:
Expand Down
17 changes: 13 additions & 4 deletions wine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#! /usr/bin/env sh

EULA="${EULA:-FALSE}"
PACKAGES="${PACKAGES:-}"
VERSION="${VERSION:-LATEST}"

if [ $(echo "$EULA" | tr '[:lower:]' '[:upper:]') != "TRUE" ]
if [ "$EULA" != "TRUE" ]
then
echo "You must accept the Minecraft EULA to run the server"
echo "Set the environment variable EULA to TRUE to accept it"
Expand All @@ -13,7 +11,18 @@ fi

export WINEDEBUG="${WINEDEBUG:--all}"

if [ ! -f "bedrock_server_mod.exe" ]; then
if [ ! -f "bedrock_server_mod.exe" ]
then
if [ "$GITHUB_MIRROR_URL" != "" ]
then
lip config GitHubMirrorURL $GITHUB_MIRROR_URL
fi

if [ "$GO_MODULE_PROXY_URL" != "" ]
then
lip config GoModuleProxyURL $GO_MODULE_PROXY_URL
fi

if [ "$VERSION" = "LATEST" ]
then
lip install -y github.com/LiteLDev/LeviLamina
Expand Down

0 comments on commit 29a223f

Please sign in to comment.