Skip to main content

Server Application

The Elixir OTP application that starts the server and keeps its processes running.

Owns​

  • The supervision tree, started by Nixstasis.Application.start/2 in packages/server/lib/nixstasis/application.ex with a :one_for_one strategy under Nixstasis.Supervisor.
  • Application and runtime configuration in packages/server/config/config.exs and packages/server/config/runtime.exs.
  • The Mix project, dependencies, and aliases in packages/server/mix.exs.

Entry points​

The supervisor starts these children in order:

ChildResponsibility
NixstasisWeb.TelemetryPhoenix and VM telemetry metrics.
Nixstasis.RepoEcto repository for PostgreSQL.
Nixstasis.E2E.RetentionWorkerPrunes old E2E runs; started unless E2E retention is disabled in config.
Nixstasis.Monitoring.TelemetryRetentionWorkerPrunes telemetry older than the retention window; started unless disabled.
DNSClusterNode discovery when a DNS cluster query is configured.
Phoenix.PubSub (Nixstasis.PubSub)Broadcasts for LiveViews and channels.
Nixstasis.Devices (:remote_access_leases)Holds and restores remote-access leases and expires them.
Nixstasis.ProvisioningTracks AtomixOS bootstrap route leases and expires them.
Nixstasis.Devices.SshKeyManager (:terminal_sessions)Issues ephemeral SSH keys for browser terminal sessions and expires them.
NixstasisWeb.RateLimiterStoreETS-backed rate-limit buckets, pruned every minute.
Nixstasis.Monitoring.OfflineCheckerMarks devices offline when heartbeats stop.
Nixstasis.TLSObservationsKeeps the most recent on-demand TLS approval decisions for the laptop diagnostics view.
NixstasisWeb.EndpointThe HTTP endpoint; started last so dependencies are ready before requests arrive.

Telemetry retention reads NIXSTASIS_TELEMETRY_RETENTION_ENABLED, NIXSTASIS_TELEMETRY_RETENTION_DAYS, and NIXSTASIS_TELEMETRY_RETENTION_INTERVAL_MS; see Deployment Configuration.

Boundaries​

  • Each child that holds state keeps it in memory and reloads what it needs when it starts. If one crashes, only that one restarts.
  • Domain behavior lives in Server Domain and the context modules; HTTP and LiveView behavior lives in Server Web.
  • Development commands such as mix setup and mix precommit are covered in the Development guide.