woolfg / dokuwiki-plugin-gitbacked

Plugin for DokuWiki to store/sync files and media with a git repo
GNU General Public License v2.0
74 stars 26 forks source link

Fails to detect changes done by other plugins #51

Closed fama closed 1 year ago

fama commented 4 years ago

We have two plugins that gitabacked fails to detect:

I think the solution may be to periodically add all files in the pages and media folders. Similarly as doing periodic git pull if enabled in the configuration.

woolfg commented 4 years ago

I guess there are two options:

@fama, do you have any information about the plugins if the call any hooks when creating files? I think this would be the clean solution. Plugins should call hooks and other plugins can react to it.

fama commented 4 years ago

I looked at the code and with my very limited php experience, it seems:

  1. draw.io action.php does not create any suitable event
  2. dokuwiki-plugin-move's op.php seems to use an event PLUGIN_MOVE_MEDIA_RENAME. Not sure if this is helpful.

I do like the periodic add/commit solution because:

  1. Config already specifies in which paths to ignore plugin»gitbacked»ignorePaths. All the other newly created pages and media files get backed up upon creation/update anyway.
  2. There may be other plugins now or in the future that my not be firing events and thus running into the same risk of missing backup.
  3. There already is a similar functionality with plugin»gitbacked»periodicPull. Maybe a plugin»gitbacked»periodicAddCommit as an option may be helpful to prevent missing backups.
woolfg commented 4 years ago

I see, maybe as an optional feature it could solve some issues, true. @fama, would you be up to develop this feature and send a Pull Request? It would help the project and the community a lot. I can also give some guidance when needed.

ochurlaud commented 2 years ago

at least we should find this one https://github.com/woolfg/dokuwiki-plugin-gitbacked/commit/8457ba7e9b7c6f553a9c104f91ea1d6cb48a5c13

annProg commented 1 year ago

I feel stuck when submit. Every submit need wait at least 5 seconds. When pushAfterCommit not checked, only need less then 40ms.

So, for performance reason, please support periodic push.

Or, is there some alternative method to push commit? If I set pushAfterCommit to false, when to push commit?

woolfg commented 1 year ago

hey @annProg, thanks for the input. I think it would help multiple people. do you want to implement it?

annProg commented 1 year ago

hey @annProg, thanks for the input. I think it would help multiple people. do you want to implement it?

I have implemented periodic push with crontab, and it works quite well, maybe there is no need to implement it in the plugin

woolfg commented 1 year ago

also a good solution @annProg , especially a pragmatic one. I will close the issue for now, but can be reopened at any time.