siteops

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownTLDs = []string{
	".com", ".net", ".org", ".io", ".co", ".ltd", ".dev", ".app", ".me",
	".info", ".biz", ".uk", ".us", ".eu", ".de", ".fr", ".ca", ".au",
}

KnownTLDs is the list of domain suffixes stripped from directory names when deriving a site name.

Functions

func CleanupRelink(path, newName string) bool

CleanupRelink handles the re-link scenario: when a site is being linked at a path that already has registrations, it carries over the secured state and removes stale entries (e.g. name changed). Returns the carried-over secured flag.

func FinishLink(site config.Site, phpVersion string) error

FinishLink performs the post-registration steps shared by link, park, and MCP: vhost generation, FPM quadlet setup, container hosts update, and nginx reload.

func IsParkedSite

func IsParkedSite(sitePath string, parkedDirs []string) bool

IsParkedSite checks whether a site's path is inside one of the parked directories.

func RegenerateSiteVhost

func RegenerateSiteVhost(site *config.Site, oldPrimary string) error

RegenerateSiteVhost regenerates the nginx vhost for a site after domain changes. If the primary domain changed, the old vhost file is removed. For secured sites the SSL vhost is generated and renamed to the main .conf path.

func SiteNameAndDomain

func SiteNameAndDomain(dirName, tld string) (string, string)

SiteNameAndDomain derives a clean site name and domain from a directory name. It strips known TLDs (e.g. "myapp.com" → "myapp") and replaces dots with dashes.

func UnlinkSiteCore

func UnlinkSiteCore(site *config.Site, parkedDirs []string) error

UnlinkSiteCore performs the shared unlink steps: remove vhost, remove certs, update registry (ignore if parked, remove otherwise), update container hosts, and reload nginx. It does NOT stop workers or clean up unused services/FPMs — callers that need those should do them before calling this function.

Types

type VersionResult

type VersionResult struct {
	PHP            string // best installed PHP version (clamped to framework range)
	Node           string // detected Node version
	PHPMin         string // framework minimum PHP version (empty if no framework)
	PHPMax         string // framework maximum PHP version (empty if no framework)
	SuggestedPHP   string // better PHP version to install (empty if current is optimal)
	FrameworkLabel string // human-readable framework name for messages
}

VersionResult holds the detected and suggested versions for a site.

func DetectSiteVersions

func DetectSiteVersions(dir, framework, defaultPHP, defaultNode string) VersionResult

DetectSiteVersions resolves the framework, PHP version (clamped to framework range), and Node version for a project directory. When the best installed PHP version is below the framework's max, SuggestedPHP is set to the max version.

Jump to

Keyboard shortcuts

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