config

package
v0.0.0-...-fce5618 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads bootstrap configuration from environment variables. Everything else (per-user data, channels) lives in the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBPath   string // SQLite file path
	HTTPAddr string // public API bind address (put behind Cloudflare / reverse proxy + TLS)

	// Basic per-user rate limit for /api/sms (requests per minute).
	RateLimitPerMin int

	// Shared Telegram bot. When BotToken is empty, the Telegram channel is
	// disabled (bot doesn't start, bind-code endpoint returns 501).
	// These are env fallbacks; the admin console can override them in the DB.
	BotToken    string
	BotUsername string // without leading @, used to build t.me deep links

	// Global broadcast target: a Telegram channel/group chat id. When non-zero,
	// every received SMS is also published there, in addition to per-user
	// delivery. DB setting "publish_chat_id" overrides this env fallback.
	PublishChatID int64

	// Admin console. Disabled when AdminUser/AdminPassword are empty.
	AdminAddr     string // bind address; keep on localhost unless fronted by TLS
	AdminUser     string
	AdminPassword string
}

func Load

func Load() Config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL