Skip to content

Commit fc4f4a2

Browse files
mmeyer2kjaydrogers
andauthored
Add option to exit immediately (#13)
* Add zero interval escape to entry point * Update README.md * Update README.md and entrypoint.sh to clarify RENEWAL_INTERVAL behavior - Revised the description of the `RENEWAL_INTERVAL` environment variable in README.md to specify that setting it to `0` disables renewals and runs the process only once. - Enhanced entrypoint.sh with a message indicating that Let's Encrypt renewals are disabled when `RENEWAL_INTERVAL` is set to `0`, improving user awareness of the configuration's impact. --------- Co-authored-by: Jay Rogers <[email protected]>
1 parent dae17e8 commit fc4f4a2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The following environment variables can be used to customize the Certbot contain
4444
| `DEBUG` | Enable debug mode (prints more information to the console) | `false` |
4545
| `PUID` | The user ID to run certbot as | `0` |
4646
| `PGID` | The group ID to run certbot as | `0` |
47-
| `RENEWAL_INTERVAL` | Interval between certificate renewal checks | 43200 seconds (12 hours) |
47+
| `RENEWAL_INTERVAL` | Interval between certificate renewal checks. Set to `0` to disable renewals and only run once. | 43200 seconds (12 hours) |
4848
| `REPLACE_SYMLINKS` | Replaces symlinks with direct copies of the files they reference (required for Windows) | `false` |
4949

5050
## Usage
@@ -155,4 +155,4 @@ If you appreciate this project, be sure to check out our other projects.
155155
### 🌍 Open Source
156156
- **[AmplitudeJS](https://521dimensions.com/open-source/amplitudejs)**: Open-source HTML5 & JavaScript Web Audio Library.
157157
- **[Spin](https://serversideup.net/open-source/spin/)**: Laravel Sail alternative for running Docker from development → production.
158-
- **[Financial Freedom](https://github.com/serversideup/financial-freedom)**: Open source alternative to Mint, YNAB, & Monarch Money.
158+
- **[Financial Freedom](https://github.com/serversideup/financial-freedom)**: Open source alternative to Mint, YNAB, & Monarch Money.

src/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ else
193193
# Run certbot initially to get the certificates
194194
run_certbot
195195

196+
# If RENEWAL_INTERVAL is set to 0, do not attempt to renew certificates and exit immediately
197+
if [ "$RENEWAL_INTERVAL" = "0" ]; then
198+
echo "Let's Encrypt Renewals are disabled because RENEWAL_INTERVAL=0. Running once and exiting..."
199+
cleanup
200+
fi
201+
196202
# Infinite loop to keep the container running and periodically check for renewals
197203
while true; do
198204
# POSIX-compliant way to show next run time

0 commit comments

Comments
 (0)