Skip to content

Commit 0ed7250

Browse files
author
Dimy Jeannot
committed
fix: working on infrastructure
1 parent 9ada0a0 commit 0ed7250

File tree

11 files changed

+162
-47
lines changed

11 files changed

+162
-47
lines changed

apps/workloads/private/event/v2alpha/event-multiplexer/spec.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ nebula:
5454
static_host_map:
5555
- '192.168.100.1'
5656
host:
57-
- '192.168.100.1': ['144.202.30.222:4242']
57+
- '192.168.100.1': ['45.63.49.173:4242']
5858
lighthouse:
5959
am_lighthouse: false
6060
interval: 60
@@ -73,6 +73,9 @@ nebula:
7373
proto: any
7474
host: any
7575
pki:
76-
ca: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/ca.crt
77-
cert: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/hosts/configuration-v2alpha-configuration.crt
78-
key: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/hosts/configuration-v2alpha-configuration.key
76+
ca: ../../../../../tmp/ca.crt
77+
cert: ../../../../../tmp/local-1-event-v2alpha-event-multiplexer.crt
78+
key: ../../../../../tmp/local-1-event-v2alpha-event-multiplexer.key
79+
# ca: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/ca.crt
80+
# cert: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/hosts/configuration-v2alpha-configuration.crt
81+
# key: /Users/dimyjeannot/workspaces/jeannotcompany/ecosystem/.config/ca/hosts/configuration-v2alpha-configuration.key

apps/workloads/public/mesh/v2alpha/lighthouse/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ func main() {
1919
func run() error {
2020
configStr := `
2121
tun:
22-
user: true
23-
disabled: true
24-
25-
static_host_map:
26-
'192.168.100.1': ['localhost:4242']
22+
disabled: false
23+
dev: nebula1
24+
drop_local_broadcast: false
25+
drop_multicast: false
26+
tx_queue: 500
27+
mtu: 1300
28+
routes:
2729
2830
listen:
2931
host: 0.0.0.0
3032
port: 4242
3133
3234
lighthouse:
3335
am_lighthouse: true
34-
interval: 60
35-
hosts:
36-
- '192.168.100.1'
3736
3837
punchy:
3938
punch: true
39+
respond: true
4040
4141
firewall:
4242
outbound:

infrastructure/apps/workloads/private/event/v2alpha/event-multiplexer/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Install Nebula client using TUN device
44
- Route all traffic through TUN device except for what is on port 6477
55
- Bind port 4222 to TUN device
6+
- Bind port 7999 to TUN device
67
- Bind port 6477 to eth0 device
78

89
run as nonroot

infrastructure/apps/workloads/private/event/v2alpha/event-multiplexer/cloud-init.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ write_files:
2828
- path: /etc/motd
2929
content: |
3030
Welcome to the Event Multiplexer!
31+
- path: /etc/sysctl.d/99-disable-ipv6.conf
32+
content: |
33+
# Disable IPv6 on all interfaces
34+
net.ipv6.conf.all.disable_ipv6 = 1
35+
net.ipv6.conf.default.disable_ipv6 = 1
36+
net.ipv6.conf.lo.disable_ipv6 = 1
3137
- content: |
3238
[Unit]
3339
Description=Event Multiplexer
@@ -151,14 +157,19 @@ packages:
151157
152158
runcmd:
153159
- sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config
154-
- echo "PermitRootLogin no" >> /etc/ssh/sshd_config
160+
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
155161
- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
156162
- echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
157163
- systemctl restart sshd
164+
- sysctl --system
158165
- curl -L https://github.com/openecosystems/ecosystem/releases/download/apps-workloads-private-event-v2alpha-event-multiplexer/devel/apps-workloads-private-event-v2alpha-event-multiplexer_%s_Linux_x86_64.tar.gz | tar zx --strip-components=1 --directory /opt
159166
- chmod +x /opt/app
167+
- setcap cap_net_admin=+pe /opt/app
160168
- sudo systemctl enable app.service
161169
- sudo systemctl start app.service
170+
- ufw allow 6477/tcp
171+
- ufw allow from 192.168.0.0/16 to any port 4222
172+
- ufw allow from 192.168.0.0/16 to any port 7999
162173
163174
`, key, _caCrt, _hostCrt, _hostKey, version)
164175
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
pki:
2+
ca: /etc/nebula/ca.crt
3+
cert: /etc/nebula/host.crt
4+
key: /etc/nebula/host.key
5+
static_host_map:
6+
"192.168.100.1": ["45.63.49.173:4242"]
7+
lighthouse:
8+
am_lighthouse: false
9+
interval: 60
10+
hosts:
11+
- "192.168.100.1"
12+
listen:
13+
host: 0.0.0.0
14+
port: 4242
15+
punchy:
16+
punch: true
17+
respond: true
18+
relay:
19+
am_relay: false
20+
use_relays: false
21+
22+
tun:
23+
disabled: false
24+
dev: nebula1
25+
drop_local_broadcast: false
26+
drop_multicast: false
27+
tx_queue: 500
28+
mtu: 1300
29+
routes:
30+
31+
logging:
32+
level: info
33+
format: text
34+
35+
firewall:
36+
outbound_action: drop
37+
inbound_action: drop
38+
39+
conntrack:
40+
tcp_timeout: 12m
41+
udp_timeout: 3m
42+
default_timeout: 10m
43+
44+
outbound:
45+
- port: any
46+
proto: any
47+
host: any
48+
inbound:
49+
- port: any
50+
proto: icmp
51+
host: any
52+
- port: any
53+
proto: any
54+
host: any

infrastructure/apps/workloads/public/mesh/v2alpha/lighthouse/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,20 @@ cat local-1-mesh-v2alpha-lighthouse.crt | pulumi config set hostCrt
3434
cat local-1-mesh-v2alpha-lighthouse.key | pulumi config set hostKey
3535

3636
./nebula-cert sign -name "configuration-v2alpha-configuration" -ip "192.168.100.9/24" -groups "connectors"
37+
38+
39+
40+
# Enable CAP_NET for TUN device
41+
setcap cap_net_admin=+pe /opt/nebula
42+
43+
44+
## Disable IpV6
45+
vim /etc/sysctl.d/70-disable-ipv6.conf
46+
47+
net.ipv6.conf.all.disable_ipv6 = 1
48+
49+
sysctl -p -f /etc/sysctl.d/70-disable-ipv6.conf
50+
51+
52+
# Allow UDP on firewall
53+
ufw allow 4242/udp

infrastructure/apps/workloads/public/mesh/v2alpha/lighthouse/cloud-init.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ write_files:
2828
- path: /etc/motd
2929
content: |
3030
Welcome to your Lighthouse!
31+
- path: /etc/sysctl.d/99-disable-ipv6.conf
32+
content: |
33+
# Disable IPv6 on all interfaces
34+
net.ipv6.conf.all.disable_ipv6 = 1
35+
net.ipv6.conf.default.disable_ipv6 = 1
36+
net.ipv6.conf.lo.disable_ipv6 = 1
3137
- content: |
3238
[Unit]
3339
Description=Lighthouse Service
@@ -74,14 +80,17 @@ packages:
7480
7581
runcmd:
7682
- sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config
77-
- echo "PermitRootLogin no" >> /etc/ssh/sshd_config
83+
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
7884
- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
7985
- echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
8086
- systemctl restart sshd
87+
- sysctl --system
8188
- curl -L https://github.com/openecosystems/ecosystem/releases/download/apps-workloads-public-mesh-v2alpha-lighthouse/devel/apps-workloads-public-mesh-v2alpha-lighthouse_%s_Linux_x86_64.tar.gz | tar zx --strip-components=1 --directory /opt
8289
- chmod +x /opt/app
90+
- setcap cap_net_admin=+pe /opt/app
8391
- sudo systemctl enable lighthouse.service
8492
- sudo systemctl start lighthouse.service
93+
- ufw allow 4242/udp
8594
8695
`, key, _caCrt, _hostCrt, _hostKey, version)
8796
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
pki:
2+
ca: /etc/nebula/ca.crt
3+
cert: /etc/nebula/host.crt
4+
key: /etc/nebula/host.key
5+
lighthouse:
6+
am_lighthouse: true
7+
listen:
8+
host: 0.0.0.0
9+
port: 4242
10+
punchy:
11+
punch: true
12+
respond: true
13+
relay:
14+
am_relay: false
15+
use_relays: false
16+
17+
tun:
18+
disabled: false
19+
dev: nebula1
20+
drop_local_broadcast: false
21+
drop_multicast: false
22+
tx_queue: 500
23+
mtu: 1300
24+
routes:
25+
26+
logging:
27+
level: debug
28+
format: text
29+
30+
firewall:
31+
outbound_action: drop
32+
inbound_action: drop
33+
34+
conntrack:
35+
tcp_timeout: 12m
36+
udp_timeout: 3m
37+
default_timeout: 10m
38+
39+
outbound:
40+
- port: any
41+
proto: any
42+
host: any
43+
inbound:
44+
- port: any
45+
proto: icmp
46+
host: any
47+
- port: any
48+
proto: any
49+
host: any

infrastructure/cpln/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

infrastructure/cpln/cp.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)