From 1ec6ce4b5409ac1c3ef4ba48f2e725712b0b1078 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 2 Aug 2025 19:04:43 +0000 Subject: [PATCH] Revert 'clean' [nobuild] --- collabora/CHANGELOG.md | 6 + collabora/Dockerfile | 142 ++++++++++++++++++ collabora/README.md | 46 ++++++ collabora/apparmor.txt | 66 ++++++++ collabora/build.json | 9 ++ collabora/config.json | 40 +++++ collabora/rootfs/etc/services.d/collabora/run | 21 +++ collabora/updater.json | 8 + 8 files changed, 338 insertions(+) create mode 100644 collabora/CHANGELOG.md create mode 100644 collabora/Dockerfile create mode 100644 collabora/README.md create mode 100644 collabora/apparmor.txt create mode 100644 collabora/build.json create mode 100644 collabora/config.json create mode 100644 collabora/rootfs/etc/services.d/collabora/run create mode 100644 collabora/updater.json diff --git a/collabora/CHANGELOG.md b/collabora/CHANGELOG.md new file mode 100644 index 000000000..070de16c6 --- /dev/null +++ b/collabora/CHANGELOG.md @@ -0,0 +1,6 @@ +## 25.04.4.2.1-2 (02-08-2025) +- Minor bugs fixed +## 25.04.4.2.1 (02-08-2025) + +- Initial release +- Start Collabora Online via service and expose domain/credential options for Nextcloud integration diff --git a/collabora/Dockerfile b/collabora/Dockerfile new file mode 100644 index 000000000..71bfef789 --- /dev/null +++ b/collabora/Dockerfile @@ -0,0 +1,142 @@ +#============================# +# ALEXBELGIUM'S DOCKERFILE # +#============================# +# _.------. +# _.-` ('>.-`"""-. +# '.--'` _'` _ .--.) +# -' '-.-';` ` +# ' - _.' ``'--. +# '---` .-'""` +# /` +#=== Home Assistant Addon ===# + +################# +# 1 Build Image # +################# + +ARG BUILD_FROM +ARG BUILD_VERSION +FROM ${BUILD_FROM} + +################## +# 2 Modify Image # +################## + +# Set S6 wait time +ENV S6_CMD_WAIT_FOR_SERVICES=1 \ + S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ + S6_SERVICES_GRACETIME=0 + +USER root + +# Global LSIO modifications +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_lsio.sh" "/ha_lsio.sh" +ARG CONFIGLOCATION="/data" +RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh + +################## +# 3 Install apps # +################## + +# Copy local files +COPY rootfs/ / + +# Uses /bin for compatibility purposes +# hadolint ignore=DL4005 +RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \ + if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi + +# Modules +ARG MODULES="00-banner.sh 01-custom_script.sh" + +# Automatic modules download +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh" +RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh + +# Manual apps +ENV PACKAGES="" + +# Automatic apps & bashio +#ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh" +#RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh + +################ +# 4 Entrypoint # +################ + +# Add entrypoint +ENV S6_STAGE2_HOOK=/ha_entrypoint.sh +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh" + +# Entrypoint modifications +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh" +RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh + +# Standalone bashio command +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/bashio-standalone.sh" "/.bashio-standalone.sh" +RUN chmod 777 /.bashio-standalone.sh + +# +#WORKDIR / +#ENTRYPOINT [ "/usr/bin/env" ] +#CMD [ "/ha_entrypoint.sh" ] + +############ +# 5 Labels # +############ + +ARG BUILD_ARCH +ARG BUILD_DATE +ARG BUILD_DESCRIPTION +ARG BUILD_NAME +ARG BUILD_REF +ARG BUILD_REPOSITORY +ARG BUILD_VERSION +ENV BUILD_VERSION="${BUILD_VERSION}" +LABEL \ + io.hass.name="${BUILD_NAME}" \ + io.hass.description="${BUILD_DESCRIPTION}" \ + io.hass.arch="${BUILD_ARCH}" \ + io.hass.type="addon" \ + io.hass.version=${BUILD_VERSION} \ + maintainer="alexbelgium (https://github.com/alexbelgium)" \ + org.opencontainers.image.title="${BUILD_NAME}" \ + org.opencontainers.image.description="${BUILD_DESCRIPTION}" \ + org.opencontainers.image.vendor="Home Assistant Add-ons" \ + org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \ + org.opencontainers.image.licenses="MIT" \ + org.opencontainers.image.url="https://github.com/alexbelgium" \ + org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \ + org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.revision=${BUILD_REF} \ + org.opencontainers.image.version=${BUILD_VERSION} + +################# +# 6 Healthcheck # +################# + +# Avoid spamming logs +# hadolint ignore=SC2016 +RUN \ + # Handle Apache configuration + if [ -d /etc/apache2/sites-available ]; then \ + for file in /etc/apache2/sites-*/*.conf; do \ + sed -i '/ /etc/nginx/nginx.conf.new && \ + mv /etc/nginx/nginx.conf.new /etc/nginx/nginx.conf; \ + fi + +ENV HEALTH_PORT="9980" \ + HEALTH_URL="" +HEALTHCHECK \ + --interval=5s \ + --retries=5 \ + --start-period=30s \ + --timeout=25s \ + CMD curl -A "HealthCheck: Docker/1.0" -s -f "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1 diff --git a/collabora/README.md b/collabora/README.md new file mode 100644 index 000000000..8df514121 --- /dev/null +++ b/collabora/README.md @@ -0,0 +1,46 @@ +# Home assistant add-on: collabora + +[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium) +[![Donate][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA) + +![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcollabora%2Fconfig.json) +![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcollabora%2Fconfig.json) +![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fcollabora%2Fconfig.json) + +## About + +Collabora Online is a collaborative office suite based on LibreOffice technology. + +## Installation + +1. Click the Home Assistant My add-on store button below. +1. Click the "Install" button to install the add-on. +1. Start the add-on. +1. Check the logs of the add-on to see if everything went well. + +Open your Home Assistant instance and show the add add-on repository dialog + +## Configuration + +Webui can be found at or through Ingress. + +### Options + +Configure the add-on to allow access from your Nextcloud instance: + +- `domain`: Regex matching the Nextcloud host (for example `cloud\\.example\\.com`). +- `username` and `password`: Optional credentials for the Collabora admin console. + +### Custom Scripts and Environment Variables + +This addon supports custom scripts and environment variables through the `addon_config` mapping: + +- **Custom scripts**: See [Running Custom Scripts in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Running-custom-scripts-in-Addons) +- **Environment variables**: See [Add Environment Variables to your Addon](https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon) + +## Support + +Create an issue on GitHub + +[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20(no%20paypal)-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white +[paypal-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20with%20Paypal-0070BA?logo=paypal&style=flat&logoColor=white diff --git a/collabora/apparmor.txt b/collabora/apparmor.txt new file mode 100644 index 000000000..ca7141cd2 --- /dev/null +++ b/collabora/apparmor.txt @@ -0,0 +1,66 @@ +#include + +profile collabora_addon flags=(attach_disconnected,mediate_deleted) { + #include + + capability, + file, + signal, + mount, + umount, + remount, + network udp, + network tcp, + network dgram, + network stream, + network inet, + network inet6, + network netlink raw, + network unix dgram, + + capability setgid, + capability setuid, + capability sys_admin, + capability dac_read_search, + # capability dac_override, + # capability sys_rawio, + +# S6-Overlay + /init ix, + /run/{s6,s6-rc*,service}/** ix, + /package/** ix, + /command/** ix, + /run/{,**} rwk, + /dev/tty rw, + /bin/** ix, + /usr/bin/** ix, + /usr/lib/bashio/** ix, + /etc/s6/** rix, + /run/s6/** rix, + /etc/services.d/** rwix, + /etc/cont-init.d/** rwix, + /etc/cont-finish.d/** rwix, + /init rix, + /var/run/** mrwkl, + /var/run/ mrwkl, + /dev/i2c-1 mrwkl, + # Files required + /dev/fuse mrwkl, + /dev/sda1 mrwkl, + /dev/sdb1 mrwkl, + /dev/nvme0 mrwkl, + /dev/nvme1 mrwkl, + /dev/mmcblk0p1 mrwkl, + /dev/* mrwkl, + /tmp/** mrkwl, + + # Data access + /data/** rw, + + # suppress ptrace denials when using 'docker ps' or using 'ps' inside a container + ptrace (trace,read) peer=docker-default, + + # docker daemon confinement requires explict allow rule for signal + signal (receive) set=(kill,term) peer=/usr/bin/docker, + +} diff --git a/collabora/build.json b/collabora/build.json new file mode 100644 index 000000000..bdc8661c7 --- /dev/null +++ b/collabora/build.json @@ -0,0 +1,9 @@ +{ + "build_from": { + "aarch64": "collabora/code:latest-arm64", + "amd64": "collabora/code:latest-amd64" + }, + "codenotary": { + "signer": "alexandrep.github@gmail.com" + } +} diff --git a/collabora/config.json b/collabora/config.json new file mode 100644 index 000000000..15d1d1188 --- /dev/null +++ b/collabora/config.json @@ -0,0 +1,40 @@ +{ + "arch": [ + "aarch64", + "amd64" + ], + "codenotary": "alexandrep.github@gmail.com", + "description": "Collabora Online office suite", + "image": "ghcr.io/alexbelgium/collabora-{arch}", + "init": false, + "map": [ + "addon_config:rw" + ], + "name": "Collabora", + "options": { + "domain": "", + "username": "", + "password": "", + "PGID": 1000, + "PUID": 1000 + }, + "panel_admin": false, + "panel_icon": "mdi:file-document-edit-outline", + "ports": { + "9980/tcp": 9980 + }, + "ports_description": { + "9980/tcp": "Web interface (Not required for Ingress)" + }, + "schema": { + "domain": "str?", + "username": "str?", + "password": "password?", + "PGID": "int", + "PUID": "int", + "TZ": "str?" + }, + "slug": "collabora", + "url": "https://github.com/alexbelgium/hassio-addons", + "version": "25.04.4.2.1-2" +} diff --git a/collabora/rootfs/etc/services.d/collabora/run b/collabora/rootfs/etc/services.d/collabora/run new file mode 100644 index 000000000..accc07991 --- /dev/null +++ b/collabora/rootfs/etc/services.d/collabora/run @@ -0,0 +1,21 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +set -e + +if bashio::config.has_value 'domain'; then + domain="$(bashio::config 'domain')" + export domain +fi + +if bashio::config.has_value 'username'; then + username="$(bashio::config 'username')" + export username +fi + +if bashio::config.has_value 'password'; then + password="$(bashio::config 'password')" + export password +fi + +bashio::log.info "Starting Collabora Online..." +exec /usr/bin/entrypoint.sh coolwsd diff --git a/collabora/updater.json b/collabora/updater.json new file mode 100644 index 000000000..4ba7f08f9 --- /dev/null +++ b/collabora/updater.json @@ -0,0 +1,8 @@ +{ + "last_update": "02-08-2025", + "repository": "alexbelgium/hassio-addons", + "slug": "collabora", + "source": "github", + "upstream_repo": "CollaboraOnline/online", + "upstream_version": "25.04.4.2.1" +}