Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main branch from development #38

Merged
merged 67 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f028c43
Fixed LEA's computation of the number of 'undeployed' clusters.
kKdH Jan 10, 2024
beaade1
CI xtask -> Make .run_requiring_success() return an error for improve…
mbfm Jan 10, 2024
a7c59ab
Extend `ClusterAssignment` for network interface provisioning. #23
mbfm Jan 10, 2024
758fddf
Types -> Split up proto/mod.rs into individual modules.
mbfm Jan 10, 2024
9d119ff
Update dependencies to fix warning for yanked version of wasm-bindgen.
mbfm Jan 11, 2024
4a397cf
Switched from 'log' crate to 'tracing' crate for logging in LEA.
kKdH Jan 11, 2024
6ed5b23
CARL ClusterManager -> Introduce logic for mapping interfaces to memb…
mbfm Jan 11, 2024
afdb421
CARL ClusterManager -> Initial code for sending PeerClusterAssignment…
mbfm Jan 12, 2024
4f8f053
CI xtask -> Include THEO as package.
mbfm Jan 12, 2024
858d791
Fix various Clippy warnings.
mbfm Jan 12, 2024
a3edcfa
VPN -> Introduce API for retrieving the VPN IP Address of a peer. #23
mbfm Jan 12, 2024
15f99a0
VPN -> Introduce default timeout for requests. #23
mbfm Jan 12, 2024
689431e
CARL ClusterManager -> Request VPN IP addresses of members. #23
mbfm Jan 12, 2024
2925b42
CARL -> Don't depend on `hyper` and `http-body` directly.
mbfm Jan 16, 2024
d9adbbc
README -> Fix width of logo.
mbfm Jan 17, 2024
45adb6a
CI xtask -> Remove erronous file information from SBOMs.
mbfm Jan 17, 2024
0975b59
Remove obsolete rust-toolchain.toml.
mbfm Jan 17, 2024
f51b392
Update dependencies.
mbfm Jan 17, 2024
a0c775b
Add editorconfig file to prevent Windows newlines from causing problems.
mbfm Jan 17, 2024
8ba39ce
CI -> Add vagrantfile for local test environment
reimarstier Jan 10, 2024
435335e
CI -> Add test environment workflow
reimarstier Jan 12, 2024
f4afa76
CI -> Add theo command to ci, restructure theo, lint
reimarstier Jan 15, 2024
408e673
CI -> Reduce logic to create default vars, add timeout for testenv me…
reimarstier Jan 15, 2024
0b6f765
CI -> Update documentation for theo
reimarstier Jan 15, 2024
2a1917d
CI -> run-testenv: Fix paths to theo artifact
reimarstier Jan 16, 2024
945993d
CI -> run-testenv: Make theo executable
reimarstier Jan 16, 2024
0261acd
CI -> Ignore errors in cleanup of test environment
reimarstier Jan 16, 2024
d2461b3
CI -> Store container logs to review error
reimarstier Jan 16, 2024
2c5e062
CI/CLEO -> Add json output to create subcommand
reimarstier Jan 17, 2024
906ea5d
Update dependencies to fix vulnerability in h2.
mbfm Jan 18, 2024
abe0d31
Fixed LEA's routing according to the changes of leptos_routing 0.5.5.
kKdH Jan 18, 2024
a0d3eb3
Enhanced LEA's usability with toasts.
kKdH Jan 18, 2024
9c4ce6b
Types -> Introduce ShortName trait for PeerState.
mbfm Jan 18, 2024
a989f74
EDGAR -> Sends remote host IP address to CARL.
mbfm Jan 18, 2024
15419c6
Fixed 'unresolved import `leptos::leptos_dom::Mountable`'.
kKdH Jan 18, 2024
19fdd68
Disabled 'run-testenv' job until #34 has been resolved.
kKdH Jan 18, 2024
5dcb978
Move deny.toml into .ci/ folder.
mbfm Jan 19, 2024
997e075
CARL PeerMessagingBroker -> Simplify module structure.
mbfm Jan 19, 2024
18b6762
Fix Clippy warnings.
mbfm Jan 19, 2024
416f5ca
Types -> Introduce ShortName trait for ClusterState.
voelkera Jan 19, 2024
b717c05
CARL -> Pass EDGAR's remote host address into the PeerState and Clust…
mbfm Jan 19, 2024
4a71f5f
EDGAR -> Move bridge creation code into shared module.
mbfm Jan 22, 2024
b8c230e
CI -> Add option to run carl on host machine
reimarstier Jan 18, 2024
28a9bdb
CI -> Disable exposing ports by default in test environment
reimarstier Jan 18, 2024
298f28e
CI -> Add option to run carl on host and everything else in a virtual…
reimarstier Jan 18, 2024
9714440
CI -> Add documentation on how to start development test environment …
reimarstier Jan 18, 2024
349ad73
CI -> Enforce startup order of containers more explicitly
reimarstier Jan 19, 2024
50489b6
CI -> Re-enable test environment #34
reimarstier Jan 19, 2024
f7fed8a
CI -> Fix command status checking
reimarstier Jan 19, 2024
58db758
CI -> Add exit status code to CLEO, fix shell scripts to test cluster
reimarstier Jan 22, 2024
a88544a
EDGAR -> Move initial GRE-related code into shared module.
mbfm Jan 23, 2024
d5fa1df
EDGAR Managed Setup -> Implement usage with VPN disabled.
mbfm Jan 23, 2024
190bd08
EDGAR Managed -> Create bridge on startup rather than in setup.
mbfm Jan 23, 2024
035a597
CARL-API -> Fix unused import warning when compiled with WASM.
mbfm Jan 23, 2024
de51a99
LEA -> Document Ior.
mbfm Jan 23, 2024
660c898
EDGAR Service -> Create GRE interfaces after message from CARL.
mbfm Jan 23, 2024
3ce7696
Fixed construction of a Netbird `GroupName` from a `PeerId` or `Clust…
kKdH Jan 24, 2024
fb35c75
Changed activity types for workflow runs on pull requests.
kKdH Jan 25, 2024
09fa2e6
Enhanced the `cargo ci check` with parameters to pass cargo features.
kKdH Jan 25, 2024
b5d02c2
EDGAR Service -> Improve error handling when creating GRE interfaces.
mbfm Jan 24, 2024
b7f5443
CLEO -> generate-peer-setup command outputs the setup string in plain…
mbfm Jan 25, 2024
cb78d65
EDGAR Setup -> Make confirmation the default during initial prompt.
mbfm Jan 25, 2024
25af1be
EDGAR Setup -> Skip user confirmation with `--no-confirm`.
mbfm Jan 25, 2024
3211701
Code cleanup for setup-key generation.
mbfm Jan 25, 2024
959425c
Fixed 'Error parsing fromJson' for external PRs.
kKdH Jan 25, 2024
865a8d8
Updated leptos and leptos_router crates from '0.5.6' to '0.5.7'.
kKdH Jan 25, 2024
1f140ea
Doc -> Add 'Tips & Tricks' and clean up.
mbfm Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deny.toml → .ci/cargo-deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ unlicensed = "deny"
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"MIT",
"MIT-0",
"Apache-2.0",
"BSL-1.0",
"BSD-2-Clause",
Expand Down
104 changes: 0 additions & 104 deletions .ci/docker/README.md

This file was deleted.

118 changes: 118 additions & 0 deletions .ci/docker/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

machine = {
:hostname => "opendut-vm",
:memory => 8192,
:cpu => 4,
:ip => "192.168.56.10",
:box_name => "ubuntu/jammy64",
}

repo_root = ENV["OPENDUT_REPO_ROOT"]
custom_root_ca = ENV["CUSTOM_ROOT_CA"]
if repo_root.nil? then
puts "Environment variable 'OPENDUT_REPO_ROOT' not set. Exiting."
exit(1)
end
puts "Repository mounted on #{repo_root}"

Vagrant.configure("2") do |config|

config.vm.box = machine[:box_name]
config.vm.hostname = machine[:hostname]
config.vm.network "private_network", ip: machine[:ip]

# default shared folder required by provisioner (otherwise some files are not found)
config.vm.synced_folder ".", "/vagrant", disabled: false, SharedFoldersEnableSymlinksCreate: false
# share the root folder from the host (relative from where the Vagrantfile is located)
config.vm.synced_folder ".", repo_root, disabled: false, SharedFoldersEnableSymlinksCreate: false

# normal user is allowed to forward ports > 1024
config.vm.network :forwarded_port, guest: 3000, host: 3000, host_ip: "127.0.0.1"

config.vm.provider "virtualbox" do |vb|
vb.name = machine[:hostname]
vb.cpus = machine[:cpu]
vb.memory = machine[:memory]

vb.gui = (ENV["SHOW_GUI"] ||= "false").to_s == "true"

# https://www.virtualbox.org/manual/ch08.html
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--graphicscontroller", "VBoxSVGA"]
vb.customize ["modifyvm", :id, "--accelerate3d", "off"]
vb.customize ["modifyvm", :id, "--accelerate2dvideo", "off"]

end

# add ssh key
if !File.file?("#{Dir.home}/.ssh/id_rsa.pub")
puts "No SSH key found."
puts "Run e.g. 'mkdir -p ~/.ssh; ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa' to generate one."
end

# automatically change directory to the repository root
config.ssh.extra_args = ["-t", "cd #{repo_root}; bash --login"]
config.ssh.forward_x11 = true

# add custom root ca
if !custom_root_ca.nil? then
if !File.file?("#{custom_root_ca}") then
puts "Custom root CA not found."
else
puts "Custom root CA found. Adding to VM."
config.vm.provision "file", source: "#{custom_root_ca}", destination: "/tmp/custom_root_ca.crt"
config.vm.provision "shell" do |s|
s.inline = "cp /tmp/custom_root_ca.crt /usr/local/share/ca-certificates; update-ca-certificates"
s.privileged = true
end
end
end

config.vm.provision "shell" do |s|
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
s.inline = <<-SHELL
if grep -sq "#{ssh_pub_key}" /home/vagrant/.ssh/authorized_keys; then
echo "SSH keys already provisioned."
exit 0;
else
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
mkdir -p /root/.ssh
echo #{ssh_pub_key} >> /root/.ssh/authorized_keys
fi
SHELL
end
# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
config.vm.define machine[:hostname] do |box|
end

# Run Ansible from the Vagrant VM
config.vm.provision "ansible_local" do |ansible|
# ansible.compatibility_mode = "2.0"
ansible.playbook = "/vagrant/.ci/docker/vagrant/playbook.yml"
ansible.become = true
ansible.galaxy_role_file = "/vagrant/.ci/docker/vagrant/ansible-requirements.yml"
ansible.galaxy_roles_path = "/vagrant/.ci/docker/vagrant/local_roles/:/vagrant/.ci/docker/vagrant/downloaded_roles/"
ansible.galaxy_command = "ansible-galaxy install --role-file=%{role_file} --roles-path=/vagrant/.ci/docker/vagrant/downloaded_roles"

# https://developer.hashicorp.com/vagrant/docs/provisioning/ansible_common
ansible.tags = ENV["ANSIBLE_TAGS"] ||= "all"
ansible.skip_tags = ENV["ANSIBLE_SKIP_TAGS"] ||= "desktop"
ansible.verbose = ENV["ANSIBLE_VERBOSE"] ||= "" # do not enable verbose by default
# ansible.verbose = ENV["ANSIBLE_VERBOSE"] ||= "v" # enables verbose mode by default
ansible.extra_vars = {
"opendut_repo_root" => "/vagrant",
}
# ANSIBLE_ARGS="-v -e arg='value' --tags firefox" vagrant provision
ansible.raw_arguments = Shellwords.shellsplit(ENV['ANSIBLE_ARGS']) if ENV['ANSIBLE_ARGS']
end

# start docker with script
config.vm.provision "shell" do |script|
script.path = "./.ci/docker/vagrant/vagrant-entrypoint.sh"
script.args = ""
end


end
30 changes: 30 additions & 0 deletions .ci/docker/carl-on-host/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# forwards to carl running in developer IDE
version: "3.9"

services:
traefik-forwarder:
image: docker.io/traefik:v2.10.4
command:
- --api.insecure=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
# Redirect to HTTPS
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
- "--log.level=DEBUG"
- "--accesslog"
volumes:
- "../../../resources/development/tls/:/etc/opendut-network/tls/:ro"

#ports:
# - "127.0.0.1:8082:8080" # traefik dashboard
networks:
opendutnet:
aliases:
- carl

networks:
opendutnet:
name: opendut_network
external: true # Use a pre-existing network
6 changes: 6 additions & 0 deletions .ci/docker/carl-on-host/localhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
version: "3.9"
services:
traefik-forwarder:
volumes:
- ./traefik_host/:/etc/traefik/dynamic/:ro
18 changes: 18 additions & 0 deletions .ci/docker/carl-on-host/traefik_host/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# As TOML Configuration File
[tcp.routers]
[tcp.routers.router1]
service = "carl"
rule = "HostSNI(`*`)"
[tcp.routers.router1.tls]
passthrough = true

[tcp.services]
[tcp.services.carl]
[tcp.services.carl.loadBalancer]
[[tcp.services.carl.loadBalancer.servers]]
address = "192.168.32.1:8080"

[[tls.certificates]]
certFile = "/etc/opendut-network/tls/carl.pem"
keyFile = "/etc/opendut-network/tls/carl.key"
stores = ["default"]
18 changes: 18 additions & 0 deletions .ci/docker/carl-on-host/traefik_vm/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# As TOML Configuration File
[tcp.routers]
[tcp.routers.router1]
service = "carl"
rule = "HostSNI(`*`)"
[tcp.routers.router1.tls]
passthrough = true

[tcp.services]
[tcp.services.carl]
[tcp.services.carl.loadBalancer]
[[tcp.services.carl.loadBalancer.servers]]
address = "192.168.56.1:8080"

[[tls.certificates]]
certFile = "/etc/opendut-network/tls/carl.pem"
keyFile = "/etc/opendut-network/tls/carl.key"
stores = ["default"]
6 changes: 6 additions & 0 deletions .ci/docker/carl-on-host/vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
version: "3.9"
services:
traefik-forwarder:
volumes:
- ./traefik_vm/:/etc/traefik/dynamic/:ro
4 changes: 2 additions & 2 deletions .ci/docker/carl/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ services:
retries: 3
start_period: 40s

ports:
- "443"
#ports:
# - "443"
networks:
opendutnet:
ipv4_address: 192.168.32.200
Expand Down
3 changes: 3 additions & 0 deletions .ci/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ RUN echo "${PUSER} ALL=(ALL:ALL) NOPASSWD: /usr/sbin/update-ca-certificates" >>
RUN echo "${PUSER} ALL=(ALL:ALL) NOPASSWD: /usr/sbin/append_hosts.sh" >> /etc/sudoers
COPY ./.ci/docker/dev/append_hosts.sh /usr/sbin/append_hosts.sh

# allow all sudo commands
#RUN echo "${PUSER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

# Set up OpenDUT repo path to ensure docker in docker cross compilation will use the same path as the host
RUN mkdir -p $OPENDUT_REPO_ROOT
WORKDIR $OPENDUT_REPO_ROOT
Expand Down
12 changes: 12 additions & 0 deletions .ci/docker/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ services:
- PGROUP
- DOCKER_GID
- OPENDUT_REPO_ROOT
# CARL
- OPENDUT_CARL_NETWORK_REMOTE_HOST=carl
- OPENDUT_CARL_NETWORK_REMOTE_PORT=443
- OPENDUT_CARL_NETWORK_BIND_PORT=443
- OPENDUT_CARL_VPN_ENABLED=true
- OPENDUT_CARL_VPN_KIND=netbird
- OPENDUT_CARL_VPN_NETBIRD_URL=http://netbird-management/api
- OPENDUT_CARL_VPN_NETBIRD_HTTPS_ONLY=false
- OPENDUT_CARL_VPN_NETBIRD_AUTH_SECRET=$NETBIRD_API_TOKEN
- OPENDUT_CARL_VPN_NETBIRD_AUTH_TYPE=personal-access-token

# cleo
- OPENDUT_CLEO_NETWORK_CARL_HOST=carl
- OPENDUT_CLEO_NETWORK_CARL_PORT=443
Expand All @@ -37,6 +48,7 @@ services:
- ../../../:$OPENDUT_REPO_ROOT
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- "../../../resources/development/tls/insecure-development-ca.pem:/etc/opendut-network/tls/ca.pem"

- $HOME/opendut_dev/:/opendut_dev/
- $HOME/.cargo/:/home/$PUSER/.cargo/
Expand Down
29 changes: 29 additions & 0 deletions .ci/docker/doc/manual-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Manual mode

Manually start containers from the command line.
All the commands are run from the repository root.

## Start containers

```sh
docker compose -f .ci/docker/carl/docker-compose.yml --env-file .env up -d
docker compose -f .ci/docker/edgar/docker-compose.yml --env-file .env up -d
docker compose -f .ci/docker/firefox/docker-compose.yml --env-file .env up -d
```

## Environment variables

* Prepare container environment variables
```bash
echo PUID=$(id -u) >> .env
echo PGID=$(id -g) >> .env
echo PUSER=$(id -un) >> .env
echo PGROUP=$(id -gn) >> .env
echo DOCKER_GID=$(cut -d: -f3 < <(getent group docker)) >> .env
echo OPENDUT_REPO_ROOT=$(git rev-parse --show-toplevel) >> .env
```
* Build dev container
```bash
docker compose -f .ci/docker/dev/docker-compose.yml --env-file .env build
docker compose -f .ci/docker/dev/docker-compose.yml --env-file .env up
```
Loading
Loading