Skip to content

Commit 34bc4be

Browse files
author
Max
committed
updates
1 parent 74d4c33 commit 34bc4be

12 files changed

Lines changed: 248 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
docker-build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Resolve default Omada release
20+
id: release
21+
shell: bash
22+
run: |
23+
set -euo pipefail
24+
version="$(jq -r 'keys[0]' release-manifests/omada-releases.json)"
25+
url="$(jq -r --arg version "${version}" '.[$version].url' release-manifests/omada-releases.json)"
26+
sha256="$(jq -r --arg version "${version}" '.[$version].sha256' release-manifests/omada-releases.json)"
27+
{
28+
echo "version=${version}"
29+
echo "url=${url}"
30+
echo "sha256=${sha256}"
31+
} >> "${GITHUB_OUTPUT}"
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Build image without publishing
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: Dockerfile
41+
platforms: linux/amd64
42+
push: false
43+
tags: ghcr.io/${{ github.repository_owner }}/omada-controller:${{ steps.release.outputs.version }}
44+
build-args: |
45+
OMADA_VERSION=${{ steps.release.outputs.version }}
46+
OMADA_URL=${{ steps.release.outputs.url }}
47+
OMADA_SHA256=${{ steps.release.outputs.sha256 }}

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install tooling
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y shellcheck
17+
sudo snap install yq
18+
- name: Lint shell and YAML
19+
run: make lint
20+

.github/workflows/release.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
inputs:
9+
omada_version:
10+
description: "Omada version to build, for example 6.2.10.17"
11+
required: true
12+
omada_url:
13+
description: "Official TP-Link artifact URL. Leave empty to use release-manifests/omada-releases.json."
14+
required: false
15+
default: ""
16+
omada_sha256:
17+
description: "Trusted artifact SHA256. Leave empty to use release-manifests/omada-releases.json."
18+
required: false
19+
default: ""
20+
publish:
21+
description: "Push to GHCR. Requires repository variable TP_LINK_REDISTRIBUTION_OK=true."
22+
type: boolean
23+
required: true
24+
default: false
25+
26+
permissions:
27+
contents: read
28+
packages: write
29+
30+
env:
31+
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/omada-controller
32+
TP_LINK_REDISTRIBUTION_OK: ${{ vars.TP_LINK_REDISTRIBUTION_OK }}
33+
34+
jobs:
35+
build:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Check out repository
39+
uses: actions/checkout@v4
40+
41+
- name: Resolve Omada release
42+
id: release
43+
shell: bash
44+
run: |
45+
set -euo pipefail
46+
47+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
48+
version="${GITHUB_REF_NAME#v}"
49+
publish_requested="true"
50+
input_url=""
51+
input_sha256=""
52+
else
53+
version="${{ inputs.omada_version }}"
54+
publish_requested="${{ inputs.publish }}"
55+
input_url="${{ inputs.omada_url }}"
56+
input_sha256="${{ inputs.omada_sha256 }}"
57+
fi
58+
59+
if [[ -z "${version}" ]]; then
60+
echo "Omada version is required" >&2
61+
exit 1
62+
fi
63+
64+
if [[ -n "${input_url}" || -n "${input_sha256}" ]]; then
65+
url="${input_url}"
66+
sha256="${input_sha256}"
67+
else
68+
url="$(jq -r --arg version "${version}" '.[$version].url // empty' release-manifests/omada-releases.json)"
69+
sha256="$(jq -r --arg version "${version}" '.[$version].sha256 // empty' release-manifests/omada-releases.json)"
70+
fi
71+
72+
if [[ -z "${url}" || -z "${sha256}" ]]; then
73+
echo "No release manifest entry found for Omada ${version}; provide omada_url and omada_sha256 manually." >&2
74+
exit 1
75+
fi
76+
77+
publish="false"
78+
if [[ "${publish_requested}" == "true" ]]; then
79+
if [[ "${TP_LINK_REDISTRIBUTION_OK}" != "true" ]]; then
80+
echo "Refusing to publish a public image containing TP-Link Omada binaries." >&2
81+
echo "Set repository variable TP_LINK_REDISTRIBUTION_OK=true only after confirming redistribution permission." >&2
82+
exit 1
83+
fi
84+
publish="true"
85+
fi
86+
87+
{
88+
echo "version=${version}"
89+
echo "url=${url}"
90+
echo "sha256=${sha256}"
91+
echo "publish=${publish}"
92+
} >> "${GITHUB_OUTPUT}"
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v3
96+
97+
- name: Log in to GHCR
98+
if: steps.release.outputs.publish == 'true'
99+
uses: docker/login-action@v3
100+
with:
101+
registry: ghcr.io
102+
username: ${{ github.actor }}
103+
password: ${{ secrets.GITHUB_TOKEN }}
104+
105+
- name: Generate image metadata
106+
id: meta
107+
uses: docker/metadata-action@v5
108+
with:
109+
images: ${{ env.IMAGE_NAME }}
110+
flavor: latest=false
111+
tags: |
112+
type=semver,pattern={{version}},value=v${{ steps.release.outputs.version }}
113+
type=semver,pattern={{major}}.{{minor}},value=v${{ steps.release.outputs.version }}
114+
type=semver,pattern={{major}},value=v${{ steps.release.outputs.version }}
115+
labels: |
116+
org.opencontainers.image.title=Omada Controller Docker Compose
117+
org.opencontainers.image.description=TP-Link Omada Software Controller image for Docker Compose with external MongoDB
118+
org.opencontainers.image.version=${{ steps.release.outputs.version }}
119+
120+
- name: Build image
121+
uses: docker/build-push-action@v6
122+
with:
123+
context: .
124+
file: Dockerfile
125+
platforms: linux/amd64
126+
push: ${{ steps.release.outputs.publish == 'true' }}
127+
tags: ${{ steps.meta.outputs.tags }}
128+
labels: ${{ steps.meta.outputs.labels }}
129+
build-args: |
130+
OMADA_VERSION=${{ steps.release.outputs.version }}
131+
OMADA_URL=${{ steps.release.outputs.url }}
132+
OMADA_SHA256=${{ steps.release.outputs.sha256 }}
133+
134+
- name: Print image tags
135+
run: |
136+
if [[ "${{ steps.release.outputs.publish }}" == "true" ]]; then
137+
echo "Published:"
138+
else
139+
echo "Built without publishing:"
140+
fi
141+
echo "${{ steps.meta.outputs.tags }}"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG OMADA_GID=508
1111
LABEL org.opencontainers.image.title="Omada Controller Compose"
1212
LABEL org.opencontainers.image.description="Controller-only TP-Link Omada Software Controller image"
1313
LABEL org.opencontainers.image.version="${OMADA_VERSION}"
14-
LABEL org.opencontainers.image.source="https://github.com/local/omada-controller"
14+
LABEL org.opencontainers.image.source="https://github.com/maxya/omada-controller"
1515
LABEL org.opencontainers.image.licenses="MIT"
1616

1717
ENV OMADA_HOME=/opt/omada

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ This project is a clean, source-built alternative for running Omada Controller i
66

77
> Unofficial project. TP-Link Omada Software Controller is proprietary software downloaded from TP-Link. This repository packages and operates it; it does not redistribute or audit TP-Link's application.
88
9+
## TP-Link Software And Container Images
10+
11+
The repository code is open source, but TP-Link Omada Software Controller is proprietary software. No explicit TP-Link permission to redistribute Omada Controller binaries inside public Docker images was found in the official download page or the Linux `.tar.gz` package. Public container images that include Omada binaries are published only if redistribution permission is confirmed.
12+
13+
Until then, the default workflow builds the image locally from the official TP-Link Linux package URL that you provide in `.env`. The GitHub Actions release workflow includes a GHCR publishing path, but it is gated by the repository variable `TP_LINK_REDISTRIBUTION_OK=true` and should remain disabled unless you have confirmed that publishing images with Omada binaries is allowed.
14+
15+
Official Omada download page: <https://support.omadanetworks.com/us/download/software/omada-controller/>
16+
917
## Why This Omada Docker Stack Exists
1018

1119
Many existing Omada Controller Docker images use all-in-one packaging or are no longer maintained. This repository takes a different approach:
@@ -19,7 +27,7 @@ Many existing Omada Controller Docker images use all-in-one packaging or are no
1927

2028
## Quickstart
2129

22-
This project currently uses a source-build workflow. Build the controller image locally before starting the stack; `docker compose pull` is not a supported workflow for the local controller image.
30+
This project currently uses a source-build workflow. Build the controller image locally before starting the stack.
2331

2432
```sh
2533
cp .env.example .env
@@ -129,7 +137,7 @@ See [backup-restore.md](docs/backup-restore.md) and [upgrades.md](docs/upgrades.
129137

130138
## Intentionally Unsupported
131139

132-
- Prebuilt public controller images.
140+
- Prebuilt public controller images unless Omada redistribution permission is confirmed.
133141
- `latest` controller tags.
134142
- Embedded MongoDB inside the controller container.
135143
- Legacy v3/v4/v5 upgrade logic in the entrypoint.

artifacts/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

certs/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

compose/docker-compose.pinned.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Release builds must replace mutable image tags with digest-pinned references.
2-
# This overlay is intentionally separate from the local source-only workflow.
2+
# This overlay is intentionally separate from the normal source-build workflow.
33
#
44
# Example:
55
# services:
@@ -8,4 +8,3 @@
88
# omada-controller:
99
# image: ghcr.io/<owner>/omada-controller:6.2.10.17@sha256:<digest>
1010
services: {}
11-
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
Description=Omada Controller Compose Stack
3+
Requires=docker.service
4+
After=docker.service network-online.target
5+
Wants=network-online.target
6+
7+
[Service]
8+
Type=oneshot
9+
RemainAfterExit=yes
10+
WorkingDirectory=/opt/omada-controller
11+
ExecStart=/usr/bin/docker compose --env-file .env -f compose/docker-compose.host.yml up -d
12+
ExecStop=/usr/bin/docker compose --env-file .env -f compose/docker-compose.host.yml down
13+
TimeoutStartSec=0
14+
TimeoutStopSec=120
15+
16+
[Install]
17+
WantedBy=multi-user.target
18+

release-manifests/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)