Documentation
¶
Overview ¶
Package panel is Skiff's hosted control panel: a login-gated web app with accounts + teams, where teams own projects deployed from git and managed on the box. Served behind the router at dash.<domain>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelfUpdate ¶
func SelfUpdate(opts SelfUpdateOpts) error
Types ¶
type AlertConfig ¶
type AlertConfig struct {
Email string `json:"email"`
SlackURL string `json:"slackUrl"`
WebhookURL string `json:"webhookUrl"`
}
AlertConfig is a team's notification channels; an empty field is off.
type AuditEntry ¶
type Backup ¶
type Backup struct {
ID string `json:"id"`
Size int64 `json:"size"`
Trigger string `json:"trigger"` // manual | scheduled
Created int64 `json:"created"`
}
Backup is a stored database dump as the dashboard sees it.
type Bucket ¶
type Bucket struct {
ID string `json:"id"`
Name string `json:"name"`
Endpoint string `json:"endpoint"`
Region string `json:"region"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
State string `json:"state"`
Attached []string `json:"attached"`
Created int64 `json:"created"`
}
Bucket is a managed object store plus the computed fields the dashboard needs.
type Database ¶
type Database struct {
ID string `json:"id"`
Name string `json:"name"`
Engine string `json:"engine"`
Host string `json:"host"`
Port int `json:"port"`
Created int64 `json:"created"`
State string `json:"state"` // computed: running / exited / missing
URL string `json:"url"` // computed: private connection string
Attached []string `json:"attached"` // computed: apps it's wired into
Public bool `json:"public"` // reachable from outside the box
PublicURL string `json:"publicUrl,omitempty"` // computed: external connection string
}
Database is a managed data store, plus computed fields the dashboard needs.
type Deploy ¶
type Deploy struct {
ID string `json:"id"`
App string `json:"app"`
Commit string `json:"commit"`
Message string `json:"message"`
Trigger string `json:"trigger"`
Status string `json:"status"`
Started int64 `json:"started"`
// Rollbackable is computed (not persisted): the build's image is still
// retained and it isn't the version currently serving.
Rollbackable bool `json:"rollbackable,omitempty"`
}
Deploy is one build/release, with a persisted log the dashboard can replay.
type Domain ¶
type Domain struct {
Host string `json:"host"`
App string `json:"app"`
Parent string `json:"parent,omitempty"` // set for a managed branch domain: the parent project's app
Branch string `json:"branch,omitempty"` // set for a managed branch domain: the branch it tracks
Created int64 `json:"created"`
PointsHere bool `json:"pointsHere"` // computed: DNS resolves to this server
ResolvesTo []string `json:"resolvesTo,omitempty"` // computed: where the host currently points
}
Domain is a custom hostname pointed at one of the team's apps. The router serves it (with an on-demand Let's Encrypt cert) once DNS points at the box.
type EnvVar ¶
type EnvVar struct {
Key string `json:"key"`
Value string `json:"value"`
Build bool `json:"build"`
}
EnvVar is a project environment variable. Build vars land in the image build ([env]); non-build vars are runtime-only secrets ([secrets]).
type Job ¶
type Job struct {
ID string `json:"id"`
App string `json:"app"`
Name string `json:"name"`
Schedule string `json:"schedule"`
Command string `json:"command"`
LastRun int64 `json:"lastRun"`
LastOk bool `json:"lastOk"`
Next int64 `json:"next"` // computed: next scheduled run
Created int64 `json:"created"`
}
Job is a command run on a cron schedule in a one-off container from the app's image, with the app's runtime env on the shared network.
type SelfUpdateOpts ¶
type SelfUpdateOpts struct {
Repo string // owner/name of Skiff's own repository
Branch string
Commit string
DeployID string
}
SelfUpdateOpts parameterizes a control-plane rebuild.
type Source ¶
type Source struct {
App string `json:"app"`
Team string `json:"team"`
Repo string `json:"repo"` // owner/name
Branch string `json:"branch"`
RootDir string `json:"rootDir"` // subdirectory to build (monorepos)
Port string `json:"port"`
CloneURL string `json:"cloneUrl"`
Auto bool `json:"auto"`
Parent string `json:"parent,omitempty"` // set on preview environments: the production app they branch from
PreviewAuto bool `json:"previewAuto,omitempty"` // auto-create a preview for pushes to other branches
Replicas int `json:"replicas,omitempty"` // identical containers to run behind the router (default 1)
Release string `json:"release,omitempty"` // command run once (e.g. migrations) before each release goes live
// Autoscaling: when on, the panel adds/retires replicas to hold each one near
// ScaleCPU (percent of one core), bounded by ScaleMin..ScaleMax.
Autoscale bool `json:"autoscale,omitempty"`
ScaleMin int `json:"scaleMin,omitempty"`
ScaleMax int `json:"scaleMax,omitempty"`
ScaleCPU int `json:"scaleCpu,omitempty"`
}
Source is a deployable app's git origin (per team), so a webhook or redeploy can rebuild it without the user re-entering anything.
Source Files
¶
- accounts.go
- alerts.go
- analytics.go
- api_v1.go
- audit.go
- autoscale.go
- backups.go
- cert.go
- databases.go
- deploys.go
- domains.go
- embed.go
- envstage.go
- exec.go
- github_handlers.go
- jobs.go
- logging.go
- networks.go
- panel.go
- previews.go
- projects.go
- ratelimit.go
- resources.go
- selfupdate.go
- server.go
- settings.go
- storage.go
- store.go
- tokens.go
- workers.go