mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 22:04:06 +02:00
Merge pull request #2279 from alexbelgium/codex/review-issue-#1753-for-closure-or-fix
Fix Seafile file server root configuration
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
||||||
|
|
||||||
|
## 12.0.15 (18-12-2025)
|
||||||
|
- Normalize `SERVICE_URL` and `FILE_SERVER_ROOT` values in `conf/seahub_settings.py` based on the add-on configuration to generate valid download links.
|
||||||
|
|
||||||
## 12.0.14 (13-09-2025)
|
## 12.0.14 (13-09-2025)
|
||||||
- Update to latest version from franchetti/seafile-arm
|
- Update to latest version from franchetti/seafile-arm
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ Webui can be found at <http://homeassistant:8000> (Seahub) and <http://homeassis
|
|||||||
3. Configure database (SQLite default, MariaDB recommended for production)
|
3. Configure database (SQLite default, MariaDB recommended for production)
|
||||||
4. Set proper file server root URL for external access
|
4. Set proper file server root URL for external access
|
||||||
|
|
||||||
|
> **File server URL**: The add-on now writes `SERVICE_URL` and `FILE_SERVER_ROOT` directly to `conf/seahub_settings.py`. `SERVICE_URL` uses the `url` option when set (otherwise `SERVER_IP` with port `8000`), while `FILE_SERVER_ROOT` follows the `FILE_SERVER_ROOT` option (defaulting to `http://<your host>:8082`). Keep `FILE_SERVER_ROOT` aligned with your accessible file server endpoint so download links resolve correctly.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Option | Type | Default | Description |
|
| Option | Type | Default | Description |
|
||||||
|
|||||||
@@ -128,5 +128,5 @@ services:
|
|||||||
slug: seafile
|
slug: seafile
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/seafile
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/seafile
|
||||||
version: 12.0.14
|
version: 12.0.15
|
||||||
webui: http://[HOST]:[PORT:8000]
|
webui: http://[HOST]:[PORT:8000]
|
||||||
|
|||||||
@@ -65,6 +65,54 @@ sed -i "s|/shared|$DATA_LOCATION|g" /docker_entrypoint.sh
|
|||||||
sed -i "s|/shared|$DATA_LOCATION|g" /home/seafile/*.sh
|
sed -i "s|/shared|$DATA_LOCATION|g" /home/seafile/*.sh
|
||||||
#sed -i "s=cp -r ./media $DATA_LOCATION/=chown -R seafile:seafile $DATA_LOCATION/* && chmod -R 777 $DATA_LOCATION/media && cp -rnf ./media/. $DATA_LOCATION/media ||true=g" /home/seafile/*.sh
|
#sed -i "s=cp -r ./media $DATA_LOCATION/=chown -R seafile:seafile $DATA_LOCATION/* && chmod -R 777 $DATA_LOCATION/media && cp -rnf ./media/. $DATA_LOCATION/media ||true=g" /home/seafile/*.sh
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Configure service URL and file server root #
|
||||||
|
#############################################
|
||||||
|
|
||||||
|
bashio::log.info "Configuring Seafile URLs"
|
||||||
|
|
||||||
|
SERVER_IP_CONFIG=$(bashio::config 'SERVER_IP')
|
||||||
|
SERVICE_URL_CONFIG=$(bashio::config 'url')
|
||||||
|
FILE_SERVER_ROOT_CONFIG=$(bashio::config 'FILE_SERVER_ROOT')
|
||||||
|
FILE_PORT_CONFIG=$(bashio::config 'PORT')
|
||||||
|
|
||||||
|
DEFAULT_HOST=${SERVER_IP_CONFIG:-homeassistant.local}
|
||||||
|
DEFAULT_FILE_PORT=${FILE_PORT_CONFIG:-8082}
|
||||||
|
|
||||||
|
normalize_url() {
|
||||||
|
local raw_url="${1%/}"
|
||||||
|
local default_scheme="$2"
|
||||||
|
|
||||||
|
if [[ -z "${raw_url}" || "${raw_url}" == "null" ]]; then
|
||||||
|
echo ""
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${raw_url}" =~ ^https?:// ]]; then
|
||||||
|
echo "${raw_url}"
|
||||||
|
else
|
||||||
|
echo "${default_scheme}://${raw_url}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
SERVICE_URL_VALUE=$(normalize_url "${SERVICE_URL_CONFIG:-${DEFAULT_HOST}:8000}" "http")
|
||||||
|
FILE_SERVER_ROOT_VALUE=$(normalize_url "${FILE_SERVER_ROOT_CONFIG:-${DEFAULT_HOST}:${DEFAULT_FILE_PORT}}" "http")
|
||||||
|
|
||||||
|
SEAHUB_SETTINGS_FILE="${DATA_LOCATION}/conf/seahub_settings.py"
|
||||||
|
mkdir -p "$(dirname "${SEAHUB_SETTINGS_FILE}")"
|
||||||
|
touch "${SEAHUB_SETTINGS_FILE}"
|
||||||
|
|
||||||
|
sed -i '/^SERVICE_URL *=/d' "${SEAHUB_SETTINGS_FILE}"
|
||||||
|
sed -i '/^FILE_SERVER_ROOT *=/d' "${SEAHUB_SETTINGS_FILE}"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "SERVICE_URL = \"${SERVICE_URL_VALUE}\""
|
||||||
|
echo "FILE_SERVER_ROOT = \"${FILE_SERVER_ROOT_VALUE}\""
|
||||||
|
} >> "${SEAHUB_SETTINGS_FILE}"
|
||||||
|
|
||||||
|
bashio::log.info "SERVICE_URL set to ${SERVICE_URL_VALUE}"
|
||||||
|
bashio::log.info "FILE_SERVER_ROOT set to ${FILE_SERVER_ROOT_VALUE}"
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# Define database #
|
# Define database #
|
||||||
###################
|
###################
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"github_fulltag": "true",
|
"github_fulltag": "true",
|
||||||
"last_update": "13-09-2025",
|
"last_update": "18-12-2025",
|
||||||
"paused": false,
|
"paused": false,
|
||||||
"repository": "alexbelgium/hassio-addons",
|
"repository": "alexbelgium/hassio-addons",
|
||||||
"slug": "seafile",
|
"slug": "seafile",
|
||||||
|
|||||||
Reference in New Issue
Block a user