Documentation
¶
Overview ¶
Package gitserver runs the optional built-in Git server (§5.8): Forgejo as a system task on the controller node, served at git.<base-domain>. When it is turned on, the controller creates its administrator, mints an API token and registers it as the Git connection "git", so services can build from its repositories with webhooks and commit statuses like any other host.
Index ¶
- Constants
- Variables
- type Manager
- func (m *Manager) Config() *system.GitServerConfig
- func (m *Manager) Credentials() (string, string, bool)
- func (m *Manager) Host() string
- func (m *Manager) Kick()
- func (m *Manager) Load(ctx context.Context) error
- func (m *Manager) RootURL() string
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) SetEnabled(ctx context.Context, on bool) error
- func (m *Manager) Status() Status
- type Status
Constants ¶
const ( // ConnectionName is the Git connection of the built-in server. ConnectionName = "git" // AdminUser is its administrator ("admin" is reserved by Forgejo). AdminUser = "syncloud" )
Variables ¶
var ErrInUse = errors.New("services still build from the built-in Git server: disconnect them first")
ErrInUse means services still build from the built-in server.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// Conns, Exec and Sys are set before Run.
Conns *gitconn.Manager
Exec *execrelay.Relay
Sys *system.Manager
// Endpoints returns the dashboard's current addresses.
Endpoints func() domain.Endpoints
// OnChange re-renders the system tasks and certificate hosts.
OnChange func()
// API is where the controller reaches the server (loopback).
API string
// CADir is where the cluster's self-signed certificates are written for
// the server to trust ("" = none); TrustPEM returns them ("" = none,
// e.g. once ACME issued real ones).
CADir string
TrustPEM func() string
// contains filtered or unexported fields
}
func (*Manager) Config ¶
func (m *Manager) Config() *system.GitServerConfig
Config is the system task configuration (nil when off).
func (*Manager) Credentials ¶
Credentials returns the administrator's sign-in.
func (*Manager) Kick ¶
func (m *Manager) Kick()
Kick re-checks the server now (after a domain change, for example).
func (*Manager) Run ¶
Run provisions the server whenever it is on and not ready yet, and keeps the connection's address in step with the domain.
func (*Manager) SetEnabled ¶
SetEnabled turns the server on or off. Turning it off keeps its data volume, so turning it on again brings the repositories back.
type Status ¶
type Status struct {
Enabled bool `json:"enabled"`
State string `json:"state"` // off | starting | provisioning | ready | failed
URL string `json:"url"`
Image string `json:"image"`
AdminUser string `json:"adminUser"`
Connection string `json:"connection"`
Problem string `json:"problem,omitempty"`
}
Status is the server as the API shows it.