platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,41 @@
package app
import "sync"
const (
singBoxProfilesStateVersion = 1
)
const (
singBoxProfileCodeNotFound = "SINGBOX_PROFILE_NOT_FOUND"
singBoxProfileCodeIDConflict = "SINGBOX_PROFILE_ID_CONFLICT"
singBoxProfileCodeBadID = "SINGBOX_PROFILE_ID_INVALID"
singBoxProfileCodeBadMode = "SINGBOX_PROFILE_MODE_INVALID"
singBoxProfileCodeBadBaseRevision = "SINGBOX_PROFILE_BASE_REVISION_INVALID"
singBoxProfileCodeRevisionMismatch = "SINGBOX_PROFILE_REVISION_MISMATCH"
singBoxProfileCodeSaveFailed = "SINGBOX_PROFILE_SAVE_FAILED"
singBoxProfileCodeSecretsFailed = "SINGBOX_PROFILE_SECRETS_FAILED"
singBoxProfileCodeValidationFailed = "SINGBOX_PROFILE_VALIDATION_FAILED"
singBoxProfileCodeRenderFailed = "SINGBOX_PROFILE_RENDER_FAILED"
singBoxProfileCodeApplyFailed = "SINGBOX_PROFILE_APPLY_FAILED"
singBoxProfileCodeRollbackFailed = "SINGBOX_PROFILE_ROLLBACK_FAILED"
singBoxProfileCodeHistoryMissing = "SINGBOX_PROFILE_HISTORY_NOT_FOUND"
singBoxProfileCodeNoClient = "SINGBOX_PROFILE_CLIENT_NOT_FOUND"
singBoxProfileCodeClientKind = "SINGBOX_PROFILE_CLIENT_KIND_MISMATCH"
singBoxProfileCodeRuntimeFailed = "SINGBOX_PROFILE_RUNTIME_FAILED"
)
var (
singBoxProfilesMu sync.Mutex
singBoxProfilesStatePath = stateDir + "/transport/singbox-profiles.json"
singBoxSecretsRootDir = stateDir + "/transport/secrets/singbox"
)
type singBoxProfilesState struct {
Version int `json:"version"`
UpdatedAt string `json:"updated_at,omitempty"`
Revision int64 `json:"revision,omitempty"`
ActiveProfileID string `json:"active_profile_id,omitempty"`
Items []SingBoxProfile `json:"items,omitempty"`
}