Spaces:
Paused
Paused
Download start.sh from darkfire514/FreshRSS: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/darkfire514/FreshRSS/resolve/main/start.sh
- Command line
-
hf download hf://spaces/darkfire514/FreshRSS/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/darkfire514/FreshRSS/resolve/main/start.sh
1.14 kB
| set -euo pipefail | |
| cd /app | |
| unset GITHUB_TOKEN | |
| data_dir="${WERSS_DATA_DIR:-/data}" | |
| case "$data_dir" in /*) ;; *) echo "WERSS_DATA_DIR must be an absolute path" >&2; exit 1;; esac | |
| mkdir -p "$data_dir" | |
| if [ ! -w "$data_dir" ]; then | |
| echo "Data directory is not writable by UID 1000: $data_dir" >&2 | |
| exit 1 | |
| fi | |
| # Do not remove an existing data directory with user files in it. | |
| if [ "$(readlink -f /app/data)" != "$(readlink -f "$data_dir")" ]; then | |
| if [ -L /app/data ]; then | |
| rm /app/data | |
| elif [ -d /app/data ]; then | |
| rmdir /app/data || { echo "Refusing to replace non-empty /app/data" >&2; exit 1; } | |
| fi | |
| ln -s "$data_dir" /app/data | |
| fi | |
| if [ ! -f "$data_dir/config.yaml" ]; then | |
| cp /app/config.template.yaml "$data_dir/config.yaml" | |
| fi | |
| if [ ! -e /app/config.yaml ] && [ ! -L /app/config.yaml ]; then | |
| ln -s "$data_dir/config.yaml" /app/config.yaml | |
| fi | |
| # Template/environment values remain runtime settings; no secrets are baked | |
| # into the image and existing persistent config is never overwritten. | |
| printf 'WeRSS Docker startup: port=%s, data=%s\n' "${PORT:-7860}" "$data_dir" | |
| exec /app/start.sh |