gitea: expose app.ini in addon_config folder for direct editing

Symlink /data/gitea/conf/app.ini -> /config/app.ini so users can read
and edit the full Gitea configuration via the HA file editor without
needing shell access. Existing installs migrate their app.ini on first
restart. Closes #1907.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D46Ef3nZZdbVuwUpPhCd4T
This commit is contained in:
Claude
2026-06-19 12:13:56 +00:00
parent 84e6a32ef3
commit 37148e39f6
4 changed files with 38 additions and 3 deletions

View File

@@ -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) ## 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) - 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)

View File

@@ -1,4 +1,3 @@
## &#9888; 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 # Home assistant add-on: Gitea
@@ -62,6 +61,15 @@ DOMAIN: "homeassistant.local"
ROOT_URL: "http://homeassistant.local:3000" 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 ### Custom Scripts and Environment Variables
This addon supports custom scripts and environment variables through the `addon_config` mapping: This addon supports custom scripts and environment variables through the `addon_config` mapping:

View File

@@ -97,5 +97,5 @@ schema:
slug: gitea slug: gitea
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/gitea 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]" webui: "[PROTO:ssl]://[HOST]:[PORT:3000]"

View File

@@ -2,7 +2,31 @@
# shellcheck shell=bash # shellcheck shell=bash
set -e 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 if [ ! -f "$file" ]; then
continue continue