diff --git a/readme-vars.yml b/readme-vars.yml index 52c1a7c..1726347 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: "In COPS 3.x, the config_local.php is being moved over to config/local.php and this container will automatically migrate it. Existing users should verify: config_local.php and/or config/local.php - define $config['cops_kepubify_path'] if they 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." } - { date: "07.05.24:", desc: "Existing users should verify: site-confs/default.conf - Fix rewriting rules default site conf." } diff --git a/root/defaults/config_local.php b/root/defaults/config/local.php similarity index 68% rename from root/defaults/config_local.php rename to root/defaults/config/local.php index 932a9fb..70c6b0b 100644 --- a/root/defaults/config_local.php +++ b/root/defaults/config/local.php @@ -32,7 +32,7 @@ */ $config['cops_use_url_rewriting'] = "0"; - /* + /* * Which header to use when downloading books outside the web directory * Possible values are : * X-Accel-Redirect : For Nginx @@ -40,12 +40,14 @@ * No value (default) : Let PHP handle the download */ - $config['cops_x_accel_redirect'] = "X-Accel-Redirect"; + $config['cops_x_accel_redirect'] = "X-Accel-Redirect"; + /* Enable cache folder * especially useful for lower power hosts */ - $config['cops_thumbnail_handling'] = ""; - $config['cops_thumbnail_cache_directory'] = "/config/cache/"; + $config['cops_thumbnail_handling'] = ""; + $config['cops_thumbnail_cache_directory'] = "/config/cache/"; + /* * Enable and configure Send To Kindle (or Email) feature. * @@ -69,10 +71,32 @@ * * You'll also need to enable Allow Less Secure Apps in you Gmail account. */ + $config['cops_mail_configuration'] = array( "smtp.host" => "", + "smtp.username" => "", + "smtp.password" => "", + "smtp.secure" => "ssl", + "address.from" => "cops@ebook.com" + ); + + /* + * Use external 'kepubify' tool to convert .epub files to .kepub.epub format for Kobo + * Example: + * $config['cops_kepubify_path'] = '/usr/bin/kepubify'; + */ + //$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'; - $config['cops_mail_configuration'] = array( "smtp.host" => "", - "smtp.username" => "", - "smtp.password" => "", - "smtp.secure" => "ssl", - "address.from" => "cops@ebook.com" -); 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..f1c98e0 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,37 @@ # 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 + if [[ -e /config/config_local.php ]]; then + echo "**** Existing config found, migrating for v3. Please check the contents of /config/config/local.php which will be the active config in v3 ****" + cp /config/config_local.php /config/config/local.php + else + echo "**** New instance detected, generating default config at /config/config/local.php ****" + cp /defaults/config/local.php /config/config/local.php + fi 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