config

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLocation = "/etc/pterodactyl/config.yml"

Variables

DefaultTLSConfig 設定內部網頁伺服器監聽公開連線時要使用的合理預設值。

@see https://blog.cloudflare.com/exposing-go-on-the-internet

Functions

func ConfigureDirectories

func ConfigureDirectories() error

ConfigureDirectories 確保系統上所有必要的目錄都存在。這些目錄 建立時只有擁有者能讀取資料,其他使用者則不行。

此函式「不是」執行緒安全的。

func ConfigurePasswd

func ConfigurePasswd() error

ConfigurePasswd 產生 Wings 啟動的容器所需使用的 passwd 檔案。

func ConfigureTimezone

func ConfigureTimezone() error

ConfigureTimezone 若組態中目前缺少時區資料,就為其進行設定。 若已設定值,此函式僅會驗證所使用的時區是否有效。

此函式「不是」執行緒安全的。

func EnableLogRotation

func EnableLogRotation() error

EnableLogRotation 若系統的 logrotate 組態目錄存在,但尚未找到 wings 的 logrotate 檔案,就將該檔案寫入該目錄。這讓我們基本上 能為多數安裝環境自動處理日誌輪替,同時也讓使用者能自行進行修改。

此函式「不是」執行緒安全的。

func EnsurePterodactylUser

func EnsurePterodactylUser() error

EnsurePterodactylUser 確保系統上存在 Pterodactyl 核心使用者。 此使用者將擁有根資料目錄中所有資料的所有權,並用於容器內部。 若檔案不屬於此使用者,Docker 掛載點就會出現權限問題。

此函式「不是」執行緒安全的,只應在應用程式開機時於主執行緒中呼叫。

func Expand

func Expand(v string) (string, error)

Expand 呼叫 os.ExpandEnv 展開輸入字串中所有的環境變數,接著 檢查該值是否以 `file://` 開頭,以支援從檔案中讀取該值。

注意:先展開環境變數、再檢查該值是否參照檔案,此順序很重要。 這樣的行為讓使用者能傳入類似 `file://${CREDENTIALS_DIRECTORY}/token` 的值,讓我們能配合 systemd 的 `LoadCredential`(或 `LoadCredentialEncrypted`)選項所載入的憑證使用,而不需要 使用者自行假設 `CREDENTIALS_DIRECTORY` 的路徑,或使用 preStart 腳本來為我們讀取檔案。

func FromFile

func FromFile(path string) error

FromFile 從指定的檔案讀取組態,並將其儲存於此實例的全域單例中。

func GetJwtAlgorithm

func GetJwtAlgorithm() *jwt.HMACSHA

GetJwtAlgorithm 回傳記憶體中的 JWT 演算法。

func Set

func Set(c *Configuration)

Set 設定全域組態實例。這是一個阻塞操作,任何嘗試設定不同組態值 或讀取組態的動作都會被暫停,直到此操作完成為止。

func SetDebugViaFlag

func SetDebugViaFlag(d bool)

SetDebugViaFlag 記錄應用程式是否因命令列旗標參數而以偵錯模式執行。 若是如此,我們不希望將此組態變更儲存至磁碟。

func Update

func Update(callback func(c *Configuration))

Update 使用執行緒安全的互斥鎖,對全域組態物件進行原地更新。 這是修改全域組態的正確方式。

func UseOpenat2

func UseOpenat2() bool

func WriteToDisk

func WriteToDisk(c *Configuration) error

WriteToDisk 將組態寫入磁碟。這是執行緒安全的操作,同時間僅允許 一次寫入,寫入期間的其他呼叫會被排入佇列。

Types

type ApiConfiguration

type ApiConfiguration struct {
	// 內部網頁伺服器應綁定的網路介面。
	Host string `default:"0.0.0.0" yaml:"host"`

	// 內部網頁伺服器應綁定的埠號。
	Port int `default:"8080" yaml:"port"`

	// daemon 的 SSL 組態。
	Ssl struct {
		Enabled         bool   `json:"enabled" yaml:"enabled"`
		CertificateFile string `json:"cert" yaml:"cert"`
		KeyFile         string `json:"key" yaml:"key"`
	}

	// 決定此實例是否啟用允許遠端下載檔案至伺服器目錄的功能。
	// 若設為 "true",伺服器將無法使用遠端下載功能。
	DisableRemoteDownload bool `json:"-" yaml:"disable_remote_download"`

	// 透過 Panel 上傳檔案的最大大小限制(MB)。
	UploadLimit int64 `default:"100" json:"upload_limit" yaml:"upload_limit"`

	// 可傳送 X-Forwarded-For 標頭以設定真實客戶端 IP 的代理伺服器 IP 位址清單
	TrustedProxies []string `json:"trusted_proxies" yaml:"trusted_proxies"`
}

ApiConfiguration 定義 Wings 網頁伺服器所公開的內部 API 組態。

type Backups

type Backups struct {
	// WriteLimit 對備份寫入磁碟施加磁碟 I/O 寫入速度限制,此設定會
	// 影響所有備份驅動程式,因為封存工具必須先將檔案寫入磁碟,
	// 才能上傳至任何外部儲存供應商。
	//
	// 若此值小於 1,寫入速度將不受限制;
	// 若此值大於 0,寫入速度即為此值(單位 MiB/s)。
	//
	// 預設為 0(無限制)
	WriteLimit int `default:"0" yaml:"write_limit"`

	// CompressionLevel 決定 wings 建立的備份要進行多少程度的壓縮。
	//
	// "none" -> 不進行任何壓縮
	// "best_speed" -> 使用 gzip 等級 1,速度較快
	// "best_compression" -> 使用 gzip 等級 9,磁碟空間使用量最少
	//
	// 預設為 "best_speed"(等級 1)
	CompressionLevel string `default:"best_speed" yaml:"compression_level"`

	// RestoreHostAllowlist 允許備份還原下載連線到原本會被封鎖的
	// 私有/內部目的地。項目可以是主機名稱、IP 位址或 CIDR 範圍。
	RestoreHostAllowlist []string `yaml:"restore_host_allowlist"`
}

type Configuration

type Configuration struct {
	Token Token `json:"-" yaml:"-"`

	// 決定 wings 是否應以偵錯模式執行。若透過命令列參數傳入
	// debug 旗標,此值會被忽略。
	Debug bool

	AppName string `default:"Pterodactyl" json:"app_name" yaml:"app_name"`

	// 此節點在 Panel 中的唯一識別碼。
	Uuid string

	// 傳送給 panel 的任何請求都必須包含此 token 的識別碼,
	// 才能正確查找該 token。
	AuthenticationTokenId string `json:"token_id" yaml:"token_id"`

	// 執行操作時使用的 token。對此實例的請求都必須以此 token
	// 進行驗證。
	AuthenticationToken string `json:"token" yaml:"token"`

	Api    ApiConfiguration    `json:"api" yaml:"api"`
	System SystemConfiguration `json:"system" yaml:"system"`
	Docker DockerConfiguration `json:"docker" yaml:"docker"`

	// 定義伺服器行程的內部節流組態,以避免有人執行無窮迴圈
	// 向日誌灌入大量資料。
	Throttles ConsoleThrottles

	// 此 daemon 應連線以收集資料並傳送事件的 panel 執行位置。
	PanelLocation string                   `json:"-" yaml:"remote"`
	RemoteQuery   RemoteQueryConfiguration `json:"remote_query" yaml:"remote_query"`

	// AllowedMounts 是允許的主機系統掛載點清單。
	// 「伺服器掛載」功能需要此設定才能正常運作。
	AllowedMounts []string `json:"-" yaml:"allowed_mounts"`

	// AllowedOrigins 是允許的請求來源清單。
	// Panel 的網址會自動被允許,此設定僅用於新增其他來源。
	AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins"`

	// AllowCORSPrivateNetwork 設定 `Access-Control-Request-Private-Network` 標頭,
	// 讓客戶端瀏覽器可以透過 HTTP 向內部 IP 位址發出請求。此設定
	// 僅適用於未使用 SSL 憑證、並以內部 IP 位址連線的 Wings 使用者。
	// 大多數使用者「不應」啟用此設定。
	AllowCORSPrivateNetwork bool `json:"allow_cors_private_network" yaml:"allow_cors_private_network"`

	// IgnorePanelConfigUpdates 會讓 panel 傳來的組態更新被忽略。
	IgnorePanelConfigUpdates bool `json:"ignore_panel_config_updates" yaml:"ignore_panel_config_updates"`
	// contains filtered or unexported fields
}

func Get

func Get() *Configuration

Get 回傳全域組態實例。這是一個執行緒安全的操作,若組態正在被 修改中則會被阻塞。

請注意,您「無法」透過修改此函式回傳的結構體來變更目前儲存的 組態。唯一能進行修改的方式是使用 Update() 函式,並在回呼函式中 傳入資料。

func NewAtPath

func NewAtPath(path string) (*Configuration, error)

NewAtPath 建立一個新的結構體,並設定其應儲存的路徑。 此函式不會修改目前儲存的全域組態。

type ConsoleThrottles

type ConsoleThrottles struct {
	// 此實例是否啟用節流器。
	Enabled bool `json:"enabled" yaml:"enabled" default:"true"`

	// 在給定的 Period 週期內,觸發警告並計入該伺服器之前,
	// 可輸出的總行數。
	Lines uint64 `json:"lines" yaml:"lines" default:"2000"`

	// 已處理行數重置為 0 之前所經過的時間。這會以固定週期持續執行,
	// 不受目前主控台輸出量影響。預設會每 100ms 將已處理行數
	// 重置回 0。
	Period uint64 `json:"line_reset_interval" yaml:"line_reset_interval" default:"100"`
}

type CrashDetection

type CrashDetection struct {
	// CrashDetectionEnabled 設定此節點上是否全域啟用崩潰偵測功能。
	CrashDetectionEnabled bool `default:"true" yaml:"enabled"`

	// 決定 Wings 是否應將以正常結束碼 "0" 停止、但並非透過
	// Wings 互動而停止的伺服器行程視為崩潰。例如:使用者並未
	// 按下停止按鈕,但行程卻自行乾淨地停止了。
	DetectCleanExitAsCrash bool `default:"true" yaml:"detect_clean_exit_as_crash"`

	// Timeout 指定兩次崩潰之間、不會觸發自動重新啟動伺服器的
	// 逾時秒數,此值用於避免伺服器在連續多次崩潰後卡在開機循環中。
	Timeout int `default:"60" json:"timeout"`
}

type DockerConfiguration

type DockerConfiguration struct {
	// 為透過 daemon 執行的容器建立新網路時應使用的網路組態。
	Network DockerNetworkConfiguration `json:"network" yaml:"network"`

	// Domainname 是所有容器使用的 Docker domainname。
	Domainname string `default:"" json:"domainname" yaml:"domainname"`

	// Registries(登錄伺服器)。
	Registries map[string]RegistryConfiguration `json:"registries" yaml:"registries"`

	// TmpfsSize 指定掛載至容器內 /tmp 目錄的大小。請注意,Docker
	// 會使用主機系統的記憶體來滿足此值,且我們不會追蹤該處的
	// 使用量,因此請避免為單一伺服器分配過大的空間。
	TmpfsSize uint `default:"100" json:"tmpfs_size" yaml:"tmpfs_size"`

	// ContainerPidLimit 設定容器在任何時刻可同時執行的行程總數上限。
	// 這在共享主機環境中是一項安全考量,因為惡意行程可能會建立
	// 足夠多的行程,導致主機節點的可用 pid 耗盡並當機。
	ContainerPidLimit int64 `default:"512" json:"container_pid_limit" yaml:"container_pid_limit"`

	// InstallerLimits 定義安裝程式容器的限制,避免伺服器的安裝流程
	// 意外消耗超出預期的資源。此設定會與伺服器定義的限制搭配使用,
	// 兩者中數值較高者將優先套用於安裝程式容器。
	InstallerLimits struct {
		Memory int64 `default:"1024" json:"memory" yaml:"memory"`
		Cpu    int64 `default:"100" json:"cpu" yaml:"cpu"`
	} `json:"installer_limits" yaml:"installer_limits"`

	// Overhead 控制提供給所有容器的記憶體額外配額,以規避某些軟體
	// (例如 JVM)無法維持在最大記憶體限制以下的問題。
	Overhead Overhead `json:"overhead" yaml:"overhead"`

	UsePerformantInspect bool `default:"true" json:"use_performant_inspect" yaml:"use_performant_inspect"`

	// 啟用使用者命名空間重新映射選項時,設定容器的使用者命名空間模式。
	//
	// 若此值為空白,則會使用 daemon 的使用者命名空間重新映射組態;
	// 若此值為 "host",則 pterodactyl 容器啟動時會停用使用者
	// 命名空間重新映射
	UsernsMode string `default:"" json:"userns_mode" yaml:"userns_mode"`

	LogConfig struct {
		Type   string            `default:"local" json:"type" yaml:"type"`
		Config map[string]string `` /* 127-byte string literal not displayed */
	} `json:"log_config" yaml:"log_config"`
}

DockerConfiguration 定義 daemon 與系統上容器及網路互動時使用的 docker 組態。

func (DockerConfiguration) ContainerLogConfig

func (c DockerConfiguration) ContainerLogConfig() container.LogConfig

func (DockerConfiguration) RegistryCredentialsForImage

func (c DockerConfiguration) RegistryCredentialsForImage(img string) (string, *RegistryConfiguration)

RegistryCredentialsForImage 僅在已設定的登錄伺服器與映像檔參照 共享相同登錄伺服器身分時,才會回傳該映像檔的登錄伺服器認證。

type DockerNetworkConfiguration

type DockerNetworkConfiguration struct {
	// 建立網路時應使用的介面。此介面不得與 Docker 或系統上
	// 其他正在使用的介面衝突。
	Interface string `default:"172.18.0.1" json:"interface" yaml:"interface"`

	// 容器的 DNS 設定。
	Dns []string `default:"[\"1.1.1.1\", \"1.0.0.1\"]"`

	// 要使用的網路名稱。若此網路已存在,就不會再重新建立。
	// 若找不到,則會使用所定義的介面建立新的網路。
	Name       string                  `default:"pterodactyl_nw"`
	ISPN       bool                    `default:"false" yaml:"ispn"`
	Driver     string                  `default:"bridge"`
	Mode       string                  `default:"pterodactyl_nw" yaml:"network_mode"`
	IsInternal bool                    `default:"false" yaml:"is_internal"`
	EnableICC  bool                    `default:"true" yaml:"enable_icc"`
	NetworkMTU int64                   `default:"1500" yaml:"network_mtu"`
	Interfaces dockerNetworkInterfaces `yaml:"interfaces"`
}

type Overhead

type Overhead struct {
	// Override 控制是否應以組態檔案中的值覆寫額外配額限制。
	Override bool `default:"false" json:"override" yaml:"override"`

	// DefaultMultiplier 設定在沒有任何 Multipliers 可套用時所使用的預設倍率。
	DefaultMultiplier float64 `default:"1.05" json:"default_multiplier" yaml:"default_multiplier"`

	// Multipliers 讓您能依據伺服器所設定的記憶體量,覆寫 DefaultMultiplier。
	//
	// 預設值(於 Override 為 `false` 時使用)
	// - 記憶體小於 2048 MB,倍率為 1.15(15%)
	// - 記憶體小於 4096 MB,倍率為 1.10(10%)
	// - 其他情況,倍率為 1.05(5%)— 於 DefaultMultiplier 中指定
	//
	// 若在組態中指定預設值,看起來會像這樣:
	// “`yaml
	// multipliers:
	//   2048: 1.15
	//   4096: 1.10
	// “`
	Multipliers map[int]float64 `json:"multipliers" yaml:"multipliers"`
}

Overhead 控制提供給所有容器的記憶體額外配額,以規避某些軟體 (例如 JVM)無法維持在最大記憶體限制以下的問題。

func (Overhead) GetMultiplier

func (o Overhead) GetMultiplier(memoryLimit int64) float64

type RegistryConfiguration

type RegistryConfiguration struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

RegistryConfiguration 定義指定 Docker 登錄伺服器的驗證憑證。

func (RegistryConfiguration) Base64

func (c RegistryConfiguration) Base64() (string, error)

Base64 以 base64 編碼字串的形式,回傳指定登錄伺服器的驗證資訊。

type RemoteQueryConfiguration

type RemoteQueryConfiguration struct {
	// Wings 允許一個對 Panel API 發出的請求完成所需的秒數。
	// 若超過這個時間,該請求就會被標記為失敗。若您的請求耗時
	// 超過 30 秒才能完成,很可能是效能問題,應該在 Panel 端
	// 解決,而不是靠調高這個數字來解決。
	Timeout int `default:"30" yaml:"timeout"`

	// Wings 實例啟動時,單次請求 Panel API 所載入的伺服器數量。
	// 系統會先向 Panel 發出一次請求以取得這個數量的伺服器,接著
	// 檢查分頁狀態,並平行發出額外的請求以取得剩餘的頁面。
	//
	// 不建議變更此預設值,因為這樣很可能會遇到 Panel 實例的
	// 記憶體限制。整體而言,以 4 次請求取得 50 台伺服器的資料,
	// 速度大致等同於以 2 次請求取得 100 台,或以 1 次請求取得
	// 400 台,而且更不容易對 Panel 造成效能問題。
	BootServersPerPage int `default:"50" yaml:"boot_servers_per_page"`
}

RemoteQueryConfiguration 定義 Wings 對 Panel 發出遠端請求的組態設定。

type SftpConfiguration

type SftpConfiguration struct {
	// SFTP 伺服器的綁定位址。
	Address string `default:"0.0.0.0" json:"bind_address" yaml:"bind_address"`
	// SFTP 伺服器的綁定埠號。
	Port int `default:"2022" json:"bind_port" yaml:"bind_port"`
	// 若設為 true,SFTP 伺服器將不允許任何寫入動作。
	ReadOnly bool `default:"false" yaml:"read_only"`
}

SftpConfiguration 定義內部 SFTP 伺服器的組態。

type SystemConfiguration

type SystemConfiguration struct {
	// 儲存所有 pterodactyl 資料的根目錄。
	RootDirectory string `default:"/var/lib/pterodactyl" json:"-" yaml:"root_directory"`

	// 儲存伺服器安裝日誌與其他 wings 事件日誌的目錄。
	LogDirectory string `default:"/var/log/pterodactyl" json:"-" yaml:"log_directory"`

	// 儲存伺服器資料的目錄。
	Data string `default:"/var/lib/pterodactyl/volumes" json:"-" yaml:"data"`

	// 儲存傳輸用伺服器封存檔的目錄。
	ArchiveDirectory string `default:"/var/lib/pterodactyl/archives" json:"-" yaml:"archive_directory"`

	// 儲存本機備份的目錄。
	BackupDirectory string `default:"/var/lib/pterodactyl/backups" json:"-" yaml:"backup_directory"`

	// TmpDirectory 指定 Pterodactyl 安裝流程所需暫存檔案的建立位置,
	// 這樣可支援執行 docker-in-docker 的環境。
	TmpDirectory string `default:"/tmp/pterodactyl" json:"-" yaml:"tmp_directory"`

	// 應擁有所有伺服器檔案並用於容器的使用者。
	Username string `default:"pterodactyl" yaml:"username"`

	// 此 Wings 實例的時區。Wings 會盡可能自動偵測此值,若無法
	// 偵測到則會退回使用 UTC。若您需要手動設定,也是可以的。
	//
	// 此時區值會傳遞給 Wings 建立的所有容器。
	Timezone string `yaml:"timezone"`

	// 用於建立系統使用者的相關定義,讓我們能快速取得此資訊,
	// 而不必每次都進行系統查詢。
	User struct {
		// Rootless 控制與 rootless 容器 daemon 相關的設定。
		Rootless struct {
			// Enabled 控制是否啟用 rootless 容器。
			Enabled bool `yaml:"enabled" default:"false"`
			// ContainerUID 控制容器內使用者的 UID。
			// 通常應設為 0,讓容器以執行 Wings 的使用者身分執行。
			ContainerUID int `yaml:"container_uid" default:"0"`
			// ContainerGID 控制容器內使用者的 GID。
			// 通常應設為 0,讓容器以執行 Wings 的使用者身分執行。
			ContainerGID int `yaml:"container_gid" default:"0"`
		} `yaml:"rootless"`

		Uid int `yaml:"uid"`
		Gid int `yaml:"gid"`
	} `yaml:"user"`

	// Passwd 控制是否將產生的 passwd 檔案掛載至 Wings 啟動的容器中。
	Passwd struct {
		// Enable 控制是否應將產生的 passwd 檔案掛載至容器中。
		//
		// 此選項預設為停用,Wings 不會將任何額外的 passwd
		// 檔案掛載至容器。
		Enable bool `yaml:"enabled" default:"false"`

		// Directory 是磁碟上儲存產生的 passwd 檔案的目錄。
		// 此目錄可能是暫時性的,因為 Wings 每次啟動時都會重新建立。
		//
		// 此路徑「將會」同時被 Wings 寫入,也會被掛載到 Wings 建立
		// 的容器中。若您在容器中執行 Wings 本身,此路徑就必須以
		// 主機上完全相同的路徑掛載至 Wings 容器中,且應與此處指定
		// 的值一致。若您使用 SELinux,還需確保此檔案具備正確的
		// SELinux context,容器才能使用它。
		Directory string `yaml:"directory" default:"/run/wings/etc"`
	} `yaml:"passwd"`

	// MachineID 控制是否將產生的 `/etc/machine-id` 檔案掛載至 Wings 啟動的容器中。
	MachineID struct {
		// Enable 控制是否應將產生的 machine-id 檔案掛載至容器中。
		//
		// 此選項預設為啟用,Wings 會將額外的 machine-id 檔案
		// 掛載至容器中。
		Enable bool `yaml:"enabled" default:"true"`

		// Directory 是磁碟上儲存產生的 machine-id 檔案的目錄。
		// 此目錄可能是暫時性的,因為 Wings 每次啟動時都會重新建立。
		//
		// 此路徑「將會」同時被 Wings 寫入,也會被掛載到 Wings 建立
		// 的容器中。若您在容器中執行 Wings 本身,此路徑就必須以
		// 主機上完全相同的路徑掛載至 Wings 容器中,且應與此處指定
		// 的值一致。若您使用 SELinux,還需確保此檔案具備正確的
		// SELinux context,容器才能使用它。
		Directory string `yaml:"directory" default:"/run/wings/machine-id"`
	} `yaml:"machine_id"`

	// 伺服器磁碟空間計算結果被視為過期、需要重新檢查前可經過的秒數。
	// 危險:將此值設得太低可能會嚴重影響系統效能,造成大量 I/O
	// 瓶頸與 Wings 行程 CPU 使用率飆高。
	//
	// 設為 0 可完全停用磁碟檢查,此時伺服器使用的磁碟空間將永遠
	// 回傳 0,僅應在效能極度重要、且不在意磁碟使用量的極端情境下設定。
	DiskCheckInterval int64 `default:"150" yaml:"disk_check_interval"`

	// ActivitySendInterval 是彙整後的伺服器活動記錄傳送給 Panel 之間
	// 應間隔的時間。預設會傳送過去一分鐘內收集到的活動記錄。請注意,
	// 每次執行只會傳送由 ActivitySendCount 所定義、固定數量的活動
	// 日誌項目。
	ActivitySendInterval int `default:"60" yaml:"activity_send_interval"`

	// ActivitySendCount 是每批次傳送的活動事件數量。
	ActivitySendCount int `default:"100" yaml:"activity_send_count"`

	// 若設為 true,伺服器行程啟動時會檢查檔案權限。若伺服器有
	// 大量檔案,可能會造成開機延遲。多數情況下停用此選項不會
	// 造成太大影響,除非有外部行程頻繁修改伺服器的檔案。
	CheckPermissionsOnBoot bool `default:"true" yaml:"check_permissions_on_boot"`

	// 若設為 false,Wings 在開機時偵測不到 log rotate 組態時,
	// 將不會嘗試將其寫入磁碟。
	EnableLogRotate bool `default:"true" yaml:"enable_log_rotate"`

	// 伺服器連上 websocket 時要傳送的日誌行數。
	WebsocketLogCount int `default:"150" yaml:"websocket_log_count"`

	Sftp SftpConfiguration `yaml:"sftp"`

	CrashDetection CrashDetection `yaml:"crash_detection"`

	Backups Backups `yaml:"backups"`

	Transfers Transfers `yaml:"transfers"`

	OpenatMode string `default:"auto" yaml:"openat_mode"`
}

SystemConfiguration 定義基本的系統組態設定。

func (*SystemConfiguration) GetStatesPath

func (sc *SystemConfiguration) GetStatesPath() string

GetStatesPath 回傳追蹤伺服器狀態的 JSON 檔案位置。

type Token

type Token struct {
	ID    string
	Token string
}

type Transfers

type Transfers struct {
	// DownloadLimit 在下載傳輸封存檔時,對網路 I/O 讀取施加速度限制。
	//
	// 若此值小於 1,寫入速度將不受限制;
	// 若此值大於 0,寫入速度即為此值(單位 MiB/s)。
	//
	// 預設為 0(無限制)
	DownloadLimit int `default:"0" yaml:"download_limit"`
}

Jump to

Keyboard shortcuts

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