From c40c2e4db473136242fcf10544c3e72919de9957 Mon Sep 17 00:00:00 2001 From: mikespub Date: Mon, 9 Sep 2024 15:49:52 +0200 Subject: [PATCH] update config, run and readme for COPS 3.x --- readme-vars.yml | 11 ++++++----- .../{config_local.php => config/local.php} | 14 ++++++++++++++ .../s6-overlay/s6-rc.d/init-cops-config/run | 19 ++++++++++++++----- 3 files changed, 34 insertions(+), 10 deletions(-) rename root/defaults/{config_local.php => config/local.php} (87%) diff --git a/readme-vars.yml b/readme-vars.yml index 446c14e..b7a518d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -2,7 +2,7 @@ # project information project_name: cops -project_url: "http://blog.slucas.fr/en/oss/calibre-opds-php-server" +project_url: "https://github.com/mikespub-org/seblucas-cops" project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/cops-icon.png" project_blurb: | [{{ project_name|capitalize }}]({{ project_url }}) by Sébastien Lucas, now maintained by MikesPub, stands for Calibre OPDS (and HTML) Php Server. @@ -13,7 +13,7 @@ project_blurb: | See : [COPS's home]({{ project_url }}) for more details. - Don't forget to check the [Wiki](https://github.com/seblucas/cops/wiki). + Don't forget to check the [Wiki](https://github.com/mikespub-org/seblucas-cops/wiki). ## Why? (taken from the author's site) @@ -36,7 +36,7 @@ project_blurb: | * With Dropbox / owncloud it's very easy to have an up to date OPDS server. * It was fun to code. - If you want to use the OPDS feed don't forget to specify feed.php at the end of your URL. + If you want to use the OPDS feed don't forget to specify /feed at the end of your URL. project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}" @@ -60,12 +60,13 @@ param_ports: # application setup block app_setup_block_enabled: true app_setup_block: | - Access the webui at `http://:80`. For connecting via OPDS on a mobile device use `http://:80/feed.php`. It is strongly suggested that you reverse proxy this prior to exposing to the internet. For more information, such as requiring credentials, check the COPS Wiki (linked above). + Access the webui at `http://:80`. For connecting via OPDS on a mobile device use `http://:80/index.php/feed`. It is strongly suggested that you reverse proxy this prior to exposing to the internet. For more information, such as requiring credentials, check the COPS Wiki (linked above). - The linuxserver version gives you access to `config_local.php` in `/config` to customise your install to suit your needs, it also includes the dependencies required to directly view epub books in your browser. + The linuxserver version gives you access to `config/local.php` in `/config` to customise your install to suit your needs, it also includes the dependencies required to directly view epub books in your browser. # changelog changelogs: + - { date: "09.09.24:", desc: "Existing users should move: config_local.php to config/local.php - for COPS 3.x release" } - { date: "01.09.24:", desc: "Existing users should verify: config_local.php - define $config['cops_kepubify_path'] if you want to use it" } - { date: "28.08.24:", desc: "Add kepubify tool to update metadata for Kobo - see mikespub-org/seblucas-cops#77" } - { date: "24.06.24:", desc: "Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings." } diff --git a/root/defaults/config_local.php b/root/defaults/config/local.php similarity index 87% rename from root/defaults/config_local.php rename to root/defaults/config/local.php index 482e1b8..70c6b0b 100644 --- a/root/defaults/config_local.php +++ b/root/defaults/config/local.php @@ -86,3 +86,17 @@ //$config['cops_kepubify_path'] = ''; $config['cops_kepubify_path'] = '/usr/bin/kepubify'; + /* + * Set front controller to remove index.php/ from route URLs generated in COPS + * + * Note: this assumes your web server config will rewrite /... to /index.php/... + * - Apache: .htaccess + * - Nginx: nginx.conf + * - PHP built-in: router.php + * - ... + * + * @todo update nginx/site-confs/default.conf.sample to make use of front controller + */ + $config['cops_front_controller'] = ''; + //$config['cops_front_controller'] = 'index.php'; + diff --git a/root/etc/s6-overlay/s6-rc.d/init-cops-config/run b/root/etc/s6-overlay/s6-rc.d/init-cops-config/run index 7ac7e35..0ba1e5c 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-cops-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-cops-config/run @@ -4,22 +4,31 @@ # create folders mkdir -p \ /config/cache +# create folders (COPS 3.x) +mkdir -p \ + /config/config -# clear previous config +# clear previous config (COPS 1.x and 2.x) for f in /app/www/public/config_local.*.php; do if [ -f "$f" ]; then rm "$f" fi done +# clear previous config (COPS 3.x) +for f in /app/www/public/config/local.*.php; do + if [ -f "$f" ]; then + rm "$f" + fi +done # copy config -if [[ ! -e /config/config_local.php ]]; then - cp /defaults/config_local.php /config/config_local.php +if [[ ! -e /config/config/local.php ]]; then + cp /defaults/config/local.php /config/config/local.php fi # copy extra user-profiles -for f in /config/config_local*.php; do - cp "$f" /app/www/public/ +for f in /config/config/local*.php; do + cp "$f" /app/www/public/config/ done # permissions