From 3ea0d1d1fd2a4fd7cd614caccf86ad29c0be7d38 Mon Sep 17 00:00:00 2001 From: The Goofball Date: Mon, 20 May 2024 09:24:42 -0700 Subject: [PATCH] Create 8.2/beta, v8.2.87 - Set latest-beta, etc. tags to 8.2/beta - Archive 8.0 folders and workflows --- .github/workflows/build-8.1-beta.yml | 4 - .github/workflows/build-8.2-beta.yml | 124 +++++++++++++ {8.0 => 8.2}/beta/Dockerfile | 0 {8.0 => 8.2}/beta/Dockerfile.alpine | 0 {8.0 => 8.2}/beta/Dockerfile.alpine.mongo | 0 {8.0 => 8.2}/beta/Dockerfile.debian | 0 {8.0 => 8.2}/beta/Dockerfile.debian.mongodb4 | 0 {8.0 => 8.2}/beta/Dockerfile.debian.mongodb5 | 0 {8.0 => 8.2}/beta/Dockerfile.debian.nomongo | 0 {8.0 => 8.2}/beta/Dockerfile.ubuntu.nomongo | 0 {8.0 => 8.2}/beta/Makefile | 0 8.2/beta/VERSION | 1 + {8.0 => 8.2}/beta/hooks/build | 0 .../beta/root/etc/ld-musl-x86_64.path | 0 .../usr/lib/unifi/system.properties.default | 0 .../root/usr/local/bin/docker-entrypoint.sh | 127 +++++++++++++ .../root/usr/local/bin/docker-healthcheck.sh | 0 .../usr/local/bin/entrypoint-functions.sh | 0 CHANGELOG.md | 5 + README.md | 4 +- {8.0/official => archive/8.0/beta}/Dockerfile | 0 .../8.0/beta}/Dockerfile.alpine | 0 .../8.0/beta}/Dockerfile.alpine.mongo | 0 .../8.0/beta}/Dockerfile.debian | 0 archive/8.0/beta/Dockerfile.debian.mongodb4 | 76 ++++++++ archive/8.0/beta/Dockerfile.debian.mongodb5 | 77 ++++++++ .../8.0/beta}/Dockerfile.debian.nomongo | 0 .../8.0/beta}/Dockerfile.ubuntu.nomongo | 0 {8.0/official => archive/8.0/beta}/Makefile | 0 {8.0 => archive/8.0}/beta/VERSION | 0 .../official => archive/8.0/beta}/hooks/build | 0 .../8.0/beta}/root/etc/ld-musl-x86_64.path | 0 .../usr/lib/unifi/system.properties.default | 0 .../root/usr/local/bin/docker-entrypoint.sh | 0 .../root/usr/local/bin/docker-healthcheck.sh | 0 .../usr/local/bin/entrypoint-functions.sh | 0 archive/8.0/official/Dockerfile | 66 +++++++ archive/8.0/official/Dockerfile.alpine | 58 ++++++ archive/8.0/official/Dockerfile.alpine.mongo | 60 +++++++ archive/8.0/official/Dockerfile.debian | 74 ++++++++ .../8.0/official/Dockerfile.debian.nomongo | 66 +++++++ .../8.0/official/Dockerfile.ubuntu.nomongo | 63 +++++++ archive/8.0/official/Makefile | 72 ++++++++ {8.0 => archive/8.0}/official/VERSION | 0 archive/8.0/official/hooks/build | 10 ++ .../8.0/official/root/etc/ld-musl-x86_64.path | 6 + .../usr/lib/unifi/system.properties.default | 44 +++++ .../root/usr/local/bin/docker-entrypoint.sh | 0 .../root/usr/local/bin/docker-healthcheck.sh | 34 ++++ .../usr/local/bin/entrypoint-functions.sh | 169 ++++++++++++++++++ .../workflows/build-8.0-beta.yml | 0 .../workflows/build-8.0-official.yml | 0 52 files changed, 1134 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-8.2-beta.yml rename {8.0 => 8.2}/beta/Dockerfile (100%) rename {8.0 => 8.2}/beta/Dockerfile.alpine (100%) rename {8.0 => 8.2}/beta/Dockerfile.alpine.mongo (100%) rename {8.0 => 8.2}/beta/Dockerfile.debian (100%) rename {8.0 => 8.2}/beta/Dockerfile.debian.mongodb4 (100%) rename {8.0 => 8.2}/beta/Dockerfile.debian.mongodb5 (100%) rename {8.0 => 8.2}/beta/Dockerfile.debian.nomongo (100%) rename {8.0 => 8.2}/beta/Dockerfile.ubuntu.nomongo (100%) rename {8.0 => 8.2}/beta/Makefile (100%) create mode 100644 8.2/beta/VERSION rename {8.0 => 8.2}/beta/hooks/build (100%) rename {8.0 => 8.2}/beta/root/etc/ld-musl-x86_64.path (100%) rename {8.0 => 8.2}/beta/root/usr/lib/unifi/system.properties.default (100%) create mode 100755 8.2/beta/root/usr/local/bin/docker-entrypoint.sh rename {8.0 => 8.2}/beta/root/usr/local/bin/docker-healthcheck.sh (100%) rename {8.0 => 8.2}/beta/root/usr/local/bin/entrypoint-functions.sh (100%) rename {8.0/official => archive/8.0/beta}/Dockerfile (100%) rename {8.0/official => archive/8.0/beta}/Dockerfile.alpine (100%) rename {8.0/official => archive/8.0/beta}/Dockerfile.alpine.mongo (100%) rename {8.0/official => archive/8.0/beta}/Dockerfile.debian (100%) create mode 100644 archive/8.0/beta/Dockerfile.debian.mongodb4 create mode 100644 archive/8.0/beta/Dockerfile.debian.mongodb5 rename {8.0/official => archive/8.0/beta}/Dockerfile.debian.nomongo (100%) rename {8.0/official => archive/8.0/beta}/Dockerfile.ubuntu.nomongo (100%) rename {8.0/official => archive/8.0/beta}/Makefile (100%) rename {8.0 => archive/8.0}/beta/VERSION (100%) rename {8.0/official => archive/8.0/beta}/hooks/build (100%) rename {8.0/official => archive/8.0/beta}/root/etc/ld-musl-x86_64.path (100%) rename {8.0/official => archive/8.0/beta}/root/usr/lib/unifi/system.properties.default (100%) rename {8.0 => archive/8.0}/beta/root/usr/local/bin/docker-entrypoint.sh (100%) rename {8.0/official => archive/8.0/beta}/root/usr/local/bin/docker-healthcheck.sh (100%) rename {8.0/official => archive/8.0/beta}/root/usr/local/bin/entrypoint-functions.sh (100%) create mode 100644 archive/8.0/official/Dockerfile create mode 100644 archive/8.0/official/Dockerfile.alpine create mode 100644 archive/8.0/official/Dockerfile.alpine.mongo create mode 100644 archive/8.0/official/Dockerfile.debian create mode 100644 archive/8.0/official/Dockerfile.debian.nomongo create mode 100644 archive/8.0/official/Dockerfile.ubuntu.nomongo create mode 100644 archive/8.0/official/Makefile rename {8.0 => archive/8.0}/official/VERSION (100%) create mode 100755 archive/8.0/official/hooks/build create mode 100644 archive/8.0/official/root/etc/ld-musl-x86_64.path create mode 100644 archive/8.0/official/root/usr/lib/unifi/system.properties.default rename {8.0 => archive/8.0}/official/root/usr/local/bin/docker-entrypoint.sh (100%) create mode 100755 archive/8.0/official/root/usr/local/bin/docker-healthcheck.sh create mode 100755 archive/8.0/official/root/usr/local/bin/entrypoint-functions.sh rename {.github => archive}/workflows/build-8.0-beta.yml (100%) rename {.github => archive}/workflows/build-8.0-official.yml (100%) diff --git a/.github/workflows/build-8.1-beta.yml b/.github/workflows/build-8.1-beta.yml index e8ff6cc..60f8959 100644 --- a/.github/workflows/build-8.1-beta.yml +++ b/.github/workflows/build-8.1-beta.yml @@ -29,7 +29,6 @@ jobs: ${{ github.repository }} ghcr.io/${{ github.repository }} tags: | - type=raw,latest-alpine-beta type=raw,8.1-alpine-beta labels: | org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com @@ -45,7 +44,6 @@ jobs: ${{ github.repository }} ghcr.io/${{ github.repository }} tags: | - type=raw,latest-debian-beta type=raw,8.1-debian-beta labels: | org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com @@ -61,8 +59,6 @@ jobs: ${{ github.repository }} ghcr.io/${{ github.repository }} tags: | - type=raw,latest-beta - type=raw,latest-ubuntu-beta type=raw,8.1-beta type=raw,8.1-ubuntu-beta labels: | diff --git a/.github/workflows/build-8.2-beta.yml b/.github/workflows/build-8.2-beta.yml new file mode 100644 index 0000000..0976d7f --- /dev/null +++ b/.github/workflows/build-8.2-beta.yml @@ -0,0 +1,124 @@ +name: Build 8.2 Beta + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - 8.2/beta/** + - .github/workflows/build-8.2-beta.yml + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up dynamic build ARGs + id: getargs + run: echo "version=$(cat ./8.2/beta/VERSION)" >> $GITHUB_OUTPUT + - + name: Set up Docker metadata for Alpine + id: meta-alpine + uses: docker/metadata-action@v5 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,latest-alpine-beta + type=raw,8.2-alpine-beta + labels: | + org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com + org.opencontainers.image.title=UniFi Controller + org.opencontainers.image.description=UniFi Controller + org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Alpine + - + name: Set up Docker metadata for Debian + id: meta-debian + uses: docker/metadata-action@v5 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,latest-debian-beta + type=raw,8.2-debian-beta + labels: | + org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com + org.opencontainers.image.title=UniFi Controller + org.opencontainers.image.description=UniFi Controller + org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Debian + - + name: Set up Docker metadata for Ubuntu + id: meta-ubuntu + uses: docker/metadata-action@v5 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,latest-beta + type=raw,latest-ubuntu-beta + type=raw,8.2-beta + type=raw,8.2-ubuntu-beta + labels: | + org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com + org.opencontainers.image.title=UniFi Controller + org.opencontainers.image.description=UniFi Controller + org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Ubuntu + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push Alpine Docker image + uses: docker/build-push-action@v5 + with: + context: ./8.2/beta + file: ./8.2/beta/Dockerfile.alpine + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-alpine.outputs.tags }} + labels: ${{ steps.meta-alpine.outputs.labels }} + build-args: VERSION=${{ steps.getargs.outputs.version }} + - + name: Build and push Debian Docker image + uses: docker/build-push-action@v5 + with: + context: ./8.2/beta + file: ./8.2/beta/Dockerfile.debian + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-debian.outputs.tags }} + labels: ${{ steps.meta-debian.outputs.labels }} + build-args: VERSION=${{ steps.getargs.outputs.version }} + - + name: Build and push Ubuntu Docker image + uses: docker/build-push-action@v5 + with: + context: ./8.2/beta + file: ./8.2/beta/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-ubuntu.outputs.tags }} + labels: ${{ steps.meta-ubuntu.outputs.labels }} + build-args: VERSION=${{ steps.getargs.outputs.version }} diff --git a/8.0/beta/Dockerfile b/8.2/beta/Dockerfile similarity index 100% rename from 8.0/beta/Dockerfile rename to 8.2/beta/Dockerfile diff --git a/8.0/beta/Dockerfile.alpine b/8.2/beta/Dockerfile.alpine similarity index 100% rename from 8.0/beta/Dockerfile.alpine rename to 8.2/beta/Dockerfile.alpine diff --git a/8.0/beta/Dockerfile.alpine.mongo b/8.2/beta/Dockerfile.alpine.mongo similarity index 100% rename from 8.0/beta/Dockerfile.alpine.mongo rename to 8.2/beta/Dockerfile.alpine.mongo diff --git a/8.0/beta/Dockerfile.debian b/8.2/beta/Dockerfile.debian similarity index 100% rename from 8.0/beta/Dockerfile.debian rename to 8.2/beta/Dockerfile.debian diff --git a/8.0/beta/Dockerfile.debian.mongodb4 b/8.2/beta/Dockerfile.debian.mongodb4 similarity index 100% rename from 8.0/beta/Dockerfile.debian.mongodb4 rename to 8.2/beta/Dockerfile.debian.mongodb4 diff --git a/8.0/beta/Dockerfile.debian.mongodb5 b/8.2/beta/Dockerfile.debian.mongodb5 similarity index 100% rename from 8.0/beta/Dockerfile.debian.mongodb5 rename to 8.2/beta/Dockerfile.debian.mongodb5 diff --git a/8.0/beta/Dockerfile.debian.nomongo b/8.2/beta/Dockerfile.debian.nomongo similarity index 100% rename from 8.0/beta/Dockerfile.debian.nomongo rename to 8.2/beta/Dockerfile.debian.nomongo diff --git a/8.0/beta/Dockerfile.ubuntu.nomongo b/8.2/beta/Dockerfile.ubuntu.nomongo similarity index 100% rename from 8.0/beta/Dockerfile.ubuntu.nomongo rename to 8.2/beta/Dockerfile.ubuntu.nomongo diff --git a/8.0/beta/Makefile b/8.2/beta/Makefile similarity index 100% rename from 8.0/beta/Makefile rename to 8.2/beta/Makefile diff --git a/8.2/beta/VERSION b/8.2/beta/VERSION new file mode 100644 index 0000000..a16a424 --- /dev/null +++ b/8.2/beta/VERSION @@ -0,0 +1 @@ +8.2.87-54321d7713 diff --git a/8.0/beta/hooks/build b/8.2/beta/hooks/build similarity index 100% rename from 8.0/beta/hooks/build rename to 8.2/beta/hooks/build diff --git a/8.0/beta/root/etc/ld-musl-x86_64.path b/8.2/beta/root/etc/ld-musl-x86_64.path similarity index 100% rename from 8.0/beta/root/etc/ld-musl-x86_64.path rename to 8.2/beta/root/etc/ld-musl-x86_64.path diff --git a/8.0/beta/root/usr/lib/unifi/system.properties.default b/8.2/beta/root/usr/lib/unifi/system.properties.default similarity index 100% rename from 8.0/beta/root/usr/lib/unifi/system.properties.default rename to 8.2/beta/root/usr/lib/unifi/system.properties.default diff --git a/8.2/beta/root/usr/local/bin/docker-entrypoint.sh b/8.2/beta/root/usr/local/bin/docker-entrypoint.sh new file mode 100755 index 0000000..ec7d26d --- /dev/null +++ b/8.2/beta/root/usr/local/bin/docker-entrypoint.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash + +# docker-entrypoint.sh script for UniFi Docker container +# License: Apache-2.0 +# Github: https://github.com/goofball222/unifi +SCRIPT_VERSION="1.1.3" +# Last updated date: 2024-03-01 + +set -Eeuo pipefail + +if [ "${DEBUG}" == 'true' ]; then + set -x + LOGSTDOUT="true" +fi + +. /usr/local/bin/entrypoint-functions.sh + +BASEDIR="/usr/lib/unifi" +CERTDIR=${BASEDIR}/cert +DATADIR=${BASEDIR}/data +LOGDIR=${BASEDIR}/logs +RUNDIR=${BASEDIR}/run + +LOGSTDOUT=${LOGSTDOUT:-"false"} +READENV=${READENV:-"true"} + +f_log "INFO - Entrypoint script version ${SCRIPT_VERSION}" +f_log "INFO - Entrypoint functions version ${ENTRYPOINT_FUNCTIONS_VERSION}" + +[ ! -z "${JVM_MAX_HEAP_SIZE}" ] && JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Xmx${JVM_MAX_HEAP_SIZE}" +[ ! -z "${JVM_INIT_HEAP_SIZE}" ] && JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Xms${JVM_INIT_HEAP_SIZE}" + +JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Dunifi.datadir=${DATADIR} -Dunifi.logdir=${LOGDIR} -Dunifi.rundir=${RUNDIR}" + +JVM_OPTS="${JVM_EXTRA_OPTS} -Djava.awt.headless=true -Dfile.encoding=UTF-8 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED" + +cd ${BASEDIR} + +f_exit_handler() { + f_log "INFO - Exit signal received, commencing shutdown" + exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar stop & + for i in `seq 0 25`; do + [ -z "$(pgrep -f ${BASEDIR}/lib/ace.jar)" ] && break + # graceful shutdown + [ $i -gt 0 ] && [ -d ${RUNDIR} ] && touch ${RUNDIR}/server.stop || true + # savage shutdown + [ $i -gt 19 ] && pkill -f ${BASEDIR}/lib/ace.jar || true + sleep 1 + done + f_log "INFO - Shutdown complete. Nothing more to see here. Have a nice day!" + f_log "INFO - Exit with status code ${?}" + exit ${?}; +} + +f_idle_handler() { + if [ "$LOGSTDOUT" = 'true' ]; then + while true + do + tail -f /dev/null & wait ${!} + done + else + while true + do + tail -F -n0 ${LOGDIR}/server.log & wait ${!} + done + fi +} + +trap 'kill ${!}; f_exit_handler' SIGHUP SIGINT SIGQUIT SIGTERM + +if [ "$(id -u)" = '0' ]; then + f_log "INFO - Entrypoint running with UID 0 (root)" + if [[ "${@}" == 'unifi' ]]; then + f_giduid + f_mongo + f_sysprop + f_ssl + f_bindpriv + f_chown + if [ "${RUNAS_UID0}" == 'true' ]; then + f_log "INFO - RUNAS_UID0=true - running UniFi processes as UID 0 (root)" + f_log "WARN - ======================================================================" + f_log "WARN - *** Running as UID 0 (root) is an insecure configuration ***" + f_log "WARN - ======================================================================" + f_log "EXEC - /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start" + exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start & + f_idle_handler + else + if [ -x "/sbin/su-exec" ]; then + f_log "INFO - Use su-exec to drop privileges and start Java/UniFi as GID=${PGID}, UID=${PUID}" + f_log "EXEC - su-exec unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start" + exec su-exec unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start & + f_idle_handler + elif [ -x "/usr/sbin/gosu" ]; then + f_log "INFO - Use gosu to drop privileges and start Java/UniFi as GID=${PGID}, UID=${PUID}" + f_log "EXEC - gosu unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start" + exec gosu unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start & + f_idle_handler + else + f_log "ERROR - su-exec/gosu NOT FOUND. Run state is invalid. Exiting." + exit 1; + fi + fi + else + f_log "EXEC - ${@} as UID 0 (root)" + exec "${@}" + fi +else + f_log "WARN - Container/entrypoint not started as UID 0 (root)" + f_log "WARN - Unable to change permissions or set custom GID/UID if configured" + f_log "WARN - Process will be spawned with GID=$(id -g), UID=$(id -u)" + f_log "WARN - Depending on permissions requested command may not work" + if [[ "${@}" == 'unifi' ]]; then + f_mongo + f_sysprop + f_ssl + f_log "EXEC - /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start" + exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start & + f_idle_handler + else + f_log "EXEC - ${@}" + exec "${@}" + fi +fi + +# Script should never make it here, but just in case exit with a generic error code if it does +exit 1; diff --git a/8.0/beta/root/usr/local/bin/docker-healthcheck.sh b/8.2/beta/root/usr/local/bin/docker-healthcheck.sh similarity index 100% rename from 8.0/beta/root/usr/local/bin/docker-healthcheck.sh rename to 8.2/beta/root/usr/local/bin/docker-healthcheck.sh diff --git a/8.0/beta/root/usr/local/bin/entrypoint-functions.sh b/8.2/beta/root/usr/local/bin/entrypoint-functions.sh similarity index 100% rename from 8.0/beta/root/usr/local/bin/entrypoint-functions.sh rename to 8.2/beta/root/usr/local/bin/entrypoint-functions.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c45b9..0fc703e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +* **2024-05-20:** + * Create 8.2/beta, v[8.2.87](https://community.ui.com/releases/UniFi-Network-Application-8-2-87/39312132-e885-4ec3-98e7-33594d08717d) + * Set latest-beta, etc. tags to 8.2/beta + * Archive 8.0 folders and workflows +--- * **2024-05-03:** * Update 8.1/official to v[8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561) * Tag 8.1.127 release diff --git a/README.md b/README.md index 709f376..24d8aee 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ | Tag | UniFi Version | Description | Release Date | | --- | :---: | --- | :---: | | [8.1, 8.1-alpine, 8.1-debian, 8.1-ubuntu, latest, latest-alpine, latest-debian, latest-ubuntu](https://github.com/goofball222/unifi/blob/main/8.1/official/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561) | UniFi Network Application official release | 2024-04-29 | -| [8.1-beta, 8.1-alpine-beta, 8.1-debian-beta, 8.1-ubuntu-beta, latest-beta, latest-alpine-beta, latest-debian-beta, latest-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.1/beta/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/dbc88c3a-a3e6-4f7d-8275-76bb40db14fd) | UniFi Network Application beta/release candidate | 2024-04-18 | -| [8.0, 8.0-alpine, 8.0-debian, 8.0-ubuntu](https://github.com/goofball222/unifi/blob/main/8.0/official/Dockerfile) | [8.0.28](https://community.ui.com/releases/UniFi-Network-Application-8-0-28/f7492865-778d-4539-aaf8-3fb09c4279b0) | UniFi Network Application official release | 2024-01-25 | +| [8.2-beta, 8.2-alpine-beta, 8.2-debian-beta, 8.2-ubuntu-beta, latest-beta, latest-alpine-beta, latest-debian-beta, latest-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.2/beta/Dockerfile) | [8.2.87](https://community.ui.com/releases/UniFi-Network-Application-8-2-87/39312132-e885-4ec3-98e7-33594d08717d) | UniFi Network Application beta/release candidate | 2024-05-20 | +| [8.1-beta, 8.1-alpine-beta, 8.1-debian-beta, 8.1-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.1/beta/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/dbc88c3a-a3e6-4f7d-8275-76bb40db14fd) | UniFi Network Application beta/release candidate | 2024-04-18 | | [8.1.127](https://github.com/goofball222/unifi/releases/tag/8.1.127) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561) | Static official release tag/image | 2024-05-03 | | [8.0.28](https://github.com/goofball222/unifi/releases/tag/8.0.28) | [8.0.28](https://community.ui.com/releases/UniFi-Network-Application-8-0-28/f7492865-778d-4539-aaf8-3fb09c4279b0) | Static official release tag/image | 2024-01-25 | | [7.5.187](https://github.com/goofball222/unifi/releases/tag/7.5.187) | [7.5.187](https://community.ui.com/releases/UniFi-Network-Application-7-5-187/408b64c5-a485-4a37-843c-31e87140be64) | Static official release tag/image | 2023-10-17 | diff --git a/8.0/official/Dockerfile b/archive/8.0/beta/Dockerfile similarity index 100% rename from 8.0/official/Dockerfile rename to archive/8.0/beta/Dockerfile diff --git a/8.0/official/Dockerfile.alpine b/archive/8.0/beta/Dockerfile.alpine similarity index 100% rename from 8.0/official/Dockerfile.alpine rename to archive/8.0/beta/Dockerfile.alpine diff --git a/8.0/official/Dockerfile.alpine.mongo b/archive/8.0/beta/Dockerfile.alpine.mongo similarity index 100% rename from 8.0/official/Dockerfile.alpine.mongo rename to archive/8.0/beta/Dockerfile.alpine.mongo diff --git a/8.0/official/Dockerfile.debian b/archive/8.0/beta/Dockerfile.debian similarity index 100% rename from 8.0/official/Dockerfile.debian rename to archive/8.0/beta/Dockerfile.debian diff --git a/archive/8.0/beta/Dockerfile.debian.mongodb4 b/archive/8.0/beta/Dockerfile.debian.mongodb4 new file mode 100644 index 0000000..5b3aff0 --- /dev/null +++ b/archive/8.0/beta/Dockerfile.debian.mongodb4 @@ -0,0 +1,76 @@ +FROM debian:bullseye-slim + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Debian \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && mkdir -p /usr/share/man/man1 \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + dirmngr gnupg2 > /dev/null \ + && apt-get -qqy update \ + && apt-get -qqy --no-install-recommends install \ + binutils curl gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + openjdk-17-jre-headless > /dev/null \ + && curl -fsSL https://www.mongodb.org/static/pgp/server-4.0.asc | \ + apt-key add - \ + && echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" \ + > /etc/apt/sources.list.d/mongodb-org-4.0.list \ + && apt-get -qqy update \ + && apt-get -qqy --no-install-recommends install \ + mongodb-org-server > /dev/null \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + apt-utils dirmngr gnupg2 > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/beta/Dockerfile.debian.mongodb5 b/archive/8.0/beta/Dockerfile.debian.mongodb5 new file mode 100644 index 0000000..67a1350 --- /dev/null +++ b/archive/8.0/beta/Dockerfile.debian.mongodb5 @@ -0,0 +1,77 @@ +FROM debian:bullseye-slim + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Debian \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && mkdir -p /usr/share/man/man1 \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + dirmngr gnupg2 > /dev/null \ + && apt-get -qqy update \ + && apt-get -qqy --no-install-recommends install \ + binutils curl gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + openjdk-17-jre-headless > /dev/null \ + && curl -fsSL https://pgp.mongodb.com/server-5.0.asc | \ + gpg -o /usr/share/keyrings/mongodb-server-5.0.gpg \ + --dearmor \ + && echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-5.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/5.0 main" \ + > /etc/apt/sources.list.d/mongodb-org-5.0.list \ + && apt-get -qqy update \ + && apt-get -qqy --no-install-recommends install \ + mongodb-org-server > /dev/null \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + apt-utils dirmngr gnupg2 > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/8.0/official/Dockerfile.debian.nomongo b/archive/8.0/beta/Dockerfile.debian.nomongo similarity index 100% rename from 8.0/official/Dockerfile.debian.nomongo rename to archive/8.0/beta/Dockerfile.debian.nomongo diff --git a/8.0/official/Dockerfile.ubuntu.nomongo b/archive/8.0/beta/Dockerfile.ubuntu.nomongo similarity index 100% rename from 8.0/official/Dockerfile.ubuntu.nomongo rename to archive/8.0/beta/Dockerfile.ubuntu.nomongo diff --git a/8.0/official/Makefile b/archive/8.0/beta/Makefile similarity index 100% rename from 8.0/official/Makefile rename to archive/8.0/beta/Makefile diff --git a/8.0/beta/VERSION b/archive/8.0/beta/VERSION similarity index 100% rename from 8.0/beta/VERSION rename to archive/8.0/beta/VERSION diff --git a/8.0/official/hooks/build b/archive/8.0/beta/hooks/build similarity index 100% rename from 8.0/official/hooks/build rename to archive/8.0/beta/hooks/build diff --git a/8.0/official/root/etc/ld-musl-x86_64.path b/archive/8.0/beta/root/etc/ld-musl-x86_64.path similarity index 100% rename from 8.0/official/root/etc/ld-musl-x86_64.path rename to archive/8.0/beta/root/etc/ld-musl-x86_64.path diff --git a/8.0/official/root/usr/lib/unifi/system.properties.default b/archive/8.0/beta/root/usr/lib/unifi/system.properties.default similarity index 100% rename from 8.0/official/root/usr/lib/unifi/system.properties.default rename to archive/8.0/beta/root/usr/lib/unifi/system.properties.default diff --git a/8.0/beta/root/usr/local/bin/docker-entrypoint.sh b/archive/8.0/beta/root/usr/local/bin/docker-entrypoint.sh similarity index 100% rename from 8.0/beta/root/usr/local/bin/docker-entrypoint.sh rename to archive/8.0/beta/root/usr/local/bin/docker-entrypoint.sh diff --git a/8.0/official/root/usr/local/bin/docker-healthcheck.sh b/archive/8.0/beta/root/usr/local/bin/docker-healthcheck.sh similarity index 100% rename from 8.0/official/root/usr/local/bin/docker-healthcheck.sh rename to archive/8.0/beta/root/usr/local/bin/docker-healthcheck.sh diff --git a/8.0/official/root/usr/local/bin/entrypoint-functions.sh b/archive/8.0/beta/root/usr/local/bin/entrypoint-functions.sh similarity index 100% rename from 8.0/official/root/usr/local/bin/entrypoint-functions.sh rename to archive/8.0/beta/root/usr/local/bin/entrypoint-functions.sh diff --git a/archive/8.0/official/Dockerfile b/archive/8.0/official/Dockerfile new file mode 100644 index 0000000..202c644 --- /dev/null +++ b/archive/8.0/official/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:20.04 + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Ubuntu \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + binutils curl dirmngr gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java openjdk-17-jre-headless > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + mongodb-server-core > /dev/null \ + && rm -rf /usr/bin/mongos \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + dirmngr > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Dockerfile.alpine b/archive/8.0/official/Dockerfile.alpine new file mode 100644 index 0000000..5082b14 --- /dev/null +++ b/archive/8.0/official/Dockerfile.alpine @@ -0,0 +1,58 @@ +FROM alpine:latest + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Alpine \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && delgroup ping \ + && addgroup -g $PGID unifi \ + && adduser -D -G unifi -u $PUID unifi \ + && apk add -q --no-cache \ + gcompat libc6-compat \ + && apk add -q --no-cache \ + bash binutils coreutils curl libcap \ + openjdk17-jre openssl shadow su-exec \ + tzdata \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/UniFi.unix.zip -o /tmp/UniFi.unix.${VERSION}.zip \ + && unzip -q /tmp/UniFi.unix.${VERSION}.zip -d /tmp \ + && mv /tmp/UniFi/* /usr/lib/unifi/ \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /tmp/* /var/tmp/* /var/cache/apk/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Dockerfile.alpine.mongo b/archive/8.0/official/Dockerfile.alpine.mongo new file mode 100644 index 0000000..d6ce786 --- /dev/null +++ b/archive/8.0/official/Dockerfile.alpine.mongo @@ -0,0 +1,60 @@ +FROM alpine:latest + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Alpine.mongo \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && delgroup ping \ + && addgroup -g $PGID unifi \ + && adduser -D -G unifi -u $PUID unifi \ + && apk add -q --no-cache \ + gcompat libc6-compat \ + && apk add -q --no-cache \ + bash binutils coreutils curl libcap \ + mongodb openjdk17-jre openssl shadow su-exec \ + tzdata \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/UniFi.unix.zip -o /tmp/UniFi.unix.${VERSION}.zip \ + && unzip -q /tmp/UniFi.unix.${VERSION}.zip -d /tmp \ + && mv /tmp/UniFi/* /usr/lib/unifi/ \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm /usr/lib/unifi/bin/mongod \ + && ln -s /usr/bin/mongod /usr/lib/unifi/bin/mongod \ + && rm -rf /tmp/* /var/tmp/* /var/cache/apk/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Dockerfile.debian b/archive/8.0/official/Dockerfile.debian new file mode 100644 index 0000000..16aadea --- /dev/null +++ b/archive/8.0/official/Dockerfile.debian @@ -0,0 +1,74 @@ +FROM debian:bullseye-slim + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Debian \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && mkdir -p /usr/share/man/man1 \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + dirmngr gnupg2 > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + binutils curl gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + openjdk-17-jre-headless > /dev/null \ + && echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main" \ + > /etc/apt/sources.list.d/mongodb-org.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && apt-get -qqy --allow-insecure-repositories update \ + && apt-get -qqy --no-install-recommends --allow-unauthenticated install \ + mongodb-org-server > /dev/null \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + apt-utils dirmngr gnupg2 > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Dockerfile.debian.nomongo b/archive/8.0/official/Dockerfile.debian.nomongo new file mode 100644 index 0000000..e243bf5 --- /dev/null +++ b/archive/8.0/official/Dockerfile.debian.nomongo @@ -0,0 +1,66 @@ +FROM debian:bullseye-slim + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Debian.nomongo \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && mkdir -p /usr/share/man/man1 \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + binutils curl gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + openjdk-17-jre-headless > /dev/null \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + apt-utils > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Dockerfile.ubuntu.nomongo b/archive/8.0/official/Dockerfile.ubuntu.nomongo new file mode 100644 index 0000000..d49e917 --- /dev/null +++ b/archive/8.0/official/Dockerfile.ubuntu.nomongo @@ -0,0 +1,63 @@ +FROM ubuntu:20.04 + +ARG BUILD_DATE +ARG VCS_REF +ARG VERSION + +LABEL \ + org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \ + org.opencontainers.image.url="https://github.com/goofball222/unifi" \ + org.opencontainers.image.title="UniFi Controller" \ + org.opencontainers.image.description="UniFi Controller" \ + org.opencontainers.image.version=${VERSION}-Ubuntu.nomongo \ + org.opencontainers.image.source="https://github.com/goofball222/unifi" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.licenses="Apache-2.0" + +ENV \ + BIND_PRIV=false \ + DEBIAN_FRONTEND=noninteractive \ + DEBUG=false \ + JVM_EXTRA_OPTS= \ + JVM_INIT_HEAP_SIZE= \ + JVM_MAX_HEAP_SIZE=1024M \ + PGID=999 \ + PUID=999 \ + RUN_CHOWN=true \ + RUNAS_UID0=false + +WORKDIR /usr/lib/unifi + +COPY root / + +RUN set -x \ + && groupadd -r unifi -g $PGID \ + && useradd --no-log-init -r -u $PUID -g $PGID unifi \ + && apt-get -qqy update \ + && apt-get -qqy install apt-utils \ + && apt-get -qqy --no-install-recommends install \ + binutils curl dirmngr gosu \ + libcap2 libcap2-bin procps > /dev/null \ + && apt-get -qqy --no-install-recommends install \ + ca-certificates-java openjdk-17-jre-headless > /dev/null \ + && curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \ + && apt-get -qqy purge \ + dirmngr > /dev/null \ + && apt-get -qqy autoremove --purge > /dev/null \ + && apt-get -qqy clean autoclean > /dev/null \ + && dpkg --force-all -i /tmp/unifi-${VERSION}.deb \ + && rm -rf data logs run \ + && bash -c 'mkdir -p {data,logs,run,cert}' \ + && chown -R unifi:unifi /usr/lib/unifi \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* + +EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp + +VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"] + +HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["unifi"] diff --git a/archive/8.0/official/Makefile b/archive/8.0/official/Makefile new file mode 100644 index 0000000..7270ed6 --- /dev/null +++ b/archive/8.0/official/Makefile @@ -0,0 +1,72 @@ +-include ../../*.mk +-include ../*.mk +-include *.mk + + + +NS ?= goofball222 + +IMAGE_NAME ?= unifi +CONTAINER_NAME ?= unifi +CONTAINER_INSTANCE ?= default + +VCS_REF := $(strip $(shell git rev-parse --short HEAD)) +BUILD_DATE := $(strip $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")) +VERSION := $(strip $(shell cat VERSION)) + +ifndef VERSION +$(error You need to create a VERSION file to build a release) +endif + +ifndef DOCKERFILE +$(error You need to set the DOCKERFILE path you want to build from) +endif + +ifndef TAG +TAG := $(notdir $(shell pwd)) +endif + + + +.PHONY: build shell debug run start stop rm rmi test clean + + + +default: build + + + +build: + docker build \ + --build-arg VCS_REF=$(VCS_REF) \ + --build-arg BUILD_DATE=$(BUILD_DATE) \ + --build-arg VERSION=$(VERSION) \ + -f $(DOCKERFILE) \ + -t $(NS)/$(IMAGE_NAME):$(TAG) . + +shell: + -docker run -it --rm --name $(CONTAINER_NAME)_$(CONTAINER_INSTANCE) $(PORTS) $(VOLUMES) $(OTHER) $(ENV) $(NS)/$(IMAGE_NAME):$(TAG) /bin/bash + +run: + -docker run --rm --name $(CONTAINER_NAME)_$(CONTAINER_INSTANCE) $(PORTS) $(VOLUMES) $(OTHER) $(ENV) $(NS)/$(IMAGE_NAME):$(TAG) + +start: + -docker run -d --name $(CONTAINER_NAME)_$(CONTAINER_INSTANCE) $(PORTS) $(VOLUMES) $(OTHER) $(ENV) $(NS)/$(IMAGE_NAME):$(TAG) + +stop: + -docker stop $(CONTAINER_NAME)_$(CONTAINER_INSTANCE) + +rm: + -docker rm $(CONTAINER_NAME)_$(CONTAINER_INSTANCE) + +rmi: + -docker rmi $(NS)/$(IMAGE_NAME):$(TAG) + +test: + @echo docker build \ + --build-arg VCS_REF=$(VCS_REF) \ + --build-arg BUILD_DATE=$(BUILD_DATE) \ + --build-arg VERSION=$(VERSION) \ + -t $(NS)/$(IMAGE_NAME):$(TAG) . + +clean: stop rm rmi diff --git a/8.0/official/VERSION b/archive/8.0/official/VERSION similarity index 100% rename from 8.0/official/VERSION rename to archive/8.0/official/VERSION diff --git a/archive/8.0/official/hooks/build b/archive/8.0/official/hooks/build new file mode 100755 index 0000000..b98cb82 --- /dev/null +++ b/archive/8.0/official/hooks/build @@ -0,0 +1,10 @@ +#!/bin/bash + +# $IMAGE_NAME var is injected into the build so the tag is correct. + +#echo "Build hook running" +docker build \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg VERSION=`cat VERSION` \ + -f $DOCKERFILE_PATH -t $DOCKER_REPO:${DOCKER_TAG//,/ -t $DOCKER_REPO:} . diff --git a/archive/8.0/official/root/etc/ld-musl-x86_64.path b/archive/8.0/official/root/etc/ld-musl-x86_64.path new file mode 100644 index 0000000..6b9dcc2 --- /dev/null +++ b/archive/8.0/official/root/etc/ld-musl-x86_64.path @@ -0,0 +1,6 @@ +/lib +/usr/lib +/usr/local/lib +/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64 +/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/jli +/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server diff --git a/archive/8.0/official/root/usr/lib/unifi/system.properties.default b/archive/8.0/official/root/usr/lib/unifi/system.properties.default new file mode 100644 index 0000000..c65fbb2 --- /dev/null +++ b/archive/8.0/official/root/usr/lib/unifi/system.properties.default @@ -0,0 +1,44 @@ +## system.properties +# +# each unifi instance requires a set of ports: +# +## device inform +# unifi.http.port=8080 +## controller UI / API +# unifi.https.port=8443 +## portal redirect port for HTTP +# portal.http.port=8880 +## portal redirect port for HTTPs +# portal.https.port=8843 +## local-bound port for DB server +# unifi.db.port=27117 +## UDP port used for STUN +# unifi.stun.port=3478 +# +## the IP devices should be talking to for inform +# system_ip=a.b.c.d +## disable mongodb journaling +# unifi.db.nojournal=false +## extra mongod args +# unifi.db.extraargs +# +## HTTPS options +# unifi.https.ciphers=TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA +# unifi.https.sslEnabledProtocols=TLSv1,SSLv2Hello +# unifi.https.hsts=false +# unifi.https.hsts.max_age=31536000 +# unifi.https.hsts.preload=false +# unifi.https.hsts.subdomain=false +# +# Ports reserved for device redirector. There is no need to open +# firewall for these ports on controller, however do NOT set +# controller to use these ports. +# +# portal.redirector.port=8881 +# portal.redirector.port.wired=8882 +# +# Port used for throughput measurement. +# unifi.throughput.port=6789 +# +unifi.logStdout=true +unifi.config.readEnv=true diff --git a/8.0/official/root/usr/local/bin/docker-entrypoint.sh b/archive/8.0/official/root/usr/local/bin/docker-entrypoint.sh similarity index 100% rename from 8.0/official/root/usr/local/bin/docker-entrypoint.sh rename to archive/8.0/official/root/usr/local/bin/docker-entrypoint.sh diff --git a/archive/8.0/official/root/usr/local/bin/docker-healthcheck.sh b/archive/8.0/official/root/usr/local/bin/docker-healthcheck.sh new file mode 100755 index 0000000..d90fe93 --- /dev/null +++ b/archive/8.0/official/root/usr/local/bin/docker-healthcheck.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# entrypoint-functions.sh script for UniFi Docker container +# License: Apache-2.0 +# Github: https://github.com/goofball222/unifi +HEALTHCHECK_VERSION="1.0.1" +# Last updated date: 2019-12-06 + +BASEDIR="/usr/lib/unifi" +DATADIR=${BASEDIR}/data + +[ ! -f ${DATADIR}/system.properties ] || api_port=$(grep "^[^#;]" ${DATADIR}/system.properties | sed -n 's/unifi.http.port=\([0-9]\+\)/\1/p') + +api_port=${api_port:-8080} + +http_code=$(curl -s --connect-timeout 1 -o /dev/null -w "%{http_code}" http://localhost:${api_port}/status) + +#MAX_WAIT=25 + +#for i in `seq 1 ${MAX_WAIT}` ; do +# if [ "${http_code}" != "200" ]; then +# sleep 1 http_code=$(curl -s --connect-timeout 1 -o /dev/null -w "%{http_code}" http://localhost:${api_port}/status) +# else +# break +# fi +#done + +if [ "${http_code}" != "200" ]; then + echo "Error: UniFi API http status code ${http_code}, expecting 200" + exit 1 + else + echo "UniFi API http status code ${http_code}: OK" + exit 0 +fi diff --git a/archive/8.0/official/root/usr/local/bin/entrypoint-functions.sh b/archive/8.0/official/root/usr/local/bin/entrypoint-functions.sh new file mode 100755 index 0000000..141c3d2 --- /dev/null +++ b/archive/8.0/official/root/usr/local/bin/entrypoint-functions.sh @@ -0,0 +1,169 @@ +#!/usr/bin/env bash + +# entrypoint-functions.sh script for UniFi Docker container +# License: Apache-2.0 +# Github: https://github.com/goofball222/unifi +ENTRYPOINT_FUNCTIONS_VERSION="1.1.0" +# Last updated date: 2024-01-18 + +f_bindpriv() { + JAVABIN=$(readlink -f /usr/bin/java) + if [ "${BIND_PRIV}" == 'true' ] && [ "${RUNAS_UID0}" == 'false' ]; then + f_log "INFO - Support binding ports <1024 'setcap 'cap_net_bind_service=+ep' ${JAVABIN}'" + if setcap 'cap_net_bind_service=+ep' ${JAVABIN}; then + sleep 1 + else + f_log "ERROR - BIND_PRIV=true and 'setcap' command failed on this Docker host" + f_log "ERROR - If binding ports <1024 required on this Docker host use RUNAS_UID0=true instead" + f_log "ERROR - Container run state is invalid, exiting..." + exit 1; + fi + fi +} + +f_chown() { + if [ "${RUN_CHOWN}" == 'false' ] && [ "${RUNAS_UID0}" == 'false' ]; then + if [ ! "$(stat -c %u ${BASEDIR})" = "${PUID}" ] || [ ! "$(stat -c %u ${CERTDIR})" = "${PUID}" ] \ + || [ ! "$(stat -c %u ${DATADIR})" = "${PUID}" ] || [ ! "$(stat -c %u ${LOGDIR})" = "${PUID}" ] \ + || [ ! "$(stat -c %u ${RUNDIR})" = "${PUID}" ]; then + f_log "WARN - Configured PUID doesn't match owner of a required directory. Ignoring RUN_CHOWN=false" + f_log "INFO - Ensuring permissions are correct before continuing - 'chown -R unifi:unifi ${BASEDIR}'" + f_log "INFO - Running recursive 'chown' on Docker overlay2 storage is **really** slow. This may take a bit." + chown -R unifi:unifi ${BASEDIR} + else + f_log "INFO - Explicitly setting owner on '${LOGDIR}/*.log' and '${DATADIR}/system.properties'" + chown unifi:unifi ${DATADIR}/system.properties + chown unifi:unifi ${LOGDIR}/*.log + f_log "INFO - RUN_CHOWN=false - Not running 'chown -R unifi:unifi ${BASEDIR}', assume subdir/file permissions OK" + fi + elif [ "${RUNAS_UID0}" == 'true' ]; then + f_log "INFO - RUNAS_UID0=true - Not running 'chown -R unifi:unifi ${BASEDIR}', no need to worry about permissions." + else + f_log "INFO - Ensuring permissions are correct before continuing - 'chown -R unifi:unifi ${BASEDIR}'" + f_log "INFO - Running recursive 'chown' on Docker overlay2 storage is **really** slow. This may take a bit." + chown -R unifi:unifi ${BASEDIR} + fi +} + +f_giduid() { + UNIFI_GID=${UNIFI_GID:-} + UNIFI_UID=${UNIFI_UID:-} + if [ ! -z "${UNIFI_GID}" ]; then + f_log "INFO - UNIFI_GID is set. Please use the updated PGID variable. Automatically converting to PGID." + PGID=${UNIFI_GID} + fi + if [ ! -z "${UNIFI_UID}" ]; then + f_log "INFO - UNIFI_UID is set. Please use the updated PUID variable. Automatically converting to PUID." + PUID=${UNIFI_UID} + fi + if [ "$(id unifi -g)" != "${PGID}" ] || [ "$(id unifi -u)" != "${PUID}" ]; then + f_log "INFO - Setting custom unifi GID/UID: GID=${PGID}, UID=${PUID}" + groupmod -o -g ${PGID} unifi + usermod -o -u ${PUID} unifi + else + f_log "INFO - GID/UID for unifi are unchanged: GID=${PGID}, UID=${PUID}" + fi +} + +f_log() { + echo "$(date +"[%Y-%m-%d %T,%3N]") $*" | tee -a ${BASEDIR}/logs/server.log +} + +f_mongo() { + DB_MONGO_LOCAL=${DB_MONGO_LOCAL:-} + DB_MONGO_URI=${DB_MONGO_URI:-} + STATDB_MONGO_URI=${STATDB_MONGO_URI:-} + UNIFI_DB_NAME=${UNIFI_DB_NAME:-} + if [ -x "/usr/bin/mongod" ]; then + if [ -z "${DB_MONGO_LOCAL}" ] || [ -z "${DB_MONGO_URI}" ] || [ -z "${STATDB_MONGO_URI}" ] \ + || [ -z "${UNIFI_DB_NAME}" ]; then + f_log "WARN - ======================================================================" + f_log "WARN - One or more of: 'DB_MONGO_LOCAL', 'DB_MONGO_URI', 'STATDB_MONGO_URI', or 'UNIFI_DB_NAME' is unset." + f_log "WARN - In the future you should consider running UniFi on Docker with an external Mongo DB instance defined." + f_log "WARN - *** Please check the README.md and examples at https://github.com/goofball222/unifi ***" + f_log "WARN - ======================================================================" + fi + else + if [ -z "${DB_MONGO_LOCAL}" ] || [ -z "${DB_MONGO_URI}" ] || [ -z "${STATDB_MONGO_URI}" ] \ + || [ -z "${UNIFI_DB_NAME}" ]; then + f_log "ERROR - ======================================================================" + f_log "ERROR - One or more of: 'DB_MONGO_LOCAL', 'DB_MONGO_URI', 'STATDB_MONGO_URI', or 'UNIFI_DB_NAME' is unset." + f_log "ERROR - This container cannot run UniFi without all Mongo external env variables defined correctly." + f_log "ERROR - They must be pointed to a valid external Mongo DB container or host instance." + f_log "ERROR - *** Please check the README.md and examples at https://github.com/goofball222/unifi ***" + f_log "ERROR - ======================================================================" + f_log "ERROR - Container run environment is invalid, exiting..." + exit 1; + fi + fi +} + +f_ssl() { + if [ -e ${CERTDIR}/privkey.pem ] && [ -e ${CERTDIR}/cert.pem ]; then + if `/usr/bin/sha256sum -c ${CERTDIR}/unificert.sha256 &> /dev/null`; then + f_log "INFO - SSL: certificate files unchanged, continuing with UniFi startup" + f_log "INFO - SSL: To force rerun import process: delete '${CERTDIR}/unificert.sha256' and restart the container" + else + if [ ! -e ${DATADIR}/keystore ]; then + f_log "WARN - SSL: keystore does not exist, generating it with Java keytool" + keytool -genkey -keyalg RSA -alias unifi -keystore ${DATADIR}/keystore \ + -storepass aircontrolenterprise -keypass aircontrolenterprise -validity 1825 \ + -keysize 4096 -dname "cn=UniFi" + else + f_log "INFO - SSL: backup existing '${DATADIR}/keystore' to '${DATADIR}/keystore-$(date +%s)'" + cp ${DATADIR}/keystore ${DATADIR}/keystore-$(date +%s) + fi + f_log "INFO - SSL: custom certificate keystore update" + f_log "INFO - SSL: openssl combine custom private key and certificate into temporary PKCS12 file" + openssl pkcs12 -export \ + -inkey ${CERTDIR}/privkey.pem \ + -in ${CERTDIR}/cert.pem \ + -out ${CERTDIR}/certtemp.p12 \ + -name unifi -password pass:temppass + f_log "INFO - SSL: Java keytool import PKCS12 '${CERTDIR}/certtemp.p12' file into '${DATADIR}/keystore'" + keytool -importkeystore -deststorepass aircontrolenterprise \ + -destkeypass aircontrolenterprise -destkeystore ${DATADIR}/keystore \ + -srckeystore ${CERTDIR}/certtemp.p12 -srcstoretype PKCS12 \ + -srcstorepass temppass -alias unifi -noprompt + f_log "INFO - SSL: Removing temporary PKCS12 file" + rm ${CERTDIR}/certtemp.p12 + f_log "INFO - SSL: Store SHA256 hash of private key and certificate file" + /usr/bin/sha256sum ${CERTDIR}/privkey.pem > ${CERTDIR}/unificert.sha256 + /usr/bin/sha256sum ${CERTDIR}/cert.pem >> ${CERTDIR}/unificert.sha256 + f_log "INFO - SSL: completed update of custom certificate in '${DATADIR}/keystore'" + f_log "INFO - SSL: Check above ***here*** for errors if your custom certificate import isn't working" + f_log "INFO - SSL: To force rerun import process: delete '${CERTDIR}/unificert.sha256' and restart the container" + fi + else + [ -f ${CERTDIR}/privkey.pem ] || f_log "WARN - Custom SSL: missing '${CERTDIR}/privkey.pem'" + [ -f ${CERTDIR}/cert.pem ] || f_log "WARN - Custom SSL: missing '${CERTDIR}/cert.pem'" + if [ -e ${CERTDIR}/fullchain.pem ]; then + f_log "WARN - UniFi v7.3+ Custom SSL: *********** '${CERTDIR}/fullchain.pem' IS DEPRECATED ***********" + f_log "WARN - UniFi v7.3+ Custom SSL: Use a single / non-chain cert file named '${CERTDIR}/cert.pem' moving forward" + f_log "WARN - UniFi v7.3+ Custom SSL: Failure to update current setup may result in constant errors" + fi + f_log "WARN - Custom SSL: certificate import was NOT performed" + fi +} + +f_sysprop() { + # UniFi system.properties container mode setup (echo logs to STDOUT, support ENV read) + f_log "INFO - Checking system.properties setup for container" + if [ ! -e ${DATADIR}/system.properties ]; then + f_log "INFO - '${DATADIR}/system.properties' doesn't exist, copying from '${BASEDIR}/system.properties.default'" + cp ${BASEDIR}/system.properties.default ${DATADIR}/system.properties + else + f_log "INFO - Existing '${DATADIR}/system.properties' found, ensuring container mode options are enabled" + if ! grep -q "unifi.logStdout" "${DATADIR}/system.properties"; then + echo "unifi.logStdout=${LOGSTDOUT}" >> ${DATADIR}/system.properties + else + sed -i "/unifi.logStdout/c\unifi.logStdout=${LOGSTDOUT}" ${DATADIR}/system.properties + fi + + if ! grep -q "unifi.config.readEnv" "${DATADIR}/system.properties"; then + echo "unifi.config.readEnv=${READENV}" >> ${DATADIR}/system.properties + else + sed -i "/unifi.config.readEnv/c\unifi.config.readEnv=${READENV}" ${DATADIR}/system.properties + fi + fi +} diff --git a/.github/workflows/build-8.0-beta.yml b/archive/workflows/build-8.0-beta.yml similarity index 100% rename from .github/workflows/build-8.0-beta.yml rename to archive/workflows/build-8.0-beta.yml diff --git a/.github/workflows/build-8.0-official.yml b/archive/workflows/build-8.0-official.yml similarity index 100% rename from .github/workflows/build-8.0-official.yml rename to archive/workflows/build-8.0-official.yml