From 515633461bd639cb689ad15b57138a5fb255c8c0 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Tue, 12 Nov 2024 22:58:25 +0100 Subject: [PATCH 1/7] Implement mbentley as submodule Prepare sharing code between Stable and Beta by using docker images only. --- .github/workflows/docker-image.yaml | 19 +- .gitmodules | 3 + Omada Beta/config.yaml | 4 +- Omada Beta/entrypoint.sh | 457 ------------------ Omada Beta/healthcheck.sh | 3 - Omada Beta/icon.png | Bin 892 -> 21 bytes Omada Beta/install.sh | 329 ------------- Omada Beta/logo.png | Bin 892 -> 21 bytes Omada Beta/translations | 1 + {Omada Beta => Omada Dev}/Dockerfile | 6 +- Omada Dev/entrypoint.sh | 41 ++ Omada Dev/healthcheck.sh | 1 + Omada Dev/icon.png | Bin 0 -> 892 bytes Omada Dev/install.sh | 30 ++ Omada Dev/logo.png | Bin 0 -> 892 bytes Omada Dev/mbentley | 1 + .../translations/en.yaml | 0 17 files changed, 93 insertions(+), 802 deletions(-) create mode 100644 .gitmodules delete mode 100755 Omada Beta/entrypoint.sh delete mode 100755 Omada Beta/healthcheck.sh mode change 100644 => 120000 Omada Beta/icon.png delete mode 100755 Omada Beta/install.sh mode change 100644 => 120000 Omada Beta/logo.png create mode 120000 Omada Beta/translations rename {Omada Beta => Omada Dev}/Dockerfile (90%) create mode 100755 Omada Dev/entrypoint.sh create mode 120000 Omada Dev/healthcheck.sh create mode 100644 Omada Dev/icon.png create mode 100755 Omada Dev/install.sh create mode 100644 Omada Dev/logo.png create mode 160000 Omada Dev/mbentley rename {Omada Beta => Omada Dev}/translations/en.yaml (100%) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 7ef4bd9..0a4b659 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout the code uses: actions/checkout@v3 + with: + submodules: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -20,7 +22,7 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v2 with: - username: dratrav + username: jeruntu password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - name: Extract Docker tag from Git tag @@ -39,15 +41,11 @@ jobs: id: image_name run: | if [[ "${GITHUB_REF_NAME}" == *-beta ]]; then - echo "IMAGE_NAME=dratrav/home-assistant-omada-beta" >> $GITHUB_ENV + echo "IMAGE_NAME=jeruntu/home-assistant-omada-beta" >> $GITHUB_ENV echo "CONFIG_FILE=Omada Beta/config.yaml" >> $GITHUB_ENV - echo "DOCKERFILE_PATH=./Omada Beta/Dockerfile" >> $GITHUB_ENV - echo "CONTEXT_PATH=./Omada Beta" >> $GITHUB_ENV elif [[ "${GITHUB_REF_NAME}" == *-stable ]]; then - echo "IMAGE_NAME=dratrav/home-assistant-omada-stable" >> $GITHUB_ENV + echo "IMAGE_NAME=jeruntu/home-assistant-omada-stable" >> $GITHUB_ENV echo "CONFIG_FILE=Omada Stable/config.yaml" >> $GITHUB_ENV - echo "DOCKERFILE_PATH=./Omada Stable/Dockerfile" >> $GITHUB_ENV - echo "CONTEXT_PATH=./Omada Stable" >> $GITHUB_ENV fi - name: Install yq @@ -65,6 +63,7 @@ jobs: echo "Error: Docker tag (${DOCKER_TAG}) does not match expected tag (${EXPECTED_TAG}) in ${CONFIG_FILE}." exit 1 fi + echo "INSTALL_VER=${DOCKER_TAG}" >> $GITHUB_ENV - name: Build and push Docker image if: success() @@ -74,5 +73,7 @@ jobs: tags: | ${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} platforms: linux/amd64,linux/arm64 - file: ${{ env.DOCKERFILE_PATH }} - context: ${{ env.CONTEXT_PATH }} + file: ./Omada Dev/Dockerfile + context: ./Omada Dev + build-args: | + INSTALL_VER=${{ env.INSTALL_VER }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c349e4e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Omada Dev/mbentley"] + path = Omada Dev/mbentley + url = https://github.com/mbentley/docker-omada-controller.git diff --git a/Omada Beta/config.yaml b/Omada Beta/config.yaml index 9a32bad..8dca72d 100644 --- a/Omada Beta/config.yaml +++ b/Omada Beta/config.yaml @@ -1,8 +1,8 @@ --- name: Omada Controller Beta -image: dratrav/home-assistant-omada-beta # <-- comment out for local build +image: dratrav/home-assistant-omada-beta version: 5.14.32.3 -slug: omada_controller +slug: omada_controller_beta description: TP-Link Omada Controller software webui: https://[HOST]:[PORT:8043] startup: application diff --git a/Omada Beta/entrypoint.sh b/Omada Beta/entrypoint.sh deleted file mode 100755 index 9f3d7a2..0000000 --- a/Omada Beta/entrypoint.sh +++ /dev/null @@ -1,457 +0,0 @@ -#!/usr/bin/env bashio - -# ===================================== -# Home Assistant specific preprocessing -# ===================================== - -# create data and logs dir, if not existing -bashio::log.info "Create 'logs' directory inside persistent /data volume, if it doesn't exist." -mkdir -p "/data/logs" - -if [ ! -d /data/data ]; then - bashio::log.info "/data/data created from docker image backup" && cp -r /opt/tplink/EAPController/data_backup /data/data - - # Check if old directory structure is in place (/data) and copy to (/data/data) - # This can be removed in the future when everyone has upgraded - directories=(db keystore pdf) - for dir in "${directories[@]}"; do - if [ -d "/data/$dir" ]; then - cp -r /data/$dir "/data/data/" - rm -rf /data/$dir - bashio::log.info "Migrate from old Add-On file structure. Copied /data/$dir to /data/data/$dir" - else - bashio::log.info "Already in new file structure. /data/$dir does not exist, skipping." - fi - done -fi - -# set permissions on /data directory for home assistant persistence -chown -R 508:508 "/data" - -# Use SSL Keys from Home Assistant -if bashio::config.true 'enable_hass_ssl'; then - bashio::log.info "Use SSL from Home Assistant" - SSL_CERT_NAME=$(bashio::config 'certfile') - bashio::log.info "SSL certificate: ${SSL_CERT_NAME}" - SSL_KEY_NAME=$(bashio::config 'keyfile') - bashio::log.info "SSL private key: ${SSL_KEY_NAME}" -fi - -# ====================================== -# mbentley original entrypoint.sh script -# ====================================== -# -# Replace this section if needed during updates. -# -# IMPORTANT: to enable pretty logs, replace all -# - `^(\s*)echo\s*"INFO: ` with `$1bashio::log.info "` -# - `^(\s*)echo\s*"WARNING: ` with `$1bashio::log.warning "` -# - `^(\s*)echo\s*"ERROR: ` with `$1bashio::log.error "` -# -# > Script start -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -# set environment variables -export TZ -TZ="${TZ:-Etc/UTC}" -SMALL_FILES="${SMALL_FILES:-false}" - -# PORTS CONFIGURATION -MANAGE_HTTP_PORT="${MANAGE_HTTP_PORT:-8088}" -MANAGE_HTTPS_PORT="${MANAGE_HTTPS_PORT:-8043}" -PORTAL_HTTP_PORT="${PORTAL_HTTP_PORT:-8088}" -PORTAL_HTTPS_PORT="${PORTAL_HTTPS_PORT:-8843}" -PORT_ADOPT_V1="${PORT_ADOPT_V1:-29812}" -PORT_APP_DISCOVERY="${PORT_APP_DISCOVERY:-27001}" -PORT_UPGRADE_V1="${PORT_UPGRADE_V1:-29813}" -PORT_MANAGER_V1="${PORT_MANAGER_V1:-29811}" -PORT_MANAGER_V2="${PORT_MANAGER_V2:-29814}" -PORT_DISCOVERY="${PORT_DISCOVERY:-29810}" -PORT_TRANSFER_V2="${PORT_TRANSFER_V2:-29815}" -PORT_RTTY="${PORT_RTTY:-29816}" -# END PORTS CONFIGURATION - -# EXTERNAL MONGODB -MONGO_EXTERNAL="${MONGO_EXTERNAL:-false}" -EAP_MONGOD_URI="${EAP_MONGOD_URI:-mongodb://127.0.0.1:27217/omada}" -# escape & for eval -EAP_MONGOD_URI="$(eval echo "${EAP_MONGOD_URI//&/\\&}")" -# escape after eval as well for sed -EAP_MONGOD_URI="${EAP_MONGOD_URI//&/\\&}" -# END EXTERNAL MONGODB - -SHOW_SERVER_LOGS="${SHOW_SERVER_LOGS:-true}" -SHOW_MONGODB_LOGS="${SHOW_MONGODB_LOGS:-false}" -SSL_CERT_NAME="${SSL_CERT_NAME:-tls.crt}" -SSL_KEY_NAME="${SSL_KEY_NAME:-tls.key}" -TLS_1_11_ENABLED="${TLS_1_11_ENABLED:-false}" -PUID="${PUID:-508}" -PGID="${PGID:-508}" -PUSERNAME="${PUSERNAME:-omada}" -PGROUP="${PGROUP:-omada}" -SKIP_USERLAND_KERNEL_CHECK="${SKIP_USERLAND_KERNEL_CHECK:-false}" - -# validate user/group exist with correct UID/GID -bashio::log.info "Validating user/group (${PUSERNAME}:${PGROUP}) exists with correct UID/GID (${PUID}:${PGID})" - -# check to see if group exists; if not, create it -if grep -q -E "^${PGROUP}:" /etc/group > /dev/null 2>&1 -then - # existing group found; also make sure the omada group matches the GID - bashio::log.info "Group (${PGROUP}) exists; skipping creation" - EXISTING_GID="$(getent group "${PGROUP}" | cut -d: -f3)" - if [ "${EXISTING_GID}" != "${PGID}" ] - then - bashio::log.error "Group (${PGROUP}) has an unexpected GID; was expecting '${PGID}' but found '${EXISTING_GID}'!" - exit 1 - fi -else - # make sure the group doesn't already exist with a different name - if awk -F ':' '{print $3}' /etc/group | grep -q "^${PGID}$" - then - # group ID exists but has a different group name - EXISTING_GROUP="$(grep ":${PGID}:" /etc/group | awk -F ':' '{print $1}')" - bashio::log.info "Group (${PGROUP}) already exists with a different name; renaming '${EXISTING_GROUP}' to '${PGROUP}'" - groupmod -n "${PGROUP}" "${EXISTING_GROUP}" - else - # create the group - bashio::log.info "Group (${PGROUP}) doesn't exist; creating" - groupadd -g "${PGID}" "${PGROUP}" - fi -fi - -# check to see if user exists; if not, create it -if id -u "${PUSERNAME}" > /dev/null 2>&1 -then - # exiting user found; also make sure the omada user matches the UID - bashio::log.info "User (${PUSERNAME}) exists; skipping creation" - EXISTING_UID="$(id -u "${PUSERNAME}")" - if [ "${EXISTING_UID}" != "${PUID}" ] - then - bashio::log.error "User (${PUSERNAME}) has an unexpected UID; was expecting '${PUID}' but found '${EXISTING_UID}'!" - exit 1 - fi -else - # make sure the user doesn't already exist with a different name - if awk -F ':' '{print $3}' /etc/passwd | grep -q "^${PUID}$" - then - # user ID exists but has a different user name - EXISTING_USER="$(grep ":${PUID}:" /etc/passwd | awk -F ':' '{print $1}')" - bashio::log.info "User (${PUSERNAME}) already exists with a different name; renaming '${EXISTING_USER}' to '${PUSERNAME}'" - usermod -g "${PGID}" -d /opt/tplink/EAPController/data -l "${PUSERNAME}" -s /bin/sh -c "" "${EXISTING_USER}" - else - # create the user - bashio::log.info "User (${PUSERNAME}) doesn't exist; creating" - useradd -u "${PUID}" -g "${PGID}" -d /opt/tplink/EAPController/data -s /bin/sh -c "" "${PUSERNAME}" - fi -fi - -# check if properties file exists; create it if it is missing -DEFAULT_FILES="/opt/tplink/EAPController/properties.defaults/*" -for FILE in ${DEFAULT_FILES} -do - BASENAME=$(basename "${FILE}") - if [ ! -f "/opt/tplink/EAPController/properties/${BASENAME}" ] - then - bashio::log.info "Properties file '${BASENAME}' missing, restoring default file..." - cp "${FILE}" "/opt/tplink/EAPController/properties/${BASENAME}" - chown "${PUSERNAME}:${PGROUP}" "/opt/tplink/EAPController/properties/${BASENAME}" - fi -done - -# set default time zone and notify user of time zone -bashio::log.info "Time zone set to '${TZ}'" - -# append smallfiles if set to true -if [ "${SMALL_FILES}" = "true" ] -then - echo "WARN: smallfiles was passed but is not supported in >= 4.1 with the WiredTiger engine in use by MongoDB" - bashio::log.info "Skipping setting smallfiles option" -fi - -# update stored ports when different of enviroment defined ports (works for numbers only) -for ELEM in MANAGE_HTTP_PORT MANAGE_HTTPS_PORT PORTAL_HTTP_PORT PORTAL_HTTPS_PORT PORT_ADOPT_V1 PORT_APP_DISCOVERY PORT_UPGRADE_V1 PORT_MANAGER_V1 PORT_MANAGER_V2 PORT_DISCOVERY PORT_TRANSFER_V2 PORT_RTTY -do - # convert element to key name - KEY="$(echo "${ELEM}" | tr '[:upper:]' '[:lower:]' | tr '_' '.')" - - # get value we want to set from the element - END_VAL=${!ELEM} - - # get the current value from the omada.properties file - STORED_PROP_VAL=$(grep -Po "(?<=${KEY}=)([0-9]+)" /opt/tplink/EAPController/properties/omada.properties || true) - - # check to see if we need to set the value - if [ "${STORED_PROP_VAL}" = "" ] - then - bashio::log.info "Skipping '${KEY}' - not present in omada.properties" - elif [ "${STORED_PROP_VAL}" != "${END_VAL}" ] - then - # check to see if we are trying to bind to privileged port - if [ "${END_VAL}" -lt "1024" ] && [ "$(cat /proc/sys/net/ipv4/ip_unprivileged_port_start)" = "1024" ] - then - bashio::log.error "Unable to set '${KEY}' to ${END_VAL}; 'ip_unprivileged_port_start' has not been set. See https://github.com/mbentley/docker-omada-controller#unprivileged-ports" - exit 1 - fi - - # update the key-value pair - bashio::log.info "Setting '${KEY}' to ${END_VAL} in omada.properties" - sed -i "s~^${KEY}=${STORED_PROP_VAL}$~${KEY}=${END_VAL}~g" /opt/tplink/EAPController/properties/omada.properties - else - # values already match; nothing to change - bashio::log.info "Value of '${KEY}' already set to ${END_VAL} in omada.properties" - fi -done - -# update stored property values when different of environment defined values (works for any value) -for ELEM in MONGO_EXTERNAL EAP_MONGOD_URI -do - # convert element to key name - KEY="$(echo "${ELEM}" | tr '[:upper:]' '[:lower:]' | tr '_' '.')" - - # get the full key & value to store for checking later - KEY_VALUE="$(grep "^${KEY}=" /opt/tplink/EAPController/properties/omada.properties || true)" - - # get value we want to set from the element - END_VAL=${!ELEM} - - # get the current value from the omada.properties file - STORED_PROP_VAL=$(grep -Po "(?<=${KEY}=)(.*)+" /opt/tplink/EAPController/properties/omada.properties || true) - - # check to see if we need to set the value; see if there is something in the key/value first - if [ -z "${KEY_VALUE}" ] - then - bashio::log.info "Skipping '${KEY}' - not present in omada.properties" - elif [ "${STORED_PROP_VAL}" != "${END_VAL}" ] - then - # update the key-value pair - bashio::log.info "Setting '${KEY}' to ${END_VAL} in omada.properties" - sed -i "s~^${KEY}=${STORED_PROP_VAL}$~${KEY}=${END_VAL}~g" /opt/tplink/EAPController/properties/omada.properties - else - # values already match; nothing to change - bashio::log.info "Value of '${KEY}' already set to ${END_VAL} in omada.properties" - fi -done - -# make sure that the html directory exists -if [ ! -d "/opt/tplink/EAPController/data/html" ] && [ -f "/opt/tplink/EAPController/data-html.tar.gz" ] -then - # missing directory; extract from original - bashio::log.info "Report HTML directory missing; extracting backup to '/opt/tplink/EAPController/data/html'" - tar zxvf /opt/tplink/EAPController/data-html.tar.gz -C /opt/tplink/EAPController/data - chown -R "${PUSERNAME}:${PGROUP}" /opt/tplink/EAPController/data/html -fi - -# make sure that the pdf directory exists -if [ ! -d "/opt/tplink/EAPController/data/pdf" ] -then - # missing directory; extract from original - bashio::log.info "Report PDF directory missing; creating '/opt/tplink/EAPController/data/pdf'" - mkdir /opt/tplink/EAPController/data/pdf - chown -R "${PUSERNAME}:${PGROUP}" /opt/tplink/EAPController/data/pdf -fi - -# make sure permissions are set appropriately on each directory -for DIR in data logs properties -do - OWNER="$(stat -c '%u' /opt/tplink/EAPController/${DIR})" - GROUP="$(stat -c '%g' /opt/tplink/EAPController/${DIR})" - - if [ "${OWNER}" != "${PUID}" ] || [ "${GROUP}" != "${PGID}" ] - then - # notify user that uid:gid are not correct and fix them - echo "WARN: Ownership not set correctly on '/opt/tplink/EAPController/${DIR}'; setting correct ownership (${PUSERNAME}:${PGROUP})" - chown -R "${PUSERNAME}:${PGROUP}" "/opt/tplink/EAPController/${DIR}" - fi -done - -# validate permissions on /tmp -TMP_PERMISSIONS="$(stat -c '%a' /tmp)" -if [ "${TMP_PERMISSIONS}" != "1777" ] -then - echo "WARN: Permissions are not set correctly on '/tmp' (${TMP_PERMISSIONS}); setting correct permissions (1777)" - chmod -v 1777 /tmp -fi - -# check to see if there is a db directory; create it if it is missing -if [ ! -d "/opt/tplink/EAPController/data/db" ] -then - bashio::log.info "Database directory missing; creating '/opt/tplink/EAPController/data/db'" - mkdir /opt/tplink/EAPController/data/db - chown "${PUSERNAME}:${PGROUP}" /opt/tplink/EAPController/data/db - echo "done" -fi - -# Import a cert from a possibly mounted secret or file at /cert -if [ -f "/cert/${SSL_KEY_NAME}" ] && [ -f "/cert/${SSL_CERT_NAME}" ] -then - # see where the keystore directory is; check for old location first - if [ -d /opt/tplink/EAPController/keystore ] - then - # keystore in the parent folder before 5.3.1 - KEYSTORE_DIR="/opt/tplink/EAPController/keystore" - else - # keystore directory moved to the data directory in 5.3.1 - KEYSTORE_DIR="/opt/tplink/EAPController/data/keystore" - - # check to see if the KEYSTORE_DIR exists (it won't on upgrade) - if [ ! -d "${KEYSTORE_DIR}" ] - then - bashio::log.info "Creating keystore directory (${KEYSTORE_DIR})" - mkdir "${KEYSTORE_DIR}" - bashio::log.info "Setting permissions on ${KEYSTORE_DIR}" - chown "${PUSERNAME}:${PGROUP}" "${KEYSTORE_DIR}" - fi - fi - - bashio::log.info "Importing cert from /cert/tls.[key|crt]" - # delete the existing keystore - rm -f "${KEYSTORE_DIR}/eap.keystore" - - # example certbot usage: ./certbot-auto certonly --standalone --preferred-challenges http -d mydomain.net - openssl pkcs12 -export \ - -inkey "/cert/${SSL_KEY_NAME}" \ - -in "/cert/${SSL_CERT_NAME}" \ - -certfile "/cert/${SSL_CERT_NAME}" \ - -name eap \ - -out "${KEYSTORE_DIR}/eap.keystore" \ - -passout pass:tplink - - # set ownership/permission on keystore - chown "${PUSERNAME}:${PGROUP}" "${KEYSTORE_DIR}/eap.keystore" - chmod 400 "${KEYSTORE_DIR}/eap.keystore" -fi - -# re-enable disabled TLS versions 1.0 & 1.1 -if [ "${TLS_1_11_ENABLED}" = "true" ] -then - bashio::log.info "Re-enabling TLS 1.0 & 1.1" - if [ -f "/etc/java-8-openjdk/security/java.security" ] - then - # openjdk8 - sed -i 's#^jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1,#jdk.tls.disabledAlgorithms=SSLv3,#' /etc/java-8-openjdk/security/java.security - elif [ -f "/etc/java-17-openjdk/security/java.security" ] - then - # openjdk17 - sed -i 's#^jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1,#jdk.tls.disabledAlgorithms=SSLv3,#' /etc/java-17-openjdk/security/java.security - else - # not running openjdk8 or openjdk17 - echo "WARN: Unable to re-enable TLS 1.0 & 1.1; unable to detect openjdk version" - fi -fi - -# see if any of these files exist; if so, do not start as they are from older versions -if [ -f /opt/tplink/EAPController/data/db/tpeap.0 ] || [ -f /opt/tplink/EAPController/data/db/tpeap.1 ] || [ -f /opt/tplink/EAPController/data/db/tpeap.ns ] -then - bashio::log.error "The data volume mounted to /opt/tplink/EAPController/data appears to have data from a previous version!" - echo " Follow the upgrade instructions at https://github.com/mbentley/docker-omada-controller#upgrading-to-41" - exit 1 -fi - -# check to see if the CMD passed contains the text "com.tplink.omada.start.OmadaLinuxMain" which is the old classpath from 4.x -if [ "$(echo "${@}" | grep -q "com.tplink.omada.start.OmadaLinuxMain"; echo $?)" = "0" ] -then - echo -e "\n############################" - bashio::log.warning "CMD from 4.x detected! It is likely that this container will fail to start properly with a \"Could not find or load main class com.tplink.omada.start.OmadaLinuxMain\" error!" - echo " See the note on old CMDs at https://github.com/mbentley/docker-omada-controller/blob/master/KNOWN_ISSUES.md#upgrade-issues for details on why and how to resolve the issue." - echo -e "############################\n" -fi - -# compare version from the image to the version stored in the persistent data (last ran version) -if [ -f "/opt/tplink/EAPController/IMAGE_OMADA_VER.txt" ] -then - # file found; read the version that is in the image - IMAGE_OMADA_VER="$(cat /opt/tplink/EAPController/IMAGE_OMADA_VER.txt)" -else - bashio::log.error "Missing image version file (/opt/tplink/EAPController/IMAGE_OMADA_VER.txt); this should never happen!" - exit 1 -fi - -# load LAST_RAN_OMADA_VER, if file present -if [ -f "/opt/tplink/EAPController/data/LAST_RAN_OMADA_VER.txt" ] -then - # file found; read the version that was last recorded - LAST_RAN_OMADA_VER="$(cat /opt/tplink/EAPController/data/LAST_RAN_OMADA_VER.txt)" -else - # no file found; set version to 0.0.0 as we don't know the last version - LAST_RAN_OMADA_VER="0.0.0" -fi - -# use sort to check which version is newer; should sort the newest version to the top -if [ "$(printf '%s\n' "${IMAGE_OMADA_VER}" "${LAST_RAN_OMADA_VER}" | sort -rV | head -n1)" != "${IMAGE_OMADA_VER}" ] -then - # version in the image is didn't match newest image version; this means we are trying to start and older version - bashio::log.error "The version from the image (${IMAGE_OMADA_VER}) is older than the last version executed (${LAST_RAN_OMADA_VER})! Refusing to start to prevent data loss!" - echo " To bypass this check, remove /opt/tplink/EAPController/data/LAST_RAN_OMADA_VER.txt only if you REALLY know what you're doing!" - exit 1 -else - bashio::log.info "Version check passed; image version (${IMAGE_OMADA_VER}) >= the last version ran (${LAST_RAN_OMADA_VER}); writing image version to last ran file..." - echo "${IMAGE_OMADA_VER}" > /opt/tplink/EAPController/data/LAST_RAN_OMADA_VER.txt -fi - -# check to see if we are in a bad situation with a 32 bit userland and 64 bit kernel (fails to start MongoDB on a Raspberry Pi) -if [ "$(dpkg --print-architecture)" = "armhf" ] && [ "$(uname -m)" = "aarch64" ] && [ "${SKIP_USERLAND_KERNEL_CHECK}" = "false" ] -then - echo "##############################################################################" - echo "##############################################################################" - bashio::log.error "32 bit userspace with 64 bit kernel detected! MongoDB will NOT start!" - echo " See https://github.com/mbentley/docker-omada-controller/blob/master/KNOWN_ISSUES.md#mismatched-userland-and-kernel for how to fix the issue" - echo "##############################################################################" - echo "##############################################################################" - - exit 1 -else - bashio::log.info "userland/kernel check passed" -fi - -# show java version -echo -e "INFO: output of 'java -version':\n$(java -version 2>&1)\n" - -# get the java version in different formats -JAVA_VERSION="$(java -version 2>&1 | head -n 1 | awk -F '"' '{print $2}')" -JAVA_VERSION_1="$(echo "${JAVA_VERSION}" | awk -F '.' '{print $1}')" -JAVA_VERSION_2="$(echo "${JAVA_VERSION}" | awk -F '.' '{print $2}')" - -# for java 8, remove the opens argument from the CMD -case ${JAVA_VERSION_1}.${JAVA_VERSION_2} in - 1.8) - bashio::log.info "running Java 8; removing '--add-opens' option(s) from CMD (if present)..." - # remove opens option - NEW_CMD="${*}" - NEW_CMD="${NEW_CMD/'--add-opens java.base/sun.security.x509=ALL-UNNAMED '/}" - NEW_CMD="${NEW_CMD/'--add-opens java.base/sun.security.util=ALL-UNNAMED '/}" - # shellcheck disable=SC2086 - set -- ${NEW_CMD} - ;; -esac - -# check for autobackup -if [ ! -d "/opt/tplink/EAPController/data/autobackup" ] -then - echo - echo "##############################################################################" - echo "##############################################################################" - echo "WARNGING: autobackup directory not found! Please configure automatic backups!" - echo " For instructions, see https://github.com/mbentley/docker-omada-controller#controller-backups" - echo "##############################################################################" - echo "##############################################################################" - echo - sleep 2 -fi - -bashio::log.info "Starting Omada Controller as user ${PUSERNAME}" - -# tail the omada logs if set to true -if [ "${SHOW_SERVER_LOGS}" = "true" ] -then - gosu "${PUSERNAME}" tail -F -n 0 /opt/tplink/EAPController/logs/server.log & -fi - -# tail the mongodb logs if set to true -if [ "${SHOW_MONGODB_LOGS}" = "true" ] -then - gosu "${PUSERNAME}" tail -F -n 0 /opt/tplink/EAPController/logs/mongod.log & -fi - -# run the actual command as the omada user -exec gosu "${PUSERNAME}" "${@}" \ No newline at end of file diff --git a/Omada Beta/healthcheck.sh b/Omada Beta/healthcheck.sh deleted file mode 100755 index fe34cea..0000000 --- a/Omada Beta/healthcheck.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -wget --quiet --tries=1 --no-check-certificate -O /dev/null --server-response --timeout=5 "https://127.0.0.1:${MANAGE_HTTPS_PORT:-8043}/login" || exit 1 diff --git a/Omada Beta/icon.png b/Omada Beta/icon.png deleted file mode 100644 index 07cb7f89ec224eaf6cab768a47101b78e954ddc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 diff --git a/Omada Beta/icon.png b/Omada Beta/icon.png new file mode 120000 index 0000000..4188ad0 --- /dev/null +++ b/Omada Beta/icon.png @@ -0,0 +1 @@ +../Omada Dev/icon.png \ No newline at end of file diff --git a/Omada Beta/install.sh b/Omada Beta/install.sh deleted file mode 100755 index 20a674c..0000000 --- a/Omada Beta/install.sh +++ /dev/null @@ -1,329 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# omada controller dependency and package installer script for version 5.x - -# set default variables -OMADA_DIR="/opt/tplink/EAPController" -ARCH="${ARCH:-}" -NO_MONGODB="${NO_MONGODB:-false}" -INSTALL_VER="${INSTALL_VER:-}" - -# install wget -export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install --no-install-recommends -y ca-certificates unzip wget - -# for armv7l, force the creation of the ssl cert hashes (see https://stackoverflow.com/questions/70767396/docker-certificate-error-when-building-for-arm-v7-platform) -if [ "${ARCH}" = "armv7l" ] -then - for i in /etc/ssl/certs/*.pem; do HASH=$(openssl x509 -hash -noout -in "${i}"); ln -sfv "$(basename "${i}")" "/etc/ssl/certs/${HASH}.0"; done -fi - -# get URL to package based on major.minor version; for information on this url API, see https://github.com/mbentley/docker-omada-controller-url -OMADA_URL="$(wget -q -O - "https://omada-controller-url.mbentley.net/hooks/omada_ver_to_url?omada-ver=${INSTALL_VER}")" - -# make sure OMADA_URL isn't empty -if [ -z "${OMADA_URL}" ] -then - echo "ERROR: ${OMADA_URL} did not return a valid URL" - exit 1 -fi - -# extract required data from the OMADA_URL -OMADA_TAR="$(echo "${OMADA_URL}" | awk -F '/' '{print $NF}')" -OMADA_VER="$(echo "${OMADA_TAR}" | awk -F '_v' '{print $2}' | awk -F '_' '{print $1}')" - -# try alternate way to get OMADA_VER if not found -if [ -z "${OMADA_VER}" ] -then - echo "INFO: failed to get OMADA_VER; trying alternate method of getting OMADA_VER..." - # get only numbers and periods; remove any beginning or trailing periods with sed (also get rid of 64 from x64 from end) - OMADA_VER="$(echo "${OMADA_TAR//[!0-9.]/}" | sed 's/\.*$//' | sed 's/^\.*//' | sed 's/64$//')" -fi - -OMADA_MAJOR_VER="$(echo "${OMADA_VER}" | awk -F '.' '{print $1}')" -OMADA_MAJOR_MINOR_VER="$(echo "${OMADA_VER}" | awk -F '.' '{print $1"."$2}')" - -# make sure we were able to figure out these env vars -if [ -z "${OMADA_TAR}" ] || [ -z "${OMADA_VER}" ] || [ -z "${OMADA_MAJOR_VER}" ] || [ -z "${OMADA_MAJOR_MINOR_VER}" ] -then - echo "ERROR: one of the following variables wasn't populated:" - echo " OMADA_TAR=\"${OMADA_TAR}\"" - echo " OMADA_VER=\"${OMADA_VER}\"" - echo " OMADA_MAJOR_VER=\"${OMADA_MAJOR_VER}\"" - echo " OMADA_MAJOR_MINOR_VER=\"${OMADA_MAJOR_MINOR_VER}\"" - exit 1 -fi - -# function to exit on error w/message -die() { echo -e "$@" 2>&1; exit 1; } - -echo "**** Selecting packages based on the architecture and version ****" -# common package dependencies -PKGS=( - gosu - net-tools - tzdata - wget -) - -# add specific package for mongodb -case "${NO_MONGODB}" in - true) - # do not include mongodb - ;; - *) - # include mongodb - case "${ARCH}" in - amd64|arm64|aarch64"") - PKGS+=( mongodb-server-core ) - ;; - armv7l) - PKGS+=( mongodb ) - ;; - *) - die "${ARCH}: unsupported ARCH" - ;; - esac - ;; -esac - -# add specific package for openjdk -case "${ARCH}:${NO_MONGODB}" in - amd64:*|arm64:*|armv7l:true|"":*) - # use openjdk-17 for v5.4 and above; all others use openjdk-8 - case "${OMADA_MAJOR_VER}" in - 5) - # pick specific package based on the major.minor version - case "${OMADA_MAJOR_MINOR_VER}" in - 5.0|5.1|5.3) - # 5.0 to 5.3 all use openjdk-8 - PKGS+=( openjdk-8-jre-headless ) - ;; - *) - # starting with 5.4, OpenJDK 17 is supported; we will use OpenJ9 if present or OpenJDK 17 if not - if [ "$(. /opt/java/openjdk/release >/dev/null 2>&1; echo "${JVM_VARIANT}")" = "Openj9" ] - then - # we found OpenJ9; assume we want to use that - echo "INFO: OpenJ9 was found; using that instead of OpenJDK 17!" - else - # OpenJ9 not found; assume we need to use OpenJDK 17 - echo "INFO: OpenJ9 was NOT found; using adding OpenJDK 17 to the list of packages to install" - PKGS+=( openjdk-17-jre-headless ) - fi - ;; - esac - ;; - *) - # all other versions, use openjdk-8 - PKGS+=( openjdk-8-jre-headless ) - ;; - esac - ;; - armv7l:false) - # always use openjdk-8 for armv7l - PKGS+=( openjdk-8-jre-headless ) - ;; - *) - die "${ARCH}: unsupported ARCH" - ;; -esac - -# output variables/selections -echo "ARCH=\"${ARCH}\"" -echo "OMADA_URL=\"${OMADA_URL}\"" -echo "OMADA_TAR=\"${OMADA_TAR}\"" -echo "OMADA_VER=\"${OMADA_VER}\"" -echo "OMADA_MAJOR_VER=\"${OMADA_MAJOR_VER}\"" -echo "OMADA_MAJOR_MINOR_VER=\"${OMADA_MAJOR_MINOR_VER}\"" -echo "PKGS=( ${PKGS[*]} )" - -echo "**** Install Dependencies ****" -apt-get install --no-install-recommends -y "${PKGS[@]}" - -echo "**** Download Omada Controller ****" -cd /tmp -wget -nv "${OMADA_URL}" - -echo "**** Extract and Install Omada Controller ****" - -if [[ "${INSTALL_VER}" =~ ^beta.* ]] -then - # get the extension to determine what to do with it - case "${OMADA_URL##*.}" in - zip) - # this beta version is a tar.gz inside of a zip so let's pre-unzip it - echo "INFO: this beta version is a zip file; unzipping..." - # unzip the file - unzip "${OMADA_TAR}" - rm -f "${OMADA_TAR}" - - # let's figure out where the tar.gz file is - if [ -n "$(find . -name "*.tar.gz" -maxdepth 1 | sed 's|^./||')" ] - then - # it's in the current directory; just output message - echo "INFO: .tar.gz is in the current directory, nothing to move" - elif [ -n "$(find . -name "*.tar.gz" | sed 's|^./||')" ] - then - # it's in a subdirectory, move it to the current directory - mv -v "$(find . -name "*.tar.gz" | sed 's|^./||')" . - - # cleanup directories - # shellcheck disable=SC2044 - for DIR in $(find ./* -type d) - do - # cd to dir, find and delete any files; return - cd "${DIR}" - find . -type f -delete - cd - - done - - find ./* -type d -delete - else - echo "ERROR: unable to find a .tar.gz file!" - exit 1 - fi - - # it's in the current directory; let's get the tar name - OMADA_TAR="$(ls -- *.tar.gz)" - ;; - gz) - # check to see if this is a tar.gz or just a gz - if ls -- *.tar.gz >/dev/null 2>&1 - then - # this is a tar.gz - echo "INFO: OMADA_TAR is a tar.gz; we can handle it normally!" - else - # this beta version might be a tar.gz inside of a gzipped file so let's pre-gunzip it - echo "INFO: this beta version is a gz file; gunzipping..." - # gunzip the file - gunzip "${OMADA_TAR}" - - # now that we have unzipped, let's get the tar name - OMADA_TAR="$(ls -- *.tar.gz*)" - fi - ;; - *) - echo "ERROR: unknown file extension, exiting!" - exit 1 - ;; - esac -fi - -echo "${OMADA_TAR}" -ls -l "${OMADA_TAR}" -tar xvf "${OMADA_TAR}" -rm -f "${OMADA_TAR}" -cd Omada_SDN_Controller_* - -# make sure tha the install directory exists -mkdir "${OMADA_DIR}" -vp - -# starting with 5.0.x, the installation has no webapps directory; these values are pulled from the install.sh -case "${OMADA_MAJOR_VER}" in - 5) - # see if we are running 5.3.x or greater by checking the minor version - if [ "${OMADA_MAJOR_MINOR_VER#*.}" -ge 3 ] - then - # 5.3.1 and above moved the keystore directory to be a subdir of data - NAMES=( bin data lib properties install.sh uninstall.sh ) - else - # is less than 5.3 - NAMES=( bin data properties keystore lib install.sh uninstall.sh ) - fi - ;; - *) - # isn't v5.x - NAMES=( bin data properties keystore lib webapps install.sh uninstall.sh ) - ;; -esac - -# copy over the files to the destination -for NAME in "${NAMES[@]}" -do - cp "${NAME}" "${OMADA_DIR}" -r -done - -# only add standlone options for controller version 5.x and above -case "${OMADA_MAJOR_VER}" in - 5) - # add additional properties to the properties file - { \ - echo "" ;\ - echo "" ;\ - echo "# external mongodb" ;\ - echo "mongo.external=false" ;\ - echo "eap.mongod.uri=mongodb://127.0.0.1:27217/omada" ;\ - } >> /opt/tplink/EAPController/properties/omada.properties - ;; -esac - -# copy omada default properties for can be used when properties is mounted as volume -cp -r /opt/tplink/EAPController/properties/ "${OMADA_DIR}/properties.defaults" - -# symlink for mongod, if applicable -case "${NO_MONGODB}" in - true) - # do not include mongodb - ;; - *) - # include mongodb - ln -sf "$(command -v mongod)" "${OMADA_DIR}/bin/mongod" - chmod 755 "${OMADA_DIR}"/bin/* - ;; -esac - -# starting with 5.0.x, the work directory is no longer needed -case "${OMADA_MAJOR_VER}" in - 5) - # create logs directory - mkdir "${OMADA_DIR}/logs" - ;; - *) - # create logs and work directories - mkdir "${OMADA_DIR}/logs" "${OMADA_DIR}/work" - ;; -esac - -# for v5.1 & above, create backup of data/html directory in case it is missing (to be extracted at runtime) -if [ -d /opt/tplink/EAPController/data/html ] -then - # create backup - cd /opt/tplink/EAPController/data - tar zcvf ../data-html.tar.gz html -fi - -echo "**** Cleanup ****" -rm -rf /tmp/* /var/lib/apt/lists/* - -# write installed version to a file -echo "${OMADA_VER}" > "${OMADA_DIR}/IMAGE_OMADA_VER.txt" - -# ------------------------------------------------------------------------------------------------------------------------------------------------------------------- -# < original script end - -# ===================================== -# Home Assistant specific preprocessing -# ===================================== - -# Install bashio -apt-get update -apt-get install --no-install-recommends -y -y ca-certificates curl jq -BASHIO_VERSION="0.16.2" -echo "**** Install BashIO ${BASHIO_VERSION}, for parsing HASS AddOn options ****" -curl -J -L -o /tmp/bashio.tar.gz "https://github.com/hassio-addons/bashio/archive/refs/tags/v${BASHIO_VERSION}.tar.gz" -mkdir /tmp/bashio -tar zxvf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio -mv /tmp/bashio/lib /usr/lib/bashio -ln -s /usr/lib/bashio/bashio /usr/bin/bashio - -# symlink to home assistant data dir to the omada data dir to make configuration persistent -mkdir -p /data - -mv /opt/tplink/EAPController/data /opt/tplink/EAPController/data_backup -ln -s /data/data /opt/tplink/EAPController/data - -rm -rf /opt/tplink/EAPController/logs -ln -s /data/logs /opt/tplink/EAPController/logs \ No newline at end of file diff --git a/Omada Beta/logo.png b/Omada Beta/logo.png deleted file mode 100644 index 07cb7f89ec224eaf6cab768a47101b78e954ddc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 diff --git a/Omada Beta/logo.png b/Omada Beta/logo.png new file mode 120000 index 0000000..af75bb7 --- /dev/null +++ b/Omada Beta/logo.png @@ -0,0 +1 @@ +../Omada Dev/logo.png \ No newline at end of file diff --git a/Omada Beta/translations b/Omada Beta/translations new file mode 120000 index 0000000..391c319 --- /dev/null +++ b/Omada Beta/translations @@ -0,0 +1 @@ +../Omada Dev/translations \ No newline at end of file diff --git a/Omada Beta/Dockerfile b/Omada Dev/Dockerfile similarity index 90% rename from Omada Beta/Dockerfile rename to Omada Dev/Dockerfile index dff559d..12bec95 100644 --- a/Omada Beta/Dockerfile +++ b/Omada Dev/Dockerfile @@ -11,6 +11,7 @@ ARG BASE=mbentley/ubuntu:20.04 FROM ${BASE} COPY healthcheck.sh install.sh / +COPY mbentley/install.sh /mbentley/ # Home Assistant adds BUILD_ARCH, and buildx adds TARGETARCH; save the right one as ARCH ARG TARGETARCH @@ -18,14 +19,15 @@ ARG BUILD_ARCH ARG ARCH=${TARGETARCH:-${BUILD_ARCH:-}} # install version (major.minor or full version); OMADA_URL set in install.sh -ARG INSTALL_VER="5.14.32.3" +ARG INSTALL_VER ARG NO_MONGODB=false # install omada controller (instructions taken from install.sh) -RUN /install.sh && rm /install.sh +RUN /install.sh && rm /install.sh && rm /mbentley/install.sh # copy entrypoint after the installation, to avoid rebuilding whole image COPY entrypoint.sh / +COPY mbentley/entrypoint-5.x.sh /mbentley/ WORKDIR /opt/tplink/EAPController/lib EXPOSE 8088 8043 8843 29810/udp 29811 29812 29813 29814 diff --git a/Omada Dev/entrypoint.sh b/Omada Dev/entrypoint.sh new file mode 100755 index 0000000..94ae896 --- /dev/null +++ b/Omada Dev/entrypoint.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bashio + +# ===================================== +# Home Assistant specific preprocessing +# ===================================== + +# create data and logs dir, if not existing +bashio::log.info "Create 'logs' directory inside persistent /data volume, if it doesn't exist." +mkdir -p "/data/logs" + +if [ ! -d /data/data ]; then + bashio::log.info "/data/data created from docker image backup" && cp -r /opt/tplink/EAPController/data_backup /data/data + + # Check if old directory structure is in place (/data) and copy to (/data/data) + # This can be removed in the future when everyone has upgraded + directories=(db keystore pdf) + for dir in "${directories[@]}"; do + if [ -d "/data/$dir" ]; then + cp -r /data/$dir "/data/data/" + rm -rf /data/$dir + bashio::log.info "Migrate from old Add-On file structure. Copied /data/$dir to /data/data/$dir" + else + bashio::log.info "Already in new file structure. /data/$dir does not exist, skipping." + fi + done +fi + +# set permissions on /data directory for home assistant persistence +chown -R 508:508 "/data" + +# Use SSL Keys from Home Assistant +if bashio::config.true 'enable_hass_ssl'; then + bashio::log.info "Use SSL from Home Assistant" + SSL_CERT_NAME=$(bashio::config 'certfile') + bashio::log.info "SSL certificate: ${SSL_CERT_NAME}" + SSL_KEY_NAME=$(bashio::config 'keyfile') + bashio::log.info "SSL private key: ${SSL_KEY_NAME}" +fi + +# Source mbentley entrypoint script +source /mbentley/entrypoint-5.x.sh diff --git a/Omada Dev/healthcheck.sh b/Omada Dev/healthcheck.sh new file mode 120000 index 0000000..42f9e0f --- /dev/null +++ b/Omada Dev/healthcheck.sh @@ -0,0 +1 @@ +mbentley/healthcheck.sh \ No newline at end of file diff --git a/Omada Dev/icon.png b/Omada Dev/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..07cb7f89ec224eaf6cab768a47101b78e954ddc6 GIT binary patch literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 literal 0 HcmV?d00001 diff --git a/Omada Dev/install.sh b/Omada Dev/install.sh new file mode 100755 index 0000000..e72b8f3 --- /dev/null +++ b/Omada Dev/install.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -e + +# Call mbentley install script +./mbentley/install.sh + +# ===================================== +# Home Assistant specific preprocessing +# ===================================== + +# Install bashio +apt-get update +apt-get install --no-install-recommends -y -y ca-certificates curl jq +BASHIO_VERSION="0.16.2" +echo "**** Install BashIO ${BASHIO_VERSION}, for parsing HASS AddOn options ****" +curl -J -L -o /tmp/bashio.tar.gz "https://github.com/hassio-addons/bashio/archive/refs/tags/v${BASHIO_VERSION}.tar.gz" +mkdir /tmp/bashio +tar zxvf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio +mv /tmp/bashio/lib /usr/lib/bashio +ln -s /usr/lib/bashio/bashio /usr/bin/bashio + +# symlink to home assistant data dir to the omada data dir to make configuration persistent +mkdir -p /data + +mv /opt/tplink/EAPController/data /opt/tplink/EAPController/data_backup +ln -s /data/data /opt/tplink/EAPController/data + +rm -rf /opt/tplink/EAPController/logs +ln -s /data/logs /opt/tplink/EAPController/logs diff --git a/Omada Dev/logo.png b/Omada Dev/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..07cb7f89ec224eaf6cab768a47101b78e954ddc6 GIT binary patch literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 literal 0 HcmV?d00001 diff --git a/Omada Dev/mbentley b/Omada Dev/mbentley new file mode 160000 index 0000000..8b3eb37 --- /dev/null +++ b/Omada Dev/mbentley @@ -0,0 +1 @@ +Subproject commit 8b3eb37079438635a99ba29d2e94314509a08761 diff --git a/Omada Beta/translations/en.yaml b/Omada Dev/translations/en.yaml similarity index 100% rename from Omada Beta/translations/en.yaml rename to Omada Dev/translations/en.yaml From e33007e1bd8b2c2ecd7e2352bb4958fba32f7350 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Wed, 13 Nov 2024 00:16:34 +0100 Subject: [PATCH 2/7] Put keys in /cert folder for mbentley --- Omada Dev/entrypoint.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Omada Dev/entrypoint.sh b/Omada Dev/entrypoint.sh index 94ae896..e4e554c 100755 --- a/Omada Dev/entrypoint.sh +++ b/Omada Dev/entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bashio -# ===================================== +# ====================================== # Home Assistant specific preprocessing -# ===================================== +# ====================================== # create data and logs dir, if not existing bashio::log.info "Create 'logs' directory inside persistent /data volume, if it doesn't exist." @@ -35,7 +35,27 @@ if bashio::config.true 'enable_hass_ssl'; then bashio::log.info "SSL certificate: ${SSL_CERT_NAME}" SSL_KEY_NAME=$(bashio::config 'keyfile') bashio::log.info "SSL private key: ${SSL_KEY_NAME}" + + # Put keys in /cert folder, this is how mbentley expects it, these are temporary files for new keystore + mkdir -p /cert + cp "$SSL_CERT_NAME" /cert/ + cp "$SSL_KEY_NAME" /cert/ + + SSL_CERT_NAME="$(basename "$SSL_CERT_NAME")" + SSL_KEY_NAME="$(basename "$SSL_KEY_NAME")" fi -# Source mbentley entrypoint script + +# ====================================== +# mbentley +# ====================================== + source /mbentley/entrypoint-5.x.sh + + +# ====================================== +# Home Assistant specific postprocessing +# ====================================== + +# Clean up cert and key +rm -rf /cert From b256c37a717744f716226e1d802b49656188aae5 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 16 Nov 2024 13:41:42 +0100 Subject: [PATCH 3/7] Implement new structure for Stable --- Omada Stable/Dockerfile | 25 --- Omada Stable/config.yaml | 4 +- Omada Stable/entrypoint.sh | 262 ------------------------------ Omada Stable/healthcheck.sh | 3 - Omada Stable/icon.png | Bin 892 -> 21 bytes Omada Stable/install.sh | 114 ------------- Omada Stable/logo.png | Bin 892 -> 21 bytes Omada Stable/translations | 1 + Omada Stable/translations/en.yaml | 11 -- 9 files changed, 3 insertions(+), 417 deletions(-) delete mode 100644 Omada Stable/Dockerfile delete mode 100755 Omada Stable/entrypoint.sh delete mode 100755 Omada Stable/healthcheck.sh mode change 100644 => 120000 Omada Stable/icon.png delete mode 100755 Omada Stable/install.sh mode change 100644 => 120000 Omada Stable/logo.png create mode 120000 Omada Stable/translations delete mode 100644 Omada Stable/translations/en.yaml diff --git a/Omada Stable/Dockerfile b/Omada Stable/Dockerfile deleted file mode 100644 index deba44f..0000000 --- a/Omada Stable/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# rebased/repackaged base image that only updates existing packages -ARG BASE=mbentley/ubuntu:20.04 -FROM ${BASE} -LABEL maintainer="Matt Bentley " -LABEL org.opencontainers.image.source="https://github.com/mbentley/docker-omada-controller" - -COPY healthcheck.sh install.sh / - -# Home Assistant adds BUILD_ARCH, and buildx adds TARGETARCH; save the right one as ARCH -ARG TARGETARCH -ARG BUILD_ARCH -ARG ARCH=${TARGETARCH:-${BUILD_ARCH:-}} - -# install omada controller (instructions taken from install.sh) -RUN /install.sh && rm /install.sh - -# copy entrypoint after the installation, to avoid rebuilding whole image -COPY entrypoint.sh / - -WORKDIR /opt/tplink/EAPController/lib -EXPOSE 8088 8043 8843 29810/udp 29811 29812 29813 29814 -HEALTHCHECK --start-period=5m CMD /healthcheck.sh -VOLUME ["/data"] -ENTRYPOINT ["/entrypoint.sh"] -CMD ["/usr/bin/java","-server","-Xms128m","-Xmx1024m","-XX:MaxHeapFreeRatio=60","-XX:MinHeapFreeRatio=30","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/opt/tplink/EAPController/logs/java_heapdump.hprof","-Djava.awt.headless=true","--add-opens","java.base/java.util=ALL-UNNAMED","-cp","/opt/tplink/EAPController/lib/*::/opt/tplink/EAPController/properties:","com.tplink.smb.omada.starter.OmadaLinuxMain"] \ No newline at end of file diff --git a/Omada Stable/config.yaml b/Omada Stable/config.yaml index 6bbb3a8..5e11b9c 100644 --- a/Omada Stable/config.yaml +++ b/Omada Stable/config.yaml @@ -1,7 +1,7 @@ --- name: Omada Controller Stable -image: dratrav/home-assistant-omada-stable -version: 5.14.7 +image: jeruntu/home-assistant-omada-stable +version: beta-5.14.30.7 slug: omada_controller_stable description: TP-Link Omada Controller software webui: https://[HOST]:[PORT:8043] diff --git a/Omada Stable/entrypoint.sh b/Omada Stable/entrypoint.sh deleted file mode 100755 index e063267..0000000 --- a/Omada Stable/entrypoint.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/usr/bin/env bashio - -set -e - -# set environment variables -export TZ -TZ="${TZ:-Etc/UTC}" -SMALL_FILES="${SMALL_FILES:-false}" -MANAGE_HTTP_PORT="${MANAGE_HTTP_PORT:-8088}" -MANAGE_HTTPS_PORT="${MANAGE_HTTPS_PORT:-8043}" -PORTAL_HTTP_PORT="${PORTAL_HTTP_PORT:-8088}" -PORTAL_HTTPS_PORT="${PORTAL_HTTPS_PORT:-8843}" -SHOW_SERVER_LOGS="${SHOW_SERVER_LOGS:-true}" -SHOW_MONGODB_LOGS="${SHOW_MONGODB_LOGS:-false}" -SSL_CERT="${SSL_CERT:-tls.crt}" -SSL_KEY="${SSL_KEY:-tls.key}" -TLS_1_11_ENABLED="${TLS_1_11_ENABLED:-false}" -# default /opt/tplink/EAPController -OMADA_DIR="/opt/tplink/EAPController" -PUID="${PUID:-508}" -PGID="${PGID:-508}" - -bashio::log.info "Create 'logs' directory inside persistent /data volume, if it doesn't exist." -mkdir -p "${OMADA_DIR}/data/logs" -ln -s "${OMADA_DIR}/data/logs" "${OMADA_DIR}/logs" -chown -R omada:omada "${OMADA_DIR}/logs" - -if bashio::config.true 'enable_hass_ssl'; then - bashio::log.info "Use SSL from Home Assistant" - SSL_CERT=$(bashio::config 'certfile') - bashio::log.info "SSL certificate: ${SSL_CERT}" - SSL_KEY=$(bashio::config 'keyfile') - bashio::log.info "SSL private key: ${SSL_KEY}" -fi - -# validate user/group exist with correct UID/GID -bashio::log.info "Validating user/group (omada:omada) exists with correct UID/GID (${PUID}:${PGID})" - -# check to see if group exists; if not, create it -if grep -q -E "^omada:" /etc/group > /dev/null 2>&1 -then - # exiting group found; also make sure the omada user matches the GID - bashio::log.info "Group (omada) exists; skipping creation" - EXISTING_GID="$(id -g omada)" - if [ "${EXISTING_GID}" != "${PGID}" ] - then - bashio::log.error "Group (omada) has an unexpected GID; was expecting '${PGID}' but found '${EXISTING_GID}'!" - exit 1 - fi -else - # make sure the group doesn't already exist with a different name - if awk -F ':' '{print $3}' /etc/group | grep -q "^${PGID}$" - then - # group ID exists but has a different group name - EXISTING_GROUP="$(grep ":${PGID}:" /etc/group | awk -F ':' '{print $1}')" - bashio::log.info "Group (omada) already exists with a different name; renaming '${EXISTING_GROUP}' to 'omada'" - groupmod -n omada "${EXISTING_GROUP}" - else - # create the group - bashio::log.info "Group (omada) doesn't exist; creating" - groupadd -g "${PGID}" omada - fi -fi - -# set permissions on /data directory for home assistant persistence -chown -R 508:508 "/data" - -# check to see if user exists; if not, create it -if id -u omada > /dev/null 2>&1 -then - # exiting user found; also make sure the omada user matches the UID - bashio::log.info "User (omada) exists; skipping creation" - EXISTING_UID="$(id -u omada)" - if [ "${EXISTING_UID}" != "${PUID}" ] - then - bashio::log.error "User (omada) has an unexpected UID; was expecting '${PUID}' but found '${EXISTING_UID}'!" - exit 1 - fi -else - # make sure the user doesn't already exist with a different name - if awk -F ':' '{print $3}' /etc/passwd | grep -q "^${PUID}$" - then - # user ID exists but has a different user name - EXISTING_USER="$(grep ":${PUID}:" /etc/passwd | awk -F ':' '{print $1}')" - bashio::log.info "User (omada) already exists with a different name; renaming '${EXISTING_USER}' to 'omada'" - usermod -g "${PGID}" -d "${OMADA_DIR}/data" -l omada -s /bin/sh -c "" "${EXISTING_USER}" - else - # create the user - bashio::log.info "User (omada) doesn't exist; creating" - useradd -u "${PUID}" -g "${PGID}" -d "${OMADA_DIR}/data" -s /bin/sh -c "" omada - fi -fi - -# set default time zone and notify user of time zone -bashio::log.info "Time zone set to '${TZ}'" - -# append smallfiles if set to true -if [ "${SMALL_FILES}" = "true" ] -then - bashio::log.warning "smallfiles was passed but is not supported in >= 4.1 with the WiredTiger engine in use by MongoDB" - bashio::log.info "Skipping setting smallfiles option" -fi - -set_port_property() { - # check to see if we are trying to bind to privileged port - if [ "${3}" -lt "1024" ] && [ "$(cat /proc/sys/net/ipv4/ip_unprivileged_port_start)" = "1024" ] - then - bashio::log.error "Unable to set '${1}' to ${3}; 'ip_unprivileged_port_start' has not been set. See https://github.com/mbentley/docker-omada-controller#unprivileged-ports" - exit 1 - fi - - bashio::log.info "Setting '${1}' to ${3} in omada.properties" - sed -i "s/^${1}=${2}$/${1}=${3}/g" "${OMADA_DIR}/properties/omada.properties" -} - -# replace MANAGE_HTTP_PORT if not the default -if [ "${MANAGE_HTTP_PORT}" != "8088" ] -then - set_port_property manage.http.port 8088 "${MANAGE_HTTP_PORT}" -fi - -# replace MANAGE_HTTPS_PORT if not the default -if [ "${MANAGE_HTTPS_PORT}" != "8043" ] -then - set_port_property manage.https.port 8043 "${MANAGE_HTTPS_PORT}" -fi - -# replace PORTAL_HTTP_PORT if not the default -if [ "${PORTAL_HTTP_PORT}" != "8088" ] -then - set_port_property portal.http.port 8088 "${PORTAL_HTTP_PORT}" -fi - -# replace PORTAL_HTTPS_PORT if not the default -if [ "${PORTAL_HTTPS_PORT}" != "8843" ] -then - set_port_property portal.https.port 8843 "${PORTAL_HTTPS_PORT}" -fi - -# make sure that the html directory exists -if [ ! -d "${OMADA_DIR}/data/html" ] && [ -f "${OMADA_DIR}/data-html.tar.gz" ] -then - # missing directory; extract from original - bashio::log.info "Report HTML directory missing; extracting backup to '${OMADA_DIR}/data/html'" - tar zxvf "${OMADA_DIR}/data-html.tar.gz" -C "${OMADA_DIR}/data" - chown -R omada:omada "${OMADA_DIR}/data/html" -fi - -# make sure that the pdf directory exists -if [ ! -d "${OMADA_DIR}/data/pdf" ] -then - # missing directory; extract from original - bashio::log.info "Report PDF directory missing; creating '${OMADA_DIR}/data/pdf'" - mkdir "${OMADA_DIR}/data/pdf" - chown -R omada:omada "${OMADA_DIR}/data/pdf" -fi - -# make sure permissions are set appropriately on each directory -for DIR in data logs properties -do - OWNER="$(stat -c '%u' ${OMADA_DIR}/${DIR})" - GROUP="$(stat -c '%g' ${OMADA_DIR}/${DIR})" - - if [ "${OWNER}" != "${PUID}" ] || [ "${GROUP}" != "${PGID}" ] - then - # notify user that uid:gid are not correct and fix them - bashio::log.warning "Ownership not set correctly on '${OMADA_DIR}/${DIR}'; setting correct ownership (omada:omada)" - chown -R omada:omada "${OMADA_DIR}/${DIR}" - fi -done - -# validate permissions on /tmp -TMP_PERMISSIONS="$(stat -c '%a' /tmp)" -if [ "${TMP_PERMISSIONS}" != "1777" ] -then - bashio::log.warning "Permissions are not set correctly on '/tmp' (${TMP_PERMISSIONS}); setting correct permissions (1777)" - chmod -v 1777 /tmp -fi - -# check to see if there is a db directory; create it if it is missing -if [ ! -d "${OMADA_DIR}/data/db" ] -then - bashio::log.info "Database directory missing; creating '${OMADA_DIR}/data/db'" - mkdir "${OMADA_DIR}/data/db" - chown omada:omada "${OMADA_DIR}/data/db" - bashio::log.info "done" -fi - -# Import a cert from a possibly mounted secret or file -if [ -f "${SSL_KEY}" ] && [ -f "${SSL_CERT}" ] -then - # keystore directory moved to the data directory in 5.3.1 - KEYSTORE_DIR="${OMADA_DIR}/data/keystore" - - # check to see if the KEYSTORE_DIR exists (it won't on upgrade) - if [ ! -d "${KEYSTORE_DIR}" ] - then - bashio::log.info "Creating keystore directory (${KEYSTORE_DIR})" - mkdir "${KEYSTORE_DIR}" - bashio::log.info "Setting permissions on ${KEYSTORE_DIR}" - chown omada:omada "${KEYSTORE_DIR}" - fi - - bashio::log.info "Importing certificate and key" - # delete the existing keystore - rm -f "${KEYSTORE_DIR}/eap.keystore" - - # example certbot usage: ./certbot-auto certonly --standalone --preferred-challenges http -d mydomain.net - openssl pkcs12 -export \ - -inkey "${SSL_KEY}" \ - -in "${SSL_CERT}" \ - -certfile "${SSL_CERT}" \ - -name eap \ - -out "${KEYSTORE_DIR}/eap.keystore" \ - -passout pass:tplink - - # set ownership/permission on keystore - chown omada:omada "${KEYSTORE_DIR}/eap.keystore" - chmod 400 "${KEYSTORE_DIR}/eap.keystore" -fi - -# re-enable disabled TLS versions 1.0 & 1.1 -if [ "${TLS_1_11_ENABLED}" = "true" ] -then - # not running openjdk8 or openjdk17 - bashio::log.warning "Unable to re-enable TLS 1.0 & 1.1; unable to detect openjdk version" -fi - -# see if any of these files exist; if so, do not start as they are from older versions -if [ -f "${OMADA_DIR}/data/db/tpeap.0" ] || [ -f "${OMADA_DIR}/data/db/tpeap.1" ] || [ -f "${OMADA_DIR}/data/db/tpeap.ns" ] -then - bashio::log.error "The data volume mounted to ${OMADA_DIR}/data appears to have data from a previous version!" - bashio::log.error " Follow the upgrade instructions at https://github.com/mbentley/docker-omada-controller#upgrading-to-41" - exit 1 -fi - -# load LAST_RAN_OMADA_VER, if file present -if [ -f "${OMADA_DIR}/data/LAST_RAN_OMADA_VER.txt" ] -then - # file found; read the version that was last recorded - LAST_RAN_OMADA_VER="$(cat ${OMADA_DIR}/data/LAST_RAN_OMADA_VER.txt)" -else - # no file found; set version to 0.0.0 as we don't know the last version - LAST_RAN_OMADA_VER="0.0.0" -fi - -bashio::log.info "Starting Omada Controller as user omada" - -# tail the omada logs if set to true -if [ "${SHOW_SERVER_LOGS}" = "true" ] -then - gosu omada tail -F -n 0 "${OMADA_DIR}/logs/server.log" & -fi - -# tail the mongodb logs if set to true -if [ "${SHOW_MONGODB_LOGS}" = "true" ] -then - gosu omada tail -F -n 0 "${OMADA_DIR}/logs/mongod.log" & -fi - -# run the actual command as the omada user -exec gosu omada "${@}" \ No newline at end of file diff --git a/Omada Stable/healthcheck.sh b/Omada Stable/healthcheck.sh deleted file mode 100755 index fe34cea..0000000 --- a/Omada Stable/healthcheck.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -wget --quiet --tries=1 --no-check-certificate -O /dev/null --server-response --timeout=5 "https://127.0.0.1:${MANAGE_HTTPS_PORT:-8043}/login" || exit 1 diff --git a/Omada Stable/icon.png b/Omada Stable/icon.png deleted file mode 100644 index 07cb7f89ec224eaf6cab768a47101b78e954ddc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 diff --git a/Omada Stable/icon.png b/Omada Stable/icon.png new file mode 120000 index 0000000..4188ad0 --- /dev/null +++ b/Omada Stable/icon.png @@ -0,0 +1 @@ +../Omada Dev/icon.png \ No newline at end of file diff --git a/Omada Stable/install.sh b/Omada Stable/install.sh deleted file mode 100755 index 9dccce6..0000000 --- a/Omada Stable/install.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env bash - -set -e - -OMADA_DIR="/opt/tplink/EAPController" -ARCH="${ARCH:-}" -OMADA_VER="${OMADA_VER:-}" -OMADA_TAR="${OMADA_TAR:-}" -OMADA_URL="https://static.tp-link.com/upload/beta/2024/202407/20240726/Omada_Controller_Linux_5.14.30.7_tar(Pre-release).zip" -OMADA_MAJOR_VER="$(echo "${OMADA_VER}" | awk -F '.' '{print $1}')" - - -# extract required data from the OMADA_URL -OMADA_TAR="$(echo "${OMADA_URL}" | awk -F '/' '{print $NF}')" -OMADA_VER="$(echo "${OMADA_TAR}" | awk -F '_v' '{print $2}' | awk -F '_' '{print $1}')" -OMADA_MAJOR_VER="${OMADA_VER%.*.*}" -OMADA_MAJOR_MINOR_VER="${OMADA_VER%.*}" - - -die() { echo -e "$@" 2>&1; exit 1; } - -# common package dependencies -PKGS=( - gosu - unzip - net-tools - openjdk-17-jre-headless - tzdata - wget - curl - jq -) - -case "${ARCH}" in -amd64|arm64|aarch64|"") - PKGS+=( mongodb-server-core ) - ;; -*) - die "${ARCH}: unsupported ARCH" - ;; -esac - -echo "ARCH=${ARCH}" -echo "OMADA_VER=${OMADA_VER}" -echo "OMADA_TAR=${OMADA_TAR}" -echo "OMADA_URL=${OMADA_URL}" - -echo "**** Install Dependencies ****" -export DEBIAN_FRONTEND=noninteractive -apt-get update --fix-missing -apt-get install --no-install-recommends -y "${PKGS[@]}" - -BASHIO_VERSION="0.16.2" -echo "**** Install BashIO ${BASHIO_VERSION}, for parsing HASS AddOn options ****" -mkdir -p /usr/src/bashio -curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \ - | tar -xzf - --strip 1 -C /usr/src/bashio -mv /usr/src/bashio/lib /usr/lib/bashio -ln -s /usr/lib/bashio/bashio /usr/bin/bashio - -echo "**** Download Omada Controller ****" -cd /tmp -wget -nv "${OMADA_URL}" - - -echo "**** Check if zip and extract ****" -if [[ $OMADA_TAR =~ \.zip$ ]]; then - unzip "${OMADA_TAR}" - cd "$(ls -t1 -d Omada*/ | head -n1)" - echo "$(ls -t1 [Release]* | tail -n1)" - OMADA_TAR="$(ls -t1 * | tail -n1)" - echo "$OMADA_TAR" -else - echo "File is not a zip" -fi - - -echo "**** Extract and Install Omada Controller ****" -tar zxvf "${OMADA_TAR}" -rm -f "${OMADA_TAR}" -cd Omada_SDN_Controller_* - - - -# make sure tha the install directory exists -mkdir "${OMADA_DIR}" -vp - -# starting with 5.0.x, the installation has no webapps directory; these values are pulled from the install.sh -NAMES=( bin properties lib install.sh uninstall.sh ) - - -# copy over the files to the destination -for NAME in "${NAMES[@]}" -do - cp "${NAME}" "${OMADA_DIR}" -r -done - -# symlink to home assistant data dir -ln -s /data "${OMADA_DIR}" - -# symlink for mongod -ln -sf "$(which mongod)" "${OMADA_DIR}/bin/mongod" -chmod 755 "${OMADA_DIR}"/bin/* - -echo "${OMADA_VER}" > "${OMADA_DIR}/IMAGE_OMADA_VER.txt" - -echo "**** Setup omada User Account ****" -groupadd -g 508 omada -useradd -u 508 -g 508 -d "${OMADA_DIR}" omada -chown -R omada:omada "${OMADA_DIR}/data" - - -echo "**** Cleanup ****" -rm -rf /tmp/* /var/lib/apt/lists/* \ No newline at end of file diff --git a/Omada Stable/logo.png b/Omada Stable/logo.png deleted file mode 100644 index 07cb7f89ec224eaf6cab768a47101b78e954ddc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3jDP)Nh#-gyD}QmI3{B@FY0}qBpyVZ)rpYfe zlS%Ysh-4ygVv-KwA%Gc`AbGSdw3si_J`s6c|Tk} zz6|HPr{VPO;V;K;)S(SB_aC1|1UB(iY8W74@&Exa)&~#)5THw^)d2%2E1)@fz$>YB zs{vLT6o&|ngXZR@RRHsv9)}{8p>4Tl+7uX8ycR5i324w}Z)ye%uxJu3axb)Iz%Kqn zgBGypn;!FQ0<5+f5+I(#Jgpl+bzoP{*osfKR2k4LsVXqULuZaav=p3FKNi!h3T!Q= z$iYF&ew1of4H#CD57b-61nFGq?SsFk)v{{9a(6|90jVPn95*HmkQ{`zto3D8faUlu zOe6)0TM@wJ9I-UtsRGP93HUru@|wRUn5_cLV=7t`nF0z;^K3A9M{@pEfNA~6SZCwI<4w(HYNb)fADAA-l>>@^Y0Ob=lGbYy8iY6JH=kagr2Rg$OWGaD z*QzvZ>%jN|5uB;KdtfkUOX?b!*3plFb`8v8iUh4&U>;b2)+I1)2tisk&btBzpXJpo zg4PW%z?uq(34}J^JTQR5X`ob60rUKQPa9=V$#Jtmc}i}st~4kDt^$^G128wKRGSwV zLE`VzWJ}~KVE7Onaxo~&lY%l=&nFDulRErEmdlp_lj=haEY*QjKL;k&Ruh0Ue%>Cy zI1!;7zyv_NIe>8@LOFm5fOvBN<3xmV022W5<^aZt2;~4K0OHL7j1v*c0ZahIn*$gp zB9s>ghJ$+Q%$Tb0`Yh?W8tNJtUCmhj|DkJOf=f8M=EZ&3(Gd{_9KZxXy!jWfpDfoR Su4`ui0000 diff --git a/Omada Stable/logo.png b/Omada Stable/logo.png new file mode 120000 index 0000000..af75bb7 --- /dev/null +++ b/Omada Stable/logo.png @@ -0,0 +1 @@ +../Omada Dev/logo.png \ No newline at end of file diff --git a/Omada Stable/translations b/Omada Stable/translations new file mode 120000 index 0000000..391c319 --- /dev/null +++ b/Omada Stable/translations @@ -0,0 +1 @@ +../Omada Dev/translations \ No newline at end of file diff --git a/Omada Stable/translations/en.yaml b/Omada Stable/translations/en.yaml deleted file mode 100644 index 392a213..0000000 --- a/Omada Stable/translations/en.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -configuration: - enable_hass_ssl: - name: Enable Home Assistant SSL - description: This can be used to enable your own Home Assistant certificate. - keyfile: - name: Private Key File - description: Path to the Private Key File. - certfile: - name: Certificate File - description: Path to the Certificate File. From d969111f7b73ff6e8715f642818cd3644020c4a0 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 16 Nov 2024 15:14:17 +0100 Subject: [PATCH 4/7] Upgrade Omada versions --- Omada Beta/config.yaml | 4 ++-- Omada Dev/mbentley | 2 +- Omada Stable/config.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Omada Beta/config.yaml b/Omada Beta/config.yaml index 8dca72d..ca977ca 100644 --- a/Omada Beta/config.yaml +++ b/Omada Beta/config.yaml @@ -1,7 +1,7 @@ --- name: Omada Controller Beta -image: dratrav/home-assistant-omada-beta -version: 5.14.32.3 +image: jeruntu/home-assistant-omada-beta +version: beta-5.15.6.4 slug: omada_controller_beta description: TP-Link Omada Controller software webui: https://[HOST]:[PORT:8043] diff --git a/Omada Dev/mbentley b/Omada Dev/mbentley index 8b3eb37..c5457df 160000 --- a/Omada Dev/mbentley +++ b/Omada Dev/mbentley @@ -1 +1 @@ -Subproject commit 8b3eb37079438635a99ba29d2e94314509a08761 +Subproject commit c5457df02f0586dc0372993269ce383eae189faf diff --git a/Omada Stable/config.yaml b/Omada Stable/config.yaml index 5e11b9c..7887ee0 100644 --- a/Omada Stable/config.yaml +++ b/Omada Stable/config.yaml @@ -1,7 +1,7 @@ --- name: Omada Controller Stable image: jeruntu/home-assistant-omada-stable -version: beta-5.14.30.7 +version: 5.14.32.4 slug: omada_controller_stable description: TP-Link Omada Controller software webui: https://[HOST]:[PORT:8043] From 47f0a788bd9a75ea463904b55f8cca86b906d696 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 16 Nov 2024 15:40:55 +0100 Subject: [PATCH 5/7] Improve pipeline --- .github/workflows/docker-image.yaml | 80 +++++++++++++++++++---------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 0a4b659..964c044 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -5,6 +5,8 @@ on: tags: - 'v*-stable' - 'v*-beta' + branches: + - '**' jobs: build-and-push: @@ -12,62 +14,84 @@ jobs: steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: - username: jeruntu + username: ${{ secrets.DOCKER_USER_NAME }} password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - name: Extract Docker tag from Git tag + - name: Extract Docker tag or branch id: version run: | - # Extract the Git tag name - GIT_TAG="${GITHUB_REF_NAME}" - - # Remove 'v' prefix and '-stable' or '-beta' suffix - DOCKER_TAG="${GIT_TAG#v}" # Remove leading 'v' - DOCKER_TAG="${DOCKER_TAG%-*}" # Remove trailing '-stable' or '-beta' + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + DOCKER_TAG="${GITHUB_REF_NAME#v}" + DOCKER_TAG="${DOCKER_TAG%-*}" + else + DOCKER_TAG="latest" + fi + if [[ -z "$DOCKER_TAG" ]]; then + echo "Error: DOCKER_TAG is empty!" >&2 + exit 1 + fi echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV - - name: Set image name and config file based on tag type + - name: Set image name and config file id: image_name run: | if [[ "${GITHUB_REF_NAME}" == *-beta ]]; then - echo "IMAGE_NAME=jeruntu/home-assistant-omada-beta" >> $GITHUB_ENV + echo "IMAGE_NAME=${{ secrets.DOCKER_USER_NAME }}/home-assistant-omada-beta" >> $GITHUB_ENV echo "CONFIG_FILE=Omada Beta/config.yaml" >> $GITHUB_ENV elif [[ "${GITHUB_REF_NAME}" == *-stable ]]; then - echo "IMAGE_NAME=jeruntu/home-assistant-omada-stable" >> $GITHUB_ENV + echo "IMAGE_NAME=${{ secrets.DOCKER_USER_NAME }}/home-assistant-omada-stable" >> $GITHUB_ENV echo "CONFIG_FILE=Omada Stable/config.yaml" >> $GITHUB_ENV + else + echo "IMAGE_NAME=${{ secrets.DOCKER_USER_NAME }}/home-assistant-omada-dev" >> $GITHUB_ENV + echo "CONFIG_FILE=Omada Beta/config.yaml" >> $GITHUB_ENV fi - - name: Install yq + - name: Set INSTALL_VER from config.yaml + run: | + EXPECTED_TAG=$(yq '.version' "${CONFIG_FILE}") + echo "INSTALL_VER=$EXPECTED_TAG" >> $GITHUB_ENV + + - name: Log key variables run: | - wget https://github.com/mikefarah/yq/releases/download/v4.27.3/yq_linux_amd64 -O /usr/local/bin/yq - chmod +x /usr/local/bin/yq + echo "Docker Image Name: ${{ env.IMAGE_NAME }}" + echo "Docker Tag: ${{ env.DOCKER_TAG }}" + echo "Install Version: ${{ env.INSTALL_VER }}" - name: Verify Docker tag matches config.yaml + if: startsWith(github.ref, 'refs/tags/') run: | - # Extract the expected tag from the config.yaml file - EXPECTED_TAG=$(yq '.version' "${CONFIG_FILE}") - - # Check if the expected tag matches the extracted Docker tag - if [[ "${EXPECTED_TAG}" != "${DOCKER_TAG}" ]]; then - echo "Error: Docker tag (${DOCKER_TAG}) does not match expected tag (${EXPECTED_TAG}) in ${CONFIG_FILE}." + if [[ "${INSTALL_VER}" != "${DOCKER_TAG}" ]]; then + echo "Error: Docker tag (${DOCKER_TAG}) does not match expected tag (${INSTALL_VER}) in ${CONFIG_FILE}." exit 1 fi - echo "INSTALL_VER=${DOCKER_TAG}" >> $GITHUB_ENV - - name: Build and push Docker image - if: success() - uses: docker/build-push-action@v5 + - name: Build Docker image for test builds + if: "!startsWith(github.ref, 'refs/tags/')" + run: | + docker buildx build \ + --platform linux/amd64 \ + --file "./Omada Dev/Dockerfile" \ + --build-arg INSTALL_VER=${{ env.INSTALL_VER }} \ + --tag ${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} \ + --cache-from=type=registry,ref=${{ env.IMAGE_NAME }}:cache \ + --cache-to=type=registry,ref=${{ env.IMAGE_NAME }}:cache,mode=max \ + --load \ + "./Omada Dev" + + - name: Build and push Docker image for release builds + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v6 with: push: true tags: | @@ -75,5 +99,7 @@ jobs: platforms: linux/amd64,linux/arm64 file: ./Omada Dev/Dockerfile context: ./Omada Dev + cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:cache + cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:cache,mode=max build-args: | INSTALL_VER=${{ env.INSTALL_VER }} From 34eebb005d3ca0de11d81687172266c356e3f333 Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 16 Nov 2024 16:50:34 +0100 Subject: [PATCH 6/7] Update README's and CHANGELOG's --- Omada Beta/CHANGELOG.md | 16 +++++++++++----- Omada Beta/README.md | 22 +++++++++++++++++----- Omada Stable/CHANGELOG.md | 36 ++++++++++++++++++------------------ Omada Stable/README.md | 19 ++++++++++++++----- README.md | 35 +++++++++++++++++++++++------------ 5 files changed, 83 insertions(+), 45 deletions(-) diff --git a/Omada Beta/CHANGELOG.md b/Omada Beta/CHANGELOG.md index dbcf9c0..6849788 100644 --- a/Omada Beta/CHANGELOG.md +++ b/Omada Beta/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## beta-5.15.6.4 2024-11-16 + +- Restructured the repostory, mbentley is now a submodule +- Implemented pipeline +- Updated to the upstream version beta-5.15.6.4 + ## 5.14.32.3 - 2024-11-10 - Upgrade to 5.14.32.3 @@ -13,7 +19,7 @@ - only storing essential data (`data` and `logs`) in the persistent `/data` volume ## 5.14.7 - 2024-09-5 -### Changed + - Updated to the upstream version 5.14.30.7 ## 5.13.300 - 2023-03-28 @@ -26,17 +32,17 @@ - Support for using the SSL certificate from Home Assistant in Omada ## 5.13.3 - 2023-08-31 + - Version bump to latest Omada Beta ## 5.9.3 - 2023-08-31 --Fix for the healthcheck Thanks nathanielks! +-Fix for the healthcheck Thanks nathanielks! ## 5.9.2 - 2023-04-3 -### Added -- Updated to 5.9.31 image +- Updated to 5.9.31 image ## 5.9.1 - 2023-03-11 -### Added + - Experimental support for AMD64 platforms. diff --git a/Omada Beta/README.md b/Omada Beta/README.md index 04962d1..a76ab47 100644 --- a/Omada Beta/README.md +++ b/Omada Beta/README.md @@ -1,8 +1,20 @@ -# Home Assistant Omada Add-On +# Home Assistant Omada Add-On Beta + This add-on brings the Omada Controller directly into Home Assistant running on an 64 bit ARM or a x64 processor. -Omada Beta contains the most recent port of the [docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller). If you need a more recent version, open an issue, or better submit a pull request. +Omada Beta contains the most recent port of the +[docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller). +If you need a more recent version, open an issue, or better submit a pull request. + +## Contribution -# Contribution -This add-on is a fork of Matt Bentleys [docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller) and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) would not have been possible without thier excellent work. Other than in the original docker omada controller, this add-on stores all persistent data in the /data directory, so that it is compatible with Home assistant. This Add-On would not be possible without the effort of other people. Pull requests for version -updates or new features are always more than welcome. Special thanks goes to DraTrav for pushing this Add-On forward! \ No newline at end of file +This add-on is a fork of Matt Bentleys +[docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller), +and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) +would not have been possible without thier excellent work. +Other than in the original docker omada controller, +this add-on stores all persistent data in the /data directory, +so that it is compatible with Home assistant. +This Add-On would not be possible without the effort of other people. +Pull requests for version updates or new features are always more than welcome. +Special thanks goes to DraTrav for pushing this Add-On forward! diff --git a/Omada Stable/CHANGELOG.md b/Omada Stable/CHANGELOG.md index 909dfca..dcc5322 100644 --- a/Omada Stable/CHANGELOG.md +++ b/Omada Stable/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 5.14.32.4 2024-11-16 + +- Restructured the repostory, mbentley is now a submodule +- Implemented pipeline +- Updated to the upstream version 5.14.32.4 + +## 5.14.7 - 2024-09-5 + +- Updated to the upstream version 5.14.30.7 + +## 5.14.1 - 2024-01-15 + +- Updated to the upstream version 5.14 + ## 5.13.300 - 2023-03-28 - Clean up Dockerfile and scripts @@ -10,31 +24,17 @@ - Support for using the SSL certificate from Home Assistant in Omada ## 5.13.3 - 2023-08-31 + - Version bump to latest Omada Beta ## 5.9.3 - 2023-08-31 --Fix for the healthcheck Thanks nathanielks! +- Fix for the healthcheck Thanks nathanielks! ## 5.9.2 - 2023-04-3 -### Added -- Updated to 5.9.31 image +- Updated to 5.9.31 image ## 5.9.1 - 2023-03-11 -### Added -- Experimental support for AMD64 platforms. - -## 5.13.1 - 2024-01-15 -### Changed -- Updated to the upstream version 5.13 - - -## 5.14.1 - 2024-01-15 -### Changed -- Updated to the upstream version 5.14 - -## 5.14.7 - 2024-09-5 -### Changed -- Updated to the upstream version 5.14.30.7 +- Experimental support for AMD64 platforms. diff --git a/Omada Stable/README.md b/Omada Stable/README.md index 64983c4..dfeacd4 100644 --- a/Omada Stable/README.md +++ b/Omada Stable/README.md @@ -1,10 +1,19 @@ # Home Assistant Omada Add-On + This add-on brings the Omada Controller directly into Home Assistant running on an ARM, x64 or x86 processor. -Omada Stable is created from Omada Beta (both in this repository), as soon as the beta add-on is updated to the latest -stable upstream version. +Omada Stable is created from Omada Beta (both in this repository), +as soon as the beta add-on is updated to the latest stable upstream version. +## Contribution -# Contribution -This add-on is a fork of Matt Bentleys [docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller) and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) would not have been possible without thier excellent work. Other than in the original docker omada controller, this add-on stores all persistent data in the /data directory, so that it is compatible with Home assistant. This Add-On would not be possible without the effort of other people. Pull requests for version -updates or new features are always more than welcome. Special thanks goes to DraTrav for pushing this Add-On forward! \ No newline at end of file +This add-on is a fork of Matt Bentleys +[docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller) +and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) +would not have been possible without thier excellent work. +Other than in the original docker omada controller, +this add-on stores all persistent data in the /data directory, +so that it is compatible with Home assistant. +This Add-On would not be possible without the effort of other people. +Pull requests for version updates or new features are always more than welcome. +Special thanks goes to DraTrav for pushing this Add-On forward! diff --git a/README.md b/README.md index 9f3b75b..f6285ec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Home Assistant Omada Add-On +![CI](https://github.com/jkunczik/home-assistant-omada/workflows/Build%20and%20Push%20Multi-Platform%20Docker%20Image/badge.svg) + This add-on brings the Omada Controller directly into Home Assistant running on an 64 bit ARM or a x64 processor. There exist two Add-On-Versions: @@ -8,7 +10,7 @@ There exist two Add-On-Versions: - Omada Beta Omada Stable is created from Omada Beta (both in this repository), as soon as the beta add-on is updated to the latest -stable upstream version. Omada Beta should also be fairly stable, because the Add-On is mostly consistent with the already tested [docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller), but might contain some Home-Assistant related inconsistencies or bugs. +stable upstream version. Omada Beta should also be fairly stable, because the Add-On is mostly consistent with the already tested [docker-omada-controller](https://github.com/mbentley/docker-omada-controller), but might contain some Home-Assistant related inconsistencies or bugs. ## Installation @@ -29,22 +31,31 @@ Set `Enable Home Assistant SSL` to `true`, and enter the full path for: - `Certificate file` - `Private key` -The default paths are compatible with the `Letsencrypt` Add-On. +The default paths are compatible with the `LetsEncrypt` Add-On. + +## Release a new version -## Update to a new version +To update the controller to a new version, the following steps have to be done: -To update the controller to a new version, the changes of Matt Bentleys docker-omada-controller are manually merged into `Omada Beta`. The following steps have to be done: -- 1. Move the current configuration of `Omada Beta` to `Omda Stable` -- 2. make sure that there are no changes in the Dockerfile -- 3. If there are changes in install.sh, copy it over, while keeping the Home Assistant specific processing steps in the bottom of the file. Add `aarch64` to the supported mongod architectures (`case "${ARCH}" in amd64|arm64|aarch64|"")`) -- 4. If there are changes in entrypoint.sh, replace the old contents with the new, keeping the Home Assistant specific steps in the top of the file. Also, change the `echo` to proper `bashio::log` statements as described in the file. -- 5. Build the addon locally by commenting out `image: dratrav/home-assistant-omada-beta` in `config.yaml` -- 6. If everything worked as expected, ask DraTrav to build and push the image to the Docker repository and to merge it into main +1. Upgrade the mbentley submodule to the latest on `master`. +2. Upgrade the version in `config.yaml` in either beta or stable. +This version should match exactly with one for the versions listed [here](https://github.com/mbentley/docker-omada-controller-url/blob/master/omada_ver_to_url.sh). +3. If everything is working as expected, you can create a new GitHub release. +The tag should match the version in the config.yaml exactly. +Otherwise the pipeline will fail. ## Contribution -This add-on is a fork of Matt Bentleys [docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller) and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) would not have been possible without thier excellent work. Other than in the original docker omada controller, this add-on stores all persistent data in the /data directory, so that it is compatible with Home assistant. This Add-On would not be possible without the effort of other people. Pull requests for version -updates or new features are always more than welcome. Special thanks goes to DraTrav for pushing this Add-On forward! +This add-on is a fork of Matt Bentleys +[docker-omada-cotroller](https://github.com/mbentley/docker-omada-controller), +and jkunczik [home-assistant-omada](https://github.com/jkunczik/home-assistant-omada) +would not have been possible without their excellent work. +Other than in the original docker omada controller, +this add-on stores all persistent data in the /data directory, +so that it is compatible with Home assistant. +This Add-On would not be possible without the effort of other people. +Pull requests for version updates or new features are always more than welcome. +Special thanks goes to DraTrav for pushing this Add-On forward! From e158033f5da7313bd909fed3f3b0ba0f7cc2a44d Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 16 Nov 2024 22:28:47 +0100 Subject: [PATCH 7/7] Implement dev version This is the default build for branches. --- .github/workflows/docker-image.yaml | 2 +- Omada Dev/config.yaml | 40 +++++++++++++++++++++++++++++ README.md | 7 ++--- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Omada Dev/config.yaml diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 964c044..77f8e1f 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -54,7 +54,7 @@ jobs: echo "CONFIG_FILE=Omada Stable/config.yaml" >> $GITHUB_ENV else echo "IMAGE_NAME=${{ secrets.DOCKER_USER_NAME }}/home-assistant-omada-dev" >> $GITHUB_ENV - echo "CONFIG_FILE=Omada Beta/config.yaml" >> $GITHUB_ENV + echo "CONFIG_FILE=Omada Dev/config.yaml" >> $GITHUB_ENV fi - name: Set INSTALL_VER from config.yaml diff --git a/Omada Dev/config.yaml b/Omada Dev/config.yaml new file mode 100644 index 0000000..c982697 --- /dev/null +++ b/Omada Dev/config.yaml @@ -0,0 +1,40 @@ +--- +name: Omada Controller Dev +image: jeruntu/home-assistant-omada-dev +version: beta-5.15.6.4 +slug: omada_controller_dev +description: TP-Link Omada Controller software +webui: https://[HOST]:[PORT:8043] +startup: application +arch: + - aarch64 + - amd64 +init: false +url: https://github.com/jkunczik/home-assistant-omada +map: + - ssl +options: + enable_hass_ssl: false + certfile: /ssl/fullchain.pem + keyfile: /ssl/privkey.pem +schema: + enable_hass_ssl: bool + certfile: str + keyfile: str +ports: + 8088/tcp: 8088 + 8043/tcp: 8043 + 8843/tcp: 8843 + 29810/tcp: 29810 + 29810/udp: 29810 + 29811/tcp: 29811 + 29811/udp: 29811 + 29812/tcp: 29812 + 29812/udp: 29812 + 29813/tcp: 29813 + 29813/udp: 29813 + 29814/tcp: 29814 + 29815/tcp: 29815 + 29815/udp: 29815 + 29816/tcp: 29816 + 29816/udp: 29816 diff --git a/README.md b/README.md index f6285ec..b31e5b5 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,16 @@ Set `Enable Home Assistant SSL` to `true`, and enter the full path for: - `Certificate file` - `Private key` -The default paths are compatible with the `LetsEncrypt` Add-On. +The default paths are compatible with the `Letsencrypt` Add-On. ## Release a new version To update the controller to a new version, the following steps have to be done: 1. Upgrade the mbentley submodule to the latest on `master`. -2. Upgrade the version in `config.yaml` in either beta or stable. -This version should match exactly with one for the versions listed [here](https://github.com/mbentley/docker-omada-controller-url/blob/master/omada_ver_to_url.sh). +2. Upgrade the version in `config.yaml` first in dev. +Than upgrade either beta or stable for the release. +This version should match exactly with one of the versions listed [here](https://github.com/mbentley/docker-omada-controller-url/blob/master/omada_ver_to_url.sh). 3. If everything is working as expected, you can create a new GitHub release. The tag should match the version in the config.yaml exactly. Otherwise the pipeline will fail.