mirror of
https://github.com/Mo3he/Axis_Cam_Tailscale.git
synced 2026-08-17 04:36:50 +00:00
Much of this work is AXIS OS 13 preparation. Of the OS 13 breaking
changes, all are now addressed except one: recompiled against the
updated SDK for 64-bit time (Y2038), migrated to Manifest Schema v2
with declared OS compatibility, audited all binaries for executable
stack (all clean, GNU_STACK rw-), and verified the web UI end to end
over HTTPS. The only outstanding item is signing through the Axis
ACAP Portal, pending a registered vendorId.
The four ACAP 4 variants (aarch64, armv7hf, and their ROOT versions)
carried byte-identical copies of the C bridge, run script, web UI, and
Makefile per architecture, diverging only between standard and ROOT.
Merge them into a single common/app/ tree:
- param_bridge.c: proxy-port parameters gated behind -DHAS_PROXY_PORTS
(set via EXTRA_CFLAGS in the standard Dockerfiles); ROOT builds omit
them as before
- Tailscale_VPN_run: variant passed as $1 ("standard"/"root") selects
userspace vs kernel networking, port-collision checks, and IP
forwarding for advertised routes
- index.html: detects proxy support at runtime from the settings
response, hiding the proxy card and keeping the params out of save
requests on ROOT builds (fixes ROOT UI always showing proxy fields
and falsely reporting save errors)
Standard variants move to ACAP Native SDK 12.10.0 and Manifest Schema
v2 (vendorId, compatibleOsVersions); verified installable and working
on OS 10.12, 11.11, and 12.10, so OS 13 readiness costs no backward
compatibility. ROOT variants intentionally stay on SDK 1.15.1 since
OS 12+ never runs root apps.
All builds (including arm_acap3) now use the repository root as build
context with -f <variant>/Dockerfile; CI updated accordingly and a
.dockerignore added to keep the context lean. Tailscale binaries are
no longer tracked in git; *.eap outputs are now gitignored.
README: correct the standard variant's floor to OS 10.12+ and ROOT to
10.12-11.x (both live-verified), update build/update instructions for
the shared tree, and check off completed OS 13 readiness items.
49 lines
2.1 KiB
Docker
49 lines
2.1 KiB
Docker
ARG UBUNTU_VERSION=20.04
|
|
FROM axisecp/acap-sdk:3.5-armv7hf-ubuntu${UBUNTU_VERSION}
|
|
|
|
RUN apt-get update -qq && apt-get install -y --no-install-recommends upx-ucl && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY arm_acap3/app /opt/app/
|
|
WORKDIR /opt/app
|
|
|
|
# Rename the shell startup script (the ELF launcher will take the Tailscale_VPN name)
|
|
RUN mv Tailscale_VPN start.sh && chmod +x start.sh
|
|
|
|
# Compile a minimal ELF launcher as APPNAME.
|
|
# ACAP 3 elflibcheck requires an ELF binary and uses pidof(APPNAME) for status.
|
|
# We fork+exec start.sh so the parent "Tailscale_VPN" process stays resident,
|
|
# making pidof find it and the camera UI correctly show Running/Stopped.
|
|
RUN . /opt/axis/acapsdk/environment-setup* && \
|
|
${CC} -o Tailscale_VPN launcher.c && \
|
|
${STRIP} -s Tailscale_VPN
|
|
|
|
# Strip then UPX-compress the Tailscale binaries so they fit on flash
|
|
RUN . /opt/axis/acapsdk/environment-setup* && \
|
|
${STRIP} -s lib/tailscale lib/tailscaled 2>/dev/null || true && \
|
|
upx --best lib/tailscale lib/tailscaled
|
|
|
|
# ACAP 3 firmware expects the settings page at the app root, not in html/
|
|
RUN cp html/index.html index.html
|
|
|
|
# Symlink tailscaled.log into html/ so the web UI can fetch it via HTTP.
|
|
# The log is written at runtime to localdata/ (resolved path at runtime).
|
|
RUN ln -sf ../localdata/tailscaled.log html/tailscaled.log
|
|
|
|
# Symlink the runtime status.json (written by start.sh from `tailscale status
|
|
# --json`) into html/ so the web UI can read Tailscale's authoritative state.
|
|
RUN ln -sf ../localdata/status.json html/status.json
|
|
|
|
# Build and package
|
|
RUN . /opt/axis/acapsdk/environment-setup* && create-package.sh ./
|
|
|
|
# Patch STARTMODE: create-package.sh hardcodes "never" unless RESTRICTION_STARTMODE is set,
|
|
# but the ACAP 3 SDK does not honour our package.conf's STARTMODE=respawn without it.
|
|
# Repack the .eap with the corrected value.
|
|
RUN for eap in *.eap; do \
|
|
tmpdir=$(mktemp -d) && tar xf "$eap" -C "$tmpdir" && \
|
|
sed -i 's/STARTMODE="never"/STARTMODE="respawn"/' "$tmpdir/package.conf" && \
|
|
(cd "$tmpdir" && tar czf "/opt/app/$eap" .) && \
|
|
rm -rf "$tmpdir"; \
|
|
done
|