Alejandro Mery
6ee848e6ca
jpictl: introduce `-e` for `jpictl env` to export variables
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
864eb02f9d
zones: turn Zones.WriteEnv() into Zones.Env().WriteTo()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
9da2f8711f
zones: fix PruneWireguardConfig recursion
...
Zones and Zone implementation should call Machine's directly
instead jumping back to Zone's for each Machine again and again
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
a5d9466fb8
zones: change WriteEnv() to not fake gateways
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
3d638e9a85
zones: add Zone.SetGateway() to set one by ID
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
60d3a2c290
zones: set first node of a Zone as ring0 gateway if it doesn't have one already
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
af90825f13
zones: Machine.SetGateway()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
b4f1d2e4d9
wireguard: implement Machine.SyncWireguardConfig()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
acf9e0e81d
zones: extend WriteWireguardConfig to include a Name indicating the ring ID
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
9762e78f5e
jpictl: do SyncWireguardConfig() on `write`
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
3534e7b755
zones: SyncWireguardConfig() as Prune+Write
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
b80dc84a26
zones: introduce WireguardConfigWriters
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
c0ef6ae9c4
zones: rearrange code around WireguardConfigPruner
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
58867031ea
zones: rearrange code around WireguardKeysWriter
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
b95d1f1878
zones: introduce Wireguard Ring Config factory
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
d38c909b0b
zones: introduce ZoneIterator, implemented by Zones
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
7dd3ea8f96
zones: Machine.Zone()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
07b4a22752
zones: introduce MachineIterator interface
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
d1f7d225ae
zones: fix RingOneAddress()'s generated address
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
dfbb358187
jpictl: introduce `write` command rewriting all config files
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
2043708949
zones: Zones.WriteWireguardKeys() and Zone.WriteWireguardKeys()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
311ae572da
zones: Zones.PruneWireguardConfig()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
4ca77b0ac0
zones: Zone.PruneWireguardConfig()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
1859c8e04b
zones: inject trailing new lines on Machine.WriteWireguardKeys()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
20484a5061
zones: change toml tags to match yaml and json output
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
c0e2ae9bf1
zones: annotate Machine for JSON encoding
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
080021b427
zones: annotate Machine for YAML encoding
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
2207e4a4a4
zones: fix New() to handle relative paths on hackpadfs
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
7ca01aa1e4
zones: Machine.RemoveWireguardConfig()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
8b72667f4d
zones: Machine.RemoveWireguardKeys()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
49694eb7cb
zones: Machine.WriteWireguardKeys()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
15a98c05ec
zones: Machine.WriteStringFile()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
a005823d44
zones: Machine.CreateFile() and Machine.CreateTruncFile()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
7af8484acc
zones: introduce Machine.OpenFile()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
0f1f1ce968
zones: introduce Machine.RemoveFile()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
5058f286c6
zones: switch to using hackpadfs/os.FS as the standard os.FS is incomplete
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
86075eb47f
zones: move Machine.ReadFile to a dedicated machine_file.go
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
c81b782b26
zones: Machine.IsGateway()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
0f62ee2e53
zones: rename Machine.RingAddresses to Machine.Rings
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
30a7bceda3
wireguard: make KeyPairs solid
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
1419e55d5b
zones: remove useless RingInfo.Address
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
ffdacb833b
zones: add Port information to RingAddressEncoder
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
aca0a5e834
zones: calculate Machine.ID on init
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
61374d4cc5
zones: load wireguard key pairs on Machine.init()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
975e166da7
zones: allow RingInfo.Merge() to enable, but not disable
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
b16c648f2c
zones: introduce Machine.GetWireguardKeys()
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
2f51a463b2
zones: reduce writeEnvZone() complexity
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
75206e4fa5
zones: Zones.WriteEnv() writing env variables describing the cluster
...
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
b084e103b9
zones: introduce Machine.getRingInfo()
...
and refactor Machine.applyRingInfo()
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago
Alejandro Mery
223edf846b
zones: introduce Zone.ForEachMachine()
...
and refactor Zones.ForEachMachine() using it
Signed-off-by: Alejandro Mery <amery@jpi.io>
1 year ago