diff --git a/gitea/CHANGELOG.md b/gitea/CHANGELOG.md index 4ea21a570c..b9c1653a36 100644 --- a/gitea/CHANGELOG.md +++ b/gitea/CHANGELOG.md @@ -1,4 +1,7 @@ +## 1.26.2-2 (2026-06-19) +- Expose app.ini in the addon_config folder so users can edit it directly via the HA file editor + ## 1.26.2-1 (2026-06-19) - Fix SSH authentication failing with `chroot("/var/empty"): Operation not permitted [preauth]` by allowing `capability sys_chroot` in the AppArmor profile, which sshd needs for privilege-separation (#2653) diff --git a/gitea/README.md b/gitea/README.md index 16ab104e75..1bee233677 100644 --- a/gitea/README.md +++ b/gitea/README.md @@ -1,4 +1,3 @@ -## ⚠ Open Request : [✨ [REQUEST] Access to Gitea app.ini (opened 2025-06-10)](https://github.com/alexbelgium/hassio-addons/issues/1907) by [@UplandJacob](https://github.com/UplandJacob) # Home assistant add-on: Gitea @@ -62,6 +61,15 @@ DOMAIN: "homeassistant.local" ROOT_URL: "http://homeassistant.local:3000" ``` +### Direct app.ini Access + +The Gitea `app.ini` configuration file is exposed in the add-on's config folder (`/addon_configs/gitea/app.ini` on the host), making it directly editable via the HA file editor or Studio Code add-on. + +- **On first run**: complete the Gitea setup wizard, then restart the add-on. The generated `app.ini` will be copied to the addon_config folder automatically. +- **On subsequent runs**: edit `/addon_configs/gitea/app.ini` directly for any Gitea setting not covered by the options above. The add-on options (SSL, DOMAIN, ROOT_URL, APP_NAME) are still applied on top of your file each restart. + +See the [Gitea configuration cheat sheet](https://docs.gitea.com/administration/config-cheat-sheet) for all available options. + ### Custom Scripts and Environment Variables This addon supports custom scripts and environment variables through the `addon_config` mapping: diff --git a/gitea/config.yaml b/gitea/config.yaml index 9901ba9b6c..733e6a1d5a 100644 --- a/gitea/config.yaml +++ b/gitea/config.yaml @@ -97,5 +97,5 @@ schema: slug: gitea udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/gitea -version: "1.26.2-1" +version: "1.26.2-2" webui: "[PROTO:ssl]://[HOST]:[PORT:3000]" diff --git a/gitea/rootfs/etc/cont-init.d/99-run.sh b/gitea/rootfs/etc/cont-init.d/99-run.sh index 320107f2c1..757e271275 100755 --- a/gitea/rootfs/etc/cont-init.d/99-run.sh +++ b/gitea/rootfs/etc/cont-init.d/99-run.sh @@ -2,7 +2,31 @@ # shellcheck shell=bash set -e -for file in /data/gitea/conf/app.ini /etc/templates/app.ini; do +############################ +# EXPOSE APP.INI IN CONFIG # +############################ + +# Ensure the gitea conf directory exists +mkdir -p /data/gitea/conf + +# If a real file (not a symlink) exists, migrate it to /config so users can edit it +if [ -f "/data/gitea/conf/app.ini" ] && [ ! -L "/data/gitea/conf/app.ini" ]; then + if [ ! -f "/config/app.ini" ]; then + bashio::log.info "Migrating app.ini to addon_config folder for direct access" + cp /data/gitea/conf/app.ini /config/app.ini + fi + rm /data/gitea/conf/app.ini +fi + +# Symlink /data/gitea/conf/app.ini -> /config/app.ini so the file is visible in the +# addon_config folder (accessible via the HA file editor). When Gitea's first-run +# wizard writes the config it lands in /config/app.ini via this symlink. +if [ ! -L "/data/gitea/conf/app.ini" ]; then + ln -s /config/app.ini /data/gitea/conf/app.ini + bashio::log.info "app.ini is now accessible in your addon_config folder" +fi + +for file in /config/app.ini /etc/templates/app.ini; do if [ ! -f "$file" ]; then continue