Compare commits

...

68 Commits

Author SHA1 Message Date
c7465dba27 feat: use emissary v2023.6.23-4a58847
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-23 12:46:15 +00:00
4a4232e358 feat: use emissary v2023.6.23-4255940
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-23 12:30:35 +00:00
250bf06367 feat: use emissary v2023.6.22-a5fbe3e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-22 15:09:27 +00:00
3ca90a54a9 feat: use emissary v2023.6.22-8b5a97d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-22 15:05:47 +00:00
58d1ffc9a2 feat: use emissary v2023.5.26-d73e027
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-26 13:56:56 +00:00
a7f3f2faea feat: use emissary v2023.5.25-054744e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-25 19:27:45 +00:00
6d0e693fc4 feat: use emissary v2023.5.24-58ef3b0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-24 08:19:36 +00:00
68a1de079e feat: use emissary v2023.5.24-e568092
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-24 08:01:26 +00:00
7f1472f21b feat: use emissary v2023.5.23-ece97ef
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-23 18:48:19 +00:00
291ad94b15 feat: use emissary v2023.5.23-4311cf6
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-23 12:53:02 +00:00
4b181ec9e1 feat: use emissary v2023.4.26-6a976c0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-26 14:00:14 +00:00
81360c3fda feat(turris,omnia): re-enable disk resizing
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-26 15:55:13 +02:00
2cf46ed9a5 feat(turris,omnia): customize uci config
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-25 14:04:38 +02:00
df763ef49a feat(turris,omnia): add uci-defaults scripts 2023-04-25 14:04:38 +02:00
9e153e38cb feat: use emissary v2023.4.25-d188af8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-25 11:57:47 +00:00
9214c097b3 feat: use emissary v2023.4.24-e975381
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-24 11:55:12 +00:00
2339bc3aa6 feat: use emissary v2023.4.24-0d03a70
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-24 10:27:28 +00:00
908a36896e feat: use emissary v2023.4.21-64ea0e0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 18:09:10 +00:00
23452a06ff feat(rpi): default firmware ok
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 18:42:06 +02:00
83f97abcbd feat: use emissary v2023.4.21-541d30d
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-21 11:13:54 +00:00
d0f6e63007 feat: use emissary v2023.4.21-87a4509
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 10:51:10 +00:00
087f8a27a8 feat: use emissary v2023.4.20-fcd159c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 17:32:21 +00:00
42c157a1e5 feat: use emissary v2023.4.20-ef3048b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 10:26:56 +00:00
7b722293b7 feat: use emissary v2023.4.20-3d01cf0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 09:04:43 +00:00
d37c10afae fix(turris,omnia): disable reboot after resize temporarily
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-17 11:57:46 +02:00
40d6d2df03 fix(turris,omnia): reboot after disk resize
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-14 17:37:19 +02:00
f70763aed7 feat: use emissary v2023.4.14-813f837
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-14 14:32:47 +00:00
475a807302 feat: use emissary v2023.4.13-ed35ee5
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 11:52:10 +00:00
4e075cbd8e feat: use emissary v2023.4.13-4b5bc0b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 10:11:55 +00:00
ed52367837 feat: use emissary v2023.4.13-dee6218
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:39:49 +00:00
a6c32c5315 feat: use emissary v2023.4.13-76656e8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:32:01 +00:00
a35c5563db feat: use emissary v2023.4.13-41b1619
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:08:54 +00:00
751f5398e1 feat: use emissary v2023.4.12-35d5ee8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-12 09:13:52 +00:00
9b2c2e5cdc feat: use emissary v2023.4.11-2315ee7
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 13:14:45 +00:00
2aa581e3c0 feat: use emissary v2023.4.11-86a6d81
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 10:09:57 +00:00
fc7be554a3 feat: use emissary v2023.4.11-8fb86c6
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 09:17:18 +00:00
f6df7651da feat(turris,omnia): automatically resize partition at startup
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-07 11:38:36 +02:00
87b15c940f feat: use emissary v2023.4.6-12f8b3a
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-06 19:00:29 +00:00
30d48ce4aa feat: use emissary v2023.4.6-4cf53d9
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 17:28:39 +00:00
2f06b5fdcf feat: use emissary v2023.4.6-47c2546
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:29:28 +00:00
c3070d2922 feat: use emissary v2023.4.6-2117391
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:21:15 +00:00
38a0d35c7b feat: use emissary v2023.4.6-b213b8d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 14:01:51 +00:00
9a48ff1a65 feat: use emissary v2023.4.6-9dcddc5
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 13:17:58 +00:00
e1ed8f9bd1 feat: use emissary v2023.4.6-253c93d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 09:04:09 +00:00
cec076241a feat: use emissary v2023.4.6-d2f865c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:47:39 +00:00
adb3877206 feat: use emissary v2023.4.6-06b1235
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:26:51 +00:00
dd3bb6748c feat: use emissary v2023.4.6-06b1235-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:25:50 +00:00
d58fe78b43 feat: use emissary v2023.4.5-2e1ee44
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-05 21:32:38 +00:00
30e31359ec feat: use emissary v2023.4.5-2e1ee44-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-05 21:25:26 +00:00
2839b21113 feat: use emissary v2023.4.4-242a247
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-04 18:44:04 +00:00
b096b36e5c feat: use emissary v2023.4.4-242a247-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-04 18:30:45 +00:00
d945203a70 feat: use emissary v2023.4.2-562d698
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-02 16:32:38 +00:00
aff32b8627 feat: use emissary v2023.4.2-562d698-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-02 16:10:04 +00:00
f9c6997cdc feat: do not keep agent state between upgrades
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-01 21:24:58 +02:00
4e1772995d feat: use emissary v2023.4.1-909549f
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-01 17:47:38 +00:00
f58c7cc6a7 feat: use emissary v2023.4.1-7d551a8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 17:34:21 +00:00
95046def13 feat: use emissary v2023.4.1-d02eb91
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 12:36:55 +00:00
dc26c10bb3 feat: use emissary v2023.4.1-d2bcdd2
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 11:31:55 +00:00
7fbc1930df chore: display emissary version in release body
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 17:50:33 +02:00
d65ba3f252 feat: use emissary v2023.3.31-c638fe1
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-03-31 15:35:20 +00:00
b56e563aa0 feat: use emissary v2023.3.31-5fc5f5f
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 15:20:01 +00:00
2c701ffc16 chore: add jenkins pipeline
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 17:19:44 +02:00
aa22f3c55b feat: update emissary to v2023.3.29-e5b6c5e 2023-03-29 21:43:31 +02:00
f6c3de68b2 feat: use emissary v2023.3.29-351f22e 2023-03-29 17:45:27 +02:00
1470bea902 chore: filter download emissary artefacts 2023-03-29 16:05:01 +02:00
aa314a939f feat: move all emissary 'data' files to /data 2023-03-29 12:23:28 +02:00
844c5d0e17 chore: allow override of used image in flash script 2023-03-29 12:23:01 +02:00
656081568e feat(turris,omnia): use armv7 arch for emissary binary 2023-03-29 12:22:27 +02:00
17 changed files with 263 additions and 20 deletions

102
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,102 @@
pipeline {
agent {
dockerfile {
filename 'Dockerfile'
dir 'misc/jenkins'
}
}
parameters {
persistentText(name: 'emissaryRelease', defaultValue: 'latest', description: 'Numéro de release Emissary', successfulOnly: false)
}
stages {
stage('Cancel older jobs') {
steps {
script {
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
}
}
stage('Update emissary release') {
when {
expression {
return params.emissaryRelease != 'latest'
}
}
steps {
script {
currentEmissaryRelease = readFile('emissary_release.txt').trim()
if (currentEmissaryRelease == params.emissaryRelease) {
currentBuild.result = 'SUCCESS'
return
}
withCredentials([
usernamePassword([
credentialsId: 'forge-jenkins',
usernameVariable: 'GIT_USERNAME',
passwordVariable: 'GIT_PASSWORD'
])
]) {
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
git add emissary_release.txt
git commit -m "feat: use emissary ${params.emissaryRelease}"
git pull --rebase
git push origin \$(git rev-parse HEAD):${env.GIT_BRANCH}
"""
}
}
}
}
stage('Build and release') {
steps {
script {
withCredentials([
usernamePassword([
credentialsId: 'forge-jenkins',
usernameVariable: 'GITEA_DOWNLOAD_USERNAME',
passwordVariable: 'GITEA_DOWNLOAD_PASSWORD'
])
]) {
sh '''
make download-emissary-release
make all
'''
}
}
}
}
stage('Release') {
steps {
withCredentials([
usernamePassword([
credentialsId: 'forge-jenkins',
usernameVariable: 'GITEA_RELEASE_USERNAME',
passwordVariable: 'GITEA_RELEASE_PASSWORD'
])
]) {
sh 'make gitea-release'
}
}
}
}
post {
always {
cleanWs()
}
}
}

View File

@ -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)"
GITEA_DOWNLOAD_RELEASE_NAME ?= latest
EMISSARY_RELEASE ?= $(shell cat emissary_release.txt)
EMISSARY_ARCH ?= armv6
EMISSARY_RECONCILIATION_INTERVAL ?=
@ -109,8 +109,8 @@ 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="" \
GITEA_RELEASE_ATTACHMENTS="$(shell find .gitea-release/* -type f)" \
GITEA_RELEASE_BODY="With Emissary $(EMISSARY_RELEASE)" \
GITEA_RELEASE_ATTACHMENTS="$$(find .gitea-release/* -type f)" \
tools/gitea-release/bin/gitea-release.sh
.PHONY: download-emissary-release
@ -119,7 +119,8 @@ download-emissary-release: tools/gitea-download/bin/gitea-download.sh
GITEA_DOWNLOAD_PROJECT="emissary" \
GITEA_DOWNLOAD_ORG="arcad" \
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$$" \
tools/gitea-download/bin/gitea-download.sh
tools/gitea-release/bin/gitea-release.sh:
@ -142,5 +143,5 @@ UPX_VERSION := 4.0.2
tools/upx/bin/upx:
mkdir -p tools/upx/bin
curl -L --output tools/upx/upx-$(UPX_VERSION)-amd64_linux.tar.xz https://github.com/upx/upx/releases/download/v$(UPX_VERSION)/upx-$(UPX_VERSION)-amd64_linux.tar.xz
cd tools/upx && tar -xJf upx-$(UPX_VERSION)-amd64_linux.tar.xz
ln -s $(shell readlink -f tools/upx/upx-$(UPX_VERSION)-amd64_linux/upx) tools/upx/bin/upx
cd tools/upx && tar -xJf upx-$(UPX_VERSION)-amd64_linux.tar.xz && wait $$!
$(SHELL) -c 'ln -s $$(readlink -f tools/upx/upx-$(UPX_VERSION)-amd64_linux/upx) tools/upx/bin/upx'

1
emissary_release.txt Normal file
View File

@ -0,0 +1 @@
v2023.6.23-4a58847

View File

@ -12,6 +12,10 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
mkdir -p files/lib/upgrade/keep.d
cp -r misc/emissary/keep.d/* files/lib/upgrade/keep.d/
# Copy profile.d files
mkdir -p files/etc/profile.d
cp -r misc/emissary/profile.d/* files/etc/profile.d/
mkdir -p gitea-dl/emissary-agent_linux_$(EMISSARY_ARCH)
cd gitea-dl && tar -xzf emissary-agent_*_linux_$(EMISSARY_ARCH).tar.gz -C emissary-agent_linux_$(EMISSARY_ARCH)
@ -22,9 +26,11 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
# Patch agent config
tools/yq/bin/yq -i '.agent.serverUrl = "$${EMISSARY_SERVER_URL}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.reconciliationInterval = "$${EMISSARY_RECONCILIATION_INTERVAL}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.privateKeyPath = "/etc/emissary/agent-key.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.persistence.stateFile = "/etc/emissary/agent-state.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.privateKeyPath = "/data/emissary/agent-key.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.persistence.stateFile = "/data/emissary/agent-state.json"' files/etc/emissary/agent.yml
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
# Copy emissary binary
mkdir -p files/usr/local/bin
@ -32,10 +38,10 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
chmod +x files/usr/local/bin/emissary
# Set defaults
mkdir -p files/etc/emissary
rm -rf files/etc/emissary/default.conf
echo "EMISSARY_RECONCILIATION_INTERVAL='$(EMISSARY_RECONCILIATION_INTERVAL)'" > files/etc/emissary/default.conf
echo "EMISSARY_SERVER_URL='$(EMISSARY_SERVER_URL)'" >> files/etc/emissary/default.conf
mkdir -p files/data/emissary
rm -rf files/data/emissary/default.conf
echo "EMISSARY_RECONCILIATION_INTERVAL='$(EMISSARY_RECONCILIATION_INTERVAL)'" > files/data/emissary/default.conf
echo "EMISSARY_SERVER_URL='$(EMISSARY_SERVER_URL)'" >> files/data/emissary/default.conf
# Compress emissary binary
tools/upx/bin/upx -9 files/usr/local/bin/emissary

7
install/raspberrypi.mk Normal file
View 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
View 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/

View File

@ -1,3 +1,3 @@
/etc/machine-id
/etc/emissary/agent-key.json
/etc/emissary/agent-state.json
/data/emissary/agent-key.json
/data/emissary/apps/data

View File

@ -0,0 +1,3 @@
#!/bin/sh
export PATH="${PATH}:/usr/local/bin"

View File

@ -3,7 +3,7 @@
set -e
main() {
local default_config="/etc/emissary/default.conf"
local default_config="/data/emissary/default.conf"
if [ ! -f "${default_config}" ]; then
exit 0

14
misc/jenkins/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM reg.cadoles.com/proxy_cache/library/ubuntu:22.04
ARG HTTP_PROXY=
ARG HTTPS_PROXY=
ARG http_proxy=
ARG https_proxy=
# Install dev environment dependencies
RUN export DEBIAN_FRONTEND=noninteractive &&\
apt-get update -y &&\
apt-get install -y --no-install-recommends curl ca-certificates build-essential wget unzip tar git jq gawk python3 rsync file
# Add LetsEncrypt certificates
RUN curl -k https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash

View 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
View 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'

View File

@ -6,7 +6,8 @@ ssh-copy-id root@${OPENWRT_DEVICE}
TARGET_ARCH=$(ssh root@${OPENWRT_DEVICE} source /etc/os-release \&\& echo \${OPENWRT_BOARD:-\$LEDE_BOARD})
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/openwrt-*-sysupgrade.img*
FIRMWARE_FILENAME=${FIRMWARE_FILENAME:-openwrt-*-sysupgrade.img*}
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/${FIRMWARE_FILENAME}
FIRMWARE_FILE=${CUSTOM_FIRMWARE_FILE:-$FIRMWARE_FILE}
ssh root@${OPENWRT_DEVICE} \

View 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

View 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

View File

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

View File

@ -4,8 +4,9 @@ turris: omnia
omnia:
$(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" \
EMISSARY_ARCH="armv6" \
EMISSARY_ARCH="armv7" \
OPENWRT_PROFILE="cznic_turris-omnia" \
build