Add --no-register flag and register-account CLI
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled

Author: https://github.com/REUSS-dev
This commit is contained in:
AnyUnion
2026-05-04 21:14:27 +07:00
committed by GitHub
parent b414db7339
commit 5645740099
12 changed files with 205 additions and 38 deletions
+28 -5
View File
@@ -173,6 +173,7 @@ make dev ARGS="--grpc.listen 0.0.0.0:9000 --grpc.public-addr 10.0.2.2:9000"
| `--grpc.public-addr` | `10.0.2.2:8003` | lunar-tear externally-reachable addr |
| `--grpc.octo-url` | `http://10.0.2.2:8080` | Octo CDN base URL passed to lunar-tear |
| `--grpc.auth-url` | `http://localhost:3000` | auth server base URL passed to lunar-tear |
| `--no-register` | `false` | disable new user registrations (only already registered users can connect). |
| `--admin.listen` | *(empty)* | lunar-tear admin webhook bind. Empty = leave default; webhook only binds when `LUNAR_ADMIN_TOKEN` is set in the env. |
| `--no-color` | `false` | disable colored output |
@@ -195,6 +196,7 @@ make dev ARGS="--grpc.listen 0.0.0.0:9000 --grpc.public-addr 10.0.2.2:9000"
| `--db` | `db/game.db` | SQLite database path |
| `--auth-url` | *(empty)* | Auth server base URL (e.g. `http://localhost:3000`) |
| `--admin-listen` | `127.0.0.1:8082` | Admin webhook listen address. Only binds when `LUNAR_ADMIN_TOKEN` is set. |
| `--no-register` | `false` | Disable new user registrations (only already registered users can connect). |
### Live Master Data Reload
@@ -270,6 +272,7 @@ All targets run from the `server/` directory.
| `make build-all` | Build all service binaries to `bin/` |
| `make build-import` | Build the import-snapshot tool |
| `make build-claim-account` | Build the claim-account tool |
| `make build-register-account` | Build the register-account tool |
| `make clean` | Remove the `bin/` directory |
| `make dev` | Run all three services with one command |
| `make migrate` | Run goose migrations on `db/game.db` |
@@ -308,11 +311,31 @@ The `--secret` flag accepts a hex-encoded HMAC key. If omitted, a random key is
### Flags
| Flag | Default | Description |
| ---------- | --------------- | -------------------------------------------- |
| `--listen` | `0.0.0.0:3000` | HTTP listen address (host:port) |
| `--db` | `db/auth.db` | SQLite database path for auth users |
| `--secret` | *(generated)* | Hex-encoded HMAC secret for token signing |
| Flag | Default | Description |
| ---------------- | --------------- | -------------------------------------------- |
| `--listen` | `0.0.0.0:3000` | HTTP listen address (host:port) |
| `--db` | `db/auth.db` | SQLite database path for auth users |
| `--secret` | *(generated)* | Hex-encoded HMAC secret for token signing |
| `--no-register` | `false` | Disable new user registrations (only already registered users can log in). |
## Create account
This tool creates a fresh account in main db and new account in Auth Server store with given name & password and automatically binds them together.
A primary mean of registering new accounts when `--no-register` flag is passed to lunar-tear for controlled server access.
```bash
go run ./cmd/register-account --name "AccountName" --password "AccountPassword" --platform "android"
```
| Flag | Default | Description |
| ------------ | ------------ | ------------------------------------------------------------ |
| `--name` | *(required)* | Auth Server account nickname to be registered |
| `--password` | *(required)* | Auth Server account password to be registered |
| `--platform` | `android` | Platform of new user account (`android` or `ios`) |
| `--db` | `db/game.db` | SQLite main database path |
| `--auth-db` | `db/auth.db` | SQLite Auth Server database path |
This only sets the nickname of Auth Server account, a player can choose their in-game nickname upon first login!
## ⚠️ Legal Disclaimer