mirror of
https://github.com/Mo3he/Axis_Cam_Tailscale.git
synced 2026-10-01 12:05:37 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c02f0aa498 | ||
|
|
96477cdb0d | ||
|
|
4e0eabeec3 | ||
|
|
59161ccd91 | ||
|
|
e1b2ac3490 | ||
|
|
5f03ac918f | ||
|
|
2db9f27181 | ||
|
|
396b450415 | ||
|
|
2d1ff5e8a6 | ||
|
|
7655028477 | ||
|
|
f890d8df1a | ||
|
|
df0756a64d | ||
|
|
df2cf84c6c | ||
|
|
f420e7d24c | ||
|
|
3dc49f1254 | ||
|
|
2005ba32db | ||
|
|
1f9c6a9e45 | ||
|
|
6148fc3298 |
@@ -2,7 +2,7 @@ name: Auto Build & Release Tailscale ACAP
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 3 * * 1" # Every Monday at 03:00 UTC
|
- cron: "0 0 * * *" # Every Monday at 03:00 UTC
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -20,8 +20,28 @@ jobs:
|
|||||||
- name: Get latest Tailscale version
|
- name: Get latest Tailscale version
|
||||||
id: tailscale_version
|
id: tailscale_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | jq -r .tag_name)
|
# 1. Start from GitHub latest
|
||||||
VERSION=${VERSION#v} # remove leading 'v'
|
GH_TAG=$(curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | jq -r .tag_name)
|
||||||
|
GH_VERSION=${GH_TAG#v}
|
||||||
|
|
||||||
|
echo "GitHub latest: $GH_VERSION"
|
||||||
|
|
||||||
|
# 2. See if static ARM build exists for that version
|
||||||
|
if curl -sfI "https://pkgs.tailscale.com/stable/tailscale_${GH_VERSION}_arm.tgz" > /dev/null; then
|
||||||
|
VERSION="$GH_VERSION"
|
||||||
|
echo "Using GitHub latest (has ARM package): $VERSION"
|
||||||
|
else
|
||||||
|
echo "No ARM package for $GH_VERSION, falling back to latest version on pkgs.tailscale.com"
|
||||||
|
# 3. Derive latest version that actually has an ARM tarball
|
||||||
|
VERSION=$(
|
||||||
|
curl -s https://pkgs.tailscale.com/stable/ \
|
||||||
|
| grep -o 'tailscale_[0-9.]*_arm\.tgz' \
|
||||||
|
| sed -E 's/^tailscale_([0-9.]+)_arm\.tgz$/\1/' \
|
||||||
|
| sort -V | tail -n1
|
||||||
|
)
|
||||||
|
echo "Fallback version: $VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -128,8 +148,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
# Only commit manifests; do not track release artifacts
|
||||||
git add */app/manifest.json releases/*
|
git add */app/manifest.json
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,2 +1,10 @@
|
|||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
**/build
|
**/build
|
||||||
|
|
||||||
|
# Do not track release artifacts
|
||||||
|
releases/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Do not track downloaded Tailscale tarballs and temp bins
|
||||||
|
tailscale_bins/
|
||||||
|
*.tgz
|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Starting Service"
|
echo "Starting Service"
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscale
|
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscaled
|
# Define paths
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscaled --socks5-server=localhost:1055 --tun=userspace-networking --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock &
|
APP_DIR="/usr/local/packages/Tailscale_VPN"
|
||||||
echo "Service Started"
|
STATE_DIR="$APP_DIR/localdata"
|
||||||
echo "Scroll to Bottom for link"
|
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscale --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock up
|
# Create localdata directory if it doesn't exist
|
||||||
wait
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscale"
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscaled"
|
||||||
|
|
||||||
|
# Start tailscaled with state stored in localdata
|
||||||
|
"$APP_DIR/lib/tailscaled" \
|
||||||
|
--state="$STATE_DIR/tailscaled.state" \
|
||||||
|
--socket="$STATE_DIR/tailscaled.sock" \
|
||||||
|
--socks5-server=localhost:1055 \
|
||||||
|
--tun=userspace-networking &
|
||||||
|
|
||||||
|
echo "Service Started"
|
||||||
|
sleep 2
|
||||||
|
echo "Scroll to Bottom for link"
|
||||||
|
|
||||||
|
# Run tailscale up with the socket in localdata
|
||||||
|
"$APP_DIR/lib/tailscale" --socket="$STATE_DIR/tailscaled.sock" up
|
||||||
|
|
||||||
|
wait
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -8,7 +8,7 @@
|
|||||||
"embeddedSdkVersion": "3.0",
|
"embeddedSdkVersion": "3.0",
|
||||||
"vendorUrl": "https://www.tailscale.com",
|
"vendorUrl": "https://www.tailscale.com",
|
||||||
"runMode": "once",
|
"runMode": "once",
|
||||||
"version": "1.90.3",
|
"version": "1.92.5",
|
||||||
"architecture": "aarch64"
|
"architecture": "aarch64"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Starting Service"
|
echo "Starting Service"
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscale
|
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscaled
|
# Define paths
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscaled &
|
APP_DIR="/usr/local/packages/Tailscale_VPN"
|
||||||
echo "Service Started"
|
STATE_DIR="$APP_DIR/localdata"
|
||||||
echo "Scroll to Bottom for link"
|
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscale up --accept-routes
|
# Create localdata directory if it doesn't exist
|
||||||
wait
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscale"
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscaled"
|
||||||
|
|
||||||
|
# Start tailscaled with state stored in localdata
|
||||||
|
"$APP_DIR/lib/tailscaled" \
|
||||||
|
--state="$STATE_DIR/tailscaled.state" \
|
||||||
|
--socket="$STATE_DIR/tailscaled.sock" &
|
||||||
|
|
||||||
|
echo "Service Started"
|
||||||
|
sleep 2
|
||||||
|
echo "Scroll to Bottom for link"
|
||||||
|
|
||||||
|
# Run tailscale up with the socket in localdata
|
||||||
|
"$APP_DIR/lib/tailscale" --socket="$STATE_DIR/tailscaled.sock" up --accept-routes
|
||||||
|
|
||||||
|
wait
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"vendorUrl": "https://www.tailscale.com",
|
"vendorUrl": "https://www.tailscale.com",
|
||||||
"runMode": "once",
|
"runMode": "once",
|
||||||
"version": "1.90.3",
|
"version": "1.92.5",
|
||||||
"architecture": "aarch64"
|
"architecture": "aarch64"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
|
|||||||
@@ -17,7 +17,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#define APP_NAME "serverconfig"
|
#define APP_NAME "serverconfig"
|
||||||
#define CONFIG_FILE "/usr/local/packages/serverconfig/config.txt"
|
#define APP_DIR "/usr/local/packages/serverconfig"
|
||||||
|
#define STATE_DIR APP_DIR "/localdata"
|
||||||
|
#define CONFIG_FILE STATE_DIR "/config.txt"
|
||||||
#define SCRIPT_PATH "/usr/local/packages/serverconfig/start_tailscale.sh"
|
#define SCRIPT_PATH "/usr/local/packages/serverconfig/start_tailscale.sh"
|
||||||
#define SCRIPT_SOURCE "/usr/local/packages/serverconfig/lib/start_tailscale.sh"
|
#define SCRIPT_SOURCE "/usr/local/packages/serverconfig/lib/start_tailscale.sh"
|
||||||
|
|
||||||
@@ -27,6 +29,19 @@ static gboolean signal_handler(gpointer loop) {
|
|||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create localdata directory
|
||||||
|
static void ensure_localdata_exists(void) {
|
||||||
|
struct stat st = {0};
|
||||||
|
|
||||||
|
if (stat(STATE_DIR, &st) == -1) {
|
||||||
|
if (mkdir(STATE_DIR, 0755) != 0) {
|
||||||
|
syslog(LOG_ERR, "Failed to create localdata directory: %s", strerror(errno));
|
||||||
|
} else {
|
||||||
|
syslog(LOG_INFO, "Created localdata directory: %s", STATE_DIR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy script from lib folder to main directory
|
// Copy script from lib folder to main directory
|
||||||
static void copy_script_file(void) {
|
static void copy_script_file(void) {
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
@@ -109,6 +124,9 @@ static void update_config_file(AXParameter* handle) {
|
|||||||
gchar* key_value = NULL;
|
gchar* key_value = NULL;
|
||||||
FILE* file;
|
FILE* file;
|
||||||
|
|
||||||
|
// Ensure localdata directory exists
|
||||||
|
ensure_localdata_exists();
|
||||||
|
|
||||||
// Get parameter values
|
// Get parameter values
|
||||||
if (!ax_parameter_get(handle, "CustomServer", &server_value, &error)) {
|
if (!ax_parameter_get(handle, "CustomServer", &server_value, &error)) {
|
||||||
syslog(LOG_ERR, "Failed to get CustomServer: %s",
|
syslog(LOG_ERR, "Failed to get CustomServer: %s",
|
||||||
@@ -125,7 +143,7 @@ static void update_config_file(AXParameter* handle) {
|
|||||||
key_value = g_strdup("");
|
key_value = g_strdup("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write to config file
|
// Write to config file in localdata
|
||||||
file = fopen(CONFIG_FILE, "w");
|
file = fopen(CONFIG_FILE, "w");
|
||||||
if (file) {
|
if (file) {
|
||||||
fprintf(file, "custom_server=%s\n", server_value ? server_value : "");
|
fprintf(file, "custom_server=%s\n", server_value ? server_value : "");
|
||||||
@@ -135,12 +153,12 @@ static void update_config_file(AXParameter* handle) {
|
|||||||
// Set permissions to ensure the file is readable
|
// Set permissions to ensure the file is readable
|
||||||
chmod(CONFIG_FILE, 0644);
|
chmod(CONFIG_FILE, 0644);
|
||||||
|
|
||||||
syslog(LOG_INFO, "Updated configuration file: custom_server=%s",
|
syslog(LOG_INFO, "Updated configuration file in local custom_server=%s",
|
||||||
server_value ? server_value : "");
|
server_value ? server_value : "");
|
||||||
syslog(LOG_INFO, "Updated configuration file: auth_key=%s",
|
syslog(LOG_INFO, "Updated configuration file in local auth_key=%s",
|
||||||
key_value && strlen(key_value) > 0 ? "(set)" : "(empty)");
|
key_value && strlen(key_value) > 0 ? "(set)" : "(empty)");
|
||||||
} else {
|
} else {
|
||||||
syslog(LOG_ERR, "Failed to open config file for writing");
|
syslog(LOG_ERR, "Failed to open config file for writing: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
@@ -185,6 +203,9 @@ int main(void) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure localdata directory exists
|
||||||
|
ensure_localdata_exists();
|
||||||
|
|
||||||
// Ensure script is copied from lib folder
|
// Ensure script is copied from lib folder
|
||||||
copy_script_file();
|
copy_script_file();
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,15 @@
|
|||||||
pkill -f tailscaled || true
|
pkill -f tailscaled || true
|
||||||
|
|
||||||
# Simple script to start Tailscale with custom configuration
|
# Simple script to start Tailscale with custom configuration
|
||||||
CONFIG_FILE="/usr/local/packages/serverconfig/config.txt"
|
APP_DIR="/usr/local/packages/serverconfig"
|
||||||
TAILSCALED_PATH="/usr/local/packages/serverconfig/lib/tailscaled"
|
STATE_DIR="$APP_DIR/localdata"
|
||||||
TAILSCALE_PATH="/usr/local/packages/serverconfig/lib/tailscale"
|
CONFIG_FILE="$STATE_DIR/config.txt"
|
||||||
SOCKET_PATH="/usr/local/packages/serverconfig/tailscaled.sock"
|
TAILSCALED_PATH="$APP_DIR/lib/tailscaled"
|
||||||
|
TAILSCALE_PATH="$APP_DIR/lib/tailscale"
|
||||||
|
SOCKET_PATH="$STATE_DIR/tailscaled.sock"
|
||||||
|
|
||||||
|
# Create localdata directory if it doesn't exist
|
||||||
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
# Log to syslog
|
# Log to syslog
|
||||||
logger -t "tailscale_script" "Starting Tailscale VPN service"
|
logger -t "tailscale_script" "Starting Tailscale VPN service"
|
||||||
@@ -31,9 +36,13 @@ if [ -f "$CONFIG_FILE" ]; then
|
|||||||
done < "$CONFIG_FILE"
|
done < "$CONFIG_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start tailscaled
|
# Start tailscaled with state stored in localdata
|
||||||
logger -t "tailscale_script" "Starting tailscaled daemon"
|
logger -t "tailscale_script" "Starting tailscaled daemon"
|
||||||
$TAILSCALED_PATH --socks5-server=localhost:1055 --tun=userspace-networking --socket=$SOCKET_PATH &
|
$TAILSCALED_PATH \
|
||||||
|
--state="$STATE_DIR/tailscaled.state" \
|
||||||
|
--socket=$SOCKET_PATH \
|
||||||
|
--socks5-server=localhost:1055 \
|
||||||
|
--tun=userspace-networking &
|
||||||
TAILSCALED_PID=$!
|
TAILSCALED_PID=$!
|
||||||
|
|
||||||
# Wait for tailscaled to initialize
|
# Wait for tailscaled to initialize
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -8,7 +8,7 @@
|
|||||||
"embeddedSdkVersion": "3.0",
|
"embeddedSdkVersion": "3.0",
|
||||||
"vendorUrl": "https://www.tailscale.com",
|
"vendorUrl": "https://www.tailscale.com",
|
||||||
"runMode": "respawn",
|
"runMode": "respawn",
|
||||||
"version": "1.90.3"
|
"version": "1.92.5"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"settingPage": "index.html",
|
"settingPage": "index.html",
|
||||||
|
|||||||
+28
-8
@@ -1,10 +1,30 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Starting Service"
|
echo "Starting Service"
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscale
|
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscaled
|
# Define paths
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscaled --socks5-server=localhost:1055 --tun=userspace-networking --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock &
|
APP_DIR="/usr/local/packages/Tailscale_VPN"
|
||||||
echo "Service Started"
|
STATE_DIR="$APP_DIR/localdata"
|
||||||
echo "Scroll to Bottom for link"
|
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscale --socket=/usr/local/packages/Tailscale_VPN/tailscaled.sock up
|
# Create localdata directory if it doesn't exist
|
||||||
wait
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscale"
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscaled"
|
||||||
|
|
||||||
|
# Start tailscaled with state stored in localdata
|
||||||
|
"$APP_DIR/lib/tailscaled" \
|
||||||
|
--state="$STATE_DIR/tailscaled.state" \
|
||||||
|
--socket="$STATE_DIR/tailscaled.sock" \
|
||||||
|
--socks5-server=localhost:1055 \
|
||||||
|
--tun=userspace-networking &
|
||||||
|
|
||||||
|
echo "Service Started"
|
||||||
|
sleep 2
|
||||||
|
echo "Scroll to Bottom for link"
|
||||||
|
|
||||||
|
# Run tailscale up with the socket in localdata
|
||||||
|
"$APP_DIR/lib/tailscale" --socket="$STATE_DIR/tailscaled.sock" up
|
||||||
|
|
||||||
|
wait
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -8,7 +8,7 @@
|
|||||||
"embeddedSdkVersion": "3.0",
|
"embeddedSdkVersion": "3.0",
|
||||||
"vendorUrl": "https://www.tailscale.com",
|
"vendorUrl": "https://www.tailscale.com",
|
||||||
"runMode": "once",
|
"runMode": "once",
|
||||||
"version": "1.90.3",
|
"version": "1.92.5",
|
||||||
"architecture": "armv7hf"
|
"architecture": "armv7hf"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Starting Service"
|
echo "Starting Service"
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscale
|
|
||||||
chmod 777 /usr/local/packages/Tailscale_VPN/lib/tailscaled
|
# Define paths
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscaled &
|
APP_DIR="/usr/local/packages/Tailscale_VPN"
|
||||||
echo "Service Started"
|
STATE_DIR="$APP_DIR/localdata"
|
||||||
echo "Scroll to Bottom for link"
|
|
||||||
/usr/local/packages/Tailscale_VPN/lib/tailscale up --accept-routes
|
# Create localdata directory if it doesn't exist
|
||||||
wait
|
mkdir -p "$STATE_DIR"
|
||||||
|
|
||||||
|
# Set permissions
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscale"
|
||||||
|
chmod 777 "$APP_DIR/lib/tailscaled"
|
||||||
|
|
||||||
|
# Start tailscaled with state stored in localdata
|
||||||
|
"$APP_DIR/lib/tailscaled" \
|
||||||
|
--state="$STATE_DIR/tailscaled.state" \
|
||||||
|
--socket="$STATE_DIR/tailscaled.sock" &
|
||||||
|
|
||||||
|
echo "Service Started"
|
||||||
|
sleep 2
|
||||||
|
echo "Scroll to Bottom for link"
|
||||||
|
|
||||||
|
# Run tailscale up with the socket in localdata
|
||||||
|
"$APP_DIR/lib/tailscale" --socket="$STATE_DIR/tailscaled.sock" up --accept-routes
|
||||||
|
|
||||||
|
wait
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"vendorUrl": "https://www.tailscale.com",
|
"vendorUrl": "https://www.tailscale.com",
|
||||||
"runMode": "once",
|
"runMode": "once",
|
||||||
"version": "1.90.3",
|
"version": "1.92.5",
|
||||||
"architecture": "armv7hf"
|
"architecture": "armv7hf"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
|
|||||||
Reference in New Issue
Block a user