diff --git a/Dockerfile b/Dockerfile index 591a5e2..0de5fbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,35 @@ -FROM bfren/nginx-php:php8.2-6.0.21 +FROM bfren/nginx-php:php8.3-7.1.5 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-freshrss" ARG BF_IMAGE ARG BF_VERSION +COPY ./overlay / + ENV \ - # disable debug output by default - BF_DEBUG=0 \ # server environment ('production' or 'development' for additional log messages) - FRESHRSS_ENVIRONMENT="production" \ + BF_FR_ENVIRONMENT="production" \ # base URL of FreshRSS instance - FRESHRSS_BASE_URL= \ + BF_FR_BASE_URL= \ # display language (see FreshRSS documentation for supported language) - FRESHRSS_LANG="en" \ + BF_FR_LANGUAGE="en" \ # default user name - FRESHRSS_USER_NAME= \ + BF_FR_USER_NAME= \ # default user password - FRESHRSS_USER_PASS= \ + BF_FR_USER_PASS= \ # database type ('sqlite', 'mysql' or 'pgsql') - FRESHRSS_DB_TYPE="mysql" \ + BF_FR_DB_TYPE="mysql" \ # database host - FRESHRSS_DB_HOST= \ + BF_FR_DB_HOST= \ # database user - FRESHRSS_DB_USER= \ + BF_FR_DB_USER= \ # database password - FRESHRSS_DB_PASS= \ + BF_FR_DB_PASS= \ # database name - FRESHRSS_DB_NAME="freshrss"\ + BF_FR_DB_NAME="freshrss"\ # database table prefix (will have an underscore added, e.g. 'fr_') - FRESHRSS_DB_PREFIX="fr" - -COPY ./overlay / + BF_FR_DB_PREFIX="fr" RUN bf-install diff --git a/LICENSE b/LICENSE index 42e7058..9cf654f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2023 bfren +Copyright (c) 2021-2024 bfren Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8780bc8..e1ba285 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [Docker Repository](https://hub.docker.com/r/bfren/freshrss) - [bfren ecosystem](https://github.com/bfren/docker) -Comes with [FreshRSS](https://freshrss.org/) preinstalled, along with all the required and recommended PHP 8.2 modules. +Comes with [FreshRSS](https://freshrss.org/) preinstalled, along with all the required and recommended PHP 8.3 modules. ## Contents @@ -29,15 +29,18 @@ See the [Nginx](https://github.com/bfren/docker-nginx) and [Nginx + PHP](https:/ See the [Nginx + PHP](https://github.com/bfren/docker-nginx-php) image for details of `www.conf` and `php.ini` overrides using environment variables. -| Variable | Values | Description | Default | -| -------------------- | ------ | ------------------------------------------ | ----------------- | -| `FRESHRSS_BASE_URL` | string | External URL used to access this instance. | *None* - required | -| `FRESHRSS_USER_NAME` | string | Default user name. | *None* - required | -| `FRESHRSS_USER_PASS` | string | Default user password. | *None* - required | -| `FRESHRSS_DB_HOST` | string | Database host. | *None* - required | -| `FRESHRSS_DB_USER` | string | Database username. | *None* - required | -| `FRESHRSS_DB_PASS` | string | Database password. | *None* - required | -| `FRESHRSS_DB_NAME` | string | Database table name. | *None* - required | +| Variable | Values | Description | Default | +| --------------------- | ------ | ------------------------------------------------------------------------------------ | ------------------------- | +| `BF_FR_ENVIRONMENT` | string | The name of the environment to use - set to 'development' for more verbose logging. | "production" - required | +| `BF_FR_BASE_URL` | string | External URL used to access this instance. | *None* - required | +| `BF_FR_LANGUAGE` | string | Default language to use for new users. | "en" - required | +| `BF_FR_USER_NAME` | string | Default user name. | *None* - required | +| `BF_FR_USER_PASS` | string | Default user password. | *None* - required | +| `BF_FR_DB_HOST` | string | Database host. | *None* - required | +| `BF_FR_DB_USER` | string | Database username. | *None* - required | +| `BF_FR_DB_PASS` | string | Database password. | *None* - required | +| `BF_FR_DB_NAME` | string | Database table name. | "freshrss" - required | +| `BF_FR_DB_PREFIX` | string | Database table prefix. | "fr" - required | ## Licence @@ -45,4 +48,4 @@ See the [Nginx + PHP](https://github.com/bfren/docker-nginx-php) image for detai ## Copyright -> Copyright (c) 2021-2023 [bfren](https://bfren.dev) (unless otherwise stated) +> Copyright (c) 2021-2024 [bfren](https://bfren.dev) (unless otherwise stated) diff --git a/VERSION b/VERSION index 402b44e..0c89fc9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.21 \ No newline at end of file +4.0.0 \ No newline at end of file diff --git a/VERSION_MAJOR b/VERSION_MAJOR index e440e5c..bf0d87a 100644 --- a/VERSION_MAJOR +++ b/VERSION_MAJOR @@ -1 +1 @@ -3 \ No newline at end of file +4 \ No newline at end of file diff --git a/VERSION_MINOR b/VERSION_MINOR index f398a20..389f774 100644 --- a/VERSION_MINOR +++ b/VERSION_MINOR @@ -1 +1 @@ -3.0 \ No newline at end of file +4.0 \ No newline at end of file diff --git a/overlay/etc/bf/init.d/10-env-nginx-root b/overlay/etc/bf/init.d/10-env-nginx-root deleted file mode 100644 index 9cbe602..0000000 --- a/overlay/etc/bf/init.d/10-env-nginx-root +++ /dev/null @@ -1,13 +0,0 @@ -#!/command/with-contenv sh - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# Add environment variables. -#====================================================================================================================== - -FRESHRSS_SRC=${BF_SRC}/freshrss -bf-env "FRESHRSS_SRC" "${FRESHRSS_SRC}" -bf-env "NGINX_PUBLIC" "${FRESHRSS_SRC}/p" diff --git a/overlay/etc/bf/init.d/10-env_public.nu b/overlay/etc/bf/init.d/10-env_public.nu new file mode 100644 index 0000000..1b95e2e --- /dev/null +++ b/overlay/etc/bf/init.d/10-env_public.nu @@ -0,0 +1,9 @@ +use bf +bf env load + +# Override Nginx public environment variable to point to FreshRSS source +def main [] { + let fr_src = $"(bf env ETC_SRC)/freshrss" + bf env set FR_SRC $fr_src + bf env set NGINX_PUBLIC $"($fr_src)/p" +} diff --git a/overlay/etc/bf/init.d/30-env b/overlay/etc/bf/init.d/30-env deleted file mode 100644 index 15e5b39..0000000 --- a/overlay/etc/bf/init.d/30-env +++ /dev/null @@ -1,18 +0,0 @@ -#!/command/with-contenv sh - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# Add environment variables. -#====================================================================================================================== - -bf-env "FRESHRSS_LIB" "${BF_LIB}/freshrss" - -FRESHRSS_DATA="/data" -bf-env "FRESHRSS_DATA" "${FRESHRSS_DATA}" -bf-env "FRESHRSS_CONFIG" "${FRESHRSS_DATA}/config.php" - -bf-env "FRESHRSS_CLI" "${FRESHRSS_SRC}/cli" -bf-env "FRESHRSS_DATA_SRC" "${FRESHRSS_SRC}/data" diff --git a/overlay/etc/bf/init.d/30-env.nu b/overlay/etc/bf/init.d/30-env.nu new file mode 100644 index 0000000..f760478 --- /dev/null +++ b/overlay/etc/bf/init.d/30-env.nu @@ -0,0 +1,13 @@ +use bf +bf env load + +# Set environment variables +def main [] { + let fr_data = "/data" + bf env set FR_DATA $fr_data + bf env set FR_CONFIG $"($fr_data)/config.php" + + let fr_src = bf env FR_SRC + bf env set FR_SRC_CLI $"($fr_src)/cli" + bf env set FR_SRC_DATA $"($fr_src)/data" +} diff --git a/overlay/etc/bf/init.d/31-fr-setup-data.nu b/overlay/etc/bf/init.d/31-fr-setup-data.nu new file mode 100644 index 0000000..4ffa724 --- /dev/null +++ b/overlay/etc/bf/init.d/31-fr-setup-data.nu @@ -0,0 +1,19 @@ +use bf +use bf-freshrss +bf env load + +def main [] { + # get variables + let fr_data = bf env FR_DATA + let fr_src_data = bf env FR_SRC_DATA + + # ensure /data is symlinked from source + if ($fr_src_data | bf fs is_not_symlink) { + bf write $"Deleting ($fr_src_data) and recreating it as a symlink." + rm --force --recursive $fr_src_data + ^ln -s $fr_data $fr_src_data + } + + # if there is a valid config file, mark the installation as complete + if (bf env FR_CONFIG | path exists) { bf-freshrss install complete } +} diff --git a/overlay/etc/bf/init.d/31-freshrss-setup-data b/overlay/etc/bf/init.d/31-freshrss-setup-data deleted file mode 100644 index ffe14bb..0000000 --- a/overlay/etc/bf/init.d/31-freshrss-setup-data +++ /dev/null @@ -1,18 +0,0 @@ -#!/command/with-contenv bash - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# If FRESHRSS_SRC doesn't exist, the source files have not been downloaded correctly. -#====================================================================================================================== - -[[ ! -d ${FRESHRSS_SRC} ]] && bf-error "FreshRSS source files cannot be found." - - -#====================================================================================================================== -# Run setup content executable. -#====================================================================================================================== - -${FRESHRSS_LIB}/setup-data diff --git a/overlay/etc/bf/init.d/32-fr-setup-install.nu b/overlay/etc/bf/init.d/32-fr-setup-install.nu new file mode 100644 index 0000000..645af93 --- /dev/null +++ b/overlay/etc/bf/init.d/32-fr-setup-install.nu @@ -0,0 +1,69 @@ +use bf +use bf-freshrss +bf env load + +def main [] { + # get source data directory + let fr_src_data = bf env FR_SRC_DATA + + # if data source is not a symlink, the content setup has not worked correctly + if ($fr_src_data | bf fs is_not_symlink) { bf write error $"($fr_src_data) is not set up correctly." } + + # if an existing installation was detected, do not proceed + if (bf env check FR_INSTALLED) { + bf write "Existing installation detected - do not reinstall." + bf-freshrss install complete + return + } + + # get variables + let fr_user = bf env FR_USER + let fr_pass = bf env FR_PASS + let fr_environment = bf env FR_ENVIRONMENT + let fr_language = bf env FR_LANGUAGE + let fr_base_url = bf env FR_BASE_URL + let fr_db_type = bf env FR_DB_TYPE + let fr_db_host = bf env FR_DB_HOST + let fr_db_user = bf env FR_DB_USER + let fr_db_pass = bf env FR_DB_PASS + let fr_db_name = bf env FR_DB_NAME + let fr_db_prefix = bf env FR_DB_PREFIX + + # use CLI to run automated installation + bf write "Using CLI to install FreshRSS." + cd (bf env FR_SRC) + + # ensure all the needed directories are in the data dir + bf write " .. preparing data directories" + ^php ./cli/prepare.php + + # install default database + bf write " .. installing database" + let args = [ + "--default_user" $fr_user + "--environment" $fr_environment + "--base_url" $fr_base_url + "--language" $fr_language + "--db-type" $fr_db_type + "--db-host" $fr_db_host + "--db-user" $fr_db_user + "--db-password" $fr_db_pass + "--db-base" $fr_db_name + "--db-prefix" $fr_db_prefix + "--disable_update" "true" + ] + ^php ./cli/do-install.php ...$args + + # create user + bf write " .. creating user account" + ^php ./cli/create-user.php --user $fr_user --password $fr_pass + ^php ./cli/actualize-user.php --user $fr_user + + # reset permissions + cd .. + ^sh cli/access-permissions.sh + bf ch --owner www:www --recurse (bf env FR_DATA) + + # setup complete + bf-freshrss install complete +} diff --git a/overlay/etc/bf/init.d/32-freshrss-setup-install b/overlay/etc/bf/init.d/32-freshrss-setup-install deleted file mode 100644 index 7659085..0000000 --- a/overlay/etc/bf/init.d/32-freshrss-setup-install +++ /dev/null @@ -1,19 +0,0 @@ -#!/command/with-contenv bash - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# If FRESHRSS_DATA_SRC is not a symlink, the content setup has not worked correctly. -#====================================================================================================================== - -[[ ! -L "${FRESHRSS_DATA_SRC}" ]] && bf-error "${FRESHRSS_DATA_SRC} is not set up correctly." - - -#====================================================================================================================== -# Run setup content executable. -#====================================================================================================================== - -${FRESHRSS_LIB}/setup-install -freshrss-setup-complete diff --git a/overlay/etc/bf/init.d/33-fr-check.nu b/overlay/etc/bf/init.d/33-fr-check.nu new file mode 100644 index 0000000..2735c88 --- /dev/null +++ b/overlay/etc/bf/init.d/33-fr-check.nu @@ -0,0 +1,15 @@ +use bf +use bf-freshrss +bf env load + +def main [] { + # check whether or not the application is installed + if (bf-freshrss install check) { + bf clean + bf write ok "FreshRSS is installed." + return + } + + # installation has not been detected or successful + bf write error "FreshRSS setup did not complete successfully, terminating container." +} diff --git a/overlay/etc/bf/init.d/33-freshrss-check b/overlay/etc/bf/init.d/33-freshrss-check deleted file mode 100644 index a42650b..0000000 --- a/overlay/etc/bf/init.d/33-freshrss-check +++ /dev/null @@ -1,18 +0,0 @@ -#!/command/with-contenv bash - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# If setup was not completed succesfully, terminate and close down the container. -#====================================================================================================================== - -if [ "${SETUP_COMPLETE-}" = "1" ] ; then - bf-clear - bf-ok "FreshRSS setup complete." - exit 0 -fi - -bf-notok "FreshRSS setup did not complete successfully, terminating container." -bf-cont-terminate diff --git a/overlay/etc/nginx/helpers/php-try-php.conf b/overlay/etc/nginx/helpers/php-try-php.conf index cf5fcdd..d703a53 100644 --- a/overlay/etc/nginx/helpers/php-try-php.conf +++ b/overlay/etc/nginx/helpers/php-try-php.conf @@ -3,7 +3,7 @@ location ~ ^.+?\.php(/.*)?$ { fastcgi_split_path_info ^(.+\.php)(/.*)$; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; - fastcgi_pass php; + fastcgi_pass php-fpm; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } \ No newline at end of file diff --git a/overlay/etc/nu/scripts/bf-freshrss/install.nu b/overlay/etc/nu/scripts/bf-freshrss/install.nu new file mode 100644 index 0000000..35d8f0c --- /dev/null +++ b/overlay/etc/nu/scripts/bf-freshrss/install.nu @@ -0,0 +1,9 @@ +use bf + +const installed = "FR_INSTALLED" + +# Mark the application as installed. +export def complete [] { bf env set $installed 1} + +# Check whether or not the application is installed. +export def check [] { bf env check $installed } diff --git a/overlay/etc/nu/scripts/bf-freshrss/mod.nu b/overlay/etc/nu/scripts/bf-freshrss/mod.nu new file mode 100644 index 0000000..8960ec8 --- /dev/null +++ b/overlay/etc/nu/scripts/bf-freshrss/mod.nu @@ -0,0 +1 @@ +export module install.nu diff --git a/overlay/etc/periodic/15min/freshrss-cron b/overlay/etc/periodic/15min/fr-cron similarity index 95% rename from overlay/etc/periodic/15min/freshrss-cron rename to overlay/etc/periodic/15min/fr-cron index 9a87b97..7734804 100644 --- a/overlay/etc/periodic/15min/freshrss-cron +++ b/overlay/etc/periodic/15min/fr-cron @@ -8,4 +8,4 @@ export BF_E=`basename ${0}` # Call freshrss-refresh executable #====================================================================================================================== -freshrss-refresh +fr-cron diff --git a/overlay/tmp/FRESHRSS_MINOR b/overlay/tmp/FRESHRSS_MINOR index e342dea..193d140 100644 --- a/overlay/tmp/FRESHRSS_MINOR +++ b/overlay/tmp/FRESHRSS_MINOR @@ -1 +1 @@ -1.22 \ No newline at end of file +1.23 \ No newline at end of file diff --git a/overlay/tmp/FRESHRSS_REVISION b/overlay/tmp/FRESHRSS_REVISION index 24b38a9..1b50fc3 100644 --- a/overlay/tmp/FRESHRSS_REVISION +++ b/overlay/tmp/FRESHRSS_REVISION @@ -1 +1 @@ -1.22.1 \ No newline at end of file +1.23.1 \ No newline at end of file diff --git a/overlay/tmp/PHP_BUILD b/overlay/tmp/PHP_BUILD deleted file mode 100644 index 2c28853..0000000 --- a/overlay/tmp/PHP_BUILD +++ /dev/null @@ -1 +0,0 @@ -8.2.10-r0 \ No newline at end of file diff --git a/overlay/tmp/PHP_EXT b/overlay/tmp/PHP_EXT new file mode 100644 index 0000000..78ba494 --- /dev/null +++ b/overlay/tmp/PHP_EXT @@ -0,0 +1,20 @@ +-ctype +-curl +-dom +-fileinfo +-gmp +-iconv +-intl +-mbstring +-opcache +-pdo_mysql +-pdo_sqlite +-pdo_pgsql +-phar +-session +-simplexml +-tokenizer +-xml +-xmlreader +-xmlwriter +-zip \ No newline at end of file diff --git a/overlay/tmp/install b/overlay/tmp/install index b69d189..759e01d 100644 --- a/overlay/tmp/install +++ b/overlay/tmp/install @@ -1,94 +1,51 @@ -#!/bin/sh +#!/usr/bin/nu -set -euo pipefail -export BF_E=`basename ${0}` +use bf +use bf-php +# Absolute path to WordPress source directory +const src = "/etc/bf/src/freshrss" -#====================================================================================================================== -# Get PHP version. -#====================================================================================================================== +def main [] { + # installed required and recommended extensions + cd /tmp + bf write $"Installing PHP extensions." + bf-php ext install_from_file -cd /tmp + # install FreshRSS source files, content directory and default plugins + bf write debug $"FreshRSS source directory: ($src)." + install_source -PHP_VERSION=$(cat PHP_BUILD) -bf-echo "PHP version ${PHP_VERSION}." + # add bf-freshrss module to config + bf config use bf-freshrss + # cleanup + bf write "Removing /www files and directories." + rm -rf /www/* +} -#====================================================================================================================== -# Install PHP dependencies. -#====================================================================================================================== +# Download and install FreshRSS source files +def install_source [] { + # add dependencies + bf write "Adding installation dependencies." install_source + bf pkg install ["--virtual .install" "git"] -bf-echo "Installing installation dependencies..." -apk add --no-cache --virtual .install \ - git -bf-done + # get version + let fr_version = bf fs read FRESHRSS_REVISION -bf-echo "Installing required PHP modules for v${PHP_VERSION}..." -apk add --no-cache \ - php82=${PHP_VERSION} \ - php82-ctype=${PHP_VERSION} \ - php82-curl=${PHP_VERSION} \ - php82-dom=${PHP_VERSION} \ - php82-fileinfo=${PHP_VERSION} \ - php82-gmp=${PHP_VERSION} \ - php82-iconv=${PHP_VERSION} \ - php82-intl=${PHP_VERSION} \ - php82-mbstring=${PHP_VERSION} \ - php82-opcache=${PHP_VERSION} \ - php82-pdo_mysql=${PHP_VERSION} \ - php82-pdo_sqlite=${PHP_VERSION} \ - php82-pdo_pgsql=${PHP_VERSION} \ - php82-phar=${PHP_VERSION} \ - php82-session=${PHP_VERSION} \ - php82-simplexml=${PHP_VERSION} \ - php82-tokenizer=${PHP_VERSION} \ - php82-xml=${PHP_VERSION} \ - php82-xmlreader=${PHP_VERSION} \ - php82-xmlwriter=${PHP_VERSION} \ - php82-zip=${PHP_VERSION} -bf-done + # save FreshRSS version to build log + bf build add FreshRSS $fr_version + # clone source files + bf write $"Cloning FreshRSS ($fr_version) into ($src)." + ^git clone --depth 1 --branch $fr_version https://github.com/FreshRSS/FreshRSS $src -#====================================================================================================================== -# Get FreeScout environment variables. -#====================================================================================================================== + # set permissions + bf write $"Setting permissions on ($src)." install_source + [$src "www:www" 0400 0500] | bf ch apply + cd $src + ^sh cli/access-permissions.sh -SRC=/etc/bf/src -bf-echo "Source directory: ${SRC}." - -FRESHRSS=freshrss -FRESHRSS_SRC=${SRC}/${FRESHRSS} -bf-echo "FreshRSS source directory: ${FRESHRSS_SRC}." - -FRESHRSS_VERSION=$(cat FRESHRSS_REVISION) -bf-echo "FreshRSS version ${FRESHRSS_VERSION}." - - -#====================================================================================================================== -# Download and install FreshRSS. -#====================================================================================================================== - -bf-echo "Cloning FreshRSS v${FRESHRSS_VERSION} into ${FRESHRSS_SRC}" -git clone --depth 1 --branch ${FRESHRSS_VERSION} https://github.com/FreshRSS/FreshRSS ${FRESHRSS_SRC} -bf-done - - -#====================================================================================================================== -# Set permissions on source files. -#====================================================================================================================== - -bf-echo "Setting permissions on ${FRESHRSS_SRC}..." -bf-ch -o www:www -m 0755 -t d ${FRESHRSS_SRC} -bf-ch -o www:www -m 0644 -t f ${FRESHRSS_SRC} -bf-done - - -#====================================================================================================================== -# Cleanup. -#====================================================================================================================== - -bf-echo "Removing /www files and directories." -rm -rf /www/* - -bf-echo "Removing installation dependencies." -apk del .install + # remove installation dependencies + bf pkg remove [".install"] +} diff --git a/overlay/usr/bin/bf/freshrss-setup-complete b/overlay/usr/bin/bf/fr-cron similarity index 67% rename from overlay/usr/bin/bf/freshrss-setup-complete rename to overlay/usr/bin/bf/fr-cron index 19d1c5a..c4eea35 100644 --- a/overlay/usr/bin/bf/freshrss-setup-complete +++ b/overlay/usr/bin/bf/fr-cron @@ -1,11 +1,12 @@ -#!/command/with-contenv bash +#!/bin/withenv sh set -euo pipefail export BF_E=`basename ${0}` #====================================================================================================================== -# Add setup complete environment variable. +# Execute FreshRSS cron #====================================================================================================================== -bf-env "SETUP_COMPLETE" "1" +bf-write-debug "Executing FreshRSS cron." fr-cron +^php "$(bf-env FR_SRC)/app/actualize_script.php" diff --git a/overlay/usr/bin/bf/freshrss-refresh b/overlay/usr/bin/bf/freshrss-refresh deleted file mode 100644 index 3773d87..0000000 --- a/overlay/usr/bin/bf/freshrss-refresh +++ /dev/null @@ -1,12 +0,0 @@ -#!/command/with-contenv bash - -set -euo pipefail -export BF_E=`basename ${0}` - - -#====================================================================================================================== -# Refresh FreshRSS. -#====================================================================================================================== - -bf-debug "Refreshing FreshRSS feeds." -php ${FRESHRSS_SRC}/app/actualize_script.php diff --git a/overlay/usr/lib/bf/freshrss/setup-data b/overlay/usr/lib/bf/freshrss/setup-data deleted file mode 100644 index f65d897..0000000 --- a/overlay/usr/lib/bf/freshrss/setup-data +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -euo pipefail - - -#====================================================================================================================== -# Create /data symlink. -#====================================================================================================================== - -if [ ! -L ${FRESHRSS_DATA_SRC} ] ; then - - bf-echo "Deleting ${FRESHRSS_DATA_SRC} and recreating it as a symlink..." "freshrss/setup-data" - rm -rf ${FRESHRSS_DATA_SRC} - ln -s ${FRESHRSS_DATA} ${FRESHRSS_DATA_SRC} - bf-done "freshrss/setup-data" - -fi - - -#====================================================================================================================== -# If a valid config file exist, mark the installation as complete. -#====================================================================================================================== - -[[ -f "${FRESHRSS_CONFIG}" ]] && bf-env "FRESHRSS_INSTALLED" "1" "freshrss/setup-data" diff --git a/overlay/usr/lib/bf/freshrss/setup-install b/overlay/usr/lib/bf/freshrss/setup-install deleted file mode 100644 index b0ca25a..0000000 --- a/overlay/usr/lib/bf/freshrss/setup-install +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -set -euo pipefail - - -#====================================================================================================================== -# If an existing installation was detected, do not proceed. -#====================================================================================================================== - -if [ "${FRESHRSS_INSTALLED-}" = "1" ] ; then - bf-echo "Existing installation detected - do not reinstall." "freshrss/setup-install" - exit 0 -fi - - -#====================================================================================================================== -# Ensure all required environment variables are set. -#====================================================================================================================== - -[[ -z "${FRESHRSS_USER_NAME-}" ]] && bf-error "FRESHRSS_USER_NAME must be set." "freshrss/setup-install" -[[ -z "${FRESHRSS_USER_PASS-}" ]] && bf-error "FRESHRSS_USER_PASS must be set." "freshrss/setup-install" -[[ -z "${FRESHRSS_BASE_URL-}" ]] && bf-error "FRESHRSS_BASE_URL must be set." "freshrss/setup-install" -[[ -z "${FRESHRSS_DB_HOST-}" ]] && bf-error "FRESHRSS_DB_HOST must be set." "freshrss/setup-install" -[[ -z "${FRESHRSS_DB_USER-}" ]] && bf-error "FRESHRSS_DB_USER must be set." "freshrss/setup-install" -[[ -z "${FRESHRSS_DB_PASS-}" ]] && bf-error "FRESHRSS_DB_PASS must be set." "freshrss/setup-install" - - -#====================================================================================================================== -# Use CLI to run automated installation. -#====================================================================================================================== - -bf-echo "Installing FreshRSS..." "freshrss/setup-install" -cd "${FRESHRSS_CLI}" - -# ensure all the needed directories are in /data -bf-echo " .. preparing ${FRESHRSS_DATA}" "freshrss/setup-install" -php ./prepare.php - -# do install -bf-echo " .. installing database" "freshrss/setup-install" -php ./do-install.php \ - --default_user "${FRESHRSS_USER_NAME}" \ - --environment "${FRESHRSS_ENVIRONMENT}" \ - --base_url "${FRESHRSS_BASE_URL}" \ - --language "${FRESHRSS_LANG}" \ - --db-type "${FRESHRSS_DB_TYPE}" \ - --db-host "${FRESHRSS_DB_HOST}" \ - --db-user "${FRESHRSS_DB_USER}" \ - --db-password "${FRESHRSS_DB_PASS}" \ - --db-base "${FRESHRSS_DB_NAME}" \ - --db-prefix "${FRESHRSS_DB_PREFIX}_" - -# create user -bf-echo " .. creating user" "freshrss/setup-install" -php ./create-user.php \ - --user "${FRESHRSS_USER_NAME}" \ - --password "${FRESHRSS_USER_PASS}" -php ./actualize-user.php \ - --user "${FRESHRSS_USER_NAME}" - -# disable updates -bf-echo " .. disabling updates" "freshrss/setup-install" -php ./reconfigure.php \ - --disable_update "true" -bf-done "freshrss/setup-install"