====== Bepasty ======
https://github.com/bepasty/bepasty-server\\
https://bepasty-server.readthedocs.io/en/latest/quickstart.html#configuring-bepasty\\
https://hub.docker.com/r/asmaps/bepasty
FROM python:alpine
ENV BEPASTY_CONFIG=/bepasty/bepasty.conf
RUN \
python -m venv bepasty && \
source /bepasty/bin/activate && \
pip install --upgrade pip && \
pip install bepasty gunicorn gevent && \
mkdir /storage
COPY bepasty.conf /bepasty/bepasty.conf
EXPOSE 5000
CMD ["/bepasty/bin/gunicorn", "bepasty.wsgi", "-k", "gevent", "--log-level=info", "--name", "bepasty", "--bind=0.0.0.0:5000", "--workers=4"]
version: '3'
services:
bepasty:
build: ./bepasty
container_name: bepasty
restart: unless-stopped
volumes:
- bepasty:/storage
labels:
- "traefik.enable=true"
- "traefik.http.routers.bepasty.rule=Host(`bva.dyndns.info`) && PathPrefix(`/paste`)"
- "traefik.http.routers.bepasty.tls.certresolver=le"
volumes:
bepasty:
Для версии Bepasty 1.2.0 нужно было в RUN докерфайла добавлять переустановку Werkzeug ''pip install -U Werkzeug==2.3.8 && \'', т. к. ставился [[https://github.com/bepasty/bepasty-server/issues/312|несовместимый Werkzeug v3]]. Если оставить как есть, то gunicorn не запустится. В 1.2.1 это исправили.
STORAGE_FILESYSTEM_DIRECTORY = '/storage/'
SITENAME = 'bva.dyndns.info'
APP_BASE_PATH = '/paste'
# UPLOAD_LOCKED = False
MAX_ALLOWED_FILE_SIZE = 4 * 1024 * 1024 * 1024
# MAX_BODY_SIZE = 1 * 1024 * 1024
# STORAGE = 'filesystem'
SECRET_KEY = 'superSecretString123'
# Set true if you use HTTPS, else set false
SESSION_COOKIE_SECURE = True
PERMANENT_SESSION = False
# PERMANENT_SESSION_LIFETIME = 31 * 24 * 3600
DEFAULT_PERMISSIONS = 'create,modify,read,delete'
PERMISSIONS = {
'superuser_93feoFgWa': 'admin,list,create,modify,read,delete',
}
# The asciinema player theme (one of asciinema, tango, solarized-dark,
# solarized-light, monokai)
# ASCIINEMA_THEME = 'asciinema'
https://bepasty-server.readthedocs.io/en/latest/_modules/bepasty/config.html#Config
===== CLI =====
# Общая справка
docker exec bepasty bepasty-object --help
# Справка по конкретной команде (удалению объектов)
docker exec bepasty bepasty-object purge --help
https://bepasty-server.readthedocs.io/en/latest/quickstart.html#invoking-cli-commands