Compare commits

...

4 Commits

Author SHA1 Message Date
772f3fff61 feat: openwrt docker recipe
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2024-03-13 10:42:53 +01:00
ede2142b9f feat(x86): use random uuid to generate machine id
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-03-08 20:15:11 +01:00
c9bedc3bf8 feat: use emissary 2024.3.4-stable.1803.0b34b48
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2024-03-04 18:08:24 +00:00
df8872064a feat: use emissary 2024.3.4-stable.1752.ab08d30
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-03-04 17:57:14 +00:00
6 changed files with 54 additions and 4 deletions

View File

@ -87,6 +87,8 @@ $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH):
cp -rf files/* $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)/
custom-files: $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)
flash:
OPENWRT_DEVICE=$(OPENWRT_DEVICE) OPENWRT_PROFILE=$(OPENWRT_PROFILE) OPENWRT_VERSION=$(OPENWRT_VERSION) misc/script/flash.sh

View File

@ -1 +1 @@
2024.3.4-stable.809.4a1a434
2024.3.4-stable.1803.0b34b48

View File

@ -25,6 +25,13 @@ main() {
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow 42521 on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='42521'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection

21
misc/docker/Dockerfile Normal file
View File

@ -0,0 +1,21 @@
ARG OPENWRT_VERSION=
ARG CUSTOM_FILES=
ARG ADDITIONAL_OPENWRT_PACKAGES=
FROM reg.cadoles.com/proxy_cache/openwrt/rootfs:x86-64-${OPENWRT_VERSION}
COPY files/ /
COPY misc/x86/uci/ /etc/config/
COPY misc/x86/uci-defaults/ /etc/uci-defaults/
RUN mkdir -p /var/lock \
&& mkdir -p /var/run \
&& opkg update \
&& opkg install dmidecode ${ADDITIONAL_OPENWRT_PACKAGES} \
&& rm /var/opkg-lists/* \
&& /etc/init.d/emissary-agent enable
STOPSIGNAL SIGKILL
CMD ["/sbin/init"]

View File

@ -11,14 +11,13 @@ main() {
fi
# Accumulate data to create unique machine id
local mac_addresses=$(cat /sys/class/net/*/address | uniq | sort)
local device_uuid=$(dmidecode | grep UUID)
local random_uuid=$(cat /proc/sys/kernel/random/uuid)
# Ensure destination directory
mkdir -p "$(dirname "$machine_id_file")"
# Generate SHA256 hash of data and save it to $machine_id_file
echo "$mac_adresses $device_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
echo "$random_uuid" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
}
main

21
targets/docker.mk Normal file
View File

@ -0,0 +1,21 @@
DOCKER_REPOSITORY ?= reg.cadoles.com/cadoles
DOCKER_CMD ?=
all: docker
docker:
$(MAKE) OPENWRT_TARGET="docker" EMISSARY_ARCH="amd64" custom-files
docker build \
--build-arg OPENWRT_VERSION=$(OPENWRT_VERSION) \
--build-arg ADDITIONAL_OPENWRT_PACKAGES=$(ADDITIONAL_OPENWRT_PACKAGES) \
-t $(DOCKER_REPOSITORY)/emissary-agent:latest \
-f misc/docker/Dockerfile \
.
run-docker:
docker run \
-it --rm \
--name emissary-agent \
-p 42521:42521 \
$(DOCKER_REPOSITORY)/emissary-agent:latest \
$(DOCKER_CMD)