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,77 @@
package app
import transportcfg "selective-vpn-api/app/transportcfg"
type transportSystemdBackend struct{}
type transportSystemdServiceTuning = transportcfg.SystemdServiceTuning
type transportSystemdHardening = transportcfg.SystemdHardening
func validSystemdUnitName(unit string) bool {
return transportcfg.ValidSystemdUnitName(unit)
}
func transportSystemdUnitPath(unit string) string {
return transportcfg.SystemdUnitPath(transportSystemdUnitsDir, unit)
}
func transportSystemdUnitOwnedByClient(path, clientID string) (bool, error) {
return transportcfg.SystemdUnitOwnedByClient(path, clientID)
}
func writeTransportSystemdUnitFile(unit string, content string) error {
return transportcfg.WriteSystemdUnitFile(transportSystemdUnitsDir, unit, content)
}
func renderTransportSystemdUnit(
client TransportClient,
unit string,
execStart string,
requiresSSH bool,
sshUnit string,
tuning transportSystemdServiceTuning,
hardening transportSystemdHardening,
) string {
return transportcfg.RenderSystemdUnit(
transportCfgClient(client),
stateDir,
unit,
execStart,
requiresSSH,
sshUnit,
transportcfg.SystemdServiceTuning(tuning),
transportcfg.SystemdHardening(hardening),
shellQuoteArg,
)
}
func renderTransportSSHOverlayUnit(
client TransportClient,
unit string,
execStart string,
tuning transportSystemdServiceTuning,
hardening transportSystemdHardening,
) string {
return transportcfg.RenderSSHOverlayUnit(
transportCfgClient(client),
stateDir,
unit,
execStart,
transportcfg.SystemdServiceTuning(tuning),
transportcfg.SystemdHardening(hardening),
shellQuoteArg,
)
}
func transportSystemdServiceTuningFromConfig(cfg map[string]any, prefix string) transportSystemdServiceTuning {
return transportcfg.SystemdServiceTuningFromConfig(cfg, prefix, transportConfigInt)
}
func transportSystemdHardeningFromConfig(cfg map[string]any, prefix string) transportSystemdHardening {
return transportcfg.SystemdHardeningFromConfig(cfg, prefix)
}
func transportConfigHasKey(cfg map[string]any, key string) bool {
return transportcfg.ConfigHasKey(cfg, key)
}