Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Source Engine Egg

A Source engine egg for Pelican and Pterodactyl, using the same container/node setup pattern as [S2Script CS2 Egg](https://github.com/s2script/s2script-cs2-egg). Choose **CS:GO, CS:S, DOD:S, L4D2, or TF2** from one game dropdown.
A Source engine egg for Pelican and Pterodactyl, using the same container/node setup pattern as [S2Script CS2 Egg](https://github.com/s2script/s2script-cs2-egg). Choose **CS:GO, CS:S, DOD:S, GMod, L4D2, or TF2** from one game dropdown.

Included: latest stable Metamod:Source, latest SourceMod prerelease, shared base-game VPKs, central framework caching/pins, game-specific updates/restarts, Discord events, password scopes, node console archives and crash bundles. Optional node modules provide backups/restore, cleanup, resource metrics/Prometheus/top, host maintenance and verified node self-updates. Workshop/map caching and the CS2 connection guard are excluded.
Included: latest stable Metamod:Source, latest SourceMod prerelease (both skipped for GMod's Lua addon system), shared base-game VPKs, central framework caching/pins, game-specific updates/restarts, Discord events, password scopes, node console archives and crash bundles. Optional node modules provide backups/restore, cleanup, resource metrics/Prometheus/top, host maintenance and verified node self-updates. Workshop/map caching and the CS2 connection guard are excluded.

Release versions come from the GitHub release tag. The bootstrap selects a published stable release and the egg defaults to `:stable`; use `:beta` for testing releases. **Wait for the release workflow to publish the node assets and image before installing.** This is an initial implementation; [live-game acceptance and remaining features](docs/IMPLEMENTATION.md) are tracked separately.

Expand Down Expand Up @@ -50,16 +50,18 @@ Create a server, select its **Game** before the first start, allocate the game p

Use `ghcr.io/edgegamers/source-egg:stable` for stable releases, or `:beta` for the newest published release including prereleases. Start it: the entrypoint installs the selected game, Metamod and SourceMod. The short panel installation script is intentional; with node-managed files, the container skips its own SteamCMD game download.

For Garry's Mod, choose `GMod` before first start. It defaults to `gm_construct` on the `public` branch; choose `STEAM_BRANCH=x86-64` before installation for its 64-bit launcher. Set `STEAM_GSLT` to a token for app **4000**. GMod uses its own Lua addons, so automatic Metamod/SourceMod installation is skipped. [GMod setup and gamemode/Workshop arguments](docs/install.md#garrys-mod).

Prefer standalone? Skip step 1. `SOURCE_MODE=auto` installs into the server's own volume when no node is present. An already shared installation requires a working node/mount and does not silently write through shared links. [Server installation guide](docs/install.md).

## 3. Choose framework and password settings

| Panel variable | Default | Purpose |
|---|---|---|
| `SOURCE_GAME` | `CS:S` | Select CS:GO, CS:S, DOD:S, L4D2 or TF2 before installation |
| `INSTALL_METAMOD` | `1` | Install/check latest stable Metamod |
| `SOURCE_GAME` | `CS:S` | Select CS:GO, CS:S, DOD:S, GMod, L4D2 or TF2 before installation |
| `INSTALL_METAMOD` | `1` | Install/check latest stable Metamod; skipped for GMod |
| `METAMOD_VERSION` | empty | Optional exact upstream release tag |
| `INSTALL_SOURCEMOD` | `1` | Install/check latest SourceMod prerelease |
| `INSTALL_SOURCEMOD` | `1` | Install/check latest SourceMod prerelease; skipped for GMod |
| `SOURCEMOD_VERSION` | empty | Optional exact upstream release tag |
| `STEAM_GSLT` | empty | Game Server Login Token where required |
| `GENERATE_PASSWORD` | `0` | Opt into node-generated join passwords for dev servers |
Expand All @@ -83,7 +85,7 @@ For a dev node sharing one public address, use Docker bridge networking with sep

[Node operations and full CLI](docs/operations.md) · [Complete configuration reference](docs/reference/node-config.md) · [Server controls](docs/server-controls.md).

The installer follows the upstream wizard's sections, help, settings review and progress, with EdgeGamers/Source 1 terminal artwork. It exposes file retention, filters, framework locks, maintenance and password scheduling. Operator commands show readable tables; add `--json` for scripts. Install a matched node/image/egg release for new server features; live five-game acceptance remains a separate release gate.
The installer follows the upstream wizard's sections, help, settings review and progress, with EdgeGamers/Source 1 terminal artwork. It exposes file retention, filters, framework locks, maintenance and password scheduling. Operator commands show readable tables; add `--json` for scripts. Install a matched node/image/egg release for new server features; live acceptance for every game remains a separate release gate.

GPL-3.0-or-later. Runtime helpers retain attribution to K4ryuu/CS2-Egg-Go and S2Script contributors; see [LICENSE](LICENSE) and [NOTICE](NOTICE).

Expand Down
4 changes: 2 additions & 2 deletions docs/IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The core, installation flow and operational modules are merged through `7cc3e68`

## Implemented

- Five game profiles and validated launch/Steam install identities, including current standalone CS:GO app mapping and mixed 32/64-bit dependencies.
- Six game profiles and validated launch/Steam install identities, including current standalone CS:GO app mapping, GMod public/x86-64 launchers, and mixed 32/64-bit dependencies. GMod skips automatic Metamod/SourceMod installation in favor of its native Lua addon system.
- Standalone/node-managed boot, including a writable SteamCMD seed for Wings' read-only root and arbitrary UID.
- Immutable staged base-game generations, read-only VPK delivery, private configs/event files and persistent references.
- Exact approved-image discovery, profile/boot checks, bounded per-server sockets and root-only operator control.
Expand Down Expand Up @@ -48,7 +48,7 @@ The upstream-fork update passed the complete verification script: Go race tests,

## Remaining release work

1. Live Linux Wings proof for all five retail installs, real client joins/authentication, map changes, actual framework loading and game-only rollouts. Current standalone CS:GO remains the highest-risk case.
1. Live Linux Wings proof for all six retail installs, real client joins/authentication, map changes, applicable framework loading and game-only rollouts. Include both GMod architectures and native Lua addons. Current standalone CS:GO remains the highest-risk case.
2. Real panel import/startup acceptance and a dev-node rollout of the published image/binary pair.
3. Publish and roll out a matched node/image/egg release containing operational parity, then perform live module acceptance on a dev node.
4. Additional proposal goals beyond the reference benchmark: canary promotion, verified runtime-health rollback and proactive framework-only restart scheduling. Framework updates currently apply at startup.
Expand Down
42 changes: 40 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,52 @@ For shared files, [set up the optional Wings node](node.md) first. No node is re
The export embeds a square 512 × 512 Source-logo PNG as the Pelican egg icon. Updating/reimporting the egg applies the picture on panels supporting embedded icons. For manual upload, use `assets/source-logo.png`; older Pterodactyl panels may ignore this visual metadata.
3. Choose the game and branch before first start. Changes on an existing volume fail with a new-volume/reinstall instruction.
4. Set map/hostname/player settings and applicable Steam credentials/GSLT. Empty map uses a game-specific default. Empty Steam username uses anonymous login; authenticated branches need a pre-authorized session for unattended Steam Guard use.
5. Start. Game updates run before the process. Metamod stable and SourceMod prerelease are checked at startup. Exact pins use full upstream tags, such as `1.12.0.1228` and `1.13.0.7478`.
5. Start. Game updates run before the process. Metamod stable and SourceMod prerelease are checked at startup for games other than GMod. Exact pins use full upstream tags, such as `1.12.0.1228` and `1.13.0.7478`.

SteamCMD is seeded into `/home/container/.source/steamcmd` so it can self-update under Wings' read-only image root and arbitrary UID. Framework configs/data remain private. Unmodified stock plugins/extensions upgrade; custom edits and disabled/deleted defaults are preserved.

`INSTALL_SOURCEMOD=1` requires Metamod even if its separate toggle is off. Toggles control installation/update; they do not uninstall existing frameworks.

Frameworks unpack into private temporary directories on the server volume, following the S2Script egg's disk-backed staging approach. Staging is removed after success or failure. Wings' default 100 MB `/tmp` limit is supported without changing the node configuration; the server volume needs room for both staging and the installed files.

## Garry's Mod

Select `SOURCE_GAME=GMod` before first start. The runtime also accepts `gmod`,
`garrysmod`, and `Garry's Mod` outside the panel selector. The dedicated server
downloads anonymously through SteamCMD app **4020**, uses the `garrysmod`
directory, and defaults to `gm_construct` with the Sandbox gamemode.
[Facepunch server setup](https://wiki.facepunch.com/gmod/Downloading_a_Dedicated_Server).

Keep `STEAM_BRANCH=public` for the standard 32-bit server, or select `x86-64`
before installation to use `srcds_run_x64`. The runtime selects the matching
native binary for custom arguments and debugging. Changing branch on an
existing installation requires a fresh volume or explicit reinstall.

Generate a unique GSLT for base-game app **4000** and enter it in `STEAM_GSLT`.
[Facepunch GSLT instructions](https://wiki.facepunch.com/gmod/Steam_Game_Server_Accounts).

Automatic Metamod/SourceMod installation and node framework downloads are skipped
for GMod, regardless of the framework toggles. Install Lua addons in
`garrysmod/addons/`, custom gamemodes in `garrysmod/gamemodes/`, and server Lua in
`garrysmod/lua/autorun/server/`. Files you add there and in `garrysmod/data/`
remain private and survive managed base-game updates while their paths remain
outside Steam's file inventory. Shipped game files outside the existing seed-only
configuration/addon paths are updated normally: edits to shipped Lua/gamemode
files are replaced, and a later Steam update can replace a custom file if it
starts shipping that path. Keep custom overrides in `garrysmod/addons/` when
possible; that directory is seeded once and existing files are preserved.

Use `CUSTOM_PARAMS` for native GMod options. For example, select the built-in TTT
gamemode with `+gamemode terrortown` and set `SRCDS_MAP` to a suitable installed
map. GMod gamemode arguments run before the startup map. To use a Workshop
collection, add `+host_workshop_collection YOUR_COLLECTION_ID`; GMod handles its
downloads into the server's own files. The egg does not cache or manage Workshop
content on the node. [Native Workshop options](https://wiki.facepunch.com/gmod/Downloading_a_Dedicated_Server).

Both standalone and node-managed paths have fixture coverage. A retail install,
real client join, Lua addons, Workshop downloads and map changes still need live
acceptance on the deployment node.

## Optional node

The normal release install uses the same bootstrap/wizard flow as the reference egg:
Expand Down Expand Up @@ -136,4 +174,4 @@ Local console logs remain `.source/logs/console.log`, rotating at 32 MiB with th

Backups/restore, resource metrics/Prometheus/top, scheduled cleanup, host maintenance, verified node updates and uninstall are documented in [Node operations](operations.md). Panel startup parameters, SourceMod plugin switches, standalone cleanup, console filtering and debugging are in [Server controls](server-controls.md). See the [complete node configuration](reference/node-config.md).

Real game startup, client authentication/joins, map changes, framework loading and live panel/Wings acceptance remain release gates for all five games. A2S readiness is not proof of third-party plugin health. Automatic canaries/health rollback remain beyond reference parity. Workshop/map caching and the connection guard are excluded.
Real game startup, client authentication/joins, map changes, applicable framework loading and live panel/Wings acceptance remain release gates for all six games. A2S readiness is not proof of third-party plugin health. Automatic canaries/health rollback remain beyond reference parity. Workshop/map caching and the connection guard are excluded.
2 changes: 1 addition & 1 deletion docs/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ curl -fsSL https://raw.githubusercontent.com/edgegamers/source-egg/main/scripts/
| --- | --- |
| Node releases | Stable/beta/dev channel, automatic updates and check interval |
| Base-game files | Shared directory, SteamCMD path/validation, symlink/hardlink/copy delivery and worker count |
| Games to prepare now | Comma-separated `csgo,css,dods,l4d2,tf2`, `all`, or `none` to wait for the first server |
| Games to prepare now | Comma-separated `csgo,css,dods,gmod,l4d2,tf2`, `all`, or `none` to wait for the first server |
| Game updates | Check interval, automatic restart switch, immediate/empty/window policy, delay and countdown |
| Metamod/SourceMod cache | Directory, metadata refresh, archive retention and exact fleet versions |
| Passwords | Master switch, game/server/node scope, token/EFF phrases, custom dictionary and private directory |
Expand Down
2 changes: 1 addition & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Node operations

These modules implement the applicable S2Script node operations for all five Source games. Configure them in `sudo sourcenode install`, or edit `/etc/sourcenode/config.json` and restart the service. Fresh installs enable the operational modules; host maintenance starts in dry-run mode. Existing configurations retain saved enable switches and the legacy defaults for omitted settings.
These modules implement the applicable S2Script node operations for all six Source games. Configure them in `sudo sourcenode install`, or edit `/etc/sourcenode/config.json` and restart the service. Fresh installs enable the operational modules; host maintenance starts in dry-run mode. Existing configurations retain saved enable switches and the legacy defaults for omitted settings.

Install a matched node/image/egg release to use new server capabilities. An older installed node/image does not gain features by changing its config.

Expand Down
5 changes: 3 additions & 2 deletions docs/server-controls.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Server controls

Set these variables in the server's panel Startup settings, then restart the server. The controls apply to CS:GO, CS:S, DOD:S, L4D2, and TF2. The egg reads custom arguments itself; keep the supplied panel startup command instead of inserting `{{CUSTOM_PARAMS}}` into a shell command.
Set these variables in the server's panel Startup settings, then restart the server. The controls apply to CS:GO, CS:S, DOD:S, GMod, L4D2, and TF2; GMod skips the Metamod/SourceMod controls and uses its own Lua addons. The egg reads custom arguments itself; keep the supplied panel startup command instead of inserting `{{CUSTOM_PARAMS}}` into a shell command.

| Panel variable | Default | Purpose |
| --- | --- | --- |
Expand Down Expand Up @@ -214,10 +214,11 @@ It launches a new engine process under the debugger; it does not attach to an ex
| --- | --- |
| CS:GO, CS:S, DOD:S | `srcds_linux64` when present, otherwise `srcds_linux`. |
| L4D2 | `srcds_linux`. |
| GMod | `srcds_linux` on `public`; `bin/linux64/srcds` on `x86-64`. |
| TF2 | `srcds_linux64`. |

The selected file must exist and be executable. Missing binaries or `gdbserver` stop startup; the egg does not silently fall back to a different launch mode. The native engine receives the normal game arguments plus validated custom arguments, with library paths for the selected architecture.

The container must permit debugging through its ptrace/security policy, and the allocated TCP port must be reachable from the debugger. The egg does not change panel allocations, firewall rules, or container security settings. Debugger access controls the game process: restrict access to the debug port and clear `GDB_DEBUG_PORT` or set it to `0` when finished. Install matching binaries/symbols in the debugging client as needed; the egg does not supply game debug symbols.

Native launches and argument handling are tested with temporary fake executables for all five profiles. The debugger wrapper is tested with a fake `gdbserver`. Acceptance against retail game binaries, a real debugger, and the runtime container remains a separate deployment check.
Native launches and argument handling are tested with temporary fake executables for all six profiles, including both GMod architectures. The debugger wrapper is tested with a fake `gdbserver`. Acceptance against retail game binaries, a real debugger, and the runtime container remains a separate deployment check.
52 changes: 52 additions & 0 deletions docs/superpowers/plans/2026-11-19-gmod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Garry's Mod Implementation Plan

> **For agentic workers:** Use superpowers:executing-plans for this small change.

**Goal:** Make GMod selectable and runnable through the existing egg and node.

**Architecture:** Extend the registry, resolve the branch-specific launcher,
and skip managed frameworks for GMod. Reuse current install/update delivery.

**Tech Stack:** Go, SteamCMD, Pelican/Pterodactyl JSON.

**Spec:** `docs/superpowers/specs/2026-11-19-gmod-design.md`

## Global Constraints

- Keep existing game identities and launch behavior intact.
- GMod uses apps 4020/4000 and default map gm_construct.
- No new dependencies or managed Workshop cache.

## Review Focus

- Both public and x86-64 launches must select the matching native binary.
- GMod must boot with the panel's framework toggles left enabled.
- Node preparation must skip GMod framework downloads.
- Managed updates must retain server-added Lua, gamemode and data files outside
Steam's inventory; shipped files retain normal update behavior.
- Predownload all must include GMod.

### Task 1: Add the profile and integrate launch/setup

**Files:** `internal/game/profile.go`, `internal/game/launch.go`,
`internal/egg/{boot,debug,run}.go`, `internal/content/steam.go`,
`internal/node/{daemon,delivery}.go`, `internal/nodeinstall/wizard.go`,
their existing tests, `pterodactyl/source-egg.json`, and current setup docs.

**Interfaces:** Add `Profile.ForBranch(string) Profile` and
`Profile.SupportsFrameworks() bool`; existing public identities remain stable.

- [x] Extend behavioral tests for profile/branch launch, standalone and node
framework skipping, native argv, private GMod content, and predownload all.
- [x] Run the focused tests and observe the missing-profile failures.
- [x] Implement profile, launcher and setup changes using existing delivery.
- [x] Update the egg selector and user-facing setup documentation.
- [x] Run focused tests, then `bash scripts/verify.sh` and bootstrap tests;
review the final diff.

Verification: focused regressions failed before implementation and passed after;
the library-path regression also failed before its fix. Full race tests, vet,
formatting, Linux builds, shell/SteamCMD fixtures and bootstrap fixtures passed
with Go 1.27.4. Egg JSON validation and the built `sourceegg profiles` command
include GMod. Fresh review has no remaining substantive findings. Retail startup,
client joins and container/Wings acceptance remain untested.
Loading
Loading