Pelican Publisher
An automatic build/publish service for Pelican website in docker
Install
docker pull ray1ex/pelican-publisher
Configuration
Create file pelican-publisher.env
PELICAN_PUBLISHER_DOMAIN=pelican-publisher.rexzhang.com
PELICAN_SITES=[{"NAME":"rexzhang.com","ZIP_URL":"https://github.com/rexzhang/rexzhang.com/archive/master.zip","WEBHOOK_SECRET":"please-change-it-!"},{"NAME":"sample.com","ZIP_URL":"https://sample.com/master.zip","WEBHOOK_SECRET":"secret"}]
PELICAN_PUBLISHER_DOMAIN
is your publisher host's domain, empty will accept any domainPELICAN_SITES
in JSON format, empty is[]
SENTRY_DSN
is your sentry client key (DSN)
Start Service
docker run -dit -p 127.0.0.1:8000:8000 --restart unless-stopped \
-v=/var/www:/output -v=$(pwd)/data:/data \
--env-file pelican-publisher.env \
--name pelican-publisher ray1ex/pelican-publisher
- Your site will output to path
/var/www/SITE_NAME
- Your database file db.sqlite3 will at
$(pwd)/data/db.sqlite3
Setup Webhook
- Github
- Payload URL: like this
https://pelican-publisher.rexzhang.com/webhook/github/rexzhang.com
- Content type: application/json
- Payload URL: like this
Example
instance | https://pelican-publisher.rexzhang.com |
---|---|
source | https://github.com/rexzhang/rexzhang.com |
target | https://rexzhang.com |
TODO
- processing task info
Development
http://127.0.0.1:8000/webhook/test
trigger task
build_pelican_site_task
Issues
Redis
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
celery
RuntimeWarning: You're running the worker with superuser privileges: this is absolutely not recommended!