Compare commits

...

55 Commits

Author SHA1 Message Date
b3fba8f4ee feat: use emissary 2024.3.13-stable.821.cec5c78
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2024-03-13 08:26:54 +00:00
e216c0ddbf feat: use emissary 2024.3.12-stable.1525.b5c36f1
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-03-12 15:30:55 +00: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
af6c9cfbe6 feat: use emissary 2024.3.4-stable.809.4a1a434
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-03-04 08:14:37 +00:00
73159308d1 feat: use emissary 2024.3.3-stable.1740.7671872
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-03-03 17:45:41 +00:00
158ef63f36 feat: add configurable agent and claim url for status page
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
ref arcad/emissary#21
2024-03-01 13:24:51 +01:00
64ef4a1b5c feat: use emissary 2024.3.1-stable.1041.8f21313
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2024-03-01 10:46:27 +00:00
70a31262ee feat: use emissary 2024.2.29-stable.1433.eee7e60
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-02-29 15:14:38 +00:00
eeecad130e feat: use emissary 2024.1.12-stable.1306.79f5301
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-12 13:11:35 +00:00
7cd6626a64 feat: use emissary 2024.1.11-stable.1331.a5c81dc
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-11 13:36:29 +00:00
ea9f7230ac feat: install package kmod-fs-ext4
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-11 12:07:35 +01:00
4009da19cf feat(agent): ensure /data/emissary directory before service start
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2024-01-11 10:13:01 +01:00
83608ce85e feat: execute data partition script earlier
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-11 10:09:56 +01:00
922310c823 feat(x86): use default root partition size
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-11 10:00:40 +01:00
6ecdd2c54b feat: automatically create /data mountpoint with available disk free space 2024-01-11 10:00:06 +01:00
57a40f12e3 feat: use emissary 2024.1.10-stable.1332.fefac83
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2024-01-10 13:37:10 +00:00
642ed76421 feat(x86): extend root partition to 1024Mb
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2024-01-10 12:03:21 +01:00
91f34171b6 feat: use emissary 2023.12.5-stable.2142.c43d1a5
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-12-05 21:48:23 +00:00
8529525524 feat: use emissary 2023.12.5-stable.2029.d9f11ac
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-05 20:35:17 +00:00
c50babbc50 feat: use emissary 2023.12.5-stable.1332.16a59fe
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-05 13:37:18 +00:00
b5e7560c53 feat: use emissary 2023.12.3-stable.1328.8d42bf0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-03 13:47:55 +00:00
9f616e4dd9 feat: use emissary 2023.12.1-stable.1421.3c3d7fe
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-01 14:26:03 +00:00
8ca78641ff feat: start emissary-agent later in the boot process and retry more times on error
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-01 14:43:22 +01:00
e2417fbdcc feat: use emissary 2023.12.1-stable.1326.ddddbbc
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-01 13:31:34 +00:00
82fb14dc36 feat: use emissary 2023.12.1-stable.1253.32ce5a2
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-01 12:57:51 +00:00
655ba28a6c feat: use emissary 2023.12.1-stable.1126.6a7945d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-12-01 11:30:57 +00:00
c053c996d9 chore: add links to release message
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-11-30 20:12:22 +01:00
25917a63b9 feat: use openwrt 23.05.2
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-11-30 20:05:16 +01:00
53a55bbc48 feat: use emissary 2023.11.30-stable.1853.86ddb6a
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-11-30 18:58:49 +00:00
cb184ccd4f feat: use emissary 2023.11.30-stable.1847.a6da1be
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-11-30 18:51:33 +00:00
5a9623f96f feat: use emissary 2023.10.25-stable.1928.b2b839c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-25 19:33:56 +00:00
120da74f01 feat: use emissary 2023.10.24-stable.2055.7fa3011
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-24 21:00:12 +00:00
c6aa6a8089 feat: use openwrt 23.05.0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-24 09:02:22 +02:00
2276e202d2 feat(bpi-r3): use openwrt 23.05.0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-23 09:27:40 +02:00
2caa7781e0 feat: use emissary 2023.10.22-stable.2118.0d2aac4
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-22 21:23:20 +00:00
241b9ad3cc feat: use emissary 2023.10.22-stable.2105.38795a9
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-22 21:10:27 +00:00
f7da4a3b74 feat: use emissary 2023.10.22-stable.848.327226a
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-22 08:53:33 +00:00
f93a9cfaca feat: use emissary 2023.10.22-stable.750.fbf818e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-22 07:54:58 +00:00
acc3c13249 feat: use emissary 2023.10.21-stable.1947.46a853a
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-21 19:52:19 +00:00
abd5cef671 feat: use emissary 2023.10.21-stable.1939.f31a63e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-21 19:43:47 +00:00
b910fecb21 feat: use emissary 2023.10.20-stable.1539.c8a2303
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-20 15:44:02 +00:00
1ff432c20e feat: use emissary 2023.10.19-stable.2022.ced2658
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-20 09:07:04 +00:00
ae5caf88d3 feat: use emissary 2023.10.13-stable.1222.e756a60
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-13 12:27:28 +00:00
f165301856 feat: use emissary 2023.10.13-stable.1030.752f1ae
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-13 10:35:23 +00:00
50ce5a25ee feat: sentry integration
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-13 12:29:51 +02:00
b8a8c9257b fix: typo in agent config
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-12 23:00:35 +02:00
7608a983e6 feat: add *.itb upgrade firmware files
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-12 19:12:28 +02:00
28c2bf152c feat(bpi-r3): use openwrt 23.05.0-rc4
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-12 09:50:55 +02:00
707a8c6f30 feat: share common uci-defaults rule + add agent additional collectors
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-11 10:09:51 +02:00
4b5f2b63d0 feat(bpi-r3): add default firewall rules 2023-10-11 10:09:51 +02:00
ce0b211bfa feat: use emissary 2023.10.3-stable.538.9068203
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-10-03 05:43:03 +00:00
0fbae8a5ca feat: use emissary 2023.10.3-stable.410.a84fa05
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-10-03 04:14:55 +00:00
eaf60e139e feat: use emissary 2023.9.20-stable.1602.6318a8b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-09-20 16:08:07 +00:00
19 changed files with 137 additions and 99 deletions

View File

@ -5,7 +5,7 @@ GIT_VERSION := $(shell git describe --always)
DATE_VERSION := $(shell date +%Y.%m.%d)
FULL_VERSION := v$(DATE_VERSION)-$(GIT_VERSION)
OPENWRT_VERSION ?= 22.03.2
OPENWRT_VERSION ?= 23.05.2
OPENWRT_TARGET ?= mvebu/cortexa9
OPENWRT_TARGET_DASHED ?= $(shell echo $(OPENWRT_TARGET) | sed 's|/|-|')
OPENWRT_PROFILE ?= linksys_wrt1200ac
@ -28,7 +28,7 @@ EMISSARY_ARCH ?= armv6
EMISSARY_RECONCILIATION_INTERVAL ?=
EMISSARY_SERVER_URL ?=
BASE_INSTALL ?= install-emissary-files
BASE_INSTALL ?= install-emissary-files install-common-uci-defaults install-common-additional-agent-collectors
ADDITIONAL_INSTALL ?=
ADDITIONAL_OPENWRT_PACKAGES ?=
@ -46,7 +46,7 @@ build: $(IMAGEBUILDER_DIR_PATH) $(IMAGEBUILDER_CUSTOM_PACKAGES_DIR_PATH) $(IMAGE
# Cleanup old packages signature
rm -f $(IMAGEBUILDER_DIR_PATH)/Packages $(IMAGEBUILDER_DIR_PATH)/Packages.gz $(IMAGEBUILDER_DIR_PATH)/Packages.sig
# Build firmware
$(MAKE) \
-C "$(IMAGEBUILDER_DIR_PATH)" \
@ -56,6 +56,7 @@ build: $(IMAGEBUILDER_DIR_PATH) $(IMAGEBUILDER_CUSTOM_PACKAGES_DIR_PATH) $(IMAGE
CONFIG_IPV6=n \
FILES="$(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)" \
BIN_DIR="$(BIN_DIR)" \
ROOTFS_PARTSIZE="$(ROOTFS_PARTSIZE)" \
clean image
$(IMAGEBUILDER_DIR_PATH): $(IMAGEBUILDER_ARCHIVE_PATH)
@ -100,6 +101,7 @@ gitea-release: tools/gitea-release/bin/gitea-release.sh
\( -name '*.img.gz' \
-or -name '*.bin' \
-or -name '*.img' \
-or -name '*.itb' \
\) -exec cp {} .gitea-release/ \;
GITEA_RELEASE_PROJECT="emissary-firmware" \
@ -109,7 +111,7 @@ gitea-release: tools/gitea-release/bin/gitea-release.sh
GITEA_RELEASE_NAME="$(FULL_VERSION)" \
GITEA_RELEASE_COMMITISH_TARGET="$(GIT_VERSION)" \
GITEA_RELEASE_IS_DRAFT="false" \
GITEA_RELEASE_BODY="With Emissary $(EMISSARY_RELEASE)" \
GITEA_RELEASE_BODY='Based on OpenWRT [`$(OPENWRT_VERSION)`](https://downloads.openwrt.org/releases/$(OPENWRT_VERSION)/targets/) and with Emissary [`$(EMISSARY_RELEASE)`](https://forge.cadoles.com/arcad/emissary/releases/tag/$(EMISSARY_RELEASE))' \
GITEA_RELEASE_ATTACHMENTS="$$(find .gitea-release/* -type f)" \
tools/gitea-release/bin/gitea-release.sh

View File

@ -1 +1 @@
2023.8.25-stable.1853.3d7a094
2024.3.13-stable.821.cec5c78

View File

@ -1,3 +1,3 @@
install-bpi-r3-network-config:
mkdir -p files/etc/config
cp misc/bpi-r3/uci/network files/etc/config/network
cp misc/bpi-r3/uci/network files/etc/config/network

6
install/common.mk Normal file
View File

@ -0,0 +1,6 @@
install-common-uci-defaults:
mkdir -p files/etc/uci-defaults
cp misc/common/uci-defaults/* files/etc/uci-defaults/
install-common-additional-agent-collectors: tools/yq/bin/yq
tools/yq/bin/yq -i '.agent.collectors += load("misc/common/agent/collectors.yml")' files/etc/emissary/agent.yml

View File

@ -31,6 +31,10 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
tools/yq/bin/yq -i '.agent.controllers.sysupgrade.firmwareVersionCommand = ["sh", "-c", "source /etc/emissary_firmware && echo \"$$FIRMWARE_VERSION\""]' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.app.dataDir = "/data/emissary/apps/data"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.app.downloadDir = "/data/emissary/apps/bundles"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.sentry.dsn = "$${EMISSARY_SENTRY_DSN}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.sentry.environment = "$${EMISSARY_SENTRY_ENVIRONMENT}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.status.claimURL = "$${EMISSARY_CONTROLLERS_STATUS_CLAIM_URL}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.status.agentURL = "$${EMISSARY_CONTROLLERS_STATUS_AGENT_URL}"' files/etc/emissary/agent.yml
# Copy emissary binary
mkdir -p files/usr/local/bin

View File

@ -1,7 +1,3 @@
install-rpi-network-config:
mkdir -p files/etc/config
cp misc/rpi/uci/network files/etc/config/network
install-rpi-uci-defaults:
mkdir -p files/etc/uci-defaults
cp misc/rpi/uci-defaults/* files/etc/uci-defaults/
cp misc/rpi/uci/network files/etc/config/network

View File

@ -0,0 +1,9 @@
- name: network-interfaces
command: ip
args:
- addr
- show
- name: emissary-firmware
command: cat
args:
- /etc/emissary_firmware

View File

@ -0,0 +1,79 @@
#!/bin/sh
MIN_DISK_SPACE_MB=1000
list_disks() {
lsblk -o NAME -r -d -n
}
main() {
local disks=$(list_disks)
local found_free_space=0
local found_device=""
for device_name in ${disks}; do
local device="/dev/${device_name}"
echo "Checking disk '$device'..."
local disk_free_space="$(parted $device unit MB print free 2>/dev/null | grep 'Free Space' | tail -n1 | awk '{ print $3 }')"
disk_free_space=${disk_free_space%MB}
disk_free_space=$(printf '%.0f' "${disk_free_space:-0}")
echo "Free space on disk: ${disk_free_space}"
if [ ! -z "${disk_free_space}" ]; then
if [ ${disk_free_space} -gt ${found_free_space} ]; then
found_free_space=${disk_free_space}
found_device=${device}
fi
fi
done
if [ -z "${found_device}" ] || [ ${MIN_DISK_SPACE_MB} -gt ${found_free_space} ]; then
echo "No device with sufficient remaining disk space, exiting."
exit 1
fi
echo "Creating new partition on '${found_device}' with remaining disk free space"
local last_partition_end_mb=$(parted "$found_device" unit MB print | awk '/^ [0-9]+ / {start=$3} END {print int(start)}')
if [ "${last_partition_end_mb}" != "0" ]; then
parted -s "${found_device}" -f -a opt mkpart primary "${last_partition_end_mb}MB" '100%'
else
parted -s "${found_device}" -f -a opt mkpart primary '0%' '100%'
fi
sync
local last_partition_number=$(parted ${found_device} print | grep -o -e '^ [0-9]*' | awk '{print $1}' | tail -n 1)
local new_partition_device=$(lsblk -r -n -o PARTN,NAME ${found_device} | awk -v partition_number="${last_partition_number}" '$1 == partition_number {print $2}')
mkfs.ext4 -F /dev/${new_partition_device}
if [ $? -ne 0 ]; then
echo "Could not initialize filesystem on new partition !"
exit 1
fi
local new_partition_uuid=$(lsblk -r -n -o PARTN,UUID ${found_device} | awk -v partition_number="${last_partition_number}" '$1 == partition_number {print $2}')
if [ -z "${new_partition_uuid}" ]; then
echo "Could not find partition with number '${last_partition_number}' !"
exit 1
fi
umount -f /data
rm -rf /data
mkdir -p /data
uci add fstab mount
uci set fstab.@mount[-1].target='/data'
uci set fstab.@mount[-1].uuid=${new_partition_uuid}
uci set fstab.@mount[-1].enabled='1'
uci commit fstab
reload_config
}
main

View File

@ -2,4 +2,8 @@ package emissary
config main 'agent'
option reconciliation_interval '60'
option server_url 'https://emissary.cadol.es'
option server_url 'https://emissary.cadol.es'
option claim_url 'https://emissary.cadol.es/hq/claim/%v'
option agent_url 'https://emissary.cadol.es/hq/agents/%v'
option sentry_dsn ''
option sentry_environment ''

View File

@ -1,26 +1,30 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=50
START=99
STOP=50
start_service() {
config_load emissary
mkdir -p /usr/share/emissary
mkdir -p /var/lib/emissary
mkdir -p /data/emissary
config_get emissary_reconciliation_interval agent 'reconciliation_interval' "60"
config_get emissary_server_url agent 'server_url' "https://emissary.cadol.es"
config_get emissary_agent_claim_url agent 'claim_url' "https://emissary.cadol.es/hq/claim/%v"
config_get emissary_agent_url agent 'agent_url' "https://emissary.cadol.es/hq/agents/%v"
config_get emissary_sentry_dsn agent 'sentry_dsn' ""
config_get emissary_sentry_environment agent 'sentry_environment' ""
local config_file="/etc/emissary/agent.yml"
procd_open_instance emissary-agent
procd_set_param env EMISSARY_SERVER_URL="$emissary_server_url" EMISSARY_RECONCILIATION_INTERVAL="$emissary_reconciliation_interval"
procd_set_param env EMISSARY_SERVER_URL="$emissary_server_url" EMISSARY_RECONCILIATION_INTERVAL="$emissary_reconciliation_interval" EMISSARY_SENTRY_DSN="$emissary_sentry_dsn" EMISSARY_SENTRY_ENVIRONMENT="$emissary_sentry_environment" EMISSARY_CONTROLLERS_STATUS_CLAIM_URL="$emissary_agent_claim_url" EMISSARY_CONTROLLERS_STATUS_AGENT_URL="$emissary_agent_url"
procd_set_param command /usr/local/bin/emissary
procd_append_param command --workdir /usr/share/emissary
procd_append_param command --config "$config_file"
procd_append_param command agent run
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-17280}
procd_set_param file "$config_file"
procd_set_param stdout 1
procd_set_param stderr 1

View File

@ -17,6 +17,12 @@ main() {
if [ ! -z "${EMISSARY_SERVER_URL}" ]; then
uci set "emissary.agent.server_url=${EMISSARY_SERVER_URL}"
fi
if [ ! -z "${EMISSARY_SENTRY_DSN}" ]; then
uci set "emissary.agent.sentry_dsn=${EMISSARY_SENTRY_DSN}"
fi
if [ ! -z "${EMISSARY_SENTRY_ENVIRONMENT}" ]; then
uci set "emissary.agent.sentry_environment=${EMISSARY_SENTRY_ENVIRONMENT}"
fi
# Commit modifications
uci commit

View File

@ -1,37 +0,0 @@
#/bin/sh
set -e
main() {
# Update default firewall ruleset
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci commit dhcp
reload_config
}
main

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

View File

@ -1,37 +0,0 @@
#/bin/sh
set -e
main() {
# Update default firewall ruleset
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci commit dhcp
reload_config
}
main

View File

@ -1,3 +1,8 @@
luci
openssh-server
openssh-sftp-server
openssh-sftp-server
parted
lsblk
e2fsprogs
block-mount
kmod-fs-ext4

View File

@ -2,8 +2,6 @@ all: bpi-r3
bpi-r3:
$(MAKE) \
OPENWRT_VERSION="23.05.0-rc3" \
IMAGEBUILDER_URL=https://downloads.openwrt.org/releases/23.05.0-rc3/targets/mediatek/filogic/openwrt-imagebuilder-23.05.0-rc3-mediatek-filogic.Linux-x86_64.tar.xz \
ADDITIONAL_INSTALL="install-bpi-r3-network-config" \
ADDITIONAL_OPENWRT_PACKAGES="block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb2" \
OPENWRT_TARGET="mediatek/filogic" \

View File

@ -2,7 +2,7 @@ all: x86-generic
x86-generic:
$(MAKE) \
ADDITIONAL_INSTALL="install-x86-network-config install-x86-uci-defaults" \
ADDITIONAL_INSTALL="install-x86-network-config" \
ADDITIONAL_OPENWRT_PACKAGES="dmidecode" \
OPENWRT_TARGET="x86/generic" \
EMISSARY_ARCH="386" \

View File

@ -2,7 +2,7 @@ all: rpi-4 rpi-3
rpi-4:
$(MAKE) \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
ADDITIONAL_INSTALL="install-rpi-network-config" \
OPENWRT_TARGET="bcm27xx/bcm2711" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-4" \
@ -10,7 +10,7 @@ rpi-4:
rpi-3:
$(MAKE) \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
ADDITIONAL_INSTALL="install-rpi-network-config" \
OPENWRT_TARGET="bcm27xx/bcm2710" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-3" \