Feature: Server Configuration #2
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#2
Original Author: @icub3d
Original Date: 2026-04-15T14:15:19Z
Feature: Server Configuration
Overview
Implement TOML-based configuration file loading for the decentcom server. This includes server identity (name, description, icon), network settings (bind address, TLS), feature flags, membership mode, content policy limits, and storage backend selection. The config is the primary way operators customize their instance.
Background
The server model design doc (server-model.md) defines membership modes, feature flags, and content policy settings. The storage design doc (storage.md) specifies backend selection via TOML config blocks. The architecture doc (architecture.md) notes that one instance hosts exactly one community, so all config is instance-level.
Requirements
--config <path>CLI argumentdecentcom.tomlin the current directory127.0.0.1:8080, SQLite storage, open membership)name(required, string),description(optional, string),icon_path(optional, file path)bind_address(default127.0.0.1:8080)[storage]section withbackendfield (sqliteorpostgres), plus backend-specific fields[features]section with boolean toggles matching the flags in the server-model design docmembership_modefield (open,invite_only,allowlist,closed)max_message_length,max_file_size,allowed_file_typesDesign
API / Interface Changes
No new HTTP endpoints. Configuration is file-based, not API-based.
CLI interface for the server binary:
Data Model Changes
None. Configuration is not stored in the database.
Component Changes
New files:
Modified files:
Config structs (in
server/src/config.rs):Task List
toml,serde,clap,tracing,tracing-subscriberdependencies toserver/Cargo.tomlDeserializeinserver/src/config.rsDefaultfor all config structs with sensible valuesnameis non-empty,database_pathis set when backend issqlite,database_urlis set when backend ispostgres)server/src/main.rs(--configflag)ServerConfigin axum's app state (viaArc<ServerConfig>in router state)database_url)decentcom.tomlatserver/decentcom.example.tomlTest List
[server] name = "test") deserializes correctly with defaults for everything elseserver.nameabsent) returns a clear errormembership_modevalue returns a clear errorbackend = "sqlite"withoutdatabase_pathreturns a validation errorbackend = "postgres"withoutdatabase_urlreturns a validation error/healthstill responds--config path/to/test.tomland verify logged config summary (not verified in this session — covered by integration test that exercises the same config-loading path)Open Questions
DECENTCOM_BIND_ADDRESS)? This is useful for container deployments but adds complexity.