zerobin is now privatebin

This commit is contained in:
Wonderfall
2016-08-06 12:10:15 +02:00
parent 14cddd6caa
commit 02347ce19e
6 changed files with 5 additions and 5 deletions

36
privatebin/Dockerfile Normal file
View File

@ -0,0 +1,36 @@
FROM alpine:edge
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ENV GID=991 UID=991
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& BUILD_DEPS="tar openssl ca-certificates" \
&& apk -U add \
$BUILD_DEPS \
nginx \
supervisor \
tini@commuedge \
php7-fpm@testing \
php7-gd@testing \
php7-mcrypt@testing \
php7-json@testing \
php7-zlib@testing \
&& mkdir zerobin && cd zerobin \
&& wget -qO- https://github.com/PrivateBin/PrivateBin/archive/master.tar.gz | tar xz --strip 1 \
&& mv cfg/conf.ini.sample cfg/conf.ini \
&& apk del $BUILD_DEPS \
&& rm -f /var/cache/apk/*
COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm.conf /etc/php7/php-fpm.conf
COPY supervisord.conf /usr/local/etc/supervisord.conf
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
VOLUME /zerobin/data
EXPOSE 80
CMD ["/sbin/tini","--","run.sh"]

18
privatebin/README.md Normal file
View File

@ -0,0 +1,18 @@
## wonderfall/privatebin
Paste securely.
#### Features
- Based on Alpine Linux.
- Uses [PrivateBin](https://github.com/PrivateBin/PrivateBin), originally a fork of zerobin by elrido.
- Bundled with nginx and PHP7.
#### Environment variables
- **UID** : zerobin user id
- **GID** : zerobin group id
#### Volumes
- **/zerobin/data**
#### Ports
- **80** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)

84
privatebin/nginx.conf Normal file
View File

@ -0,0 +1,84 @@
user zerobin;
worker_processes auto;
pid /var/run/nginx.pid;
daemon off;
events {
worker_connections 1024;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log /var/log/nginx/error.log error;
sendfile on;
keepalive_timeout 15;
keepalive_disable msie6;
keepalive_requests 100;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
gzip on;
gzip_comp_level 5;
gzip_min_length 512;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_vary on;
gzip_disable "msie6";
gzip_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/vnd.ms-fontobject
font/truetype
font/opentype
image/svg+xml;
server {
listen 80;
root /zerobin;
index index.php index.html;
location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ {
expires 30d;
access_log off;
}
location ~ ^/(data|cfg|tmp) {
deny all;
}
location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
deny all;
}
location ~ /\. {
deny all;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
}

12
privatebin/php-fpm.conf Normal file
View File

@ -0,0 +1,12 @@
[www]
user = zerobin
group = zerobin
listen = /var/run/php-fpm.sock
listen.owner = zerobin
listen.group = zerobin
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

5
privatebin/run.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
addgroup -g ${GID} zerobin && adduser -h /zerobin -s /bin/sh -D -G zerobin -u ${UID} zerobin
touch /var/run/php-fpm.sock
chown -R zerobin:zerobin /zerobin /var/run/php-fpm.sock /var/lib/nginx /tmp
supervisord -c /usr/local/etc/supervisord.conf

View File

@ -0,0 +1,8 @@
[supervisord]
nodaemon=true
[program:php-fpm]
command=php-fpm7 --nodaemonize
[program:nginx]
command=nginx