https://github.com/hyrsky/certbot-jail
Get Let's encrypt certificate in FreeNAS jail.
https://github.com/hyrsky/certbot-jail
freenas-scripts letsencrypt
Last synced: 11 months ago
JSON representation
Get Let's encrypt certificate in FreeNAS jail.
- Host: GitHub
- URL: https://github.com/hyrsky/certbot-jail
- Owner: hyrsky
- License: mit
- Created: 2018-12-11T21:27:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-11T23:14:30.000Z (about 7 years ago)
- Last Synced: 2025-01-17T11:46:04.796Z (about 1 year ago)
- Topics: freenas-scripts, letsencrypt
- Language: Shell
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Let's encrypt jail
1. Create aws user with policies
* Managed policy ``AmazonRoute53ReadOnlyAccess``
* Managed policy ``AmazonRoute53DomainsReadOnlyAccess``
* Policy from ``./policy.json``
2. Create ``~/.aws/credentials`` with content:
```ini
[default]
aws_access_key_id=
aws_secret_access_key=
```
3. Log in to jail and run following commands
```sh
pkg install py36-certbot py36-ansible py36-boto git
git clone https://github.com/hyrsky/certbot-jail.git
certbot-jail/certonly
```
4. Then create cron job for renewing certificate
```sh
# Attempt to renew daily
0 3 * * * $HOME/certbot-jail/renew
```
5. Run following commands as root inside FreeNAS
Copy files to boot pool. Certificates are not available if using encrypted pool.
```sh
mkdir -p /certs
chmod 700 /certs
ln -s /certs/fullchain.pem /certs/letsencrypt.crt
ln -s /certs/privkey.pem /certs/letsencrypt.key
rsync -L /mnt/POOL/iocage/jails/letsencrypt/root/usr/local/etc/letsencrypt/live/DOMAIN/* /certs
```
6. Create certificate with identifier letsencrypt
7. Create System > Tunables: SSLDIR (rc.conf) = /certs
8. Create Tasks > Cron Jobs:
```sh
# Attempt to renew daily
30 3 * * *
rsync -L /mnt/POOL/iocage/jails/letsencrypt/root/usr/local/etc/letsencrypt/live/DOMAIN/* /certs && service nginx reload
```
9. Enable HTTPS in System > General
## TODO
* Installer script