Namespace FishMMO.Installer
Classes
- AppSettingsInstaller
Interactive wizard that creates or updates appsettings.json and related configuration files with secure file permissions (chmod 600 on Linux). Also generates environment-variable export files so passwords never need to live in plain-text JSON at rest.
Supported components:
- IPFetch Web Server — WebServer.HttpPort + ConnectionStrings.NpgsqlConnection
- Patcher Web Server — WebServer.HttpPort + Patches.DirectoryName
- WebGL Web Server — WebServer.HttpPort
- Discord Bot — Discord.Token + Discord.DefaultGuildId + ConnectionStrings.Npgsql + rate-limiting
- CMS Server — ConnectionStrings.DefaultConnection
Supported outputs:
- appsettings.json — base configuration, chmod 600
- appsettings.Development.json / appsettings.Production.json — environment overrides, chmod 600
- fish shell snippet — ~/.config/fish/conf.d/fishmmo-secrets.fish, chmod 600
- systemd / .env file — fishmmo-secrets.env in target directory, chmod 600
Database credentials (Username/Password) are NOT stored in appsettings.json. They are resolved at runtime via the
DatabaseSecretsclass from environment variables (FISHMMO_DB_USERNAME,FISHMMO_DB_PASSWORD) or the platform secrets file (/etc/fishmmo/db-secrets.envon Linux).
- CliCommand
Parsed CLI command from
Program.Main(string[] args).
- CliParser
Parses CLI arguments into a CliCommand model. Supports interactive (no args), non-interactive (--non-interactive), single-component (--component), dry-run (--dry-run), validate (--validate), help (--help), and version (--version).
- DatabaseSecretsInstaller
Interactive wizard for configuring database connection parameters. On Linux, sudo is used automatically when /etc/fishmmo/ requires root.
- DotNetInstaller
Handles ASP.NET Core Runtime installation, dotnet-ef global tool installation, and EF Core migration/database-update commands. Supports Windows and Linux.
- DotNetReleaseHelper
Resolves the latest ASP.NET Core Runtime download URLs and SHA512 hashes dynamically from the official .NET release metadata API. Falls back to hardcoded constants in InstallationConstants when the API is unreachable.
- DownloadHelper
Handles file downloads with SHA256 integrity verification, progress reporting, and intelligent skip-when-already-downloaded behavior.
- DownloadHelper.ConsoleProgress
Simple console progress bar implementation for use as IProgress<int>.
- FirewallInstaller
Automates host firewall rule creation for FishMMO server ports. Linux: ufw first, firewalld fallback. Windows: netsh.
- HealthCheckResult
A single health check result.
- HealthChecker
Runs post-install validation checks and returns a pass/fail report. Used by
--validatemode and the non-interactive install pipeline.
- InstallManifest
Deserialized from
install-config.jsonfor non-interactive installation.
- InstallOrchestrator
Orchestrates multi-component installations in dependency order. Handles both single-component dispatch and full manifest-driven installs for the non-interactive pipeline.
- InstallResult
Result of a single component installation operation.
- InstallationConstants
Contains constants for installation URLs, filenames, default configuration values, and EF Core project paths for FishMMO dependencies.
- InstallerProcessHelper
Provides shared process execution, console prompting, and Linux DotNet environment bootstrapping used by installer classes.
- LetsEncryptInstaller
Handles Let's Encrypt certificate installation and renewal bootstrap for NGINX on Windows and Linux distributions supported by this installer.
- LinuxConfigHardeningHelper
Shared helpers for reading and atomically writing Linux system configuration files that are owned by privileged users (root, postgres, pgbouncer, ...). All writes go through a temp file in /tmp followed by
sudo install -o <owner> -g <group> -m <mode>which provides atomic rename + ownership/mode in a single privileged step.
- LinuxPackageManagerHelper
Detects and wraps the Linux package manager (pacman, apt-get, dnf, yum). Extracted from InstallerProcessHelper to keep infrastructure concerns separated.
- LinuxPlatform
Linux platform implementation.
- NGINXInstaller
Handles NGINX installation and detection. Supports Windows (zip download + Windows service) and Linux (pacman, apt-get, dnf, yum + systemd).
- PackageManagerInfo
Information about a detected Linux package manager.
- PgBouncerInstaller
Handles PgBouncer installation and baseline service setup. Supports Windows and Linux (Arch/CachyOS, Ubuntu/Debian).
- PlatformFactory
Provides the singleton platform instance for the current OS.
- PostgreSQLInstaller
PostgreSQL security hardening: rewrites
pg_hba.confto requirescram-sha-256on all TCP entries, setspassword_encryptionandlisten_addressesinpostgresql.conf, then reloads the server viapg_reload_conf(). Idempotent: re-runs detect the managed marker and skip. Linux-only; on Windows the installer prints a hint and exits.
- PreFlightChecker
Validates system readiness before any install operation begins. Checks internet, disk, RAM, admin access, and port conflicts. Runs all checks in parallel for speed. Results are cached for the process lifetime to avoid redundant I/O.
- PreFlightResult
Result of pre-flight system readiness checks.
- Program
Console-based installer tool for FishMMO dependencies and database setup. Supports interactive menu mode (default) and CLI-driven non-interactive mode for headless/automated deployment.
- ProjectBuildInstaller
Builds all discovered C# project files under a selected directory hierarchy. The scan is dynamic and includes new projects automatically when added.
- SecurityKeyInstaller
Generates cryptographic keys for FishMMO deployments and stores them directly in the database using a superuser connection. No env files to copy between machines — every server loads its keys from the DB at startup.
Keys managed:
- Gate secret → deployment_secrets table (key='client_gate_secret')
- Connection token HMAC key → connection_token_keys table (key_id='shared')
- Signing key KEK → deployment_secrets table (key='signing_key_kek')
Client build files (ClientApiSecret.generated.cs, etc.) are generated separately from within the Unity Editor (FishMMO > Security > Fetch Client Secrets).
Uses a superuser NpgsqlConnection — matching the pattern established by InstallFishMMODatabase and GrantUserPermissions. The caller is responsible for obtaining the superuser credentials (via HandleWithSuperuser or the FISHMMO_PG_SUPERUSER_PASSWORD environment variable).
- SystemdServiceInstaller
Generates and installs systemd unit files for FishMMO ASP.NET web servers (IPFetch, Patcher, WebGL). On Windows, logs a reminder and skips.
- UnityBuildInstaller
Drives FishMMO-Unity headless builds (Client / Server / Addressables) for Windows, Linux, and WebGL targets by invoking the Unity Editor in -batchmode -nographics and dispatching to
CustomBuildToolCLI methods.
- UnityInstaller
Handles Unity Hub installation and Unity Editor version installation with selectable modules. Supports Windows and Linux (Arch/CachyOS, Debian/Ubuntu). Unity Hub CLI is used to install specific Unity versions and modules.
- VSBuildToolsInstaller
Handles installation of Visual Studio Build Tools on Windows. Downloads the bootstrapper and runs an automated silent installation.
- WindowsPlatform
Windows platform implementation.
Interfaces
- IPlatform
Abstracts OS-specific operations so installer components don't scatter IsOSPlatform(OSPlatform) checks everywhere.
Enums
- UnityBuildInstaller.UnityBuildKind
Identifies a build flavor for the Unity CLI dispatcher.
- UnityBuildInstaller.UnityBuildType
Identifies the build type passed to the Unity build tool.
- UnityBuildInstaller.UnityOSTarget
Identifies the OS target passed to the Unity build tool.