4.0 KiB
Healthchecks
This repository contains the operational wrapper for the headless login healthcheck. The underlying smoke client lives in m2dev-server-src.
What Exists
Source repository:
tests/login_smoke.cpp- binary target:
metin_login_smoke
Runtime repository:
deploy/healthcheck/metin-login-healthcheck.sh
Installed on the VPS:
/usr/local/sbin/metin-login-healthcheck
What The Headless Healthcheck Verifies
The check performs the real two-step Metin login flow without a GUI client and then exercises the in-game mall open path:
- Connect to the auth socket.
- Complete the secure handshake.
- Send login credentials.
- Receive
AUTH_SUCCESSand the login key. - Open a second connection to the channel socket.
- Complete the secure handshake again.
- Send
LOGIN2withlogin+login_key. - Verify
EMPIRE. - Verify
LOGIN_SUCCESS4. - Select a character slot.
- Send
ENTERGAME. - Verify
MAIN_CHARACTER,PHASE_GAME,TIME, andCHANNEL. - Send
/mall_password 000000through the encrypted chat path. - Verify
MALL_OPEN.
This is an end-to-end gameplay-path verification, not just a TCP port check.
How The Wrapper Works
metin-login-healthcheck.sh does the following:
- creates a temporary account in MariaDB
- lets
metin_login_smokecreate a temporary character when the account is empty - runs
metin_login_smoke - verifies a successful auth + channel +
ENTERGAMEflow - verifies that the shared safebox/mall DB load bootstrap can open the mall with the default empty password
- deletes the temporary account and temporary character rows on exit
- passes the configured client version expected by the server
It is intended for manual admin use on the VPS.
Usage
On the VPS:
ssh mt2
/usr/local/sbin/metin-login-healthcheck
The smoke binary can also be run directly:
sudo -iu mt2.jakubkadlec.dev \
/home/mt2.jakubkadlec.dev/metin/build/server-src/bin/metin_login_smoke \
173.249.9.66 11000 11011 <login> <password>
Or with password passed through the environment:
sudo -iu mt2.jakubkadlec.dev env METIN_LOGIN_SMOKE_PASSWORD='<password>' \
/home/mt2.jakubkadlec.dev/metin/build/server-src/bin/metin_login_smoke \
173.249.9.66 11000 11011 <login> --password-env=METIN_LOGIN_SMOKE_PASSWORD
If you want the smoke client to create a temporary character when the account is empty:
sudo -iu mt2.jakubkadlec.dev env METIN_LOGIN_SMOKE_PASSWORD='<password>' \
/home/mt2.jakubkadlec.dev/metin/build/server-src/bin/metin_login_smoke \
173.249.9.66 11000 11011 <login> --password-env=METIN_LOGIN_SMOKE_PASSWORD \
--create-character-name=smoketestchar \
--client-version=1215955205 \
--mall-password=000000
Useful direct flags:
--jsonreturns a machine-readable summary including timings and emitted events--expect-auth-failure=STATUStreats an auth failure such asNOIDorWRONGPWDas a successful negative test--expect-channel-failure=STATUStreats a channel failure as a successful negative test--mall-password=PASSWORDafterENTERGAME, opens the in-game mall via encrypted chat command and verifiesMALL_OPEN
Example negative auth test:
sudo -iu mt2.jakubkadlec.dev env METIN_LOGIN_SMOKE_PASSWORD='wrongpass' \
/home/mt2.jakubkadlec.dev/metin/build/server-src/bin/metin_login_smoke \
173.249.9.66 11000 11011 someuser --password-env=METIN_LOGIN_SMOKE_PASSWORD \
--expect-auth-failure=WRONGPWD --json
Security Notes
This does not open a new public network surface. It is a local operational tool.
Current guardrails:
- no new listening port
- root-only installed wrapper (
/usr/local/sbin/metin-login-healthcheck, mode700) - temporary credentials
- cleanup trap removes the test account
- wrapper passes the password through environment instead of command-line plaintext
- secrets are not committed to git
Remaining trust boundary:
- anyone with effective root access can still inspect or run the check
- therefore this tool assumes root is already trusted