mcserver-cli 3.0.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.
- mcserver_cli-3.0.0/.gitignore +5 -0
- mcserver_cli-3.0.0/CHANGELOG.md +211 -0
- mcserver_cli-3.0.0/LICENSE +9 -0
- mcserver_cli-3.0.0/NOTES.txt +270 -0
- mcserver_cli-3.0.0/PKG-INFO +63 -0
- mcserver_cli-3.0.0/README.md +49 -0
- mcserver_cli-3.0.0/mcserver_search.txt +20 -0
- mcserver_cli-3.0.0/mcserver_test.py +23 -0
- mcserver_cli-3.0.0/pyproject.toml +33 -0
- mcserver_cli-3.0.0/src/__main__.py +3 -0
- mcserver_cli-3.0.0/src/mcserver/__init__.py +1 -0
- mcserver_cli-3.0.0/src/mcserver/__main__.py +3 -0
- mcserver_cli-3.0.0/src/mcserver/app.py +24 -0
- mcserver_cli-3.0.0/src/mcserver/caching.py +0 -0
- mcserver_cli-3.0.0/src/mcserver/cli.py +326 -0
- mcserver_cli-3.0.0/src/mcserver/commands/__init__.py +39 -0
- mcserver_cli-3.0.0/src/mcserver/commands/add_projects.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/import_setup.py +6 -0
- mcserver_cli-3.0.0/src/mcserver/commands/initialize_server.py +119 -0
- mcserver_cli-3.0.0/src/mcserver/commands/list_projects.py +6 -0
- mcserver_cli-3.0.0/src/mcserver/commands/op_grant.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/op_list.py +32 -0
- mcserver_cli-3.0.0/src/mcserver/commands/op_revoke.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/print_help.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/remove_projects.py +6 -0
- mcserver_cli-3.0.0/src/mcserver/commands/search_projects.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/server_status.py +6 -0
- mcserver_cli-3.0.0/src/mcserver/commands/show_projects.py +26 -0
- mcserver_cli-3.0.0/src/mcserver/commands/start_server.py +150 -0
- mcserver_cli-3.0.0/src/mcserver/commands/stop_server.py +46 -0
- mcserver_cli-3.0.0/src/mcserver/commands/update_projects.py +6 -0
- mcserver_cli-3.0.0/src/mcserver/commands/whitelist_add.py +7 -0
- mcserver_cli-3.0.0/src/mcserver/commands/whitelist_list.py +31 -0
- mcserver_cli-3.0.0/src/mcserver/commands/whitelist_remove.py +31 -0
- mcserver_cli-3.0.0/src/mcserver/commandsa.py +1297 -0
- mcserver_cli-3.0.0/src/mcserver/config.py +37 -0
- mcserver_cli-3.0.0/src/mcserver/constants.py +14 -0
- mcserver_cli-3.0.0/src/mcserver/fabricmc/meta.py +41 -0
- mcserver_cli-3.0.0/src/mcserver/legacyfabric/meta.py +37 -0
- mcserver_cli-3.0.0/src/mcserver/metadata.py +33 -0
- mcserver_cli-3.0.0/src/mcserver/minecraft/api.py +94 -0
- mcserver_cli-3.0.0/src/mcserver/minecraft/player_identity.py +21 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/api.py +657 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/modpack.py +101 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/metadata.py +0 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/relationships.py +203 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/shared.py +9 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/projects.py +80 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/shared.py +13 -0
- mcserver_cli-3.0.0/src/mcserver/modrinth/slug_index.py +36 -0
- mcserver_cli-3.0.0/src/mcserver/mojang/eula.py +28 -0
- mcserver_cli-3.0.0/src/mcserver/mojang/manifest.py +69 -0
- mcserver_cli-3.0.0/src/mcserver/mysterious.py +5 -0
- mcserver_cli-3.0.0/src/mcserver/networking.py +152 -0
- mcserver_cli-3.0.0/src/mcserver/papermc/api.py +81 -0
- mcserver_cli-3.0.0/src/mcserver/purpurmc/api.py +81 -0
- mcserver_cli-3.0.0/src/mcserver/quiltmc/meta.py +54 -0
- mcserver_cli-3.0.0/src/mcserver/resolver.py +164 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/banned_ips.py +120 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/banned_players.py +166 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/ops.py +143 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/properties.py +41 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/usercaches.py +0 -0
- mcserver_cli-3.0.0/src/mcserver/server_files/whitelist.py +163 -0
- mcserver_cli-3.0.0/src/mcserver/shared.py +198 -0
- mcserver_cli-3.0.0/src/mcserver/state.py +77 -0
- mcserver_cli-3.0.0/zip_app.py +39 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Paper and Purpur as server software
|
|
13
|
+
- Metadata to keep information of what version of MCServer is used
|
|
14
|
+
- State to keep information of a running MCServer to avoid conflict
|
|
15
|
+
|
|
16
|
+
## [2.0.0] - 2026-06-14
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Separate the project index data to metadata and relationship
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fetching list of ids when it is not needed
|
|
25
|
+
|
|
26
|
+
## [1.13.16] - 2026-06-11
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- An unknown bug
|
|
31
|
+
|
|
32
|
+
## [1.13.15] - 2026-06-11
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Error class when there's no file in a project version
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- The slug_to_id function to use existing format
|
|
41
|
+
- The Mdorinth API base to use https instead of http
|
|
42
|
+
|
|
43
|
+
### Removed
|
|
44
|
+
|
|
45
|
+
- Unused error class
|
|
46
|
+
|
|
47
|
+
## [1.13.14] - 2026-06-11
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- Revert code changes
|
|
52
|
+
|
|
53
|
+
## [1.13.13] - 2026-06-11
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- Code
|
|
58
|
+
|
|
59
|
+
## [1.13.12] - 2026-06-05
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- Refactor some code
|
|
64
|
+
|
|
65
|
+
## [1.13.11] - 2026-05-29
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Code structure to be modula with zipapp
|
|
70
|
+
- Rename project index directory to `project_indexes`
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
|
|
74
|
+
- Error class name inconsistency
|
|
75
|
+
|
|
76
|
+
## [1.13.10] - 2026-05-16
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- Missing `mods` directory when adding mod
|
|
81
|
+
- Crash when using `--no-filter` option on `search`
|
|
82
|
+
- Invalid code in an error
|
|
83
|
+
|
|
84
|
+
## [1.13.9] - 2026-05-11
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- Error message for adding projects that doesn't have version for current server
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- Error when adding project (invalid value)
|
|
93
|
+
|
|
94
|
+
## [1.13.8] - 2026-04-29
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
- Revert Modrinth API base URL
|
|
99
|
+
|
|
100
|
+
## [1.13.7] - 2026-04-29
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
|
|
104
|
+
- Code type hinting
|
|
105
|
+
- `fetch_project_versions` is more close to Mdorinth docs
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- The width of the wrapped text always be 80, now it is terminal width
|
|
110
|
+
|
|
111
|
+
## [1.13.6] - 2026-04-27
|
|
112
|
+
|
|
113
|
+
### Added
|
|
114
|
+
|
|
115
|
+
- Check to make sure only adding slug -> id for required and incompatible only
|
|
116
|
+
|
|
117
|
+
### Changed
|
|
118
|
+
|
|
119
|
+
- Some commands description in help
|
|
120
|
+
|
|
121
|
+
### Fixed
|
|
122
|
+
|
|
123
|
+
- Remove unused data in an error message
|
|
124
|
+
|
|
125
|
+
## [1.13.5] - 2026-04-25
|
|
126
|
+
|
|
127
|
+
### Fixed
|
|
128
|
+
|
|
129
|
+
- Crash when searching project in a vanilla/no config setup
|
|
130
|
+
|
|
131
|
+
## [1.13.4] - 2026-04-25
|
|
132
|
+
|
|
133
|
+
### Fixed
|
|
134
|
+
|
|
135
|
+
- Why so many bug fixes?
|
|
136
|
+
|
|
137
|
+
## [1.13.3] - 2026-04-25
|
|
138
|
+
|
|
139
|
+
### Fixed
|
|
140
|
+
|
|
141
|
+
- The previous bug again
|
|
142
|
+
|
|
143
|
+
## [1.13.2] - 2026-04-25
|
|
144
|
+
|
|
145
|
+
### Fixed
|
|
146
|
+
|
|
147
|
+
- Error name not reflecting changes
|
|
148
|
+
|
|
149
|
+
## [1.13.1] - 2026-04-25
|
|
150
|
+
|
|
151
|
+
### Fixed
|
|
152
|
+
|
|
153
|
+
- It now doesn't try to make mods/ or projects/ directory for "vanilla" server
|
|
154
|
+
|
|
155
|
+
## [1.13.0] - 2026-04-24
|
|
156
|
+
|
|
157
|
+
### Added
|
|
158
|
+
|
|
159
|
+
- Preparing to support plugins
|
|
160
|
+
- Slug to ID cache, reducing API call
|
|
161
|
+
|
|
162
|
+
### Changed
|
|
163
|
+
|
|
164
|
+
- EULA agreement sentence
|
|
165
|
+
- Improved confirmation prompt
|
|
166
|
+
|
|
167
|
+
## [1.12.2] - 2026-04-14
|
|
168
|
+
|
|
169
|
+
### Fixed
|
|
170
|
+
|
|
171
|
+
- Revert Modrinth API URL back to normal
|
|
172
|
+
|
|
173
|
+
## [1.12.1] - 2026-04-14
|
|
174
|
+
|
|
175
|
+
### Added
|
|
176
|
+
|
|
177
|
+
- Create `mods_index` directory when running `init`
|
|
178
|
+
|
|
179
|
+
## [1.12.0] - 2026-04-14
|
|
180
|
+
|
|
181
|
+
### Added
|
|
182
|
+
|
|
183
|
+
- Mod indexing functionality
|
|
184
|
+
|
|
185
|
+
### Changed
|
|
186
|
+
|
|
187
|
+
- Better mod conflict error
|
|
188
|
+
- Faster mod resolving
|
|
189
|
+
|
|
190
|
+
[unreleased]: https://github.com/Othecat35/MCServer/compare/v2.0.0...HEAD
|
|
191
|
+
[2.0.0]: https://github.com/Othecat35/MCServer/compare/v1.13.16...v2.0.0
|
|
192
|
+
[1.13.16]: https://github.com/Othecat35/MCServer/compare/v1.13.15...v1.13.16
|
|
193
|
+
[1.13.15]: https://github.com/Othecat35/MCServer/compare/v1.13.14...v1.13.15
|
|
194
|
+
[1.13.14]: https://github.com/Othecat35/MCServer/compare/v1.13.13...v1.13.14
|
|
195
|
+
[1.13.13]: https://github.com/Othecat35/MCServer/compare/v1.13.12...v1.13.13
|
|
196
|
+
[1.13.12]: https://github.com/Othecat35/MCServer/compare/v1.13.11...v1.13.12
|
|
197
|
+
[1.13.11]: https://github.com/Othecat35/MCServer/compare/v1.13.10...v1.13.11
|
|
198
|
+
[1.13.10]: https://github.com/Othecat35/MCServer/compare/v1.13.9...v1.13.10
|
|
199
|
+
[1.13.9]: https://github.com/Othecat35/MCServer/compare/v1.13.8...v1.13.9
|
|
200
|
+
[1.13.8]: https://github.com/Othecat35/MCServer/compare/v1.13.7...v1.13.8
|
|
201
|
+
[1.13.7]: https://github.com/Othecat35/MCServer/compare/v1.13.6...v1.13.7
|
|
202
|
+
[1.13.6]: https://github.com/Othecat35/MCServer/compare/v1.13.5...v1.13.6
|
|
203
|
+
[1.13.5]: https://github.com/Othecat35/MCServer/compare/v1.13.4...v1.13.5
|
|
204
|
+
[1.13.4]: https://github.com/Othecat35/MCServer/compare/v1.13.3...v1.13.4
|
|
205
|
+
[1.13.3]: https://github.com/Othecat35/MCServer/compare/v1.13.2...v1.13.3
|
|
206
|
+
[1.13.2]: https://github.com/Othecat35/MCServer/compare/v1.13.1...v1.13.2
|
|
207
|
+
[1.13.1]: https://github.com/Othecat35/MCServer/compare/v1.13.0...v1.13.1
|
|
208
|
+
[1.13.0]: https://github.com/Othecat35/MCServer/compare/v1.12.2...v1.13.0
|
|
209
|
+
[1.12.2]: https://github.com/Othecat35/MCServer/compare/v1.12.1...v1.12.2
|
|
210
|
+
[1.12.1]: https://github.com/Othecat35/MCServer/compare/v1.12.0...v1.12.1
|
|
211
|
+
[1.12.0]: https://github.com/Othecat35/MCServer/compare/v1.11.8...v1.12.0
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Othecat35
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
A file where I dumped ideas for this project.
|
|
2
|
+
|
|
3
|
+
CLI Commands:
|
|
4
|
+
- Add `init` and `install`
|
|
5
|
+
`init` is used initialize the ".mcserver" directory and its configurations.
|
|
6
|
+
And `install` is used to install and setup the Minecraft server with the configuration inside ".mcserver".
|
|
7
|
+
|
|
8
|
+
Mod Management:
|
|
9
|
+
- Add mod search command with Modrinth: Done!
|
|
10
|
+
- Mod search with key=value. eg, mcserver search lithium limit=20: using flag
|
|
11
|
+
|
|
12
|
+
Miscellaneous
|
|
13
|
+
- Rename "ram" to "memory"? Only in script
|
|
14
|
+
- Shrink the project scope first: Yep!
|
|
15
|
+
|
|
16
|
+
new things
|
|
17
|
+
- Create config generator and loader: Done
|
|
18
|
+
- Make the search_mod limit based in modrinth configuration file: Done
|
|
19
|
+
|
|
20
|
+
Here's where I can yap about something
|
|
21
|
+
- CHANGELOGS.md is primarily for myself?
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Semantic Versioning (MAJOR.Minor.patch):
|
|
26
|
+
- MAJOR: When you make incompatible API changes
|
|
27
|
+
- Minor: When you add functionality that is backward compatible
|
|
28
|
+
- patch: When you make bug fixes
|
|
29
|
+
|
|
30
|
+
The "v" Version Prefix:
|
|
31
|
+
- Use in:
|
|
32
|
+
- Git Tag
|
|
33
|
+
- Github Release
|
|
34
|
+
- `mcserver --version`
|
|
35
|
+
- User Agent
|
|
36
|
+
- (Basically everything that a user will see)
|
|
37
|
+
- Don't use in:
|
|
38
|
+
- Internal script version (`__version__`)
|
|
39
|
+
- Changelog header
|
|
40
|
+
- (Basically everything that is internal about the project)
|
|
41
|
+
|
|
42
|
+
Changelog Structure (Examples): ---
|
|
43
|
+
|
|
44
|
+
# Changelog
|
|
45
|
+
|
|
46
|
+
All notable changes to this project will be documented in this file.
|
|
47
|
+
|
|
48
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
49
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
50
|
+
|
|
51
|
+
## [Unreleased]
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- Mod indexing
|
|
56
|
+
|
|
57
|
+
### Removed
|
|
58
|
+
|
|
59
|
+
- The whole project
|
|
60
|
+
|
|
61
|
+
## [<semver>] - <date(YYYY-MM-DD)>
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- New command `D`
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Command `A` now print `Hello, world!`
|
|
70
|
+
|
|
71
|
+
### Deprecating
|
|
72
|
+
|
|
73
|
+
- Removing command `C`
|
|
74
|
+
|
|
75
|
+
### Removed
|
|
76
|
+
|
|
77
|
+
- Command `B`
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- Bug where the script stuck in an infinite loop
|
|
82
|
+
|
|
83
|
+
### Security
|
|
84
|
+
|
|
85
|
+
- Fix auth bug
|
|
86
|
+
|
|
87
|
+
## [0.0.0] - 2026-06-08
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
|
|
91
|
+
- This example
|
|
92
|
+
|
|
93
|
+
[unreleased]: https://github.com/<username/<repo>/compare/<latest_tag>...HEAD
|
|
94
|
+
[<semvar>]: https://github.com/<username>/<repo>/compare/<prev_tag>...<tag>
|
|
95
|
+
[0.1.0]: https://github.com/<username>/<repo>/releases/tag/v0.1.0
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
make it nicer (imposible)
|
|
100
|
+
#- what am I doing making this project? my school has nothing to do with it. Me being self-deprecating and having Impostor Syndrome while coding is apparently normal? how? #TODO: comment-out this line
|
|
101
|
+
#paper? later. I mean it is close to being worked on ;)
|
|
102
|
+
#progress bar: whats that
|
|
103
|
+
warn client only mod because as the name suggest, it is designed for server! client already have too much attention ;/
|
|
104
|
+
#fabric installer, be dynamic (but sadly coding is not that magical that I can command the computer easily :insert_smile_with_tears_emoji:)
|
|
105
|
+
add init options for search because I felt like it: future/present me here. I, in fact, don't actually felt like it.
|
|
106
|
+
Lol the data-driven backup >:(
|
|
107
|
+
#pid lock I guess, what? .mcserver/.lock
|
|
108
|
+
be a good API citizen and implement ratelimit check >:)
|
|
109
|
+
auto download sometimes, when there's no optional or incompatible mods, or the size is "reasonable": what are you talking about?
|
|
110
|
+
haha, the scope will grow even more when you implement that rdepends >:)
|
|
111
|
+
oh hell nah, I already implemented that rdepends? how so quick? I have AI as helper, if you know rubberducking, that is exactly what I'm doing! not vibecoding I swear.
|
|
112
|
+
#Before that, fix my data migration logic first to make every single entry uses id as the key and don't leave any slug left! done, lol
|
|
113
|
+
After that, also implement a conflict check pls, like if you request this mod and that mod, and they met as "incompatible", whatever. you are kinda responsible for that, not really but nice to have, and make yourself comoareable to Prism >:). by "you" I mean myself. there, pls update your mcserver
|
|
114
|
+
#And then? hahaha, the hole of the rabbithole for dependency resolution didn't end there, you have to index them. why? because I said so. nah jk, because we should know that we already have Fabric API installed so we don't redownload it again. wdym?
|
|
115
|
+
remove? list? update? clean? check? yep, btw clean means remove orphaned mods, and check? I guess that can be used to scan for any manual .jar added in mods/
|
|
116
|
+
now make any mod that are incompatible ripples down to the source, only stopped by an optional mod -_-, wait, why I'm bother to fetch optional mods? just make it required only! idk I'm in the middle of refactoring rn
|
|
117
|
+
You screwed up the add command lol, no I'm not >:c
|
|
118
|
+
mod indexing, don't forget! don't remind me the... 3rd time?
|
|
119
|
+
Gemini suggest adding "status" command and get ram usage info, sure but not now. oh good idea I guess
|
|
120
|
+
|
|
121
|
+
Things that MCServer can touch (In theory):
|
|
122
|
+
Server Root
|
|
123
|
+
- .mcserver/
|
|
124
|
+
- caches/
|
|
125
|
+
- modrinth/
|
|
126
|
+
- versions/
|
|
127
|
+
- <project_id>.json
|
|
128
|
+
- configs/
|
|
129
|
+
- launcher.json
|
|
130
|
+
- modrinth.json
|
|
131
|
+
- server.json
|
|
132
|
+
- modrinth/
|
|
133
|
+
- slug_index.json
|
|
134
|
+
- projects/
|
|
135
|
+
- <project_id>
|
|
136
|
+
- metadata.json
|
|
137
|
+
- relationships.json
|
|
138
|
+
- tempfiles/
|
|
139
|
+
- <file_hash>
|
|
140
|
+
- <url_hash> #if file hash does not exist, use hash from digesting the URL
|
|
141
|
+
- metadata.json
|
|
142
|
+
- state.json
|
|
143
|
+
- banned-ips.json
|
|
144
|
+
- banned-players.json
|
|
145
|
+
- eula.txt
|
|
146
|
+
- ops.json
|
|
147
|
+
- server.properties
|
|
148
|
+
- usercaches.json
|
|
149
|
+
- whitelist.json
|
|
150
|
+
- <jarfile_name>.jar
|
|
151
|
+
|
|
152
|
+
- A good error message for UX is one that not only tell you what went wrong, but also how to fix that error (or at least tell what caused the error) | Not like I'm interested right now...
|
|
153
|
+
- Consider to cache optional projects' bulk fetch data in resolved_projects even though we don't neccesearily process it?
|
|
154
|
+
- Delete cache if we don't install it (like dry run)
|
|
155
|
+
- Oh, back with zipapp huh... and I also have pyright now? cool
|
|
156
|
+
- You know what's cool? the ability to put 1.125M in the RAM config ofc. and also check if system RAM is even enough to run the server with the config.
|
|
157
|
+
- Make backup data-driven, meaning you can choose what ro get bsckup. and also option to rotate backup seems good for storage, deleting older backup for the new one.
|
|
158
|
+
- Hey, make every command function print with log.error and return as integer instead of raising error pls :>
|
|
159
|
+
- .mcserver/metadata.json and .mcserver/lock.json
|
|
160
|
+
- Warn projects that don't show up when `show`
|
|
161
|
+
- Actually, .mcserver/state.json (replacing lock.json) sounds better, and we can store pid_number, action, and created_time?
|
|
162
|
+
- The `show` command could show which Minecraft version are in common, pls future me >:). either in each mod's entry or at the end as sumarry of some sort.
|
|
163
|
+
- ChatGPT just told me about zipapp just now? Yes, it did.
|
|
164
|
+
|
|
165
|
+
I got an idea about the dependency resolution this small project (line 111)
|
|
166
|
+
So, instead of a big resolve_projects that do almost everything, why don't we just split them?
|
|
167
|
+
We can have a "data provider", function that when called will return the data that the resolver needs.
|
|
168
|
+
The "rule", or just the conflict checker -_-
|
|
169
|
+
And the BFS, the engine of the resolver.
|
|
170
|
+
probably like:
|
|
171
|
+
user: "request mod a"
|
|
172
|
+
resolve_dependencies: hey get_project_dependencies, what are the dependencies of mod a?
|
|
173
|
+
get_project_dependencies: mod b is required and mod c is required
|
|
174
|
+
resolve_dependencies: are mod b is somehow incompactible?
|
|
175
|
+
check_dependency_conflicts: no
|
|
176
|
+
resolve_dependencies: are mod c is somehow incompactible??
|
|
177
|
+
check_dependency_conflicts: no
|
|
178
|
+
resolve_dependencies: ok... what are dependencies of mod b?
|
|
179
|
+
(some dialogue later)
|
|
180
|
+
resolve_dependencies: ok, there's no more dependency. here you go "return the list of dependencies"
|
|
181
|
+
user: why are there 29 mods including dependencies 0_0
|
|
182
|
+
|
|
183
|
+
thx chatgpt but I can't prove it yet
|
|
184
|
+
|
|
185
|
+
- Merge install command functionallity to the start command [Done; 2026/07/03]
|
|
186
|
+
- Add import command to import .mrpack or future .mcserver
|
|
187
|
+
- Add export command
|
|
188
|
+
- Make the downloader:
|
|
189
|
+
- Continue from where it left of
|
|
190
|
+
- Internet speed from five seconds history
|
|
191
|
+
- ETA
|
|
192
|
+
- Make the status update each seconds instead of every packet recieved
|
|
193
|
+
- Please, somehow make the codebase morebmanageable ;-;
|
|
194
|
+
- Review codes, especially TypedDict, because why not
|
|
195
|
+
- Avoid making myself suffer in this project, potentially abandoning this cool project
|
|
196
|
+
- I hate CurseForge personally.
|
|
197
|
+
- And yet I still have no friend (to talk about my weird hobby of computer, including this)
|
|
198
|
+
- Add command such as 'whitelist add/remove/list', 'ban/unban/ban-list', and probably 'op/deop <player> <level>'
|
|
199
|
+
|
|
200
|
+
MCServer™ Naming Convention: (the Trademark is just a joke)
|
|
201
|
+
- is_*
|
|
202
|
+
The value is true or false
|
|
203
|
+
- Examples:
|
|
204
|
+
- is_featured
|
|
205
|
+
- is_primary
|
|
206
|
+
- filename
|
|
207
|
+
Full file name with extension
|
|
208
|
+
- file_path
|
|
209
|
+
The path of a file (relative to current working directory)
|
|
210
|
+
- download_url
|
|
211
|
+
URL that can be downloaded
|
|
212
|
+
- *_count
|
|
213
|
+
Return a number of something
|
|
214
|
+
- Examples:
|
|
215
|
+
- download_count
|
|
216
|
+
- follower_count
|
|
217
|
+
- file_size
|
|
218
|
+
The size of the file in byte
|
|
219
|
+
- file_hashes
|
|
220
|
+
A hash or multiple hashes of the file
|
|
221
|
+
- *_url:
|
|
222
|
+
Its an URL.
|
|
223
|
+
- The `get_`
|
|
224
|
+
|
|
225
|
+
- Fix the "get_players_from_names" in minecraft_api.py. you mean, adding Content-Type: application/json? nvm I fixed it the same day anyway.
|
|
226
|
+
|
|
227
|
+
pls Othecat35, stop using AI.
|
|
228
|
+
- Othecat35 (2026/07/16)
|
|
229
|
+
|
|
230
|
+
(sadly) I could break that promise any seconds
|
|
231
|
+
- Othecat35 (2026/07/16)
|
|
232
|
+
|
|
233
|
+
I definitely broke my promise. (oops)
|
|
234
|
+
- Othecat35 (2026/07/20)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
- Command like `mcserver config <set/get> <option>` and option probably just those options in init,
|
|
238
|
+
so "mc_version" can mean <server.json>.game_version.
|
|
239
|
+
- init command could take some sort of "target dir"
|
|
240
|
+
- make src/mcserver/modrinth/projects.py into a dir, ans inside it we have metadata.py and relationship.py
|
|
241
|
+
- flowchart TD
|
|
242
|
+
A[Did you fix a bug?]
|
|
243
|
+
A -- Yes --> B[It's fix]
|
|
244
|
+
A -- No --> C[Did you change functionality or affect UI?]
|
|
245
|
+
|
|
246
|
+
C -- Yes --> D[It's feat]
|
|
247
|
+
C -- No --> E[Did you add or change tests?]
|
|
248
|
+
|
|
249
|
+
E -- Yes --> F[It's test]
|
|
250
|
+
E -- No --> G[Did you change code style or formatting?]
|
|
251
|
+
|
|
252
|
+
G -- Yes --> H[It's style]
|
|
253
|
+
G -- No --> I[Did you make changes to documentation?]
|
|
254
|
+
|
|
255
|
+
I -- Yes --> J[It's docs]
|
|
256
|
+
I -- No --> K[Did you change things related to build or deploy operations?]
|
|
257
|
+
|
|
258
|
+
K -- Yes --> L[It's build]
|
|
259
|
+
K -- No --> M[Did you change something related to devops, infrastructure or backups?]
|
|
260
|
+
|
|
261
|
+
M -- Yes --> N[It's ops]
|
|
262
|
+
M -- No --> O[Did you complete a maintenance task or other non-code task?]
|
|
263
|
+
|
|
264
|
+
O -- Yes --> P[It's chore]
|
|
265
|
+
O -- No --> Q[Did you rewrite or restructure code specifically for performance?]
|
|
266
|
+
|
|
267
|
+
Q -- Yes --> R[It's perf]
|
|
268
|
+
Q -- No --> S[It's refactor]
|
|
269
|
+
- commit convention reference: https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13
|
|
270
|
+
- or more "official" looking: https://www.conventionalcommits.org/en/v1.0.0/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mcserver-cli
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: A CLI tool to manage Minecraft: Java Edition servers.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Othecat35/MCServer
|
|
6
|
+
Project-URL: Repository, https://github.com/Othecat35/MCServer.git
|
|
7
|
+
Project-URL: Changelog, https://github.com/Othecat35/MCServer/blob/main/CHANGELOG.md
|
|
8
|
+
Author-email: Othecat35 <othecat35@gmail.com>
|
|
9
|
+
Maintainer-email: Othecat35 <othecat35@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Python: >=3.14
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# MCServer
|
|
16
|
+
## About
|
|
17
|
+
A CLI tool to manage Minecraft: Java Edition servers.
|
|
18
|
+
|
|
19
|
+
## Platform
|
|
20
|
+
Supported platforms:
|
|
21
|
+
- Linux
|
|
22
|
+
- and Termux.
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
- Python 3.14 or newer
|
|
26
|
+
- JRE (depends on Minecraft version)
|
|
27
|
+
|
|
28
|
+
## How to install
|
|
29
|
+
- System-wide (Requires root):
|
|
30
|
+
1. Download the `mcserver` script file from GitHub releases
|
|
31
|
+
2. Move the file to `/usr/local/bin`
|
|
32
|
+
3. Run `chmod +x mcserver`
|
|
33
|
+
|
|
34
|
+
- Per-user:
|
|
35
|
+
1. Create a directory "bin"
|
|
36
|
+
2. Download the script from GitHub releases onto that directory
|
|
37
|
+
3. Give it "executable" permission with `chmod +x mcserver`
|
|
38
|
+
4. Add the directory in the PATH environment:
|
|
39
|
+
- Run `export PATH=$HOME/bin:$PATH` if you're using shell that is POSIX-compliant like Bash, Zsh, or ash
|
|
40
|
+
- Run `fish_add_path ~/bin` if you're using FISH
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
- Add mods (and its dependencies): `mcserver add <mods>`
|
|
44
|
+
- Import a modpack: `mcserver import [file]`
|
|
45
|
+
- Initialize the server: `mcserver init [options]`
|
|
46
|
+
- Manage operator status: `mcserver op`
|
|
47
|
+
- Search mods from Modrinth: `mcserver search [<query>] [options]`
|
|
48
|
+
- Show mod information from Modrinth: `mcserver show <mods>`
|
|
49
|
+
- Start the server: `mcserver start`
|
|
50
|
+
- Stop the server: `mcserver stop`
|
|
51
|
+
- Manage the whitelist: `mcserver whitelist`
|
|
52
|
+
|
|
53
|
+
### Example
|
|
54
|
+
```bash
|
|
55
|
+
mcserver init --mc-version=1.20.1 --loader=fabric --loader-version=0.19.3
|
|
56
|
+
mcserver search --no-filter thdilos
|
|
57
|
+
mcserver show thdilos-fox-origin thdilos-fox-origin-expanded
|
|
58
|
+
mcserver add thdilos-fox-origin-expanded lithium tick-stasis ferrite-core krypton
|
|
59
|
+
mcserver start
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Note
|
|
63
|
+
This is a **Personal Project**, things may be unstable.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# MCServer
|
|
2
|
+
## About
|
|
3
|
+
A CLI tool to manage Minecraft: Java Edition servers.
|
|
4
|
+
|
|
5
|
+
## Platform
|
|
6
|
+
Supported platforms:
|
|
7
|
+
- Linux
|
|
8
|
+
- and Termux.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
- Python 3.14 or newer
|
|
12
|
+
- JRE (depends on Minecraft version)
|
|
13
|
+
|
|
14
|
+
## How to install
|
|
15
|
+
- System-wide (Requires root):
|
|
16
|
+
1. Download the `mcserver` script file from GitHub releases
|
|
17
|
+
2. Move the file to `/usr/local/bin`
|
|
18
|
+
3. Run `chmod +x mcserver`
|
|
19
|
+
|
|
20
|
+
- Per-user:
|
|
21
|
+
1. Create a directory "bin"
|
|
22
|
+
2. Download the script from GitHub releases onto that directory
|
|
23
|
+
3. Give it "executable" permission with `chmod +x mcserver`
|
|
24
|
+
4. Add the directory in the PATH environment:
|
|
25
|
+
- Run `export PATH=$HOME/bin:$PATH` if you're using shell that is POSIX-compliant like Bash, Zsh, or ash
|
|
26
|
+
- Run `fish_add_path ~/bin` if you're using FISH
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
- Add mods (and its dependencies): `mcserver add <mods>`
|
|
30
|
+
- Import a modpack: `mcserver import [file]`
|
|
31
|
+
- Initialize the server: `mcserver init [options]`
|
|
32
|
+
- Manage operator status: `mcserver op`
|
|
33
|
+
- Search mods from Modrinth: `mcserver search [<query>] [options]`
|
|
34
|
+
- Show mod information from Modrinth: `mcserver show <mods>`
|
|
35
|
+
- Start the server: `mcserver start`
|
|
36
|
+
- Stop the server: `mcserver stop`
|
|
37
|
+
- Manage the whitelist: `mcserver whitelist`
|
|
38
|
+
|
|
39
|
+
### Example
|
|
40
|
+
```bash
|
|
41
|
+
mcserver init --mc-version=1.20.1 --loader=fabric --loader-version=0.19.3
|
|
42
|
+
mcserver search --no-filter thdilos
|
|
43
|
+
mcserver show thdilos-fox-origin thdilos-fox-origin-expanded
|
|
44
|
+
mcserver add thdilos-fox-origin-expanded lithium tick-stasis ferrite-core krypton
|
|
45
|
+
mcserver start
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Note
|
|
49
|
+
This is a **Personal Project**, things may be unstable.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
3652 socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
|
|
2
|
+
3652 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
|
|
3
|
+
3652 connect(3, {sa_family=AF_UNIX, sun_path="/dev/socket/dnsproxyd"}, 110) = 0
|
|
4
|
+
3652 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 3
|
|
5
|
+
3652 getsockopt(3, SOL_SOCKET, SO_DOMAIN, [10], [4]) = 0
|
|
6
|
+
3652 socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
|
|
7
|
+
3652 connect(4, {sa_family=AF_UNIX, sun_path="/dev/socket/fwmarkd"}, 110) = 0
|
|
8
|
+
3652 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=16}, {iov_base=NULL, iov_len=0}], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[3]}], msg_controllen=24, msg_flags=0}, 0) = 16
|
|
9
|
+
3652 recvfrom(4, "\0\0\0\0", 4, 0, NULL, NULL) = 4
|
|
10
|
+
3652 connect(3, {sa_family=AF_INET6, sin6_port=htons(443), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2606:4700::6812:1623", &sin6_addr), sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
|
|
11
|
+
3652 socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
|
|
12
|
+
3652 connect(4, {sa_family=AF_UNIX, sun_path="/dev/socket/fwmarkd"}, 110) = 0
|
|
13
|
+
3652 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=16}, {iov_base="s\0\0\0\0\0\0\0\n\0\1\273\0\0\0\0&\6G\0\0\0\0\0\0\0\0\0h\22\26#"..., iov_len=36}], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[3]}], msg_controllen=24, msg_flags=0}, 0) = 52
|
|
14
|
+
3652 recvfrom(4, "\0\0\0\0", 4, 0, NULL, NULL) = 4
|
|
15
|
+
3652 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
|
|
16
|
+
3652 setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
|
|
17
|
+
3652 getsockopt(3, SOL_SOCKET, SO_TYPE, [1], [4]) = 0
|
|
18
|
+
3652 getsockname(3, {sa_family=AF_INET6, sin6_port=htons(38360), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2402:5680:8094:f721:fe54:132e:a6a9:d724", &sin6_addr), sin6_scope_id=0}, [128 => 28]) = 0
|
|
19
|
+
3652 getpeername(3, {sa_family=AF_INET6, sin6_port=htons(443), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2606:4700::6812:1623", &sin6_addr), sin6_scope_id=0}, [28]) = 0
|
|
20
|
+
3652 +++ exited with 0 +++
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import subprocess
|
|
3
|
+
import tempfile
|
|
4
|
+
import unittest
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestMCServer(unittest.TestCase):
|
|
9
|
+
script_path = Path.cwd() / "mcserver"
|
|
10
|
+
|
|
11
|
+
def setUp(self):
|
|
12
|
+
self.temporary_directory = tempfile.TemporaryDirectory()
|
|
13
|
+
self.test_directory = Path(self.temporary_directory.name)
|
|
14
|
+
|
|
15
|
+
self.mcserver_path = self.test_directory / ".mcserver"
|
|
16
|
+
self.configs_path = self.mcserver_path / "configs"
|
|
17
|
+
|
|
18
|
+
def tearDown(self):
|
|
19
|
+
self.temporary_directory.cleanup()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
unittest.main()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mcserver-cli"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
dependencies = []
|
|
9
|
+
requires-python = ">= 3.14"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Othecat35", email = "othecat35@gmail.com"}
|
|
12
|
+
]
|
|
13
|
+
maintainers = [
|
|
14
|
+
{ name = "Othecat35", email = "othecat35@gmail.com"}
|
|
15
|
+
]
|
|
16
|
+
description = "A CLI tool to manage Minecraft: Java Edition servers."
|
|
17
|
+
readme = "README.md"
|
|
18
|
+
license = "MIT"
|
|
19
|
+
license-files = ["LICENSE"]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/Othecat35/MCServer"
|
|
23
|
+
Repository = "https://github.com/Othecat35/MCServer.git"
|
|
24
|
+
Changelog = "https://github.com/Othecat35/MCServer/blob/main/CHANGELOG.md"
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
mcserver = "mcserver:__main__"
|
|
28
|
+
|
|
29
|
+
[tool.hatch.build.targets.wheel]
|
|
30
|
+
packages = ["src/mcserver"]
|
|
31
|
+
|
|
32
|
+
[tool.hatch.version]
|
|
33
|
+
path = "src/mcserver/__init__.py"
|