[GH-ISSUE #1176] proposal - reload config file on save #919

Closed
opened 2026-05-05 12:35:06 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @YanB25 on GitHub (Apr 4, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1176

abstract

I'd like to contribute to this project by adding a new feature. I wish to support reloading the config files automatically on save.

details

Users can enable this feature in frpc.ini

reload_on_save = true

and whenever the config file is written, a reload is automatically triggered.

implementation details

I would use https://github.com/fsnotify/fsnotify(Cross-platform file system notifications for Go) to watch the config files and use go's channel to pass the information asynchronously.

motivation

It's more natural for users (including me) to ssh to the client and change the config file. AdminUI is great but ssh is better.
A reload on save would be helpful.

Originally created by @YanB25 on GitHub (Apr 4, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1176 ## abstract I'd like to contribute to this project by adding a new feature. I wish to support reloading the config files automatically on save. ## details Users can enable this feature in `frpc.ini` ``` reload_on_save = true ``` and whenever the config file is written, a `reload` is automatically triggered. ### implementation details I would use [https://github.com/fsnotify/fsnotify](fsnotify)(Cross-platform file system notifications for Go) to watch the config files and use `go's channel` to pass the information asynchronously. ## motivation It's more natural for users (including me) to `ssh` to the client and change the config file. AdminUI is great but `ssh` is better. A reload on save would be helpful.
gitea-mirror 2026-05-05 12:35:06 -06:00
  • closed this issue
  • added the
    proposal
    label
Author
Owner

@fatedier commented on GitHub (Apr 4, 2019):

I'm glad for your upcoming contribution.

Can we use reload_on_update instead of reload_on_save ?

The repo https://github.com/fsnotify/fsnotify maybe has some problem on macos like missing some events.

<!-- gh-comment-id:479770284 --> @fatedier commented on GitHub (Apr 4, 2019): I'm glad for your upcoming contribution. Can we use `reload_on_update` instead of `reload_on_save` ? The repo `https://github.com/fsnotify/fsnotify` maybe has some problem on macos like missing some events.
Author
Owner

@YanB25 commented on GitHub (Apr 5, 2019):

Can we use reload_on_update instead of reload_on_save ?

Okay.

The repo https://github.com/fsnotify/fsnotify maybe has some problem on macos like missing some events.

The repo has some problems causing extra events on files (this issue). Users may find extra reload triggered in the log file. I couldn't find a stable library to watch a file on MacOS currently.

If extra reloads on MacOS is not acceptable, maybe we have to close this issue.

<!-- gh-comment-id:480135477 --> @YanB25 commented on GitHub (Apr 5, 2019): > Can we use `reload_on_update` instead of `reload_on_save` ? Okay. > The repo `https://github.com/fsnotify/fsnotify` maybe has some problem on macos like missing some events. The repo has some problems causing *extra* events on files ([this issue](https://github.com/howeyc/fsnotify/issues/62)). Users may find extra reload triggered in the log file. I couldn't find a stable library to watch a file on MacOS currently. If extra reloads on MacOS is not acceptable, maybe we have to close this issue.
Author
Owner

@fatedier commented on GitHub (Apr 5, 2019):

Double events is ok. The problem is missing events.

You can try to test it or at least reload conf at a fixed interval ?

<!-- gh-comment-id:480312229 --> @fatedier commented on GitHub (Apr 5, 2019): Double events is ok. The problem is missing events. You can try to test it or at least reload conf at a fixed interval ?
Author
Owner

@YanB25 commented on GitHub (Apr 6, 2019):

You can try to test it or at least reload conf at a fixed interval ?

Yes, I can get the last modified time at a fixed interval and reload on necessary, if you prefer to use polling.

The problem is missing events.

I go through the issues and only find this one related to losing events. There's no further information about it. Only double events bug is confirmed.

BTW, I have MacOS environment and I can have a test about it if necessary.

<!-- gh-comment-id:480499266 --> @YanB25 commented on GitHub (Apr 6, 2019): > You can try to test it or at least reload conf at a fixed interval ? Yes, I can get the `last modified time` at a fixed interval and reload on necessary, if you prefer to use polling. > The problem is missing events. I go through the issues and only find [this one](https://github.com/fsnotify/fsnotify/issues/220) related to losing events. There's no further information about it. Only double events bug is confirmed. BTW, I have MacOS environment and I can have a test about it if necessary.
Author
Owner

@fatedier commented on GitHub (Jul 25, 2019):

@YanB25 No progress?

<!-- gh-comment-id:514938949 --> @fatedier commented on GitHub (Jul 25, 2019): @YanB25 No progress?
Author
Owner

@zyfdegh commented on GitHub (Jan 2, 2020):

Any update?

<!-- gh-comment-id:570111068 --> @zyfdegh commented on GitHub (Jan 2, 2020): Any update?
Author
Owner

@fatedier commented on GitHub (Mar 20, 2026):

This has been open for a long time — thanks for the suggestion. Since then, frpc has added a web dashboard with config editing, a reload API, and a store API for dynamic proxy/visitor management at runtime. These cover the original use case, so closing this.

<!-- gh-comment-id:4099315357 --> @fatedier commented on GitHub (Mar 20, 2026): This has been open for a long time — thanks for the suggestion. Since then, frpc has added a web dashboard with config editing, a reload API, and a store API for dynamic proxy/visitor management at runtime. These cover the original use case, so closing this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#919
No description provided.