Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions
b97d9c16da GitHub bot : README updated 2026-01-30 17:12:29 +00:00
Alexandre
f7d877b84e Merge pull request #2418 from alexbelgium/codex/fix-issue-#2416-in-hassio-addons
Fix Seafile env_vars export handling https://github.com/alexbelgium/hassio-addons/issues/2416
2026-01-30 16:58:13 +01:00
Alexandre
4624ab8aa2 Fix seafile env_vars export 2026-01-30 16:57:44 +01:00
Alexandre
a5eb85a8fd Fix seafile env_vars export 2026-01-30 16:55:56 +01:00
4 changed files with 40 additions and 8 deletions

View File

@@ -57,13 +57,13 @@ If you want to do add the repository manually, please follow the procedure highl
### Number of addons
- In the repository : 121
- Installed : 69094
- Installed : 77528
### Top 3
1. Filebrowser (8649x)
2. Portainer (4066x)
3. Netalertx (3804x)
1. Filebrowser (11110x)
2. Portainer (4539x)
3. Netalertx (4492x)
### Architectures used
@@ -278,7 +278,7 @@ If you want to do add the repository manually, please follow the procedure highl
![amd64][amd64-badge]
![ingress][ingress-badge]
✓ ![image](https://api.iconify.design/mdi/file-search.svg) [Filebrowser (8649x)](filebrowser/) : filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files
✓ ![image](https://api.iconify.design/mdi/file-search.svg) [Filebrowser (11110x)](filebrowser/) : filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Ffilebrowser%2Fconfig.yaml)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Ffilebrowser%2Fupdater.json)
@@ -641,7 +641,7 @@ If you want to do add the repository manually, please follow the procedure highl
![aarch64][aarch64-badge]
![amd64][amd64-badge]
✓ ![image](https://api.iconify.design/mdi/docker.svg) [Portainer (4066x)](portainer/) : Manage your Docker environment with ease
✓ ![image](https://api.iconify.design/mdi/docker.svg) [Portainer (4539x)](portainer/) : Manage your Docker environment with ease
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer%2Fconfig.yaml)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer%2Fupdater.json)
@@ -649,7 +649,7 @@ If you want to do add the repository manually, please follow the procedure highl
![amd64][amd64-badge]
![ingress][ingress-badge]
✓ [Portainer (4066x) Agent](portainer_agent/) : An agent used to manage all the resources in a Swarm cluster
✓ [Portainer (4539x) Agent](portainer_agent/) : An agent used to manage all the resources in a Swarm cluster
  ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer_agent%2Fconfig.yaml)
![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fportainer_agent%2Fupdater.json)

View File

@@ -1,4 +1,7 @@
## 12.0.18 (2026-03-20)
- Fix `env_vars` handling so extra environment variables are exported correctly.
## 12.0.17 (2026-03-12)
- Ensure `SERVICE_URL` and `FILE_SERVER_ROOT` are written to the active Seafile config path.

View File

@@ -128,5 +128,5 @@ services:
slug: seafile
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/seafile
version: "12.0.17"
version: "12.0.18"
webui: http://[HOST]:[PORT:8000]

View File

@@ -17,6 +17,9 @@ JSONSOURCE="/data/options.json"
mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}")
for KEYS in "${arr[@]}"; do
if [[ "${KEYS}" == "env_vars" ]]; then
continue
fi
# export key
VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
line="${KEYS}='${VALUE//[\"\']/}'"
@@ -33,6 +36,32 @@ for KEYS in "${arr[@]}"; do
find /opt/seafile -name '*.sh' -print0 | xargs -0 sed -i "1a export $line"
done
#######################################
# Apply extra environment variables #
#######################################
if jq -e '.env_vars? | length > 0' "${JSONSOURCE}" >/dev/null; then
bashio::log.info "Applying env_vars"
while IFS=$'\t' read -r ENV_NAME ENV_VALUE; do
if [[ -z "${ENV_NAME}" || "${ENV_NAME}" == "null" ]]; then
continue
fi
if bashio::config.false "verbose" || [[ "${ENV_NAME}" == *"PASS"* ]]; then
bashio::log.blue "${ENV_NAME}=******"
else
bashio::log.blue "${ENV_NAME}=${ENV_VALUE}"
fi
export "${ENV_NAME}=${ENV_VALUE}"
ENV_VALUE_ESCAPED=$(printf "%q" "${ENV_VALUE}")
ENV_LINE="export ${ENV_NAME}=${ENV_VALUE_ESCAPED}"
sed -i "1a ${ENV_LINE}" /home/seafile/*.sh 2>/dev/null
find /opt/seafile -name '*.sh' -print0 | xargs -0 sed -i "1a ${ENV_LINE}"
done < <(jq -r '.env_vars[] | [.name, .value] | @tsv' "${JSONSOURCE}")
fi
#################
# DATA_LOCATION #
#################