diff --git a/.github/workflows/call_invalid_helper.yml b/.github/workflows/call_invalid_helper.yml new file mode 100644 index 00000000..773767c2 --- /dev/null +++ b/.github/workflows/call_invalid_helper.yml @@ -0,0 +1,12 @@ +name: Comment on invalid interaction +on: + issues: + types: + - labeled +jobs: + add-comment-on-invalid: + if: github.event.label.name == 'invalid' + permissions: + issues: write + uses: linuxserver/github-workflows/.github/workflows/invalid-interaction-helper.yml@v1 + secrets: inherit diff --git a/Dockerfile b/Dockerfile index ab09bc1f..1b37364e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 # set version label ARG BUILD_DATE @@ -13,32 +15,30 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ libxml2 \ mariadb-client \ - php8-bcmath \ - php8-ctype \ - php8-curl \ - php8-gd \ - php8-iconv \ - php8-ldap \ - php8-mbstring \ - php8-pdo_mysql \ - php8-pdo_sqlite \ - php8-pecl-mcrypt \ - php8-phar \ - php8-sodium \ - php8-sqlite3 \ - php8-tokenizer \ - php8-xml \ - php8-xmlreader \ - php8-zip \ - tar \ - unzip && \ + php81-bcmath \ + php81-ctype \ + php81-curl \ + php81-gd \ + php81-iconv \ + php81-ldap \ + php81-mbstring \ + php81-pdo_mysql \ + php81-pdo_sqlite \ + php81-phar \ + php81-sodium \ + php81-sqlite3 \ + php81-tokenizer \ + php81-xml \ + php81-xmlreader \ + php81-zip && \ + apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php81-pecl-mcrypt && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** install snipe-it ****" && \ mkdir -p \ /app/www/ && \ @@ -63,7 +63,7 @@ RUN \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.composer \ + $HOME/.composer \ /tmp/* # copy local files diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 227669aa..e2f385f0 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 # set version label ARG BUILD_DATE @@ -13,32 +15,30 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ libxml2 \ mariadb-client \ - php8-bcmath \ - php8-ctype \ - php8-curl \ - php8-gd \ - php8-iconv \ - php8-ldap \ - php8-mbstring \ - php8-pdo_mysql \ - php8-pdo_sqlite \ - php8-pecl-mcrypt \ - php8-phar \ - php8-sodium \ - php8-sqlite3 \ - php8-tokenizer \ - php8-xml \ - php8-xmlreader \ - php8-zip \ - tar \ - unzip && \ + php81-bcmath \ + php81-ctype \ + php81-curl \ + php81-gd \ + php81-iconv \ + php81-ldap \ + php81-mbstring \ + php81-pdo_mysql \ + php81-pdo_sqlite \ + php81-phar \ + php81-sodium \ + php81-sqlite3 \ + php81-tokenizer \ + php81-xml \ + php81-xmlreader \ + php81-zip && \ + apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php81-pecl-mcrypt && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** install snipe-it ****" && \ mkdir -p \ /app/www/ && \ @@ -63,7 +63,7 @@ RUN \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.composer \ + $HOME/.composer \ /tmp/* # copy local files diff --git a/Dockerfile.armhf b/Dockerfile.armhf index fc7dd10b..60d132f9 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 # set version label ARG BUILD_DATE @@ -13,32 +15,30 @@ RUN \ composer && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ - curl \ libxml2 \ mariadb-client \ - php8-bcmath \ - php8-ctype \ - php8-curl \ - php8-gd \ - php8-iconv \ - php8-ldap \ - php8-mbstring \ - php8-pdo_mysql \ - php8-pdo_sqlite \ - php8-pecl-mcrypt \ - php8-phar \ - php8-sodium \ - php8-sqlite3 \ - php8-tokenizer \ - php8-xml \ - php8-xmlreader \ - php8-zip \ - tar \ - unzip && \ + php81-bcmath \ + php81-ctype \ + php81-curl \ + php81-gd \ + php81-iconv \ + php81-ldap \ + php81-mbstring \ + php81-pdo_mysql \ + php81-pdo_sqlite \ + php81-phar \ + php81-sodium \ + php81-sqlite3 \ + php81-tokenizer \ + php81-xml \ + php81-xmlreader \ + php81-zip && \ + apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + php81-pecl-mcrypt && \ echo "**** configure php-fpm to pass env vars ****" && \ - sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \ - grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php8/php-fpm.conf && \ + sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \ + grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \ + echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \ echo "**** install snipe-it ****" && \ mkdir -p \ /app/www/ && \ @@ -63,7 +63,7 @@ RUN \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.composer \ + $HOME/.composer \ /tmp/* # copy local files diff --git a/README.md b/README.md index 91ba5fc5..ddf25542 100644 --- a/README.md +++ b/README.md @@ -115,14 +115,14 @@ services: - PUID=1000 - PGID=1000 - APP_URL=http://localhost:8080 - - MYSQL_PORT_3306_TCP_ADDR= - - MYSQL_PORT_3306_TCP_PORT= - - MYSQL_DATABASE= - - MYSQL_USER= - - MYSQL_PASSWORD=changeme + - MYSQL_PORT_3306_TCP_ADDR= + - MYSQL_PORT_3306_TCP_PORT= + - MYSQL_DATABASE= + - MYSQL_USER= + - MYSQL_PASSWORD= - TZ=US/Pacific volumes: - - :/config + - /path/to/data:/config ports: - 8080:80 restart: unless-stopped @@ -136,14 +136,14 @@ docker run -d \ -e PUID=1000 \ -e PGID=1000 \ -e APP_URL=http://localhost:8080 \ - -e MYSQL_PORT_3306_TCP_ADDR= \ - -e MYSQL_PORT_3306_TCP_PORT= \ - -e MYSQL_DATABASE= \ - -e MYSQL_USER= \ - -e MYSQL_PASSWORD=changeme \ + -e MYSQL_PORT_3306_TCP_ADDR= \ + -e MYSQL_PORT_3306_TCP_PORT= \ + -e MYSQL_DATABASE= \ + -e MYSQL_USER= \ + -e MYSQL_PASSWORD= \ -e TZ=US/Pacific \ -p 8080:80 \ - -v :/config \ + -v /path/to/data:/config \ --restart unless-stopped \ lscr.io/linuxserver/snipe-it:latest ``` @@ -158,11 +158,11 @@ Container images are configured using parameters passed at runtime (such as thos | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | | `-e APP_URL=http://localhost:8080` | Hostname or IP and port if applicable, be sure to define https/http | -| `-e MYSQL_PORT_3306_TCP_ADDR=` | Mysql hostname or IP to use | -| `-e MYSQL_PORT_3306_TCP_PORT=` | Mysql port to use | -| `-e MYSQL_DATABASE=` | Mysql database to use | -| `-e MYSQL_USER=` | Mysql user to use | -| `-e MYSQL_PASSWORD=changeme` | Mysql password to use | +| `-e MYSQL_PORT_3306_TCP_ADDR=` | Mysql hostname or IP to use | +| `-e MYSQL_PORT_3306_TCP_PORT=` | Mysql port to use | +| `-e MYSQL_DATABASE=` | Mysql database to use | +| `-e MYSQL_USER=` | Mysql user to use | +| `-e MYSQL_PASSWORD=` | Mysql password to use | | `-e TZ=US/Pacific` | Specify a timezone to use EG Europe/London, this is required to run snipe-it | | `-v /config` | Contains your config files and data storage for Snipe-IT | @@ -275,6 +275,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **28.12.22:** - Rebase to Alpine 3.17, migrate to s6v3. * **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)). * **14.05.22:** - Add php7-sodium for v6. * **12.04.22:** - Don't build development elements. diff --git a/readme-vars.yml b/readme-vars.yml index 1e6426f7..1285e886 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -18,18 +18,18 @@ common_param_env_vars_enabled: true #PGID, PUID, etc param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "", desc: "Contains your config files and data storage for Snipe-IT" } + - { vol_path: "/config", vol_host_path: "/path/to/data", desc: "Contains your config files and data storage for Snipe-IT" } param_usage_include_ports: true param_ports: - { external_port: "8080", internal_port: "80", port_desc: "Snipe-IT Web UI" } param_usage_include_env: true param_env_vars: - { env_var: "APP_URL", env_value: "http://localhost:8080", desc: "Hostname or IP and port if applicable, be sure to define https/http"} - - { env_var: "MYSQL_PORT_3306_TCP_ADDR", env_value: "", desc: "Mysql hostname or IP to use"} - - { env_var: "MYSQL_PORT_3306_TCP_PORT", env_value: "", desc: "Mysql port to use"} - - { env_var: "MYSQL_DATABASE", env_value: "", desc: "Mysql database to use"} - - { env_var: "MYSQL_USER", env_value: "", desc: "Mysql user to use"} - - { env_var: "MYSQL_PASSWORD", env_value: "changeme", desc: "Mysql password to use"} + - { env_var: "MYSQL_PORT_3306_TCP_ADDR", env_value: "", desc: "Mysql hostname or IP to use"} + - { env_var: "MYSQL_PORT_3306_TCP_PORT", env_value: "", desc: "Mysql port to use"} + - { env_var: "MYSQL_DATABASE", env_value: "", desc: "Mysql database to use"} + - { env_var: "MYSQL_USER", env_value: "", desc: "Mysql user to use"} + - { env_var: "MYSQL_PASSWORD", env_value: "", desc: "Mysql password to use"} - { env_var: "TZ", env_value: "US/Pacific", desc: "Specify a timezone to use EG Europe/London, this is required to run snipe-it"} # application setup block @@ -75,6 +75,7 @@ app_setup_block: | # changelog changelogs: + - { date: "28.12.22:", desc: "Rebase to Alpine 3.17, migrate to s6v3." } - { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." } - { date: "14.05.22:", desc: "Add php7-sodium for v6." } - { date: "12.04.22:", desc: "Don't build development elements." } diff --git a/root/etc/php8/conf.d/snipe-local.ini b/root/etc/php81/conf.d/snipe-local.ini similarity index 100% rename from root/etc/php8/conf.d/snipe-local.ini rename to root/etc/php81/conf.d/snipe-local.ini diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-snipe-it-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-snipe-it-config new file mode 100644 index 00000000..e69de29b diff --git a/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/dependencies.d/init-config new file mode 100644 index 00000000..e69de29b diff --git a/root/etc/cont-init.d/40-config b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/run old mode 100644 new mode 100755 similarity index 88% rename from root/etc/cont-init.d/40-config rename to root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/run index fd7fd7bc..61db88e7 --- a/root/etc/cont-init.d/40-config +++ b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/run @@ -34,7 +34,7 @@ if [[ ! -L /app/www/public/uploads ]]; then fi # Create API key if needed -if [ ! -f "/config/SNIPE_IT_APP_KEY.txt" ]; then +if [[ ! -f "/config/SNIPE_IT_APP_KEY.txt" ]]; then echo "Generating SnipeIT app key for first run" key=$(php /app/www/artisan key:generate --show) echo "${key}" >/config/SNIPE_IT_APP_KEY.txt @@ -42,7 +42,7 @@ if [ ! -f "/config/SNIPE_IT_APP_KEY.txt" ]; then fi # permissions -chown -R abc:abc \ +lsiown -R abc:abc \ /config/ \ /app/www/bootstrap/cache @@ -63,16 +63,16 @@ fi sed -i "s/APP_URL_PLACEHOLDER/${REPLACE_URL}/g" /config/nginx/site-confs/default.conf # If the Oauth DB files are not present copy the vendor files over to the db migrations -if [ ! -f "/app/www/database/migrations/*create_oauth*" ]; then +if [[ ! -f "/app/www/database/migrations/*create_oauth*" ]]; then cp -ax /app/www/vendor/laravel/passport/database/migrations/* /app/www/database/migrations/ fi # if this container is setup run migrate -if [ -f /config/storage/oauth-public.key ]; then +if [[ -f /config/storage/oauth-public.key ]]; then php /app/www/artisan migrate --force fi # copy over timezone env var if [[ -n ${TZ+x} ]]; then - echo "${TZ}" >/run/s6/container_environment/APP_TIMEZONE + printf '%s' "${TZ}" >/run/s6/container_environment/APP_TIMEZONE fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/type b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/type new file mode 100644 index 00000000..bdd22a18 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/up b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/up new file mode 100644 index 00000000..072cb487 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-snipe-it-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/dependencies.d/init-services new file mode 100644 index 00000000..e69de29b diff --git a/root/etc/services.d/php-fpm/run b/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/run similarity index 59% rename from root/etc/services.d/php-fpm/run rename to root/etc/s6-overlay/s6-rc.d/svc-php-fpm/run index e24e1f0e..9e7175ca 100755 --- a/root/etc/services.d/php-fpm/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/run @@ -1,3 +1,6 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash + export APP_KEY=$(cat /config/SNIPE_IT_APP_KEY.txt) -exec /usr/sbin/php-fpm8 -F + +exec /usr/sbin/php-fpm81 -F diff --git a/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/type b/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/type new file mode 100644 index 00000000..5883cff0 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-php-fpm/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-qbittorrent-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-qbittorrent-config new file mode 100644 index 00000000..e69de29b