mirror of
https://github.com/Mo3he/Axis_Cam_Tailscale.git
synced 2026-10-01 12:05:37 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e01a2ab95f | ||
|
|
5b87555295 | ||
|
|
4a4618344a | ||
|
|
de739dec13 | ||
|
|
ef0cb156be |
@@ -0,0 +1,125 @@
|
||||
name: Auto Build & Release Tailscale ACAP
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force:
|
||||
description: "Force build even if version exists"
|
||||
required: false
|
||||
default: "false"
|
||||
schedule:
|
||||
- cron: '0 6 * * *' # optional: daily at 06:00 UTC
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
# 1. Checkout repo
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: true
|
||||
fetch-depth: 0
|
||||
|
||||
# 2. Get latest Tailscale version
|
||||
- name: Get latest Tailscale version
|
||||
id: tailscale_version
|
||||
run: |
|
||||
VERSION=$(curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | jq -r .tag_name)
|
||||
VERSION=${VERSION#v} # remove leading 'v'
|
||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# 3. Download Tailscale binaries
|
||||
- name: Download Tailscale binaries
|
||||
run: |
|
||||
mkdir -p tailscale_bins
|
||||
curl -L "https://pkgs.tailscale.com/stable/tailscale_${RELEASE_VERSION}_arm.tgz" -o tailscale_arm.tgz
|
||||
tar -xzf tailscale_arm.tgz -C tailscale_bins --strip-components=1
|
||||
mv tailscale_bins/tailscale tailscale_bins/tailscale_arm
|
||||
mv tailscale_bins/tailscaled tailscale_bins/tailscaled_arm
|
||||
|
||||
curl -L "https://pkgs.tailscale.com/stable/tailscale_${RELEASE_VERSION}_arm64.tgz" -o tailscale_arm64.tgz
|
||||
tar -xzf tailscale_arm64.tgz -C tailscale_bins --strip-components=1
|
||||
mv tailscale_bins/tailscale tailscale_bins/tailscale_arm64
|
||||
mv tailscale_bins/tailscaled tailscale_bins/tailscaled_arm64
|
||||
|
||||
# 4. Build each folder, update manifest, and copy .eap files
|
||||
- name: Build all folders
|
||||
run: |
|
||||
mkdir -p build
|
||||
mkdir -p releases
|
||||
|
||||
for folder in */ ; do
|
||||
[[ ! -d "$folder/app" ]] && continue
|
||||
FOLDER_NAME="${folder%/}" # remove trailing slash
|
||||
echo "Processing folder $FOLDER_NAME"
|
||||
|
||||
# Detect architecture
|
||||
if [[ "$FOLDER_NAME" == arm* ]]; then
|
||||
cp tailscale_bins/tailscale_arm "$folder/app/lib/tailscale"
|
||||
cp tailscale_bins/tailscaled_arm "$folder/app/lib/tailscaled"
|
||||
else
|
||||
cp tailscale_bins/tailscale_arm64 "$folder/app/lib/tailscale"
|
||||
cp tailscale_bins/tailscaled_arm64 "$folder/app/lib/tailscaled"
|
||||
fi
|
||||
|
||||
# Detect variant suffix for .eap naming
|
||||
if [[ "$FOLDER_NAME" == *_ROOT ]]; then
|
||||
VARIANT="_root"
|
||||
elif [[ "$FOLDER_NAME" == *_custom ]]; then
|
||||
VARIANT="_custom"
|
||||
else
|
||||
VARIANT=""
|
||||
fi
|
||||
|
||||
# Update manifest version
|
||||
sed -i "s/\"version\": \".*\"/\"version\": \"${RELEASE_VERSION}\"/" "$folder/app/manifest.json"
|
||||
|
||||
# Docker build
|
||||
TAG_NAME=$(echo "$FOLDER_NAME" | tr '[:upper:]' '[:lower:]' | tr '/ ' '_') # lowercase and clean
|
||||
echo "Building $TAG_NAME"
|
||||
docker build -f "$folder/Dockerfile" --tag "$TAG_NAME" "$folder"
|
||||
|
||||
# Extract .eap files into build folder
|
||||
EAP_OUTPUT="./build/${TAG_NAME}"
|
||||
mkdir -p "$EAP_OUTPUT"
|
||||
docker cp $(docker create "$TAG_NAME"):/opt/app "$EAP_OUTPUT"
|
||||
|
||||
# Move all .eap files to releases folder, append variant if needed
|
||||
find "$EAP_OUTPUT" -type f -name "*.eap" | while read eap; do
|
||||
BASENAME=$(basename "$eap" .eap)
|
||||
if [[ -n "$VARIANT" ]]; then
|
||||
mv "$eap" "releases/${BASENAME}${VARIANT}.eap"
|
||||
else
|
||||
mv "$eap" "releases/${BASENAME}.eap"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Clean up
|
||||
rm -rf build tailscale_bins *.tgz
|
||||
|
||||
# 5. Commit updated manifests and .eap files directly to main
|
||||
- name: Commit updates to main
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add */app/manifest.json releases/*
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit"
|
||||
else
|
||||
git commit -m "Update Tailscale to v${RELEASE_VERSION}"
|
||||
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Mo3he/Axis_Cam_Tailscale.git main
|
||||
fi
|
||||
|
||||
# 6. Create GitHub Release with all new .eap files
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ env.RELEASE_VERSION }}
|
||||
name: "Tailscale VPN ${{ env.RELEASE_VERSION }}"
|
||||
files: releases/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
This ACAP packages the scripts and files required to install the Tailscale VPN client on Axis Cameras.
|
||||
|
||||
Current version 1.82.0
|
||||
Current version 1.84.0
|
||||
|
||||
https://tailscale.com/changelog/
|
||||
|
||||
@@ -14,7 +14,7 @@ If you like my work and want to help me to keep maintaining it, a sponsor would
|
||||
|
||||
## Testers needed
|
||||
|
||||
I have added a new "custom" version (Tailscale_VPN_Custom_1_82_0_aarch64.eap) which allows you to set a custom server and auth key for use of headscale.
|
||||
I have added a new "custom" version (Tailscale_VPN_Custom_1_84_0_aarch64.eap) which allows you to set a custom server and auth key for use of headscale.
|
||||
|
||||
Click the three dots then "settings" to add your details.
|
||||
If you get a tls error restart the app.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"embeddedSdkVersion": "3.0",
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "once",
|
||||
"version": "1.84.0",
|
||||
"version": "1.86.2",
|
||||
"architecture": "aarch64"
|
||||
},
|
||||
"configuration": {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "once",
|
||||
"version": "1.84.0",
|
||||
"version": "1.86.2",
|
||||
"architecture": "aarch64"
|
||||
},
|
||||
"configuration": {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"embeddedSdkVersion": "3.0",
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "respawn",
|
||||
"version": "1.84.0"
|
||||
"version": "1.86.2"
|
||||
},
|
||||
"configuration": {
|
||||
"settingPage": "index.html",
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# example usage:
|
||||
# docker build --build-arg ARCH=armv7hf --build-arg TAILSCALE_VERSION=1.70.0 -t axis_tailscale:latest .
|
||||
# docker cp $(docker create axis_tailscale):/opt/app ./build
|
||||
|
||||
ARG REPO=axisecp
|
||||
ARG SDK=acap-native-sdk
|
||||
ARG VERSION=1.3
|
||||
ARG ARCH=armv7hf
|
||||
ARG UBUNTU_VERSION=22.04
|
||||
|
||||
FROM ${REPO}/${SDK}:${VERSION}-${ARCH}-ubuntu${UBUNTU_VERSION}
|
||||
WORKDIR /opt/app
|
||||
COPY ./app /opt/app/
|
||||
|
||||
ARG ARCH=armv7hf
|
||||
ARG TAILSCALE_VERSION=1.68.1
|
||||
|
||||
# template files
|
||||
RUN sed -i "s/@@ARCH@@/${ARCH}/g" /opt/app/manifest.json \
|
||||
&& sed -i "s/@@TAILSCALE_VERSION@@/${TAILSCALE_VERSION}/g" /opt/app/manifest.json
|
||||
|
||||
# tailscale uses "arm(64)" instead of the more specific arm arch names
|
||||
RUN \
|
||||
if [ "${ARCH}" = "armv7hf" ]; then TAILSCALE_ARCH="arm"; \
|
||||
elif [ "${ARCH}" = "aarch64" ]; then TAILSCALE_ARCH="arm64"; \
|
||||
else TAILSCALE_ARCH="${ARCH}"; fi \
|
||||
&& curl -sS --fail -L -o /tmp/tailscale.tgz https://pkgs.tailscale.com/stable/tailscale_${TAILSCALE_VERSION}_${TAILSCALE_ARCH}.tgz \
|
||||
&& mkdir -p /opt/app/lib \
|
||||
&& tar xzf /tmp/tailscale.tgz -C /opt/app/lib --strip-components=1 --wildcards --no-anchored '*/tailscale' '*/tailscaled' \
|
||||
&& rm /tmp/tailscale.tgz
|
||||
|
||||
RUN . /opt/axis/acapsdk/environment-setup* && acap-build ./
|
||||
@@ -1,18 +0,0 @@
|
||||
# Building
|
||||
|
||||
Set your preferred build parameters via the docker build command.
|
||||
|
||||
* `ARCH` - use the Axis architecture string you can fetch from `/axis-cgi/param.cgi?action=list&group=Properties.System.Architecture`
|
||||
* `TAILSCALE_VERSION` - Specify the version string as it appears on the [Tailscale archive](https://pkgs.tailscale.com/stable/#static)
|
||||
|
||||
Tailscale arm arch strings are different than the axis format. The Dockerfile has some mappings for common strings.
|
||||
|
||||
```
|
||||
docker build --build-arg ARCH=armv7hf --build-arg TAILSCALE_VERSION=1.70.0 -t axis_tailscale:latest .
|
||||
```
|
||||
|
||||
Then copy out the build artifacts:
|
||||
|
||||
```
|
||||
docker cp $(docker create axis_tailscale):/opt/app ./build
|
||||
```
|
||||
@@ -1,29 +0,0 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2020 Tailscale & AUTHORS.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1 +0,0 @@
|
||||
nop:
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting Service"
|
||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscale
|
||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscaled
|
||||
/usr/local/packages/Tailscale_VPN/lib/tailscaled --tun=userspace-networking --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock &
|
||||
echo "Service Started"
|
||||
echo "Scroll to Bottom for link"
|
||||
/usr/local/packages/Tailscale_VPN/lib/tailscale --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock up
|
||||
wait
|
||||
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<head>
|
||||
<h1 style="color:red;">Scroll to the bottom to find authentication URL</h1>
|
||||
<script>
|
||||
function refreshIFrame() {
|
||||
var x = document.getElementById("*Your_iframe_id*");
|
||||
x.contentWindow.location.reload();
|
||||
var t = setTimeout(refreshIFrame, 5000);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="refreshIFrame()">
|
||||
<iframe id="*Your_iframe_id*" src= "/axis-cgi/admin/systemlog.cgi?appname=Tailscale_VPN" style="height:600px;width:100%;border: none;" ></iframe>
|
||||
</body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"schemaVersion": "1.3",
|
||||
"acapPackageConf": {
|
||||
"setup": {
|
||||
"appName": "Tailscale_VPN",
|
||||
"friendlyName": "Tailscale VPN",
|
||||
"vendor": "Tailscale - Packaged by Mo3he",
|
||||
"embeddedSdkVersion": "3.0",
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "once",
|
||||
"version": "@@TAILSCALE_VERSION@@",
|
||||
"architecture": "@@ARCH@@"
|
||||
},
|
||||
"configuration": {
|
||||
"settingPage": "index.html"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
"embeddedSdkVersion": "3.0",
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "once",
|
||||
"version": "1.84.0",
|
||||
"version": "1.86.2",
|
||||
"architecture": "armv7hf"
|
||||
},
|
||||
"configuration": {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"vendorUrl": "https://www.tailscale.com",
|
||||
"runMode": "once",
|
||||
"version": "1.84.0",
|
||||
"version": "1.86.2",
|
||||
"architecture": "armv7hf"
|
||||
},
|
||||
"configuration": {
|
||||
|
||||
Reference in New Issue
Block a user