- JavaScript 87.1%
- Rust 6.2%
- CSS 5.2%
- Python 0.6%
- Go Template 0.6%
- Other 0.2%
|
All checks were successful
Build push artifact / build (push) Successful in 1m3s
MariaDB 11.x renamed the mysql* client tools to mariadb*, so verify_seed's `docker compose exec mysql mysql ...` (and wipe's mysql/mysqladmin) fail inside an 11.x container -> setup panics on a false "seed verification failed" even though the prepare container actually seeded the DBs. Pin to 10.11 instead: still a supported LTS (not EOL like 10.9), same major as before, and keeps the mysql CLI the tooling depends on. Bumped the prepare image off 10.9 too. Claude-Session: https://claude.ai/code/session_01UEwLzzWrdgngMqCuu5iimB |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| templates | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
gio-tool
Scaffolds and manages Dockerized hk4e (Genshin Impact) private servers from version templates.
Experimental. You supply the server binaries, shared libraries and game data; this tool generates the configs, seeds the databases, generates RSA keys and wires up the Docker stack.
What it does
Given a version template (e.g. cb2test_live, 1.0_live, 3.2_dev), gio-tool:
- extracts the per-version configs plus a shared
globalscaffold (SDK server, muiptool, docker-compose) - substitutes your IP / ports / subnet / RSA keys into every config and SQL file
- initializes MariaDB (creates the databases + users and seeds the config tables)
- writes the dispatch + password RSA keypairs (PEM + XML) to
INFO/
It does not patch or launch the game client (use Cultivation for that), and it does not ship the server binaries or game data.
Requirements
- Docker + Docker Compose
- A Rust toolchain (to build)
- The server binaries, their
lib/shared objects, and the game data for your target version
Build
cargo build --release
# -> target/release/gio-tool
Commands
list
Show the available version templates.
gio-tool list
setup
Scaffold a brand-new install.
gio-tool setup --path <dir> --server <version> [options]
| flag | default | meaning |
|---|---|---|
-p, --path |
— | output directory (created by the tool; must not already exist) |
-s, --server |
— | version template (see list) |
-o, --outer-ip |
127.0.0.1 |
IP the client reaches the server on |
--region-name |
dev_docker |
dispatch region name |
--subnet |
172.10.3.0 |
docker network subnet |
--network |
hk4e_net |
docker network name |
--server-port |
21101 |
gateserver UDP port (exposed to the host) |
--sdk-port / --external-sdk-port |
21000 |
SDK / dispatch HTTP port |
--muiptool-port |
8483 |
muiptool web UI |
--phpmyadmin-port |
8087 |
phpMyAdmin |
--mysql-password |
MyVeryLowPasswordHere |
MariaDB root password |
--pathfinding |
off | also start the pathfinding (AI) server |
--password-check |
off | require account password verification |
--password-rsa-key / --dispatch-rsa-key |
built-in | custom RSA private keys (PEM) |
Then drop your binaries / resources / data into place and start it:
# bins -> <dir>/server/bins/ (server executables; .so files in bins/lib/)
# data -> <dir>/server/data/ (json/ lua/ txt/)
# res -> <dir>/server/res/ (NavMesh / SVO, if you have it)
cd <dir> && docker compose up -d
The keys the client needs are written to <dir>/INFO/.
wipe
Re-seed an existing install's config databases in place. Player userdata is preserved by default — this is the building block for reinstalling / upgrading a server without losing accounts.
gio-tool wipe <path> [--userdata] [--redis] [--accounts] [--yes] [--no-restart]
| flag | effect |
|---|---|
| (default) | drop + re-seed hk4e_db_config, hk4e_db_deploy_config, hk4e_db_order; keep hk4e_db_user |
--userdata |
also wipe the player DB (hk4e_db_user) |
--redis |
also flush Redis (player status / mail / offline messages) |
--accounts |
also reset SDK accounts (restores the template's fresh sdk.db) |
--yes |
skip the typed-name confirmation |
--no-restart |
leave the stack stopped afterwards |
The seed is taken from the template embedded in the binary, so it still works even though setup
removes the on-disk seed scripts. You must type the install's directory name to confirm (unless --yes).
migrate-ip
Change outer_ip on an existing install (patches the config XMLs + MySQL rows, then restarts the
affected containers).
gio-tool migrate-ip <path> --outer-ip <ip|auto> [--no-restart]
Notes
- WSL: the gateserver uses UDP, and default WSL2 NAT does not forward localhost UDP — use mirrored
networking, or set
--outer-ipto a LAN IP. - Client patching / domain redirection is out of scope (Cultivation recommended).
- Managing live events / banners / abyss is up to you (seed the relevant config tables).