forgejo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package forgejo provisions a git.profullstack.com account for every verified AgentBBS member (free and paid alike) on the self-hosted Forgejo backend that powers AgentGit. BBS membership *is* the git account: when a member verifies their email, EnsureUser creates the matching Forgejo user. It is idempotent — an existing account is left untouched. When unconfigured (no admin token) Configured() reports false and callers skip provisioning entirely.

This mirrors the AgentGit ForgejoAdapter.ensureUser contract in profullstack/logicsrc (plugins/agentgit). Plan (free vs. premium) never affects whether the account exists — only quotas, which are enforced server-side by AgentGit merge policy, not here.

Config (env):

AGENTBBS_FORGEJO_URL          base URL, e.g. https://git.profullstack.com
AGENTBBS_FORGEJO_ADMIN_TOKEN  Forgejo admin access token

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL string
	Token   string
}

Config holds the Forgejo base URL and admin token.

func ConfigFromEnv

func ConfigFromEnv() Config

ConfigFromEnv reads the Forgejo settings from the environment.

func (Config) Configured

func (c Config) Configured() bool

Configured reports whether accounts can actually be provisioned.

func (Config) EnsureUser

func (c Config) EnsureUser(username, email string) (created bool, err error)

EnsureUser creates a Forgejo account for username (forwarding to email) if it does not already exist. It is idempotent: created is false when the account was already present. New accounts are created with must_change_password — git access is via SSH keys, so the generated password is never used interactively.

Jump to

Keyboard shortcuts

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