Compare commits
53 Commits
v2023.03.3
...
v2023.05.2
Author | SHA1 | Date | |
---|---|---|---|
291ad94b15 | |||
4b181ec9e1 | |||
81360c3fda | |||
2cf46ed9a5 | |||
df763ef49a | |||
9e153e38cb | |||
9214c097b3 | |||
2339bc3aa6 | |||
908a36896e | |||
23452a06ff | |||
83f97abcbd | |||
d0f6e63007 | |||
087f8a27a8 | |||
42c157a1e5 | |||
7b722293b7 | |||
d37c10afae | |||
40d6d2df03 | |||
f70763aed7 | |||
475a807302 | |||
4e075cbd8e | |||
ed52367837 | |||
a6c32c5315 | |||
a35c5563db | |||
751f5398e1 | |||
9b2c2e5cdc | |||
2aa581e3c0 | |||
fc7be554a3 | |||
f6df7651da | |||
87b15c940f | |||
30d48ce4aa | |||
2f06b5fdcf | |||
c3070d2922 | |||
38a0d35c7b | |||
9a48ff1a65 | |||
e1ed8f9bd1 | |||
cec076241a | |||
adb3877206 | |||
dd3bb6748c | |||
d58fe78b43 | |||
30e31359ec | |||
2839b21113 | |||
b096b36e5c | |||
d945203a70 | |||
aff32b8627 | |||
f9c6997cdc | |||
4e1772995d | |||
f58c7cc6a7 | |||
95046def13 | |||
dc26c10bb3 | |||
7fbc1930df | |||
d65ba3f252 | |||
b56e563aa0 | |||
2c701ffc16 |
27
Jenkinsfile
vendored
27
Jenkinsfile
vendored
@ -29,27 +29,38 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
steps {
|
currentEmissaryRelease = readFile('emissary_release.txt').trim()
|
||||||
currentEmissaryRelease = readFile('emissary_release.txt')
|
|
||||||
|
|
||||||
if (currentEmissaryRelease == params.emissaryRelease) {
|
if (currentEmissaryRelease == params.emissaryRelease) {
|
||||||
currentBuild.result = 'SUCCESS'
|
currentBuild.result = 'SUCCESS'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withCredentials([
|
||||||
|
usernamePassword([
|
||||||
|
credentialsId: 'forge-jenkins',
|
||||||
|
usernameVariable: 'GIT_USERNAME',
|
||||||
|
passwordVariable: 'GIT_PASSWORD'
|
||||||
|
])
|
||||||
|
]) {
|
||||||
sh """
|
sh """
|
||||||
|
git config user.email "jenkins@cadoles.com"
|
||||||
|
git config user.name "Jenkins"
|
||||||
|
git config credential.https://forge.cadoles.com.username "\$GIT_USERNAME"
|
||||||
|
git config credential.https://forge.cadoles.com.helper '!f() { test "\$1" = get && echo "password=\$GIT_PASSWORD"; }; f'
|
||||||
|
|
||||||
echo '${params.emissaryRelease}' > emissary_release.txt
|
echo '${params.emissaryRelease}' > emissary_release.txt
|
||||||
git add emissary_release.txt
|
git add emissary_release.txt
|
||||||
git commit -m "feat: use emissary ${params.emissaryRelease}"
|
git commit -m "feat: use emissary ${params.emissaryRelease}"
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
git push
|
git push origin \$(git rev-parse HEAD):${env.GIT_BRANCH}
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build and release') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
|
8
Makefile
8
Makefile
@ -22,7 +22,7 @@ IMAGEBUILDER_CUSTOM_FILES_DIR_PATH := $(IMAGEBUILDER_DIR_PATH)/files
|
|||||||
|
|
||||||
BIN_DIR := "$(shell readlink -f bin)/$(OPENWRT_VERSION)/$(OPENWRT_TARGET)/$(OPENWRT_PROFILE)$(BIN_DIR_NAME_SUFFIX)"
|
BIN_DIR := "$(shell readlink -f bin)/$(OPENWRT_VERSION)/$(OPENWRT_TARGET)/$(OPENWRT_PROFILE)$(BIN_DIR_NAME_SUFFIX)"
|
||||||
|
|
||||||
GITEA_DOWNLOAD_RELEASE_NAME ?= $(shell cat emissary_release.txt)
|
EMISSARY_RELEASE ?= $(shell cat emissary_release.txt)
|
||||||
EMISSARY_ARCH ?= armv6
|
EMISSARY_ARCH ?= armv6
|
||||||
|
|
||||||
EMISSARY_RECONCILIATION_INTERVAL ?=
|
EMISSARY_RECONCILIATION_INTERVAL ?=
|
||||||
@ -109,8 +109,8 @@ gitea-release: tools/gitea-release/bin/gitea-release.sh
|
|||||||
GITEA_RELEASE_NAME="$(FULL_VERSION)" \
|
GITEA_RELEASE_NAME="$(FULL_VERSION)" \
|
||||||
GITEA_RELEASE_COMMITISH_TARGET="$(GIT_VERSION)" \
|
GITEA_RELEASE_COMMITISH_TARGET="$(GIT_VERSION)" \
|
||||||
GITEA_RELEASE_IS_DRAFT="false" \
|
GITEA_RELEASE_IS_DRAFT="false" \
|
||||||
GITEA_RELEASE_BODY="" \
|
GITEA_RELEASE_BODY="With Emissary $(EMISSARY_RELEASE)" \
|
||||||
GITEA_RELEASE_ATTACHMENTS="$(shell find .gitea-release/* -type f)" \
|
GITEA_RELEASE_ATTACHMENTS="$$(find .gitea-release/* -type f)" \
|
||||||
tools/gitea-release/bin/gitea-release.sh
|
tools/gitea-release/bin/gitea-release.sh
|
||||||
|
|
||||||
.PHONY: download-emissary-release
|
.PHONY: download-emissary-release
|
||||||
@ -119,7 +119,7 @@ download-emissary-release: tools/gitea-download/bin/gitea-download.sh
|
|||||||
GITEA_DOWNLOAD_PROJECT="emissary" \
|
GITEA_DOWNLOAD_PROJECT="emissary" \
|
||||||
GITEA_DOWNLOAD_ORG="arcad" \
|
GITEA_DOWNLOAD_ORG="arcad" \
|
||||||
GITEA_DOWNLOAD_BASE_URL="https://forge.cadoles.com" \
|
GITEA_DOWNLOAD_BASE_URL="https://forge.cadoles.com" \
|
||||||
GITEA_DOWNLOAD_RELEASE_NAME="$(GITEA_DOWNLOAD_RELEASE_NAME)" \
|
GITEA_DOWNLOAD_RELEASE_NAME="$(EMISSARY_RELEASE)" \
|
||||||
GITEA_DOWNLOAD_ATTACHMENTS_FILTER="\.tar\.gz$$" \
|
GITEA_DOWNLOAD_ATTACHMENTS_FILTER="\.tar\.gz$$" \
|
||||||
tools/gitea-download/bin/gitea-download.sh
|
tools/gitea-download/bin/gitea-download.sh
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
v2023.3.29-e5b6c5e
|
v2023.5.23-4311cf6
|
||||||
|
7
install/raspberrypi.mk
Normal file
7
install/raspberrypi.mk
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
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/
|
3
install/turris-omnia.mk
Normal file
3
install/turris-omnia.mk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
install-turris-omnia-uci-defaults:
|
||||||
|
mkdir -p files/etc/uci-defaults
|
||||||
|
cp misc/turris/omnia/uci-defaults/* files/etc/uci-defaults/
|
@ -1,4 +1,3 @@
|
|||||||
/etc/machine-id
|
/etc/machine-id
|
||||||
/data/emissary/agent-key.json
|
/data/emissary/agent-key.json
|
||||||
/data/emissary/agent-state.json
|
|
||||||
/data/emissary/apps/data
|
/data/emissary/apps/data
|
||||||
|
37
misc/rpi/uci-defaults/99-x86-uci-custom.sh
Normal file
37
misc/rpi/uci-defaults/99-x86-uci-custom.sh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#/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
|
9
misc/rpi/uci/network
Normal file
9
misc/rpi/uci/network
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
config interface 'loopback'
|
||||||
|
option ifname 'lo'
|
||||||
|
option proto 'static'
|
||||||
|
option ipaddr '127.0.0.1'
|
||||||
|
option netmask '255.0.0.0'
|
||||||
|
|
||||||
|
config interface 'wan'
|
||||||
|
option ifname 'eth0'
|
||||||
|
option proto 'dhcp'
|
37
misc/turris/omnia/uci-defaults/98-turris-omnia-uci-custom.sh
Normal file
37
misc/turris/omnia/uci-defaults/98-turris-omnia-uci-custom.sh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#/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
|
21
misc/turris/omnia/uci-defaults/99-resize-disk.sh
Normal file
21
misc/turris/omnia/uci-defaults/99-resize-disk.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
block info
|
||||||
|
|
||||||
|
DISK=/dev/mmcblk0
|
||||||
|
PARTITION="${DISK}p2"
|
||||||
|
|
||||||
|
parted -s -a opt "$DISK" "resizepart 2 100%"
|
||||||
|
|
||||||
|
FS_SIZE="$(unsquashfs -s "$PARTITION" | grep -o 'Filesystem size [0-9]* bytes' | grep -o '[0-9][0-9]*')"
|
||||||
|
FS_OFFSET="$(expr '(' "$FS_SIZE" + 65535 ')' / 65536 '*' 65536)"
|
||||||
|
LOOP_DEVICE="$(losetup -f --show -o "$FS_OFFSET" "$PARTITION")"
|
||||||
|
|
||||||
|
e2fsck -y -f "$LOOP_DEVICE"
|
||||||
|
resize2fs "$LOOP_DEVICE"
|
||||||
|
|
||||||
|
rm -f /etc/uci-defaults/99-resize-disk.sh
|
||||||
|
|
||||||
|
reboot
|
@ -2,7 +2,7 @@ all: rpi-4 rpi-3
|
|||||||
|
|
||||||
rpi-4:
|
rpi-4:
|
||||||
$(MAKE) \
|
$(MAKE) \
|
||||||
ADDITIONAL_INSTALL="" \
|
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
|
||||||
OPENWRT_TARGET="bcm27xx/bcm2711" \
|
OPENWRT_TARGET="bcm27xx/bcm2711" \
|
||||||
EMISSARY_ARCH="arm64" \
|
EMISSARY_ARCH="arm64" \
|
||||||
OPENWRT_PROFILE="rpi-4" \
|
OPENWRT_PROFILE="rpi-4" \
|
||||||
@ -10,7 +10,7 @@ rpi-4:
|
|||||||
|
|
||||||
rpi-3:
|
rpi-3:
|
||||||
$(MAKE) \
|
$(MAKE) \
|
||||||
ADDITIONAL_INSTALL="" \
|
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
|
||||||
OPENWRT_TARGET="bcm27xx/bcm2710" \
|
OPENWRT_TARGET="bcm27xx/bcm2710" \
|
||||||
EMISSARY_ARCH="arm64" \
|
EMISSARY_ARCH="arm64" \
|
||||||
OPENWRT_PROFILE="rpi-3" \
|
OPENWRT_PROFILE="rpi-3" \
|
@ -4,7 +4,8 @@ turris: omnia
|
|||||||
|
|
||||||
omnia:
|
omnia:
|
||||||
$(MAKE) \
|
$(MAKE) \
|
||||||
ADDITIONAL_INSTALL="" \
|
ADDITIONAL_INSTALL="install-turris-omnia-uci-defaults" \
|
||||||
|
ADDITIONAL_OPENWRT_PACKAGES="losetup squashfs-tools-unsquashfs resize2fs e2fsprogs parted block-mount" \
|
||||||
OPENWRT_TARGET="mvebu/cortexa9" \
|
OPENWRT_TARGET="mvebu/cortexa9" \
|
||||||
EMISSARY_ARCH="armv7" \
|
EMISSARY_ARCH="armv7" \
|
||||||
OPENWRT_PROFILE="cznic_turris-omnia" \
|
OPENWRT_PROFILE="cznic_turris-omnia" \
|
||||||
|
Reference in New Issue
Block a user