Compare commits

...

23 commits

Author SHA1 Message Date
d104b4f3b1 Update Dockerfile
Some checks failed
Security-scan / build (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
Build & Deploy container image / fs image / edge release (push) Has been cancelled
Build & Deploy container image / gcs image / edge release (push) Has been cancelled
Build & Deploy container image / nginx-fpm-alpine image / edge release (push) Has been cancelled
Build & Deploy container image / pdo image / edge release (push) Has been cancelled
Build & Deploy container image / s3 image / edge release (push) Has been cancelled
Build & Deploy container image / fs image / stable release (push) Has been cancelled
Build & Deploy container image / gcs image / stable release (push) Has been cancelled
Build & Deploy container image / nginx-fpm-alpine image / stable release (push) Has been cancelled
Build & Deploy container image / pdo image / stable release (push) Has been cancelled
Build & Deploy container image / s3 image / stable release (push) Has been cancelled
Snyk Container / snyk (push) Has been cancelled
trivy-analysis / Trivy analysis (push) Has been cancelled
2025-03-03 01:54:04 +00:00
El RIDO
606baa89c9
Merge pull request #211 from PrivateBin/php84
upgrade to PHP 8.4 packages
2025-02-01 14:17:30 +01:00
El RIDO
4cec4761ef
upgrade to PHP 8.4 packages
composer related packages need to stay at PHP 8.3 until the composer package gets upgrade in Alpine - they get removed again at the end of the image build
2025-02-01 12:02:25 +01:00
El RIDO
53489980c1
new release 1.7.6 2025-02-01 11:25:56 +01:00
El RIDO
e296cba5d6 Bump alpine from 3.20.3 to 3.21 2024-12-06 05:49:23 +01:00
El RIDO
1cd8f44849
Merge pull request #207 from PrivateBin/dependabot/github_actions/zaproxy/action-full-scan-0.12.0
Bump zaproxy/action-full-scan from 0.11.0 to 0.12.0
2024-11-22 06:56:46 +01:00
dependabot[bot]
8d911cbd2a
Bump zaproxy/action-full-scan from 0.11.0 to 0.12.0
Bumps [zaproxy/action-full-scan](https://github.com/zaproxy/action-full-scan) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/zaproxy/action-full-scan/releases)
- [Changelog](https://github.com/zaproxy/action-full-scan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zaproxy/action-full-scan/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: zaproxy/action-full-scan
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-22 05:52:09 +00:00
El RIDO
5cae408aee
new release 1.7.5 2024-11-16 08:40:03 +01:00
El RIDO
eaa8107aca
Merge pull request #205 from PrivateBin/s6-usr-bin
with s6 2.13.1.0 binaries live in /usr/bin instead of /bin
2024-10-23 07:23:03 +02:00
El RIDO
c2f338790d
typo in usage 2024-10-19 10:56:16 +02:00
El RIDO
53c3e60b9b
with s6 2.13.1.0 binaries live in /usr/bin instead of /bin
this change makes the entrypoint script PATH dependent, but agnostic to the real location of the s6-svcscan binary, so it work both for alpine 3.20 as well as edge / future stable alpine releases

see d348893ddf (bc2914fbfe731ad6ff1eb5c019c39433c87bcaf5_22_24)
2024-10-19 10:11:19 +02:00
El RIDO
3ede9d518e
Merge pull request #202 from PrivateBin/dependabot/github_actions/zaproxy/action-full-scan-0.11.0
Bump zaproxy/action-full-scan from 0.10.0 to 0.11.0
2024-09-26 08:34:50 +02:00
dependabot[bot]
e7959a773f
Bump zaproxy/action-full-scan from 0.10.0 to 0.11.0
Bumps [zaproxy/action-full-scan](https://github.com/zaproxy/action-full-scan) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/zaproxy/action-full-scan/releases)
- [Changelog](https://github.com/zaproxy/action-full-scan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zaproxy/action-full-scan/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: zaproxy/action-full-scan
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-26 05:13:24 +00:00
El RIDO
960be2c980
Merge pull request #201 from PrivateBin/dependabot/docker/alpine-3.20.3
Bump alpine from 3.20.2 to 3.20.3
2024-09-09 12:56:44 +02:00
dependabot[bot]
6a5de49db3
Bump alpine from 3.20.2 to 3.20.3
Bumps alpine from 3.20.2 to 3.20.3.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 05:44:22 +00:00
El RIDO
f8e50740ee Bump alpine from 3.20.1 to 3.20.2 2024-07-23 06:59:24 +02:00
El RIDO
9a6270cfd4
new release 1.7.4 2024-07-09 21:09:29 +02:00
El RIDO
ee4c8fe350 timezone vars are part of env vars 2024-06-21 12:46:41 +02:00
dependabot[bot]
652dea8c8c
Bump alpine from 3.20.0 to 3.20.1
Bumps alpine from 3.20.0 to 3.20.1.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-21 05:42:45 +00:00
El RIDO
fc508c9b37
Merge pull request #197 from PrivateBin/env-vars
enable custom env var passthrough & document usage
2024-06-14 07:08:23 +02:00
El RIDO
b71945e5e0
enable custom env var passthrough & document usage 2024-06-13 19:39:49 +02:00
El RIDO
beac0038fd
Merge pull request #195 from PrivateBin/alpine-3.20
Bump alpine from 3.19.1 to 3.20.0
2024-05-23 12:46:43 +02:00
El RIDO
bb09a19975 Bump alpine from 3.19.1 to 3.20.0
Also undo now obsolete 8.2 fix for #193, composer now is on the same PHP release as the rest
2024-05-23 07:24:03 +02:00
7 changed files with 71 additions and 25 deletions

View file

@ -35,7 +35,7 @@ jobs:
# Run OWASP scan
- name: OWASP ZAP Full Scan
uses: zaproxy/action-full-scan@v0.10.0
uses: zaproxy/action-full-scan@v0.12.0
with:
# GitHub Token to create issues in the repository
#token: # optional, default is ${{ github.token }}

View file

@ -1,9 +1,9 @@
FROM alpine:3.19.1
FROM alpine:3.21
ARG ALPINE_PACKAGES="php83-iconv php83-pdo_mysql php83-pdo_pgsql php83-openssl php83-simplexml"
ARG ALPINE_PACKAGES="php84-iconv php84-pdo_mysql php84-pdo_pgsql php84-openssl php84-simplexml"
ARG COMPOSER_PACKAGES="aws/aws-sdk-php google/cloud-storage"
ARG PBURL=https://github.com/PrivateBin/PrivateBin/
ARG RELEASE=1.7.3
ARG RELEASE=1.7.6
ARG UID=65534
ARG GID=82
@ -24,6 +24,7 @@ RUN \
ALPINE_PACKAGES="$(echo ${ALPINE_PACKAGES} | sed 's/,/ /g')" ;\
ALPINE_COMPOSER_PACKAGES="" ;\
if [ -n "${COMPOSER_PACKAGES}" ] ; then \
# we need these PHP 8.3 packages until composer gets updated to depend on PHP 8.4
ALPINE_COMPOSER_PACKAGES="composer" ;\
if [ -n "${ALPINE_PACKAGES##*php83-curl*}" ] ; then \
ALPINE_COMPOSER_PACKAGES="php83-curl ${ALPINE_COMPOSER_PACKAGES}" ;\
@ -31,18 +32,18 @@ RUN \
if [ -n "${ALPINE_PACKAGES##*php83-mbstring*}" ] ; then \
ALPINE_COMPOSER_PACKAGES="php83-mbstring ${ALPINE_COMPOSER_PACKAGES}" ;\
fi ;\
if [ -z "${ALPINE_PACKAGES##*php83-simplexml*}" ] ; then \
ALPINE_COMPOSER_PACKAGES="php82-simplexml ${ALPINE_COMPOSER_PACKAGES}" ;\
if [ -z "${ALPINE_PACKAGES##*php84-simplexml*}" ] ; then \
ALPINE_COMPOSER_PACKAGES="php83-simplexml ${ALPINE_COMPOSER_PACKAGES}" ;\
fi ;\
fi \
# Install dependencies
&& apk upgrade --no-cache \
&& apk add --no-cache gnupg git nginx php83 php83-ctype php83-fpm php83-gd \
php83-opcache s6 tzdata ${ALPINE_PACKAGES} ${ALPINE_COMPOSER_PACKAGES} \
&& apk add --no-cache gnupg git nginx php84 php84-ctype php84-fpm php84-gd \
php84-opcache s6 tzdata ${ALPINE_PACKAGES} ${ALPINE_COMPOSER_PACKAGES} \
# Stabilize php config location
&& mv /etc/php83 /etc/php \
&& ln -s /etc/php /etc/php83 \
&& ln -s $(which php83) /usr/local/bin/php \
&& mv /etc/php84 /etc/php \
&& ln -s /etc/php /etc/php84 \
&& ln -s $(which php84) /usr/local/bin/php \
# Remove (some of the) default nginx & php config
&& rm -f /etc/nginx.conf /etc/nginx/http.d/default.conf /etc/php/php-fpm.d/www.conf \
&& rm -rf /etc/nginx/sites-* \
@ -78,10 +79,10 @@ RUN \
&& mkdir -p /srv/data \
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
# Support running s6 under a non-root user
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm83/supervise \
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm84/supervise \
&& mkfifo \
/etc/s6/services/nginx/supervise/control \
/etc/s6/services/php-fpm83/supervise/control \
/etc/s6/services/php-fpm84/supervise/control \
&& chown -R ${UID}:${GID} /etc/s6 /run /srv/* /var/lib/nginx /var/www \
&& chmod o+rwx /run /var/lib/nginx /var/lib/nginx/tmp \
# Clean up
@ -96,7 +97,7 @@ WORKDIR /var/www
USER ${UID}:${GID}
# mark dirs as volumes that need to be writable, allows running the container --read-only
VOLUME /run /srv/data /tmp /var/lib/nginx/tmp
VOLUME /run /srv/data /srv/img /tmp /var/lib/nginx/tmp
EXPOSE 8080

View file

@ -58,11 +58,46 @@ $ docker run -d --restart="always" --read-only -p 8080:8080 -v $PWD/conf.php:/sr
Note: The `Filesystem` data storage is supported out of the box. The image includes PDO modules for MySQL and PostgreSQL, required for the `Database` one, but you still need to keep the /srv/data persisted for the server salt and the traffic limiter when using a release before 1.4.0.
### Adjusting nginx or php-fpm settings
#### Environment variables
You can attach your own `php.ini` or nginx configuration files to the folders `/etc/php/conf.d/` and `/etc/nginx/http.d/` respectively. This would for example let you adjust the maximum size these two services accept for file uploads, if you need more then the default 10 MiB.
The following variables do get passed down to the PHP application to support various scenarios. This allows changing some settings via the environment instead of a configuration file. Most of these relate to the storage backends:
### Timezone settings
##### Amazon Web Services variables used by the S3 backend
- `AWS_ACCESS_KEY_ID`
- `AWS_CONTAINER_AUTHORIZATION_TOKEN`
- `AWS_CONTAINER_CREDENTIALS_FULL_URI`
- `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`
- `AWS_DEFAULT_REGION`
- `AWS_PROFILE`
- `AWS_ROLE_ARN`
- `AWS_ROLE_SESSION_NAME`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN`
- `AWS_STS_REGIONAL_ENDPOINTS`
- `AWS_WEB_IDENTITY_TOKEN_FILE`
- `AWS_SHARED_CREDENTIALS_FILE`
##### Google Cloud variables used by the GCS backend
- `GCLOUD_PROJECT`
- `GOOGLE_APPLICATION_CREDENTIALS`
- `GOOGLE_CLOUD_PROJECT`
- `PRIVATEBIN_GCS_BUCKET`
##### Custom backend settings
The following variables are not used by default, but can be [enabled in your custom configuration file](https://github.com/PrivateBin/docker-nginx-fpm-alpine/issues/196#issuecomment-2163331528), to keep sensitive information out of it:
- `STORAGE_HOST`
- `STORAGE_LOGIN`
- `STORAGE_PASSWORD`
- `STORAGE_CONTAINER`
##### Configuration folder
- `CONFIG_PATH`
##### Timezone settings
The image supports the use of the following two environment variables to adjust the timezone. This is most useful to ensure the logs show the correct local time.
@ -71,6 +106,10 @@ The image supports the use of the following two environment variables to adjust
Note: The application internally handles expiration of pastes based on a UNIX timestamp that is calculated based on the timezone set during its creation. Changing the PHP_TZ will affect this and leads to earlier (if the timezone is increased) or later (if it is decreased) expiration then expected.
### Adjusting nginx or php-fpm settings
You can attach your own `php.ini` or nginx configuration files to the folders `/etc/php/conf.d/` and `/etc/nginx/http.d/` respectively. This would for example let you adjust the maximum size these two services accept for file uploads, if you need more then the default 10 MiB.
### Kubernetes deployment
Below is an example deployment for Kubernetes.
@ -164,7 +203,7 @@ Options:
-p, --purge purge all expired pastes
-s, --statistics reads all stored pastes and comments and reports statistics
docker exec -t privatebin migrate --help
$ docker exec -t privatebin migrate --help
migrate - Copy data between PrivateBin backends
Usage:
@ -182,9 +221,9 @@ Options:
-h, --help displays this help message
-n dry run, do not copy data
-v be verbose
<srcconfdir> use storage backend configration from conf.php found in
<srcconfdir> use storage backend configuration from conf.php found in
this directory as source
<dstconfdir> optionally, use storage backend configration from conf.php
<dstconfdir> optionally, use storage backend configuration from conf.php
found in this directory as destination; defaults to:
/srv/bin/../cfg/conf.php
```

View file

@ -52,13 +52,13 @@ main() {
BUILD_ARGS="--build-arg ALPINE_PACKAGES= --build-arg COMPOSER_PACKAGES="
;;
gcs)
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php83-openssl --build-arg COMPOSER_PACKAGES=google/cloud-storage"
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php84-openssl --build-arg COMPOSER_PACKAGES=google/cloud-storage"
;;
pdo)
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php83-pdo_mysql,php83-pdo_pgsql --build-arg COMPOSER_PACKAGES="
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php84-pdo_mysql,php84-pdo_pgsql --build-arg COMPOSER_PACKAGES="
;;
s3)
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php83-curl,php83-mbstring,php83-openssl,php83-simplexml --build-arg COMPOSER_PACKAGES=aws/aws-sdk-php"
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php84-curl,php84-mbstring,php84-openssl,php84-simplexml --build-arg COMPOSER_PACKAGES=aws/aws-sdk-php"
;;
*)
BUILD_ARGS=""

View file

@ -1,3 +1,3 @@
#!/bin/execlineb -P
foreground { cp -r /etc/s6/services /run }
/bin/s6-svscan /run/services
s6-svscan /run/services

View file

@ -35,3 +35,9 @@ env[GCLOUD_PROJECT] = $GCLOUD_PROJECT
env[GOOGLE_APPLICATION_CREDENTIALS] = $GOOGLE_APPLICATION_CREDENTIALS
env[GOOGLE_CLOUD_PROJECT] = $GOOGLE_CLOUD_PROJECT
env[PRIVATEBIN_GCS_BUCKET] = $PRIVATEBIN_GCS_BUCKET
; allow using custom backend settings
env[STORAGE_HOST] = $STORAGE_HOST
env[STORAGE_LOGIN] = $STORAGE_LOGIN
env[STORAGE_PASSWORD] = $STORAGE_PASSWORD
env[STORAGE_CONTAINER] = $STORAGE_CONTAINER

View file

@ -1,2 +1,2 @@
#!/bin/execlineb -P
/usr/sbin/php-fpm83
/usr/sbin/php-fpm84