Skip to content

Commit

Permalink
v4.0.0 (#138)
Browse files Browse the repository at this point in the history
**Complete rewrite using [nushell](https://nushell.sh)**

## Major updates and breaking changes
* To enter nushell do `docker exec -it container_name nu` and type `bf-freshrss+ tab` to see a complete list of functions
* All environment variables now begin `BF_FR`

## Minor updates
* Updating to PHP 8.3.2
* Updating to FreshRSS 1.23.1

## Documentation updates
* Updating copyright year to 2024
  • Loading branch information
bfren authored Jan 25, 2024
1 parent 2686ccc commit a5cb3f6
Show file tree
Hide file tree
Showing 29 changed files with 234 additions and 308 deletions.
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -29,20 +29,23 @@ 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

> [MIT](https://mit.bfren.dev/2021)
## Copyright

> Copyright (c) 2021-2023 [bfren](https://bfren.dev) (unless otherwise stated)
> Copyright (c) 2021-2024 [bfren](https://bfren.dev) (unless otherwise stated)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.21
4.0.0
2 changes: 1 addition & 1 deletion VERSION_MAJOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3
4
2 changes: 1 addition & 1 deletion VERSION_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
13 changes: 0 additions & 13 deletions overlay/etc/bf/init.d/10-env-nginx-root

This file was deleted.

9 changes: 9 additions & 0 deletions overlay/etc/bf/init.d/10-env_public.nu
Original file line number Diff line number Diff line change
@@ -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"
}
18 changes: 0 additions & 18 deletions overlay/etc/bf/init.d/30-env

This file was deleted.

13 changes: 13 additions & 0 deletions overlay/etc/bf/init.d/30-env.nu
Original file line number Diff line number Diff line change
@@ -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"
}
19 changes: 19 additions & 0 deletions overlay/etc/bf/init.d/31-fr-setup-data.nu
Original file line number Diff line number Diff line change
@@ -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 }
}
18 changes: 0 additions & 18 deletions overlay/etc/bf/init.d/31-freshrss-setup-data

This file was deleted.

69 changes: 69 additions & 0 deletions overlay/etc/bf/init.d/32-fr-setup-install.nu
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 0 additions & 19 deletions overlay/etc/bf/init.d/32-freshrss-setup-install

This file was deleted.

15 changes: 15 additions & 0 deletions overlay/etc/bf/init.d/33-fr-check.nu
Original file line number Diff line number Diff line change
@@ -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."
}
18 changes: 0 additions & 18 deletions overlay/etc/bf/init.d/33-freshrss-check

This file was deleted.

2 changes: 1 addition & 1 deletion overlay/etc/nginx/helpers/php-try-php.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 9 additions & 0 deletions overlay/etc/nu/scripts/bf-freshrss/install.nu
Original file line number Diff line number Diff line change
@@ -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 }
1 change: 1 addition & 0 deletions overlay/etc/nu/scripts/bf-freshrss/mod.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export module install.nu
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export BF_E=`basename ${0}`
# Call freshrss-refresh executable
#======================================================================================================================

freshrss-refresh
fr-cron
2 changes: 1 addition & 1 deletion overlay/tmp/FRESHRSS_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.22
1.23
2 changes: 1 addition & 1 deletion overlay/tmp/FRESHRSS_REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.22.1
1.23.1
1 change: 0 additions & 1 deletion overlay/tmp/PHP_BUILD

This file was deleted.

Loading

0 comments on commit a5cb3f6

Please sign in to comment.