Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase to 3.20 #70

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.20

# set version label
ARG BUILD_DATE
Expand All @@ -10,35 +10,26 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="TheLamer"

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
libxml2 \
mariadb-client \
php81-bcmath \
php81-ctype \
php81-curl \
php81-exif \
php81-gd \
php81-iconv \
php81-ldap \
php81-pdo_mysql \
php81-pdo_sqlite \
php81-pecl-redis \
php81-phar \
php81-sodium \
php81-sqlite3 \
php81-tokenizer \
php81-xmlreader \
php81-zip && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
php81-pecl-mcrypt && \
php83-bcmath \
php83-exif \
php83-gd \
php83-ldap \
php83-pdo_mysql \
php83-pdo_sqlite \
php83-pecl-redis \
php83-sodium \
php83-sqlite3 \
php83-tokenizer \
php83-xmlreader \
php83-pecl-mcrypt && \
echo "**** configure php-fpm to pass env vars ****" && \
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 && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php83/php-fpm.conf && \
echo "**** install snipe-it ****" && \
mkdir -p \
/app/www/ && \
Expand All @@ -59,10 +50,10 @@ RUN \
"/app/www/storage" \
"/app/www/public/uploads" \
/defaults/ && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.cache \
$HOME/.composer \
/tmp/*

Expand All @@ -71,4 +62,5 @@ COPY root/ /

# ports and volumes
EXPOSE 80 443

VOLUME /config
46 changes: 19 additions & 27 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.20

# set version label
ARG BUILD_DATE
Expand All @@ -10,35 +10,26 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="TheLamer"

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
libxml2 \
mariadb-client \
php81-bcmath \
php81-ctype \
php81-curl \
php81-exif \
php81-gd \
php81-iconv \
php81-ldap \
php81-pdo_mysql \
php81-pdo_sqlite \
php81-pecl-redis \
php81-phar \
php81-sodium \
php81-sqlite3 \
php81-tokenizer \
php81-xmlreader \
php81-zip && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
php81-pecl-mcrypt && \
php83-bcmath \
php83-exif \
php83-gd \
php83-ldap \
php83-pdo_mysql \
php83-pdo_sqlite \
php83-pecl-redis \
php83-sodium \
php83-sqlite3 \
php83-tokenizer \
php83-xmlreader \
php83-pecl-mcrypt && \
echo "**** configure php-fpm to pass env vars ****" && \
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 && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php83/php-fpm.conf && \
echo "**** install snipe-it ****" && \
mkdir -p \
/app/www/ && \
Expand All @@ -59,10 +50,10 @@ RUN \
"/app/www/storage" \
"/app/www/public/uploads" \
/defaults/ && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.cache \
$HOME/.composer \
/tmp/*

Expand All @@ -71,4 +62,5 @@ COPY root/ /

# ports and volumes
EXPOSE 80 443

VOLUME /config
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ pipeline {
CI_WEB='false'
CI_PORT='80'
CI_SSL='false'
CI_DELAY='120'
CI_DELAY='60'
CI_DOCKERENV='APP_URL=http://localhost:80|NGINX_APP_URL=_|DB_CONNECTION=sqlite_testing'
CI_AUTH='user:password'
CI_AUTH=''
CI_WEBPATH=''
}
stages {
Expand Down
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Find us at:

[Snipe-it](https://github.com/snipe/snipe-it) makes asset management easy. It was built by people solving real-world IT and asset management problems, and a solid UX has always been a top priority. Straightforward design and bulk actions mean getting things done faster.

[![snipe-it](https://s3-us-west-2.amazonaws.com/linuxserver-docs/images/snipe-it-logo500x500.png)](https://github.com/snipe/snipe-it)
[![snipe-it](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/snipe-it-logo.png)](https://github.com/snipe/snipe-it)

## Supported Architectures

Expand Down Expand Up @@ -83,6 +83,7 @@ services:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- APP_KEY=
- APP_URL=http://localhost:8080
- MYSQL_PORT_3306_TCP_ADDR=
- MYSQL_PORT_3306_TCP_PORT=
Expand All @@ -92,15 +93,15 @@ services:
- APP_ENV=production #optional
- APP_DEBUG=false #optional
- APP_LOCALE= #optional
- MAIL_PORT_587_TCP_ADDR=US/Pacific #optional
- MAIL_PORT_587_TCP_PORT=US/Pacific #optional
- MAIL_ENV_FROM_ADDR=US/Pacific #optional
- MAIL_ENV_FROM_NAME=US/Pacific #optional
- MAIL_ENV_ENCRYPTION=US/Pacific #optional
- MAIL_ENV_USERNAME=US/Pacific #optional
- MAIL_ENV_PASSWORD=US/Pacific #optional
- MAIL_PORT_587_TCP_ADDR= #optional
- MAIL_PORT_587_TCP_PORT= #optional
- MAIL_ENV_FROM_ADDR= #optional
- MAIL_ENV_FROM_NAME= #optional
- MAIL_ENV_ENCRYPTION= #optional
- MAIL_ENV_USERNAME= #optional
- MAIL_ENV_PASSWORD= #optional
volumes:
- /path/to/data:/config
- /path/to/snipe-it/data:/config
ports:
- 8080:80
restart: unless-stopped
Expand All @@ -114,6 +115,7 @@ docker run -d \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e APP_KEY= \
-e APP_URL=http://localhost:8080 \
-e MYSQL_PORT_3306_TCP_ADDR= \
-e MYSQL_PORT_3306_TCP_PORT= \
Expand All @@ -123,15 +125,15 @@ docker run -d \
-e APP_ENV=production `#optional` \
-e APP_DEBUG=false `#optional` \
-e APP_LOCALE= `#optional` \
-e MAIL_PORT_587_TCP_ADDR=US/Pacific `#optional` \
-e MAIL_PORT_587_TCP_PORT=US/Pacific `#optional` \
-e MAIL_ENV_FROM_ADDR=US/Pacific `#optional` \
-e MAIL_ENV_FROM_NAME=US/Pacific `#optional` \
-e MAIL_ENV_ENCRYPTION=US/Pacific `#optional` \
-e MAIL_ENV_USERNAME=US/Pacific `#optional` \
-e MAIL_ENV_PASSWORD=US/Pacific `#optional` \
-e MAIL_PORT_587_TCP_ADDR= `#optional` \
-e MAIL_PORT_587_TCP_PORT= `#optional` \
-e MAIL_ENV_FROM_ADDR= `#optional` \
-e MAIL_ENV_FROM_NAME= `#optional` \
-e MAIL_ENV_ENCRYPTION= `#optional` \
-e MAIL_ENV_USERNAME= `#optional` \
-e MAIL_ENV_PASSWORD= `#optional` \
-p 8080:80 \
-v /path/to/data:/config \
-v /path/to/snipe-it/data:/config \
--restart unless-stopped \
lscr.io/linuxserver/snipe-it:latest
```
Expand All @@ -146,6 +148,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e APP_KEY=` | App key used for encrypting stored data. Generate with `docker exec snipe-it php /app/www/artisan key:generate --show`. |
| `-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 |
Expand All @@ -155,13 +158,13 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e APP_ENV=production` | Default is `production` but can use `testing` or `develop`. |
| `-e APP_DEBUG=false` | Set to `true` to see debugging output in the web UI. |
| `-e APP_LOCALE=` | Default is `en`. Set to a language from [this list](https://snipe-it.readme.io/docs/configuration#section-setting-a-language). |
| `-e MAIL_PORT_587_TCP_ADDR=US/Pacific` | SMTP mail server ip or hostname. |
| `-e MAIL_PORT_587_TCP_PORT=US/Pacific` | SMTP mail server port. |
| `-e MAIL_ENV_FROM_ADDR=US/Pacific` | The email address mail should be replied to and listed when sent. |
| `-e MAIL_ENV_FROM_NAME=US/Pacific` | The name listed on email sent from the default account on the system. |
| `-e MAIL_ENV_ENCRYPTION=US/Pacific` | Mail encryption to use e.g. `tls`. |
| `-e MAIL_ENV_USERNAME=US/Pacific` | SMTP server login username. |
| `-e MAIL_ENV_PASSWORD=US/Pacific` | SMTP server login password. |
| `-e MAIL_PORT_587_TCP_ADDR=` | SMTP mail server ip or hostname. |
| `-e MAIL_PORT_587_TCP_PORT=` | SMTP mail server port. |
| `-e MAIL_ENV_FROM_ADDR=` | The email address mail should be replied to and listed when sent. |
| `-e MAIL_ENV_FROM_NAME=` | The name listed on email sent from the default account on the system. |
| `-e MAIL_ENV_ENCRYPTION=` | Mail encryption to use e.g. `tls`. |
| `-e MAIL_ENV_USERNAME=` | SMTP server login username. |
| `-e MAIL_ENV_PASSWORD=` | SMTP server login password. |
| `-v /config` | Contains your config files and data storage for Snipe-IT |

## Environment variables from files (Docker secrets)
Expand Down Expand Up @@ -325,6 +328,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **31.05.24:** - Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings.
* **06.03.24:** - Existing users should update: site-confs/default.conf - Cleanup default site conf.
* **17.02.24:** - Add php81-exif.
* **03.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)
Expand Down
4 changes: 2 additions & 2 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ repo_vars:
- CI_WEB='false'
- CI_PORT='80'
- CI_SSL='false'
- CI_DELAY='120'
- CI_DELAY='60'
- CI_DOCKERENV='APP_URL=http://localhost:80|NGINX_APP_URL=_|DB_CONNECTION=sqlite_testing'
- CI_AUTH='user:password'
- CI_AUTH=''
- CI_WEBPATH=''
sponsor_links:
- { name: "Snipe-IT", url: "https://snipeitapp.com/donate" }
20 changes: 11 additions & 9 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# project information
project_name: snipe-it
project_url: "https://github.com/snipe/snipe-it"
project_logo: "https://s3-us-west-2.amazonaws.com/linuxserver-docs/images/snipe-it-logo500x500.png"
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/snipe-it-logo.png"
project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) makes asset management easy. It was built by people solving real-world IT and asset management problems, and a solid UX has always been a top priority. Straightforward design and bulk actions mean getting things done faster."
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
# supported architectures
Expand All @@ -15,12 +15,13 @@ common_param_env_vars_enabled: true
param_container_name: "{{ project_name }}"
param_usage_include_vols: true
param_volumes:
- {vol_path: "/config", vol_host_path: "/path/to/data", desc: "Contains your config files and data storage for Snipe-IT"}
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/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_KEY", env_value: "", desc: "App key used for encrypting stored data. Generate with `docker exec snipe-it php /app/www/artisan key:generate --show`."}
- {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"}
Expand All @@ -33,13 +34,13 @@ opt_param_env_vars:
- {env_var: "APP_ENV", env_value: "production", desc: "Default is `production` but can use `testing` or `develop`."}
- {env_var: "APP_DEBUG", env_value: "false", desc: "Set to `true` to see debugging output in the web UI."}
- {env_var: "APP_LOCALE", env_value: "", desc: "Default is `en`. Set to a language from [this list](https://snipe-it.readme.io/docs/configuration#section-setting-a-language)."}
- {env_var: "MAIL_PORT_587_TCP_ADDR", env_value: "US/Pacific", desc: "SMTP mail server ip or hostname."}
- {env_var: "MAIL_PORT_587_TCP_PORT", env_value: "US/Pacific", desc: "SMTP mail server port."}
- {env_var: "MAIL_ENV_FROM_ADDR", env_value: "US/Pacific", desc: "The email address mail should be replied to and listed when sent."}
- {env_var: "MAIL_ENV_FROM_NAME", env_value: "US/Pacific", desc: "The name listed on email sent from the default account on the system."}
- {env_var: "MAIL_ENV_ENCRYPTION", env_value: "US/Pacific", desc: "Mail encryption to use e.g. `tls`."}
- {env_var: "MAIL_ENV_USERNAME", env_value: "US/Pacific", desc: "SMTP server login username."}
- {env_var: "MAIL_ENV_PASSWORD", env_value: "US/Pacific", desc: "SMTP server login password."}
- {env_var: "MAIL_PORT_587_TCP_ADDR", env_value: "", desc: "SMTP mail server ip or hostname."}
- {env_var: "MAIL_PORT_587_TCP_PORT", env_value: "", desc: "SMTP mail server port."}
- {env_var: "MAIL_ENV_FROM_ADDR", env_value: "", desc: "The email address mail should be replied to and listed when sent."}
- {env_var: "MAIL_ENV_FROM_NAME", env_value: "", desc: "The name listed on email sent from the default account on the system."}
- {env_var: "MAIL_ENV_ENCRYPTION", env_value: "", desc: "Mail encryption to use e.g. `tls`."}
- {env_var: "MAIL_ENV_USERNAME", env_value: "", desc: "SMTP server login username."}
- {env_var: "MAIL_ENV_PASSWORD", env_value: "", desc: "SMTP server login password."}
# application setup block
app_setup_block_enabled: true
app_setup_block: |
Expand All @@ -53,6 +54,7 @@ app_setup_block: |

# changelog
changelogs:
- {date: "31.05.24:", desc: "Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings."}
- {date: "06.03.24:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf."}
- {date: "17.02.24:", desc: "Add php81-exif."}
- {date: "03.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"}
Expand Down
9 changes: 3 additions & 6 deletions root/defaults/nginx/site-confs/default.conf.sample
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
## Version 2024/03/06 - Changelog: https://github.com/linuxserver/docker-snapdrop/commits/master/root/defaults/nginx/site-confs/default.conf.sample
## Version 2024/05/31 - Changelog: https://github.com/linuxserver/docker-snapdrop/commits/master/root/defaults/nginx/site-confs/default.conf.sample

server {
listen 80 default_server;
listen [::]:80 default_server;

listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
listen *:80 default_server;
listen *:443 ssl default_server;

server_name APP_URL_PLACEHOLDER;

Expand Down
2 changes: 1 addition & 1 deletion root/etc/crontabs/abc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# min hour day month weekday command
* * * * * php /app/www/artisan schedule:run >> /dev/null 2>&1
* * * * * /usr/bin/php /app/www/artisan schedule:run 2>&1
6 changes: 0 additions & 6 deletions root/etc/crontabs/root

This file was deleted.

8 changes: 5 additions & 3 deletions root/etc/s6-overlay/s6-rc.d/init-snipe-it-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ 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" ]] && [[ -z "${APP_KEY}" ]]; 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
echo "App Key set to ${key} you can modify the file to update /config/SNIPE_IT_APP_KEY.txt"
printf "%s" "${key}" > /run/s6/container_environment/APP_KEY
echo "App Key set to ${key} you can set the APP_KEY environment variable to provide a persistent key."
elif [[ -f "/config/SNIPE_IT_APP_KEY.txt" ]]; then
printf '%s' "$(cat /config/SNIPE_IT_APP_KEY.txt)" > /run/s6/container_environment/APP_KEY
fi

# permissions
Expand Down
Empty file.
6 changes: 0 additions & 6 deletions root/etc/s6-overlay/s6-rc.d/svc-php-fpm/run

This file was deleted.

1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-php-fpm/type

This file was deleted.