Getting Started

Configuration

Initial configuration and environment settings for GO Shortener.

Configuration

GO Shortener is configured exclusively via environment variables loaded from the .env file located in the working directory (typically /root/Go-shortner/.env).

Never commit your .env file to public source control or expose it publicly. Restrict access using chmod 600 .env so only the owner can read or write to it.

Core Server Settings

.env
# Network Binding
PORT=3000
HOST=127.0.0.1
BASE_URL=https://go.arcn.online

# Database Path
DB_PATH=/root/Go-shortner/data/go.sqlite

# Security & Sessions
JWT_SECRET=your_32_or_64_character_random_hex_string
SESSION_DURATION_HOURS=72

Parameters

  • PORT: The internal TCP port the HTTP server listens on (default: 3000).
  • HOST: IP address to bind to. Set to 127.0.0.1 when proxied by Cloudflare Tunnel or Nginx; use 0.0.0.0 only if directly reachable.
  • BASE_URL: Canonical public URL for generating short links (e.g., https://go.arcn.online). Crucial for redirect links and OAuth callbacks.
  • DB_PATH: Absolute file path to the SQLite database file.
  • JWT_SECRET: Cryptographic secret used for signing HMAC authentication cookies. Must be at least 32 characters long.
  • SESSION_DURATION_HOURS: Validity lifetime of authenticated user session cookies in hours (default: 72).

Quotas and Lifecycles

GO enforces separate rate limits and expiration boundaries for anonymous visitors and registered accounts:

.env
# Anonymous Quota Limits
ANONYMOUS_DAILY_QUOTA=15
ANONYMOUS_MAX_EXPIRATION_DAYS=7

# Registered User Quota Limits
REGISTERED_MONTHLY_QUOTA=100
REGISTERED_MAX_EXPIRATION_DAYS=365
Changing quota variables affects newly created links immediately upon restarting the service. Existing links maintain their established expires_at timestamps.

Optional Integrations

GO supports two optional external integrations that can be enabled as needed:

  1. Cloudflare Turnstile: Set TURNSTILE_ENABLED=true and provide TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY. See Cloudflare Turnstile Documentation.
  2. Firebase Google OAuth: Supply the six FIREBASE_* client credentials. See Firebase Setup Documentation.

Applying Configuration Changes

Whenever you edit /root/Go-shortner/.env, restart the systemd service to apply the changes:

Terminal
systemctl restart go-shortener
systemctl status go-shortener
Copyright © 2026