8000 Fix reloading if files are replaced by abh · Pull Request #1 · dyson/certman · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix reloading if files are replaced #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Fix reloading if files are replaced #1

wants to merge 14 commits into from

Conversation

abh
Copy link
@abh abh commented Nov 29, 2021

No description provided.

abh added 3 commits November 28, 2021 21:44
(on macOS and/or newer Go versions the error changed)
On linux inotify is tied to the inode, so if the files are
replaced (rather than re-written in place) the previous code
wouldn't be watching the new files.

The fix instead watches the diretory and then reloads when
filenames matching the original names are modified.

Another issue I ran into was the vault agent having a small
window between updating the certificate and key, so the
reloading would always have a noisy "key and cert don't match"
error. Fix this by always waiting 2 seconds after a change
to do the reload.
@ts3ng ts3ng mentioned this pull request Feb 17, 2022
dyson and others added 4 commits May 28, 2023 23:44
Bump go and use go modules.
Logs were prefixed with "certman: " however this imposes an odd format
on the logging. The injected logger is a better place to do any
prefixing if desired or to perform structured logging, etc.

The "certman: " prefix has been removed from all log lines.
Use shields.io for version badge in README.
BREAKING CHANGES:
- Replace custom logger interface with standard log/slog
- Remove public Logger() method in favor of WithLogger() option
- Change constructor to accept functional options
- Require Go 1.21+ for slog support

Features:
- Add WithLogger() and WithContext() functional options
- Use context.Context for graceful shutdown
- Structured logging with Info, Error, and Debug levels
- Add comprehensive CLAUDE.md for AI-assisted development

This modernizes the API to use Go's standard structured logging
and provides a cleaner, more extensible interface through functional
options pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0