Parasol Static Site
A recipe for generating static websites with Hugo and a listener service which triggers git pulls and builds via webhookd
- Category: Development
- Status: 0, dev
- Image: site-badger
- Healthcheck: {{ .Healthcheck }}
- Backups: No
- Email: No
- Tests: No
- SSO: No
Quick start
abra app new parasol-static-site --secrets
abra app config <app-site-name>
abra app deploy <app-site-name>
For more, see docs.coopcloud.tech
.
Modes
Public
The default deployment is fully public:
/
: the Hugo site is served/deploy
: the webhook to re-build the site, includes publicly viewable logs
HTTP Basic Auth
If you enable this in your .env
file:
AUTH_ENABLED=1
AUTH_USERNAME=foobar
SECRET_AUTH_PASSWORD_VERSION=v1
Then you can run abra app secret generate -a <domain>
.
When you deploy:
/
: the Hugo site is served/deploy
: the webhook is behind HTTP basic auth
Private repository
If you enable this in your .env
file:
COMPOSE_FILE="compose.yml:compose.private.yml"
PRIVATE_ENABLED=1
SECRET_DEPLOY_KEY_VERSION=v1
Then you need to generate a SSH key:
ssh-keygen -a 100 -t ed25519
Then, you need to remove the final newline of the file:
truncate -s -1 <ssh-private-key-file>
And due to a limitation in abra
(can't insert files yet), you'll have to manually insert the secret yourself:
DOCKER_CONTEXT=example.org \
docker secret create \
parasol-static-site_example_org_deploy_key_v1 \
<ssh-private-key-file>
Run abra app secret ls <domain>
to get a hint about the exact formatting of the secret name.
You can then deploy and the deploy key will be loaded before cloning the private repository.
HTTP Basic Auth & Private repository
Combine them with the COMPOSE_FILE
technique:
COMPOSE_FILE="compose.yml:compose.auth.yml:compose.private.yml"
Troubleshooting
Site not generating?
You can manually trigger the site build yourself:
abra app run <domain> badger sh
sh /root/scripts/deploy.sh
SSH keys not working?
You can get in and inspect the SSH keys via the following:
abra app run <domain> badger sh
ls /root/.ssh
License
The following starter was made by @adz for offline.place with the following license:
UNIVERSAL PUBLIC DOMAIN LICENSE
This software and everything else in the universe is in the public domain. Ideas are not property.