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
|
4514b44211
|
wireguard: implement MarshalYAML for PrivateKey and PublicKey
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
49b82ace71
|
wireguard: implement MarshalJSON for PrivateKey and PublicKey
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
|
60e2687d04
|
wireguard: make keys arrays instead of slices
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
|
47d79f7576
|
wireguard: introduce KeyPair.Validate()
it will also set the PublicKey field is empty
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
e2f831fd6a
|
wireguard: introduce NewKeyPair, NewPrivateKey, and PrivateKey.Public()
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
1d8c818ec4
|
wireguard: make PrivateKey and PublicKey two distinct types
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 |
Alejandro Mery
|
fdb0f0324f
|
zones: finish scan sorting the content
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
9aef92f32d
|
zones: assign zoneID to zones inferable ID
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
e5baf53758
|
zones: import wireguard keys from wgN.conf files
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
0fe451eed0
|
zones: introduce RingInfo.Merge()
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
cb5ea80e66
|
zones: introduce Zones.GetMachineByName()
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
f7da9519fa
|
zones: allow iterators to terminate
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
589fb2f0e1
|
zones: set zoneID based on wireguard config files
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
f5ee63e5aa
|
wireguard: cleanup Config parser using BinaryKey
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
0de2e3f4d9
|
wireguard: introduce BinaryKey.Equal()
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
c92873f07d
|
zones: introduce RingInfo and Machine.Rings
RingInfo includes Wireguard ring related details
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
4d25ea1d16
|
wireguard: introduce initial BinaryKey and KeyPair structs
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
0d14510958
|
zones: introduce RingAddressEncoder and RingZero/RingOne implementations
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
c3b47ba812
|
zones: introduce ValidZoneID() and ValidNodeID()
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
15f5aab449
|
zones: rename address.go to rings.go
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
7cf3ee04f5
|
zones: use cloudflare's resolver
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |
Alejandro Mery
|
a3e3cde4c4
|
zones: fix scanMachines to run after all zones have been read
Signed-off-by: Alejandro Mery <amery@jpi.io>
|
1 year ago |