Skip to main content

Overview

This guide walks you through the complete configuration process, from cloning the repository to starting the server.

Configuration Loading

gitGost uses a simple configuration system that loads settings from environment variables with sensible defaults.
Configuration is loaded via internal/config/config.go:24 using the Load() function.

Load Order

1

Environment Variables

The application first looks for environment variables in the system.
2

.env File

If a .env file exists in the working directory, it’s loaded automatically via godotenv.Load() (see cmd/server/main.go:24).
3

Defaults

If a variable is not set, the application falls back to built-in defaults.

Complete Setup Workflow

1. Clone and Build

2. Create Configuration File

Copy the example environment file:
Edit .env with your configuration:
.env

3. Verify Configuration

Before starting the server, verify your configuration:

4. Start the Server

Expected output:
If you see “Warning: Supabase not configured, stats will not be persisted”, ensure SUPABASE_URL and SUPABASE_KEY are set correctly.

5. Verify Deployment

Test that the service is running:

Repository Configuration (.gitgost.yml)

To signal that a repository welcomes anonymous contributions, add a .gitgost.yml file to the repository root:
.gitgost.yml
This file is optional but recommended for transparency. It signals to contributors that anonymous PRs are accepted.

Badge Support

Repositories with .gitgost.yml can use the verified badge:

Configuration Reference

Config Structure

The configuration is loaded into a Config struct defined in internal/config/config.go:10-21:

Default Values

GITHUB_TOKEN has no default. The server will start without it, but push operations will fail.

Production Hardening

Reverse Proxy Setup (nginx)

Systemd Service

Create /etc/systemd/system/gitgost.service:
Enable and start:

Troubleshooting

Common Issues

Cause: GITHUB_TOKEN is invalid or lacks repo permissions.Solution:
  1. Verify token at https://github.com/settings/tokens
  2. Ensure the repo scope is selected
  3. Regenerate if necessary
  4. Update .env and restart the server
Cause: Supabase is not configured or credentials are invalid.Solution:
  1. Check SUPABASE_URL and SUPABASE_KEY in .env
  2. Test connection: curl "$SUPABASE_URL/rest/v1/" -H "apikey: $SUPABASE_KEY"
  3. If 401, regenerate the key from Supabase dashboard
Cause: Another service is using port 8080.Solution:
  1. Change PORT in .env to an available port (e.g., 8081)
  2. Update firewall rules and reverse proxy configuration
  3. Restart the server
Cause: Incorrect PANIC_PASSWORD or missing header.Solution:

Next Steps

Environment Variables

Complete reference of all configuration options

Docker Deployment

Deploy using Docker with compose examples

API Reference

Explore the gitGost API endpoints