diff --git a/Dockerfile b/Dockerfile index 6c06130..cb6c32e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,6 @@ LABEL maintainer="chbmb" RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - # libxml2 \ php83-dom \ php83-gd \ php83-intl \ @@ -47,6 +46,10 @@ RUN \ /usr/bin/kepubify -L \ "https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit" && \ chmod 755 /usr/bin/kepubify && \ + mkdir -p /defaults/config && \ + cp /app/www/public/config/* /defaults/config && \ + rm -rf /app/www/public/config && \ + ln -s /config/config /app/www/public/config && \ echo "**** cleanup ****" && \ rm -rf \ /root/.composer \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 3ff07dc..c19f353 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -12,7 +12,6 @@ LABEL maintainer="chbmb" RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - # libxml2 \ php83-dom \ php83-gd \ php83-intl \ @@ -35,7 +34,6 @@ RUN \ tar xf /tmp/cops.tar.gz -C \ /app/www/public --strip-components=1 && \ cd /app/www/public && \ - # use standard composer 2.x now, no need to install older 1.x version composer \ install --no-dev --optimize-autoloader && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ @@ -48,6 +46,10 @@ RUN \ /usr/bin/kepubify -L \ "https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm64" && \ chmod 755 /usr/bin/kepubify && \ + mkdir -p /defaults/config && \ + cp /app/www/public/config/* /defaults/config && \ + rm -rf /app/www/public/config && \ + ln -s /config/config /app/www/public/config && \ echo "**** cleanup ****" && \ rm -rf \ /root/.composer \ diff --git a/README.md b/README.md index f0f2037..f14e376 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,14 @@ Access the webui at `http://:80`. For connecting via OPDS on a m 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. +## Read-Only Operation + +This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/). + +### Caveats + +* `/tmp` must be mounted to tmpfs + ## Usage To help you get started creating a container from this image you can either use docker-compose or the docker cli. @@ -151,6 +159,7 @@ Containers are configured using parameters passed at runtime (such as those abov | `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). | | `-v /config` | COPS Application Data. | | `-v /books` | Calibre metadata.db location. | +| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). | ## Environment variables from files (Docker secrets) diff --git a/readme-vars.yml b/readme-vars.yml index 0c58449..da2f56f 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -53,6 +53,9 @@ param_usage_include_ports: true param_ports: - {external_port: "80", internal_port: "80", port_desc: "HTTP WebUI"} - {external_port: "443", internal_port: "443", port_desc: "HTTPS WebUI"} +readonly_supported: true +readonly_message: | + * `/tmp` must be mounted to tmpfs # application setup block app_setup_block_enabled: true app_setup_block: | diff --git a/root/defaults/config/local.php b/root/defaults/local/local.php similarity index 100% rename from root/defaults/config/local.php rename to root/defaults/local/local.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 c631ac4..01cab3f 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 @@ -8,19 +8,6 @@ mkdir -p \ mkdir -p \ /config/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 if [[ -e /config/config_local.php ]]; then @@ -28,15 +15,11 @@ if [[ ! -e /config/config/local.php ]]; then 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 + cp /defaults/local/local.php /config/config/ fi fi -# copy extra user-profiles -for f in /config/config/local*.php; do - cp "${f}" /app/www/public/config/ - chmod +r "/app/www/public/config/$(basename ${f})" -done +cp /defaults/config/* /config/config/ # permissions lsiown -R abc:abc \