Fix docker caching and correcting version in Gitea workflow
build / build-linux-amd64 (push) Successful in 1m56s
build / build-linux-amd64 (push) Successful in 1m56s
This commit is contained in:
+11
-25
@@ -4,18 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [pro-features]
|
branches: [pro-features]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
version_suffix:
|
|
||||||
description: "Version suffix (e.g. 'cst', 'beta1'). Empty = vanilla."
|
|
||||||
type: string
|
|
||||||
default: "cst"
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Cargo.lock is lockfile v4, which requires Rust >= 1.78. Upstream's
|
# Cargo.lock is lockfile v4, which requires Rust >= 1.78. Upstream's
|
||||||
# .github/workflows/build.yaml pins 1.90; mirror that here.
|
# .github/workflows/build.yaml pins 1.90; mirror that here.
|
||||||
RUST_VERSION: "1.90"
|
RUST_VERSION: "1.90"
|
||||||
VERSION_BASE: "1.1.15"
|
|
||||||
VERSION_SUFFIX: ${{ inputs.version_suffix || 'cst' }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-amd64:
|
build-amd64:
|
||||||
@@ -48,32 +41,25 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Compute version strings
|
- name: Read version from Cargo.toml
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
base="${VERSION_BASE}"
|
# Single source of truth: the top-level Cargo.toml's first `version =`
|
||||||
suffix="${VERSION_SUFFIX}"
|
# line (hbbs package). debian/changelog is patched to match below so
|
||||||
[[ "$base" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || {
|
# the produced .deb filenames carry the same version.
|
||||||
echo "VERSION_BASE '$base' must be major.minor.patch"; exit 1; }
|
display=$(grep -m1 -E '^version[[:space:]]*=' Cargo.toml \
|
||||||
if [[ -n "$suffix" ]]; then display="${base}-${suffix}"; else display="${base}"; fi
|
| sed -E 's/^version[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/')
|
||||||
echo "Base : $base"
|
[[ -n "$display" ]] || { echo "Could not read version from Cargo.toml"; exit 1; }
|
||||||
echo "Suffix : $suffix"
|
echo "Version : $display"
|
||||||
echo "Display : $display"
|
|
||||||
echo "VERSION_DISPLAY=$display" >> "$GITHUB_ENV"
|
echo "VERSION_DISPLAY=$display" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Patch Cargo.toml with display version
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sed -i -E "0,/^version[[:space:]]*=/{s/^version[[:space:]]*=[[:space:]]*\"${VERSION_BASE}\"/version = \"${VERSION_DISPLAY}\"/}" Cargo.toml
|
|
||||||
grep '^version' Cargo.toml | head -1
|
|
||||||
|
|
||||||
- name: Patch debian/changelog with display version
|
- name: Patch debian/changelog with display version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# The .deb filename is derived from the first changelog entry's
|
# The .deb filename is derived from the first changelog entry's
|
||||||
# parenthesized version, NOT from Cargo.toml. Rewrite the leading
|
# parenthesized version, NOT from Cargo.toml. Rewrite whatever
|
||||||
# entry so the produced .debs carry $VERSION_DISPLAY.
|
# version is in the leading entry to match $VERSION_DISPLAY.
|
||||||
sed -i -E "0,/^rustdesk-server \(${VERSION_BASE}\)/{s/^rustdesk-server \(${VERSION_BASE}\)/rustdesk-server (${VERSION_DISPLAY})/}" debian/changelog
|
sed -i -E "0,/^rustdesk-server \([^)]+\)/{s/^rustdesk-server \([^)]+\)/rustdesk-server (${VERSION_DISPLAY})/}" debian/changelog
|
||||||
head -1 debian/changelog
|
head -1 debian/changelog
|
||||||
|
|
||||||
- name: Ensure Rust toolchain configured
|
- name: Ensure Rust toolchain configured
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
rustdesk-server (1.1.15) UNRELEASED; urgency=medium
|
rustdesk-server (1.1.17-pro) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Fix: 127.0.0.1 is not loopback (#515)
|
* Fix: 127.0.0.1 is not loopback (#515)
|
||||||
* Higher default bandwidth
|
* Higher default bandwidth
|
||||||
|
|||||||
+22
-20
@@ -1,39 +1,41 @@
|
|||||||
# Builds a minimal debian image that installs the hbbs/hbbr/utils .deb from a
|
# Builds a minimal debian image that, on every container start, pulls the
|
||||||
# Gitea Actions artifact and runs it. Both services share the same image; only
|
# hbbs/hbbr/utils .deb from a Gitea Actions artifact and installs it before
|
||||||
# the entrypoint command differs.
|
# launching the binary. Both services share the same image; only the command
|
||||||
|
# differs.
|
||||||
#
|
#
|
||||||
# Settings below are baked in as defaults. To override a value without editing
|
# The .deb is fetched at runtime (not build time), so `docker compose up`
|
||||||
# this file, export it in your shell or put it in .env, e.g.:
|
# always picks up the newest successful run on $GITEA_BRANCH. To pin a
|
||||||
# RUSTDESK_DOMAIN=rd.example.com docker compose up -d
|
# specific zip and skip auto-discovery, set ARTIFACT_URL in your shell or
|
||||||
#
|
# .env, e.g.:
|
||||||
# To pin a specific artifact zip (skip API auto-discovery), set ARTIFACT_URL:
|
|
||||||
# ARTIFACT_URL=https://gitea.cstudio.ch/mike/rustdesk-server/actions/runs/173/artifacts/rustdesk-server-linux-amd64-1e961cdd929f7af97148b76d9de79998a89402a3 \
|
# ARTIFACT_URL=https://gitea.cstudio.ch/mike/rustdesk-server/actions/runs/173/artifacts/rustdesk-server-linux-amd64-1e961cdd929f7af97148b76d9de79998a89402a3 \
|
||||||
# docker compose build
|
# docker compose up -d
|
||||||
#
|
#
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
rustdesk-net:
|
rustdesk-net:
|
||||||
external: false
|
external: false
|
||||||
|
|
||||||
# Build args — passed to docker/Dockerfile.deb. ARTIFACT_URL, if set, short-
|
# The image only needs to bundle curl/jq/unzip/tini/dpkg + the fetch scripts —
|
||||||
# circuits the API discovery and downloads the zip directly.
|
# no build args required. The actual .deb download happens at container start
|
||||||
|
# (see docker/entrypoint.sh), driven by the env vars in x-rustdesk-env below.
|
||||||
x-rustdesk-build: &rustdesk-build
|
x-rustdesk-build: &rustdesk-build
|
||||||
context: ./docker
|
context: ./docker
|
||||||
dockerfile: Dockerfile.deb
|
dockerfile: Dockerfile.deb
|
||||||
args:
|
|
||||||
|
# Runtime env. Two groups:
|
||||||
|
# 1) Artifact-fetch config consumed by entrypoint.sh on every container
|
||||||
|
# start — set ARTIFACT_URL to pin a specific zip, otherwise the script
|
||||||
|
# picks the newest successful run on $GITEA_BRANCH.
|
||||||
|
# 2) hbbs/hbbr knobs. Most settings (relay, bootstrap admin, key, http
|
||||||
|
# port) are passed via CLI flags below — the binary's env-var
|
||||||
|
# convention transforms `--foo-bar` into `FOO-BAR` (literal dashes,
|
||||||
|
# uppercase), which is awkward in YAML, so flags are clearer.
|
||||||
|
x-rustdesk-env: &rustdesk-env
|
||||||
GITEA_URL: "${GITEA_URL:-https://gitea.cstudio.ch}"
|
GITEA_URL: "${GITEA_URL:-https://gitea.cstudio.ch}"
|
||||||
GITEA_OWNER: "${GITEA_OWNER:-mike}"
|
GITEA_OWNER: "${GITEA_OWNER:-mike}"
|
||||||
GITEA_REPO: "${GITEA_REPO:-rustdesk-server}"
|
GITEA_REPO: "${GITEA_REPO:-rustdesk-server}"
|
||||||
GITEA_BRANCH: "${GITEA_BRANCH:-pro-features}"
|
GITEA_BRANCH: "${GITEA_BRANCH:-pro-features}"
|
||||||
ARTIFACT_URL: "${ARTIFACT_URL:-}"
|
ARTIFACT_URL: "${ARTIFACT_URL:-}"
|
||||||
CACHE_BUST: "${CACHE_BUST:-0}"
|
|
||||||
|
|
||||||
# Runtime env that hbbs/hbbr actually read. Most settings (relay, bootstrap
|
|
||||||
# admin, key, http port) are passed via CLI flags below — the binary's
|
|
||||||
# env-var convention transforms `--foo-bar` into `FOO-BAR` (literal dashes,
|
|
||||||
# uppercase), which is awkward in YAML, so flags are clearer. The names
|
|
||||||
# below are the few that the binary reads as plain env vars.
|
|
||||||
x-rustdesk-env: &rustdesk-env
|
|
||||||
RUST_LOG: "${RUST_LOG:-info}"
|
RUST_LOG: "${RUST_LOG:-info}"
|
||||||
# Force relay for all sessions even on LAN. Uncomment to enable.
|
# Force relay for all sessions even on LAN. Uncomment to enable.
|
||||||
# ALWAYS_USE_RELAY: "Y"
|
# ALWAYS_USE_RELAY: "Y"
|
||||||
|
|||||||
+9
-22
@@ -1,22 +1,13 @@
|
|||||||
# Minimal debian image that installs hbbs/hbbr/rustdesk-utils from the .deb
|
# Minimal debian image with the tooling needed to download + install the
|
||||||
# artifact produced by the Gitea Actions workflow at
|
# hbbs/hbbr/rustdesk-utils .deb at *container start* (not build time).
|
||||||
# https://gitea.cstudio.ch/mike/rustdesk-server.
|
# The actual fetch happens in /usr/local/sbin/entrypoint.sh, which calls
|
||||||
#
|
# fetch-artifact.sh on every start — see docker-compose.yml for the runtime
|
||||||
# To force a fresh artifact pull on rebuild, bump CACHE_BUST (e.g.
|
# env vars (GITEA_URL, GITEA_OWNER, GITEA_REPO, GITEA_BRANCH, ARTIFACT_URL).
|
||||||
# `docker compose build --build-arg CACHE_BUST=$(date +%s)`).
|
|
||||||
#
|
#
|
||||||
# The Gitea workflow only produces amd64 .debs, so pin the image platform.
|
# The Gitea workflow only produces amd64 .debs, so pin the image platform.
|
||||||
# On non-amd64 hosts (e.g. Apple Silicon) Docker will emulate via qemu.
|
# On non-amd64 hosts (e.g. Apple Silicon) Docker will emulate via qemu.
|
||||||
FROM --platform=linux/amd64 debian:bookworm-slim
|
FROM --platform=linux/amd64 debian:bookworm-slim
|
||||||
|
|
||||||
ARG GITEA_URL=https://gitea.cstudio.ch
|
|
||||||
ARG GITEA_OWNER=mike
|
|
||||||
ARG GITEA_REPO=rustdesk-server
|
|
||||||
ARG GITEA_BRANCH=pro-features
|
|
||||||
# When set, the script downloads this URL directly and skips API discovery.
|
|
||||||
ARG ARTIFACT_URL=
|
|
||||||
ARG CACHE_BUST=$(date +%s)
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -25,12 +16,8 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY fetch-artifact.sh /usr/local/sbin/fetch-artifact.sh
|
COPY fetch-artifact.sh /usr/local/sbin/fetch-artifact.sh
|
||||||
RUN chmod +x /usr/local/sbin/fetch-artifact.sh
|
COPY entrypoint.sh /usr/local/sbin/entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/sbin/fetch-artifact.sh /usr/local/sbin/entrypoint.sh
|
||||||
RUN echo "cache-bust=$CACHE_BUST" \
|
|
||||||
&& GITEA_URL="$GITEA_URL" GITEA_OWNER="$GITEA_OWNER" GITEA_REPO="$GITEA_REPO" \
|
|
||||||
GITEA_BRANCH="$GITEA_BRANCH" ARTIFACT_URL="$ARTIFACT_URL" \
|
|
||||||
/usr/local/sbin/fetch-artifact.sh
|
|
||||||
|
|
||||||
WORKDIR /var/lib/rustdesk-server
|
WORKDIR /var/lib/rustdesk-server
|
||||||
|
|
||||||
@@ -38,5 +25,5 @@ WORKDIR /var/lib/rustdesk-server
|
|||||||
# 21118 web socket signal, 21119 web socket relay.
|
# 21118 web socket signal, 21119 web socket relay.
|
||||||
EXPOSE 21114 21115 21116 21116/udp 21117 21118 21119
|
EXPOSE 21114 21115 21116 21116/udp 21117 21118 21119
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/sbin/entrypoint.sh"]
|
||||||
CMD ["/usr/bin/hbbs"]
|
CMD ["hbbs"]
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Runtime entrypoint: pulls the latest .deb artifact from Gitea Actions and
|
||||||
|
# installs it on every container start, then execs the CMD (hbbs / hbbr).
|
||||||
|
#
|
||||||
|
# Configuration comes from the environment — see docker-compose.yml:
|
||||||
|
# ARTIFACT_URL pinned zip URL; if unset the script discovers the newest
|
||||||
|
# successful run on GITEA_BRANCH
|
||||||
|
# GITEA_URL, GITEA_OWNER, GITEA_REPO, GITEA_BRANCH
|
||||||
|
# required when ARTIFACT_URL is unset
|
||||||
|
#
|
||||||
|
# Container fails to start if the fetch fails — that's intentional: we always
|
||||||
|
# want a fresh artifact, never a stale one.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
/usr/local/sbin/fetch-artifact.sh
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Reference in New Issue
Block a user