server

package
v0.0.0-...-e356956 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePlaybookDB

func DeletePlaybookDB(db *bolt.DB, pb *playbook.Playbook) error

func GetAllPlaybooksFromDB

func GetAllPlaybooksFromDB(db *bolt.DB) map[string]*playbook.Playbook

func ServerMain

func ServerMain()

func UpdatePlaybookDB

func UpdatePlaybookDB(db *bolt.DB, pb *playbook.Playbook) error

Types

type AutoUpdater

type AutoUpdater struct {
	// contains filtered or unexported fields
}

More like AutoSlow, because of how unscalable and unoptimized it is. Needs redesign and refactor like client code. Someday i'll have the time for that ~sigh~

func NewAutoUpdater

func NewAutoUpdater(server *AutoVPNServer) *AutoUpdater

func (*AutoUpdater) DelEntry

func (u *AutoUpdater) DelEntry(name string)

func (*AutoUpdater) GetEntries

func (u *AutoUpdater) GetEntries() map[string]int

func (*AutoUpdater) Tick

func (u *AutoUpdater) Tick()

func (*AutoUpdater) UpdateEntry

func (u *AutoUpdater) UpdateEntry(name string, interval int)

type AutoVPNServer

type AutoVPNServer struct {
	pb.UnimplementedAutoVPNServer
	// contains filtered or unexported fields
}

func (*AutoVPNServer) ExecuteTask

func (*AutoVPNServer) StepApplyDNS

func (s *AutoVPNServer) StepApplyDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Put these DNS records onto our dns cache server or whatever. Wants in context: "playbook", "dnsrecords"

func (*AutoVPNServer) StepApplyLockAdd

func (s *AutoVPNServer) StepApplyLockAdd(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Lock newly parsed playbook and add to db. Wants in context: playbook

func (*AutoVPNServer) StepApplyRoutes

func (s *AutoVPNServer) StepApplyRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Put these routes on our router. Wants in context: playbook, dnsrecords

func (*AutoVPNServer) StepFetchIPs

func (s *AutoVPNServer) StepFetchIPs(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Run DOH resolver to gather ips to route. Wants in context: "playbook"

func (*AutoVPNServer) StepFinalizePlaybook

func (s *AutoVPNServer) StepFinalizePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Set out playbook as installed and unlock. Wants in context: "playbook"

func (*AutoVPNServer) StepList

func (s *AutoVPNServer) StepList(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

List our playbooks to the user

func (*AutoVPNServer) StepSwapPlaybooks

func (s *AutoVPNServer) StepSwapPlaybooks(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Swap new playbook with retrieved old. For updating existing playbooks with new revisions. Wants in context: old_playbook, playbook

func (*AutoVPNServer) StepUndoDNS

func (s *AutoVPNServer) StepUndoDNS(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Remove these DNS records from our dns cache server or whatever. Wants in context: "playbook"

func (*AutoVPNServer) StepUndoRoutes

func (*AutoVPNServer) StepUndoRoutes(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Remove these routes records from our router. Wants in context: "playbook"

func (*AutoVPNServer) StepUpdatePlaybook

func (s *AutoVPNServer) StepUpdatePlaybook(updates chan *executor.ExecutorUpdate, ctx context.Context) context.Context

Update current playbook in bbolt db. Wants in context: playbook

func (*AutoVPNServer) UpdateUpdaterTable

func (s *AutoVPNServer) UpdateUpdaterTable()

func (*AutoVPNServer) UpdaterLoop

func (s *AutoVPNServer) UpdaterLoop()

type TaskBuilder

type TaskBuilder struct {
	// contains filtered or unexported fields
}

Builds a task, by creating an executor with a specific set of steps and a prepared context.

func NewTaskBuilder

func NewTaskBuilder(srv *AutoVPNServer) *TaskBuilder

func (*TaskBuilder) Apply

func (tb *TaskBuilder) Apply(playbk_yaml string) error

func (*TaskBuilder) Build

func (tb *TaskBuilder) Build() *executor.Executor

func (*TaskBuilder) List

func (tb *TaskBuilder) List() error

func (*TaskBuilder) Undo

func (tb *TaskBuilder) Undo(pbook_name string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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