scripts

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubRepo    = "https://github.com/community-scripts/ProxmoxVE"
	GitHubAPIRepo = "https://api.github.com/repos/community-scripts/ProxmoxVE"
	RawGitHubRepo = "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
)

GitHubRepo is the URL to the Proxmox Community Scripts repository.

View Source
const (
	ScriptMetadataTTL = 24 * time.Hour // Cache script metadata for 24 hours
	ScriptListTTL     = 12 * time.Hour // Cache script list for 12 hours
)

Cache TTLs.

View Source
const (
	ScriptListCacheKey   = "github_script_list"
	ScriptCacheKeyPrefix = "github_script_"
)

Cache keys.

Variables

This section is empty.

Functions

func InstallScript

func InstallScript(user, nodeIP, scriptPath string) error

InstallScript installs a script on a Proxmox node interactively.

func ValidateConnection

func ValidateConnection(user, nodeIP string) error

ValidateConnection checks if SSH connection to the node is possible.

Types

type GitHubContent

type GitHubContent struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Type        string `json:"type"` // "file" or "dir"
	DownloadURL string `json:"download_url"`
}

GitHubContent represents a file or directory in the GitHub API.

func GetScriptMetadataFiles

func GetScriptMetadataFiles() ([]GitHubContent, error)

GetScriptMetadataFiles fetches the list of script metadata JSON files from the repository.

type Script

type Script struct {
	Name          string `json:"name"`
	Slug          string `json:"slug"`
	Description   string `json:"description"`
	Categories    []int  `json:"categories"`
	Type          string `json:"type"` // "ct" for containers, "vm" for VMs
	Updateable    bool   `json:"updateable"`
	Privileged    bool   `json:"privileged"`
	InterfacePort int    `json:"interface_port"`
	Documentation string `json:"documentation"`
	Website       string `json:"website"`
	ConfigPath    string `json:"config_path"`
	ScriptPath    string // Added for our use, not in the JSON
	DateCreated   string `json:"date_created"`
}

Script represents a single script from the repository.

func FetchScripts

func FetchScripts() ([]Script, error)

FetchScripts fetches all available scripts from the repository.

func GetScriptMetadata

func GetScriptMetadata(metadataURL string) (*Script, error)

GetScriptMetadata fetches and parses the metadata for a specific script.

func GetScriptsByCategory

func GetScriptsByCategory(category string) ([]Script, error)

GetScriptsByCategory returns scripts for a specific category.

type ScriptCategory

type ScriptCategory struct {
	Name        string
	Description string
	Path        string
}

ScriptCategory represents a category of Proxmox scripts.

func GetScriptCategories

func GetScriptCategories() []ScriptCategory

GetScriptCategories returns the available script categories.

Jump to

Keyboard shortcuts

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