Add SurrealDB helpers and promo screenshot assets

- Add local SurrealDB install, update, and run scripts for Forge
- Update setup docs and package the server SurrealDB helpers
This commit is contained in:
Jacob Schmidt 2026-05-03 11:48:41 -05:00
parent d2811a3c43
commit 01dda0e060
10 changed files with 149 additions and 2 deletions

2
.gitignore vendored
View File

@ -34,3 +34,5 @@ Thumbs.db
# Arma
arma/ui/map-viewer/
arma/server/surrealdb/forge.db/
promo/

View File

@ -18,6 +18,7 @@ include = [
"config.example.toml",
"LICENSE.md",
"README.md",
"surrealdb/**/*",
]
exclude = []

View File

@ -0,0 +1,3 @@
@echo off
call "%~dp0UpdateMe.bat"
call "%~dp0RunMe.bat"

View File

@ -0,0 +1,74 @@
# Forge SurrealDB
Forge uses SurrealDB as the durable database for the server extension. These
helpers install the SurrealDB CLI and start a local RocksDB-backed Forge
database from this directory.
These scripts are for local development and single-host Forge servers. For a
public or shared production host, change the root password and review bind,
firewall, TLS, backup, and upgrade policy before exposing the database.
## Windows
Install or update SurrealDB:
```bat
UpdateMe.bat
```
If this is the first install and the terminal cannot find `surreal` after the
script finishes, open a new terminal so Windows reloads `PATH`.
Start Forge's local database:
```bat
RunMe.bat
```
Install and start in one step:
```bat
AllInOne.bat
```
## Linux or macOS
Install SurrealDB:
```bash
./setup.sh
```
Start Forge's local database:
```bash
./run.sh
```
Update SurrealDB:
```bash
./update.sh
```
## Manual Command
The run scripts execute:
```bash
surreal start --user root --pass root --bind 127.0.0.1:8000 rocksdb://forge.db
```
The database files are created under `arma/server/surrealdb/forge.db`.
Forge's extension config should match the local SurrealDB server:
```toml
[surreal]
endpoint = "127.0.0.1:8000"
namespace = "forge"
database = "main"
username = "root"
password = "root"
connect_timeout_ms = 5000
```

View File

@ -0,0 +1,3 @@
@echo off
cd /d "%~dp0"
surreal start --user root --pass root --bind 127.0.0.1:8000 rocksdb://forge.db

View File

@ -0,0 +1,14 @@
@echo off
where surreal >nul 2>nul
if %errorlevel% equ 0 (
surreal upgrade
surreal version
) else (
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr https://windows.surrealdb.com -useb | iex"
where surreal >nul 2>nul
if %errorlevel% equ 0 (
surreal version
) else (
echo SurrealDB install finished. Open a new terminal if the surreal command is not available yet.
)
)

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
surreal start --user root --pass root --bind 127.0.0.1:8000 rocksdb://forge.db

View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
if command -v surreal >/dev/null 2>&1; then
surreal version
exit 0
fi
if command -v brew >/dev/null 2>&1; then
brew install surrealdb/tap/surreal
else
curl -sSf https://install.surrealdb.com | sh
fi
surreal version

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
if command -v brew >/dev/null 2>&1; then
brew upgrade surrealdb/tap/surreal || brew install surrealdb/tap/surreal
else
curl -sSf https://install.surrealdb.com | sh
fi
surreal version

View File

@ -14,7 +14,23 @@ hosting the live Arma server.
Official SurrealDB resources:
- [SurrealDB install page](https://surrealdb.com/install)
- [SurrealDB CLI `start` reference](https://surrealdb.com/docs/reference/cli/surrealdb-cli/commands/start)
- [SurrealDB CLI `start` reference](https://surrealdb.com/docs/surrealdb/cli/start)
Forge also includes helper scripts under `arma/server/surrealdb`:
```powershell
cd arma/server/surrealdb
.\UpdateMe.bat
.\RunMe.bat
```
On Linux or macOS:
```bash
cd arma/server/surrealdb
./setup.sh
./run.sh
```
Install SurrealDB with the official method for your platform:
@ -37,9 +53,12 @@ For Forge, start a persistent local database instead of the default in-memory
mode:
```powershell
surreal start surrealkv://forge.db --bind 127.0.0.1:8000 --user root --pass root
surreal start --user root --pass root --bind 127.0.0.1:8000 rocksdb://forge.db
```
`root`/`root` is only the local development default. For a public or shared
server, set a real password and keep `config.toml` aligned.
Then copy `arma/server/extension/config.example.toml` to `config.toml` next to
`forge_server_x64.dll` and keep the values aligned with the database you
started: