From c8e197a9c4def3a564c2f517675a251429b5c8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Alegre=20Sep=C3=BAlveda?= Date: Fri, 20 Sep 2024 22:52:19 -0300 Subject: [PATCH 1/4] feat(docker): add Minecraft server configuration and environment optimizations --- examples/docker-compose-paper-config.yml | 19 +++++++++++++++++++ scripts/start-deployPaper | 19 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 examples/docker-compose-paper-config.yml diff --git a/examples/docker-compose-paper-config.yml b/examples/docker-compose-paper-config.yml new file mode 100644 index 00000000000..72f4a7005f0 --- /dev/null +++ b/examples/docker-compose-paper-config.yml @@ -0,0 +1,19 @@ +services: + mc: + image: itzg/minecraft-server + container_name: paper + environment: + EULA: "true" + TYPE: "PAPER" + VIEW_DISTANCE: 10 + MEMORY: 2G + PAPER_CONFIG_REPO: "RAW URL from your repo" # <--- Use this env var if you want to set the paper config for yourself (You only need just one, if you use both env vars PAPER_OPTIMIZE have more priority) + PAPER_OPTIMIZE: "TRUE" # <--- you can use this env var set true if you want to use the Alpha018 Repo in https://github.com/Alpha018/paper-config-optimized + + ports: + - "25565:25565" + volumes: + - mc-paper:/data + restart: unless-stopped +volumes: + mc-paper: {} diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index eaed0e11b4a..52220acb8d5 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -10,7 +10,24 @@ handleDebugMode : "${PAPER_CHANNEL:=default}" : "${PAPER_DOWNLOAD_URL:=}" : "${PAPER_CUSTOM_JAR:=}" -: "${PAPER_CONFIG_DEFAULTS_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}" + +# Default repository URL +DEFAULT_REPO="https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main" +OPTIMIZED_REPO="https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" + +# Check if PAPER_CONFIG_REPO is set and not empty +if [ -n "$PAPER_CONFIG_REPO" ]; then + log "Download Default config from ${PAPER_CONFIG_REPO}" + PAPER_CONFIG_DEFAULTS_REPO="$PAPER_CONFIG_REPO" +else + PAPER_CONFIG_DEFAULTS_REPO="$DEFAULT_REPO" +fi + +# Check if PAPER_OPTIMIZE is set to TRUE +if isTrue "${PAPER_OPTIMIZE}"; then + log "Download Default config from Alpha018 Repo" + PAPER_CONFIG_DEFAULTS_REPO="$OPTIMIZED_REPO" +fi resultsFile=/data/.paper.env if [[ $PAPER_CUSTOM_JAR ]]; then From f250f51bbefe8762cedb2af69106ec87989046e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Alegre=20Sep=C3=BAlveda?= Date: Sat, 21 Sep 2024 18:30:13 -0300 Subject: [PATCH 2/4] feat: enhance Minecraft Docker setup with custom and optimized configurations --- examples/docker-compose-paper-config.yml | 19 ------ examples/optimized-paper-config/README.md | 59 +++++++++++++++++++ .../optimized-paper-config/docker-compose.yml | 17 ++++++ scripts/start-deployPaper | 13 +--- 4 files changed, 78 insertions(+), 30 deletions(-) delete mode 100644 examples/docker-compose-paper-config.yml create mode 100644 examples/optimized-paper-config/README.md create mode 100644 examples/optimized-paper-config/docker-compose.yml diff --git a/examples/docker-compose-paper-config.yml b/examples/docker-compose-paper-config.yml deleted file mode 100644 index 72f4a7005f0..00000000000 --- a/examples/docker-compose-paper-config.yml +++ /dev/null @@ -1,19 +0,0 @@ -services: - mc: - image: itzg/minecraft-server - container_name: paper - environment: - EULA: "true" - TYPE: "PAPER" - VIEW_DISTANCE: 10 - MEMORY: 2G - PAPER_CONFIG_REPO: "RAW URL from your repo" # <--- Use this env var if you want to set the paper config for yourself (You only need just one, if you use both env vars PAPER_OPTIMIZE have more priority) - PAPER_OPTIMIZE: "TRUE" # <--- you can use this env var set true if you want to use the Alpha018 Repo in https://github.com/Alpha018/paper-config-optimized - - ports: - - "25565:25565" - volumes: - - mc-paper:/data - restart: unless-stopped -volumes: - mc-paper: {} diff --git a/examples/optimized-paper-config/README.md b/examples/optimized-paper-config/README.md new file mode 100644 index 00000000000..f630e347db3 --- /dev/null +++ b/examples/optimized-paper-config/README.md @@ -0,0 +1,59 @@ + +# Repository Proposal for Optimized Minecraft Configurations for Paper + +This repository provides a set of optimized configuration files for Minecraft servers, focusing on improving performance and reducing lag. These configurations are based on community best practices and have been tested. You can also use your config file; you just need to replace the env var with another repo. It's important to follow the structure of a config file version like this [repo](https://github.com/Alpha018/paper-config-optimized). + +## Usage + +You can directly use the optimized configuration files from this repository by accessing them through the GitHub raw URLs. Simply replace the env var like the docker compose with any other repo with different configurations. + +To use the raw files, you can download or link to them using the following pattern: + +```yaml +services: + mc: + image: itzg/minecraft-server + container_name: paper + environment: + EULA: "true" + TYPE: "PAPER" + VIEW_DISTANCE: 10 + MEMORY: 2G + PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/[your-username]/[your-repository]/main/[file-path]" + ports: + - "25565:25565" + volumes: + - mc-paper:/data + restart: unless-stopped +volumes: + mc-paper: {} +``` + +For example: + +```yaml +services: + mc: + image: itzg/minecraft-server + container_name: paper + environment: + EULA: "true" + TYPE: "PAPER" + VIEW_DISTANCE: 10 + MEMORY: 2G + PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" + ports: + - "25565:25565" + volumes: + - mc-paper:/data + restart: unless-stopped +volumes: + mc-paper: {} +``` + +Feel free to explore and use the configurations in this repo to enhance your Minecraft server's performance. + +## Contribution + +If you'd like to improve or suggest changes to these configurations, feel free to submit a pull request in this [repository](https://github.com/Alpha018/paper-config-optimized). We welcome contributions from the community! + diff --git a/examples/optimized-paper-config/docker-compose.yml b/examples/optimized-paper-config/docker-compose.yml new file mode 100644 index 00000000000..b4a9d2f6960 --- /dev/null +++ b/examples/optimized-paper-config/docker-compose.yml @@ -0,0 +1,17 @@ +services: + mc: + image: itzg/minecraft-server + container_name: paper + environment: + EULA: "true" + TYPE: "PAPER" + VIEW_DISTANCE: 10 + MEMORY: 2G + PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" # <--- You can use this repo to get paper config-optimized files + ports: + - "25565:25565" + volumes: + - mc-paper:/data + restart: unless-stopped +volumes: + mc-paper: {} diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index 52220acb8d5..0e70c47518c 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -12,21 +12,12 @@ handleDebugMode : "${PAPER_CUSTOM_JAR:=}" # Default repository URL -DEFAULT_REPO="https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main" -OPTIMIZED_REPO="https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" +PAPER_CONFIG_DEFAULTS_REPO="https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main" # Check if PAPER_CONFIG_REPO is set and not empty if [ -n "$PAPER_CONFIG_REPO" ]; then - log "Download Default config from ${PAPER_CONFIG_REPO}" + log "Download config from ${PAPER_CONFIG_REPO}" PAPER_CONFIG_DEFAULTS_REPO="$PAPER_CONFIG_REPO" -else - PAPER_CONFIG_DEFAULTS_REPO="$DEFAULT_REPO" -fi - -# Check if PAPER_OPTIMIZE is set to TRUE -if isTrue "${PAPER_OPTIMIZE}"; then - log "Download Default config from Alpha018 Repo" - PAPER_CONFIG_DEFAULTS_REPO="$OPTIMIZED_REPO" fi resultsFile=/data/.paper.env From 74bf6e969def0d185fe705a0ba98e990cddec895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Alegre=20Sep=C3=BAlveda?= Date: Sat, 21 Sep 2024 22:55:02 -0300 Subject: [PATCH 3/4] feat: conditional var init with default value Co-authored-by: Geoff Bourne --- scripts/start-deployPaper | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index 0e70c47518c..8aff64c6819 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -10,15 +10,7 @@ handleDebugMode : "${PAPER_CHANNEL:=default}" : "${PAPER_DOWNLOAD_URL:=}" : "${PAPER_CUSTOM_JAR:=}" - -# Default repository URL -PAPER_CONFIG_DEFAULTS_REPO="https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main" - -# Check if PAPER_CONFIG_REPO is set and not empty -if [ -n "$PAPER_CONFIG_REPO" ]; then - log "Download config from ${PAPER_CONFIG_REPO}" - PAPER_CONFIG_DEFAULTS_REPO="$PAPER_CONFIG_REPO" -fi +: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}}" resultsFile=/data/.paper.env if [[ $PAPER_CUSTOM_JAR ]]; then From b6852b1e02303d88083680ca198d566f612fb051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Alegre=20Sep=C3=BAlveda?= Date: Mon, 23 Sep 2024 01:37:59 -0300 Subject: [PATCH 4/4] docs: refine documentation and apply minor improvements for better clarity --- examples/optimized-paper-config/README.md | 5 +++-- examples/optimized-paper-config/docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/optimized-paper-config/README.md b/examples/optimized-paper-config/README.md index f630e347db3..0ce0c81cb94 100644 --- a/examples/optimized-paper-config/README.md +++ b/examples/optimized-paper-config/README.md @@ -1,7 +1,8 @@ +# A Form to Load New Config Files to Paper MC -# Repository Proposal for Optimized Minecraft Configurations for Paper +In this example, we illustrate how to efficiently load and manage different configuration files to optimize a Paper Minecraft server. To implement this, it is necessary to create a dedicated repository where the configuration files can be stored and later retrieved. The repository should adhere to a specific structure to facilitate seamless integration with your Docker setup. Notably, the configurations must be organized into a folder named after the version of Minecraft you are using. -This repository provides a set of optimized configuration files for Minecraft servers, focusing on improving performance and reducing lag. These configurations are based on community best practices and have been tested. You can also use your config file; you just need to replace the env var with another repo. It's important to follow the structure of a config file version like this [repo](https://github.com/Alpha018/paper-config-optimized). +For reference, I have provided this [repository](https://github.com/Alpha018/paper-config-optimized), which contains optimized configuration files for the latest version of Minecraft. You can use this repository by linking directly to the configuration files in your Docker file, as demonstrated in the example below. ## Usage diff --git a/examples/optimized-paper-config/docker-compose.yml b/examples/optimized-paper-config/docker-compose.yml index b4a9d2f6960..a4abafec0a1 100644 --- a/examples/optimized-paper-config/docker-compose.yml +++ b/examples/optimized-paper-config/docker-compose.yml @@ -7,7 +7,7 @@ services: TYPE: "PAPER" VIEW_DISTANCE: 10 MEMORY: 2G - PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" # <--- You can use this repo to get paper config-optimized files + PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main" ports: - "25565:25565" volumes: