MinecraftDockerCLI 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. minecraftdockercli-0.10.0/LICENSE +21 -0
  2. minecraftdockercli-0.10.0/PKG-INFO +127 -0
  3. minecraftdockercli-0.10.0/README.md +92 -0
  4. minecraftdockercli-0.10.0/pyproject.toml +242 -0
  5. minecraftdockercli-0.10.0/src/__init__.py +6 -0
  6. minecraftdockercli-0.10.0/src/__main__.py +96 -0
  7. minecraftdockercli-0.10.0/src/assets/README.md +45 -0
  8. minecraftdockercli-0.10.0/src/assets/config/eula.txt +1 -0
  9. minecraftdockercli-0.10.0/src/assets/config/recommended-args.txt +7 -0
  10. minecraftdockercli-0.10.0/src/assets/docker/minecraft.Dockerfile +21 -0
  11. minecraftdockercli-0.10.0/src/assets/docker/minecraft.dockerignore +37 -0
  12. minecraftdockercli-0.10.0/src/assets/docker/node.Dockerfile +21 -0
  13. minecraftdockercli-0.10.0/src/assets/docker/node.dockerignore +28 -0
  14. minecraftdockercli-0.10.0/src/assets/docker/python.Dockerfile +36 -0
  15. minecraftdockercli-0.10.0/src/assets/docker/python.dockerignore +23 -0
  16. minecraftdockercli-0.10.0/src/assets/scripts/run.sh +32 -0
  17. minecraftdockercli-0.10.0/src/assets/templates/.env.j2 +11 -0
  18. minecraftdockercli-0.10.0/src/assets/templates/docker-compose.yml.j2 +86 -0
  19. minecraftdockercli-0.10.0/src/assets/templates/template.json +55 -0
  20. minecraftdockercli-0.10.0/src/cli/__init__.py +0 -0
  21. minecraftdockercli-0.10.0/src/cli/builder.py +397 -0
  22. minecraftdockercli-0.10.0/src/cli/custom_group.py +82 -0
  23. minecraftdockercli-0.10.0/src/cli/manager.py +143 -0
  24. minecraftdockercli-0.10.0/src/cli/menu.py +380 -0
  25. minecraftdockercli-0.10.0/src/cli/param_types.py +108 -0
  26. minecraftdockercli-0.10.0/src/core/__init__.py +0 -0
  27. minecraftdockercli-0.10.0/src/core/docker.py +183 -0
  28. minecraftdockercli-0.10.0/src/core/downloader.py +89 -0
  29. minecraftdockercli-0.10.0/src/core/files.py +192 -0
  30. minecraftdockercli-0.10.0/src/utils/__init__.py +0 -0
  31. minecraftdockercli-0.10.0/src/utils/cli.py +52 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: MinecraftDockerCLI
3
+ Version: 0.10.0
4
+ Summary: CLI tool to enhance and simplify containerization of Minecraft servers
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: minecraft,docker,server
8
+ Author: Dtar380
9
+ Maintainer: Dtar380
10
+ Requires-Python: >=3.13,<4.0
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Other Audience
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Games/Entertainment
21
+ Classifier: Topic :: System :: Installation/Setup
22
+ Requires-Dist: click (>=8.3.0,<9.0.0)
23
+ Requires-Dist: importlib-resources (>=6.5.2,<7.0.0)
24
+ Requires-Dist: inquirerpy (>=0.3.4,<0.4.0)
25
+ Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
26
+ Requires-Dist: psutil (>=7.1.3,<8.0.0)
27
+ Requires-Dist: requests (>=2.32.5,<3.0.0)
28
+ Requires-Dist: yaspin (>=3.3.0,<4.0.0)
29
+ Project-URL: Bug Tracker, https://github.com/Dtar380/Minecraft-Dockerfile-CLI/issues
30
+ Project-URL: Documentation, https://minecraftdockercli.readthedocs.io/en/latest/
31
+ Project-URL: Homepage, https://github.com/dtar380/Minecraft-Dockerfile-CLI
32
+ Project-URL: Repository, https://github.com/dtar380/Minecraft-Dockerfile-CLI
33
+ Description-Content-Type: text/markdown
34
+
35
+ <!-- omit in toc -->
36
+ # MinecraftDockerCLI
37
+ <!-- omit in toc -->
38
+ ## Set up your Minecraft network blazingly fast
39
+
40
+ <div align="center">
41
+ <img alt="license" title="License" src="https://custom-icon-badges.demolab.com/github/license/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=law&logoColor=white&labelColor=1155BA&color=236AD3" height=30>
42
+ <img alt="stars" title="stars" src="https://custom-icon-badges.demolab.com/github/stars/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=star&logoColor=white&label=STARS&labelColor=9133D4&color=A444E0" height=30>
43
+ <img alt="downloads" title="downloads" src="https://img.shields.io/pypi/dm/MinecraftDockerCLI?style=for-the-badge&logo=download&logoColor=white&label=Downloads&labelColor=488207&color=55960C" height=30>
44
+ <img alt="Visitors" title="Visitors" src="https://viewcounterpython.onrender.com/Dtar380/MinecraftDockerCLI">
45
+ <img alt="open issues" title="open issues" src="https://custom-icon-badges.demolab.com/github/issues/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=issue-opened&logoColor=white&label=open%20issues&labelColor=CE4630&color=E05D44" height=30>
46
+ </div>
47
+
48
+ **MinecraftDockerCLI** is a python CLI application to allow minecraft server admins to set up in a fast and easy way a server or a network using docker containers.
49
+ **MinecraftDockerCLI** is orientated towards minecraft server admins that administrate networks, since a single server cannot fully use the advantages of Docker containers. Docker containers make minecraft networks easier and cleaner because of how docker containers work and intercomunicate on the same machine.
50
+
51
+ <!-- omit in toc -->
52
+ ## :bookmark_tabs: **Table of Contents**
53
+ - [:blue\_heart: **Main Feautures**](#blue_heart-main-feautures)
54
+ - [:arrow\_down: **Installation**](#arrow_down-installation)
55
+ - [:wrench: **Tips \& Troubleshooting**](#wrench-tips--troubleshooting)
56
+ - [:memo: **Working On**](#memo--working-on)
57
+ - [:open\_file\_folder: **Kown Issues**](#open_file_folder-kown-issues)
58
+ - [:scroll: **License**](#scroll-license)
59
+ - [:money\_with\_wings: **Sponsorship**](#money_with_wings-sponsorship)
60
+
61
+ ## :blue_heart: **Main Feautures**
62
+ - **Full Minecraft servers Containerization**
63
+ - **Prompt based data input**
64
+ - **Up/Down, Start/Stop docker commands implementation**
65
+ - **SQL database compatibility**
66
+ - **Web servers compatibility**
67
+ - **Backups for Minecraft Servers and Databases**
68
+
69
+ ## :arrow_down: **Installation**
70
+
71
+ **Prerequisites:**
72
+ - Docker Engine (Docker Desktop on Windows) running and configured.
73
+ - Docker Compose (bundled with modern Docker Desktop installations).
74
+ - Python 3.13+ and `pip`.
75
+
76
+ **Recommended Installation:**
77
+
78
+ ```shell
79
+ # Create a Virtual Environment
80
+ python3 -m venv .venv
81
+ .\.venv\Scripts\Activate.ps1
82
+
83
+ # Install the python package
84
+ pip install MinecraftDockerCLI
85
+ ```
86
+ <br>
87
+
88
+ **Clone repo:**
89
+
90
+ Extra requirement: `Poetry`.
91
+
92
+ ```shell
93
+ # Clone the repository
94
+ git clone https://github.com/Dtar380/Minecraft-Dockerfile-CLI.git
95
+ cd Minecraft-Dockerfile-CLI
96
+
97
+ poetry install
98
+ ```
99
+
100
+ > [!NOTE]
101
+ > When running the program you would need to be using the poetry environment and run it like `poetry run MinecraftDockerCLI`
102
+
103
+ ## :wrench: **Tips & Troubleshooting**
104
+ - Ensure Docker Desktop is running and you can run `docker ps` without errors before invoking the CLI.
105
+ - On Windows, run PowerShell as Administrator or ensure your user has permissions for Docker.
106
+ - If `data.json` is missing, run `builder create` first to scaffold services.
107
+
108
+ ## :memo: **Working On**
109
+ Currently resolving issues and developing the unit tests for future updates.
110
+
111
+ Already Planned releases
112
+ | VERSION | INCLUDES |
113
+ |---------|-------------------------------|
114
+ | 1.0.0 | First release (Do full tests) |
115
+
116
+ Feel free to open Feature Requests at [issues](https://github.com/Dtar380/WorkspaceAutomation/issues/new/choose).
117
+
118
+ ## :open_file_folder: **Kown Issues**
119
+ There is no known issues on the project, you can submit yours to [issues](https://github.com/Dtar380/MinecraftDockerCLI/issues/new/choose).
120
+
121
+ ## :scroll: **License**
122
+ This project is distributed under the MIT license.
123
+ See the [LICENSE](LICENSE).
124
+
125
+ ## :money_with_wings: **Sponsorship**
126
+ You can support me and the project with a donation to my Ko-Fi.
127
+
@@ -0,0 +1,92 @@
1
+ <!-- omit in toc -->
2
+ # MinecraftDockerCLI
3
+ <!-- omit in toc -->
4
+ ## Set up your Minecraft network blazingly fast
5
+
6
+ <div align="center">
7
+ <img alt="license" title="License" src="https://custom-icon-badges.demolab.com/github/license/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=law&logoColor=white&labelColor=1155BA&color=236AD3" height=30>
8
+ <img alt="stars" title="stars" src="https://custom-icon-badges.demolab.com/github/stars/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=star&logoColor=white&label=STARS&labelColor=9133D4&color=A444E0" height=30>
9
+ <img alt="downloads" title="downloads" src="https://img.shields.io/pypi/dm/MinecraftDockerCLI?style=for-the-badge&logo=download&logoColor=white&label=Downloads&labelColor=488207&color=55960C" height=30>
10
+ <img alt="Visitors" title="Visitors" src="https://viewcounterpython.onrender.com/Dtar380/MinecraftDockerCLI">
11
+ <img alt="open issues" title="open issues" src="https://custom-icon-badges.demolab.com/github/issues/Dtar380/MinecraftDockerCLI?style=for-the-badge&logo=issue-opened&logoColor=white&label=open%20issues&labelColor=CE4630&color=E05D44" height=30>
12
+ </div>
13
+
14
+ **MinecraftDockerCLI** is a python CLI application to allow minecraft server admins to set up in a fast and easy way a server or a network using docker containers.
15
+ **MinecraftDockerCLI** is orientated towards minecraft server admins that administrate networks, since a single server cannot fully use the advantages of Docker containers. Docker containers make minecraft networks easier and cleaner because of how docker containers work and intercomunicate on the same machine.
16
+
17
+ <!-- omit in toc -->
18
+ ## :bookmark_tabs: **Table of Contents**
19
+ - [:blue\_heart: **Main Feautures**](#blue_heart-main-feautures)
20
+ - [:arrow\_down: **Installation**](#arrow_down-installation)
21
+ - [:wrench: **Tips \& Troubleshooting**](#wrench-tips--troubleshooting)
22
+ - [:memo: **Working On**](#memo--working-on)
23
+ - [:open\_file\_folder: **Kown Issues**](#open_file_folder-kown-issues)
24
+ - [:scroll: **License**](#scroll-license)
25
+ - [:money\_with\_wings: **Sponsorship**](#money_with_wings-sponsorship)
26
+
27
+ ## :blue_heart: **Main Feautures**
28
+ - **Full Minecraft servers Containerization**
29
+ - **Prompt based data input**
30
+ - **Up/Down, Start/Stop docker commands implementation**
31
+ - **SQL database compatibility**
32
+ - **Web servers compatibility**
33
+ - **Backups for Minecraft Servers and Databases**
34
+
35
+ ## :arrow_down: **Installation**
36
+
37
+ **Prerequisites:**
38
+ - Docker Engine (Docker Desktop on Windows) running and configured.
39
+ - Docker Compose (bundled with modern Docker Desktop installations).
40
+ - Python 3.13+ and `pip`.
41
+
42
+ **Recommended Installation:**
43
+
44
+ ```shell
45
+ # Create a Virtual Environment
46
+ python3 -m venv .venv
47
+ .\.venv\Scripts\Activate.ps1
48
+
49
+ # Install the python package
50
+ pip install MinecraftDockerCLI
51
+ ```
52
+ <br>
53
+
54
+ **Clone repo:**
55
+
56
+ Extra requirement: `Poetry`.
57
+
58
+ ```shell
59
+ # Clone the repository
60
+ git clone https://github.com/Dtar380/Minecraft-Dockerfile-CLI.git
61
+ cd Minecraft-Dockerfile-CLI
62
+
63
+ poetry install
64
+ ```
65
+
66
+ > [!NOTE]
67
+ > When running the program you would need to be using the poetry environment and run it like `poetry run MinecraftDockerCLI`
68
+
69
+ ## :wrench: **Tips & Troubleshooting**
70
+ - Ensure Docker Desktop is running and you can run `docker ps` without errors before invoking the CLI.
71
+ - On Windows, run PowerShell as Administrator or ensure your user has permissions for Docker.
72
+ - If `data.json` is missing, run `builder create` first to scaffold services.
73
+
74
+ ## :memo: **Working On**
75
+ Currently resolving issues and developing the unit tests for future updates.
76
+
77
+ Already Planned releases
78
+ | VERSION | INCLUDES |
79
+ |---------|-------------------------------|
80
+ | 1.0.0 | First release (Do full tests) |
81
+
82
+ Feel free to open Feature Requests at [issues](https://github.com/Dtar380/WorkspaceAutomation/issues/new/choose).
83
+
84
+ ## :open_file_folder: **Kown Issues**
85
+ There is no known issues on the project, you can submit yours to [issues](https://github.com/Dtar380/MinecraftDockerCLI/issues/new/choose).
86
+
87
+ ## :scroll: **License**
88
+ This project is distributed under the MIT license.
89
+ See the [LICENSE](LICENSE).
90
+
91
+ ## :money_with_wings: **Sponsorship**
92
+ You can support me and the project with a donation to my Ko-Fi.
@@ -0,0 +1,242 @@
1
+ [build-system]
2
+ requires = ["poetry-core"]
3
+ build-backend = "poetry.core.masonry.api"
4
+
5
+ [tool.poetry]
6
+ name = "MinecraftDockerCLI"
7
+ version = "0.10.0"
8
+ description = "CLI tool to enhance and simplify containerization of Minecraft servers"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ authors = ["Dtar380"]
12
+ maintainers = ["Dtar380"]
13
+ homepage = "https://github.com/dtar380/Minecraft-Dockerfile-CLI"
14
+ documentation = "https://minecraftdockercli.readthedocs.io/en/latest/"
15
+ repository = "https://github.com/dtar380/Minecraft-Dockerfile-CLI"
16
+ keywords = ["minecraft", "docker", "server"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Intended Audience :: System Administrators",
20
+ "Intended Audience :: Developers",
21
+ "Intended Audience :: Other Audience",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Environment :: Console",
25
+ "Topic :: Games/Entertainment",
26
+ "Topic :: System :: Installation/Setup"
27
+ ]
28
+ packages = [{ include = "src" }]
29
+
30
+ [tool.poetry.urls]
31
+ "Homepage" = "https://github.com/dtar380/Minecraft-Dockerfile-CLI"
32
+ "Documentation" = "https://minecraftdockercli.readthedocs.io/en/latest/"
33
+ "Repository" = "https://github.com/dtar380/Minecraft-Dockerfile-CLI"
34
+ "Bug Tracker" = "https://github.com/Dtar380/Minecraft-Dockerfile-CLI/issues"
35
+
36
+ [tool.poetry.dependencies]
37
+ python = "^3.13"
38
+ jinja2 = "^3.1.6"
39
+ inquirerpy = "^0.3.4"
40
+ yaspin = "^3.3.0"
41
+ click = "^8.3.0"
42
+ psutil = "^7.1.3"
43
+ importlib-resources = "^6.5.2"
44
+ requests = "^2.32.5"
45
+
46
+ [tool.poetry.group.dev.dependencies]
47
+ black = "^25.9.0"
48
+ mypy = "^1.18.2"
49
+ isort = "^7.0.0"
50
+ pre-commit = "^4.3.0"
51
+ flake8 = "^7.3.0"
52
+ flake8-pyproject = "^1.2.3"
53
+ poethepoet = "^0.37.0"
54
+
55
+ [tool.poetry.group.test.dependencies]
56
+ pytest = "^8.4.2"
57
+ pytest-cov = "^7.0.0"
58
+ pytest-modern = "^0.7.4"
59
+ rich = "^14.2.0"
60
+ pytest-socket = "^0.7.0"
61
+
62
+ [tool.poetry.group.docs.dependencies]
63
+ sphinx = "^8.2.3"
64
+ furo = "^2025.9.25"
65
+ myst-parser = "^4.0.1"
66
+
67
+ [tool.poetry.scripts]
68
+ MinecraftDockerCLI = "src.__main__:main"
69
+
70
+ # Tareas de desarrollo con poethepoet
71
+ [tool.poe.tasks]
72
+ # Sphinx docs
73
+ server = "python -m http.server --directory ./docs/build/html"
74
+ make-docs = "docs/make.bat html"
75
+
76
+ # Configuración para herramientas de desarrollo
77
+ [tool.black]
78
+ line-length = 80
79
+ target-version = ["py313"]
80
+ skip-string-normalization = false
81
+ skip-magic-trailing-comma = false
82
+ include = '\.pyi?$'
83
+ extend-exclude = '''
84
+ /(
85
+ # Directorios generados
86
+ \.eggs
87
+ | \.git
88
+ | \.hg
89
+ | \.mypy_cache
90
+ | \.tox
91
+ | \.venv
92
+ | \.pytest_cache
93
+ | build
94
+ | dist
95
+ | migrations # Archivos de migración de DB
96
+ | __pycache__
97
+ )/
98
+ '''
99
+
100
+ [tool.isort]
101
+ profile = "black"
102
+ line_length = 80
103
+ multi_line_output = 3
104
+ ensure_newline_before_comments = true
105
+
106
+ known_first_party = ["APP"]
107
+
108
+ known_third_party = [
109
+ "fastapi",
110
+ "uvicorn",
111
+ "sqlmodel",
112
+ "pydantic",
113
+ "yfinance",
114
+ "jinja2"
115
+ ]
116
+
117
+ extra_standard_library = ["typing_extensions"]
118
+
119
+ sections = [
120
+ "FUTURE", # from __future__ import
121
+ "STDLIB", # import os, sys
122
+ "THIRDPARTY", # import fastapi
123
+ "FIRSTPARTY", # import APP
124
+ "LOCALFOLDER" # from . import
125
+ ]
126
+
127
+ force_single_line = false
128
+ force_sort_within_sections = true
129
+
130
+ add_imports = [
131
+ "from __future__ import annotations"
132
+ ]
133
+
134
+ skip_glob = [
135
+ "*/migrations/*",
136
+ "*/__pycache__/*",
137
+ "*/venv/*"
138
+ ]
139
+
140
+ [tool.mypy]
141
+ python_version = "3.13"
142
+
143
+ # === CONFIGURACIONES ESTRICTAS ===
144
+ # Requerir anotaciones de tipos
145
+ disallow_untyped_defs = true
146
+ disallow_incomplete_defs = true
147
+ disallow_untyped_decorators = true
148
+
149
+ # Verificar llamadas a funciones sin tipos
150
+ check_untyped_defs = true
151
+
152
+ # No permitir Any implícito
153
+ no_implicit_optional = true
154
+ disallow_any_unimported = true
155
+ disallow_any_expr = false
156
+ disallow_any_decorated = false
157
+ disallow_any_explicit = false
158
+ disallow_any_generics = true
159
+ disallow_subclassing_any = true
160
+
161
+ # === ADVERTENCIAS ===
162
+ warn_return_any = true
163
+ warn_unused_configs = true
164
+ warn_redundant_casts = true
165
+ warn_unused_ignores = false
166
+ warn_no_return = true
167
+ warn_unreachable = true
168
+
169
+ # === VERIFICACIONES ADICIONALES ===
170
+ strict_equality = true
171
+ strict_optional = true
172
+
173
+ # === CONFIGURACIÓN DE ERRORES ===
174
+ show_error_codes = true
175
+ show_column_numbers = true
176
+ show_error_context = true
177
+ color_output = true
178
+ error_summary = true
179
+
180
+ # === PATHS Y ARCHIVOS ===
181
+ mypy_path = ["APP"]
182
+ namespace_packages = true
183
+ exclude = [
184
+ "tests/",
185
+ "migrations/",
186
+ "venv/",
187
+ "__pycache__/"
188
+ ]
189
+
190
+ [[tool.mypy.overrides]]
191
+ module = [
192
+ "yfinance.*",
193
+ "fastapi_mail.*",
194
+ "dotenv.*",
195
+ "sqlmodel.*",
196
+ "pydantic.*"
197
+ ]
198
+ ignore_missing_imports = true
199
+
200
+ [tool.flake8]
201
+ max-line-length = 80
202
+ extend-ignore = ["E203","E501","E701","E266","F403","F405","B008","F401", "B010"]
203
+ exclude = [
204
+ ".eggs",
205
+ ".git",
206
+ ".hg",
207
+ ".mypy_cache",
208
+ ".tox",
209
+ ".venv",
210
+ ".pytest_cache",
211
+ "build",
212
+ "dist",
213
+ "migrations",
214
+ "__pycache__"
215
+ ]
216
+
217
+ [tool.pytest.ini_options]
218
+ filterwarnings = ["ignore::UserWarning"]
219
+ testpaths = ["tests"]
220
+ python_files = ["test_*.py", "*_test.py"]
221
+ python_classes = ["Test*"]
222
+ python_functions = ["test_*"]
223
+ addopts = [
224
+ "-q",
225
+ "--color=yes",
226
+ "--strict-markers",
227
+ "--strict-config",
228
+ "--disable-socket"
229
+ ]
230
+ markers = [
231
+ "slow: marks tests as slow",
232
+ "integration: marks tests as integration tests",
233
+ "unit: marks tests as unit tests",
234
+ ]
235
+
236
+ [tool.coverage.run]
237
+ source = ["src"]
238
+ omit = [
239
+ "**/tests/**",
240
+ "**/venv/**",
241
+ "**/__pycache__/**"
242
+ ]
@@ -0,0 +1,6 @@
1
+ from __future__ import annotations
2
+
3
+ from .__main__ import *
4
+
5
+ __version__ = "0.10.0"
6
+ __name__ = "MinecraftDockerCLI"
@@ -0,0 +1,96 @@
1
+ #################################################
2
+ # IMPORTS
3
+ #################################################
4
+ from __future__ import annotations
5
+
6
+ from click import Context, Group, group, option
7
+ from click.formatting import HelpFormatter
8
+
9
+ from .cli.builder import Builder
10
+ from .cli.manager import Manager
11
+ from .utils import cli as cli_utils
12
+
13
+
14
+ #################################################
15
+ # CODE
16
+ #################################################
17
+ class TopGroup(Group):
18
+
19
+ def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None:
20
+ # Build a mapping source -> list[(name, help)]
21
+ sections: dict[str, list[tuple[str, str]]] = {}
22
+ for cmd_name in self.list_commands(ctx):
23
+ cmd = self.get_command(ctx, cmd_name)
24
+ if cmd is None:
25
+ continue
26
+ source = getattr(cmd, "source", "Other")
27
+ sections.setdefault(source, []).append(
28
+ (cmd_name, cmd.get_short_help_str())
29
+ )
30
+
31
+ # Write sections in a stable order (Builder, Manager, Other)
32
+ order = ["Builder", "Manager"] + [
33
+ s for s in sections.keys() if s not in ("Builder", "Manager")
34
+ ]
35
+ written_any = False
36
+ for sec in order:
37
+ entries = sections.get(sec)
38
+ if not entries:
39
+ continue
40
+ written_any = True
41
+ with formatter.section(sec):
42
+ formatter.write_dl(entries)
43
+
44
+ if not written_any:
45
+ # Fallback to default behaviour
46
+ super().format_commands(ctx, formatter)
47
+
48
+
49
+ # Create the main group for the CLI using custom Group class
50
+ @option(
51
+ "-v",
52
+ "--verbose",
53
+ is_flag=True,
54
+ default=False,
55
+ help="Enable verbose output (avoid clears).",
56
+ )
57
+ @option(
58
+ "-y",
59
+ "--no-confirm",
60
+ "no_confirm",
61
+ is_flag=True,
62
+ default=False,
63
+ help="Do not ask for confirmations (assume yes).",
64
+ )
65
+ @group(cls=TopGroup)
66
+ def cli(verbose: bool = False, no_confirm: bool = False) -> None:
67
+ # Apply global CLI flags to utility helpers
68
+ try:
69
+ cli_utils.set_verbose(verbose)
70
+ cli_utils.set_no_confirm(no_confirm)
71
+ except Exception:
72
+ # If utils cannot be imported for some reason, continue silently
73
+ pass
74
+
75
+
76
+ # Add the two command groups
77
+ builder = Builder()
78
+ manager = Manager()
79
+
80
+ for cmd in builder.commands.values():
81
+ # annotate source so TopGroup can display grouped help
82
+ setattr(cmd, "source", "Builder")
83
+ cli.add_command(cmd)
84
+ for cmd in manager.commands.values():
85
+ setattr(cmd, "source", "Manager")
86
+ cli.add_command(cmd)
87
+
88
+
89
+ # Create the main entry point
90
+ def main() -> None:
91
+ cli()
92
+
93
+
94
+ # Execute the program
95
+ if __name__ == "__main__":
96
+ main()
@@ -0,0 +1,45 @@
1
+ __ __ _____ _ _ ______ _____ _____ ______ _______ _____ ____ _____ _ ________ _____ _____ _ _____
2
+ | \/ |_ _| \ | | ____/ ____| __ \ /\ | ____|__ __| | __ \ / __ \ / ____| |/ / ____| __ \ / ____| | |_ _|
3
+ | \ / | | | | \| | |__ | | | |__) | / \ | |__ | | | | | | | | | | | ' /| |__ | |__) | | | | | | |
4
+ | |\/| | | | | . ` | __|| | | _ / / /\ \ | __| | | | | | | | | | | | < | __| | _ / | | | | | |
5
+ | | | |_| |_| |\ | |___| |____| | \ \ / ____ \| | | | | |__| | |__| | |____| . \| |____| | \ \ | |____| |____ _| |_
6
+ |_| |_|_____|_| \_|______\_____|_| \_\/_/ \_\_| |_| |_____/ \____/ \_____|_|\_\______|_| \_\ \_____|______|_____|
7
+
8
+ **READ BEFORE USING THE APP.**
9
+
10
+ # START
11
+ If this file is in your Current Working Directory (CWD), it means your files built correctly, you should still check if your project has the following structure:
12
+ +---docker-compose.yml
13
+ +---README.md
14
+ +---data.json
15
+ \---backup
16
+ \---servers
17
+ | \---`server name`
18
+ | +---.env
19
+ | +---.dockerignore
20
+ | +---Dockerfile
21
+ | +---run.sh
22
+ | \---data
23
+ | +---eula.txt
24
+ | +---`.jar` file
25
+ \---web
26
+ \---backend
27
+ | +---.dockerignore
28
+ | +---Dockerfile
29
+ \---frontend
30
+ +---.dockerignore
31
+ +---Dockerfile
32
+
33
+ # Minecraft Configs
34
+ If you didnt setup a network, you will have a one and only container, you can always configure it running it on your host inside the data folder, and then up the container once you finished configuring
35
+
36
+ If you setup creating a network you need to know the following things:
37
+ - The proxy will be done inside the velocity config like this:<br>
38
+ `{server_name} = {service_name}:port`<br>
39
+ Where:
40
+ - server_name: is anything you want.
41
+ - service_name: is the docker container service name.
42
+ - port: is the minecraft port you exposed on the container.
43
+ - To connect a database you will set it up like: `database:5432`
44
+ - Your host machine should have forwarded the port you added to your proxy.
45
+ - To connect to the server you will need to use the public IP of the host and the port you assigned to your proxy.
@@ -0,0 +1 @@
1
+ eula=true
@@ -0,0 +1,7 @@
1
+ -XX:+UseG1GC
2
+ -XX:+ParallelRefProcEnabled
3
+ -XX:+AlwaysPreTouch
4
+ -XX:+DisableExplicitGC
5
+ -XX:+PerfDisableSharedMem
6
+ -XX:MaxGCPauseMillis=200
7
+ -XX:InitiatingHeapOccupancyPercent=15
@@ -0,0 +1,21 @@
1
+ FROM eclipse-temurin:21-jre-alpine
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ bash \
5
+ vim \
6
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR $SERVER_DIR
9
+ COPY ./data .
10
+
11
+ COPY run.sh /usr/local/bin/run.sh
12
+ RUN chmod +x /usr/local/bin/run.sh
13
+
14
+ RUN useradd --create-home serverUser
15
+ USER serverUser
16
+
17
+ SHELL ["/bin/bash", "-c"]
18
+ CMD ["/bin/bash"]
19
+ RUN chsh -s /bin/bash serverUser
20
+
21
+ ENTRYPOINT ["/usr/local/bin/run.sh"]