Add git backup to remote repository (closes #996)#1018
Add git backup to remote repository (closes #996)#1018EduardSchwarzkopf wants to merge 58 commits into
Conversation
|
Let me know when you are done. |
|
absolutely fine. Should I update the versions in the README from v0.10.0 to v,0.11.0 for the backup and reverse proxy features?
|
|
alright, i have updated the code. I hope i got everything. Let me know if there is still some things missing. |
|
thanks! It would be could if you could create a separate PR with the flag documentation of the proxy settings. I would keep the Git configuration still in this PR, to be ready for the v0.11.0 release. I will checkout the branch and let it run on my system and test it a bit manually before merging it. Hopefully soon ;) If you are interested to support more let me know! One issue I'm facing at the moment, as the flags are growing not sure if it makes sense to keep them like that. If you are interested to do a proposal and implementing it. Let me know! But we still need to consider how it could be started in a few seconds without providing a huge configuration file. Maybe like Paperless-ngx? https://docs.paperless-ngx.com/configuration/ They allow a configuration file & flags. Maybe this is the way to go. |
Alright, will remove this from my PR then and provide a new PR.
Sadly i do not have that much time to be an active maintainer, but I might provide more support in the future, when i see the need for a new feature/fix :D
Yes, I see the point, having this managed via a config or .env file is fine for the moment. Long term, I'd suggest moving this into a settings page, so the user can manage this via UI? |
Perfect, thanks!
Happy to hear ;)
Here I need to think a bit deeper, because as a K8s admin, I hate having my configuration not managed via GitOps. So it depends, but I need to think about it. |
100%, considering the point that the setup itself requires some sort of technical knowledge, I'd 100% second your idea with a configuration file. Maybe to have the pluses of both worlds, the app can provide a small overview of enabled features and their values, similar to Firefox's about:config`. Another benefit of this is that it also provides a bit of a sanity check. |
|
@EduardSchwarzkopf thanks for rebasing it. I will check it out the upcoming days. I reworked a bit the Readme. Based on your PR, regarding releases badge :) |
|
No problemo. I'm just not too sure about the big backup section in README tbh. Maybe move it into |
|
I need to spin up anyway a LeafWiki instance for the public documentation. If you take a look at the bitnami sealed secrets repo https://github.com/bitnami-labs/sealed-secrets. They have a pretty huge readme already. I guess this is OK for now. I think it is already good to have it documented. |
|
I will work on your branch if it is ok. |
|
Yes, sure, go ahead, I don't mind at all. Hit me up, when you need something from my end |
|
I have to do a patch release and some smaller improvements. So not sure when I will get to that, but you already have the functionality. So I guess it is not urgent to you |
@perber I'm not in a rush here. My backups are running anyway. This feature is nothing I'm desperate to have. You are doing great work, so don't rush anything :) |
What: Automated git backup to a remote repository via SSH with configurable schedule.
Why: Addresses the feature request in #996 — users wanted an optional way to auto-commit page saves and push them to a remote git repository for backup purposes, similar to Otterwiki's experimental repository management feature.
Changes:
internal/backup/package — Git repository operations, scheduled backup runner, configuration, status tracking, and gitignore handlingGET /api/admin/backup/statusandPOST /api/admin/backup/pushendpointsdocs/docker-backup.mdaddedConfiguration
CLI Flags
--git-backupfalse--git-backup-remote""--git-backup-branchmain--git-backup-author-nameLeafWiki Backup--git-backup-author-email[email protected]--git-backup-interval60--git-backup-ssh-key-path""--git-backup-ssh-key""--git-backup-ssh-known-hosts""Environment Variables
LEAFWIKI_GIT_BACKUPLEAFWIKI_GIT_BACKUP_REMOTELEAFWIKI_GIT_BACKUP_BRANCHLEAFWIKI_GIT_BACKUP_AUTHOR_NAMELEAFWIKI_GIT_BACKUP_AUTHOR_EMAILLEAFWIKI_GIT_BACKUP_INTERVALLEAFWIKI_GIT_BACKUP_SSH_KEY_PATHLEAFWIKI_GIT_BACKUP_SSH_KEYLEAFWIKI_GIT_BACKUP_SSH_KNOWN_HOSTSExample usage
Or via environment variables:
Admin API
When git backup is enabled, two admin-only REST endpoints are available:
/api/admin/backup/status/api/admin/backup/pushRestoring from backup
To restore your wiki from a git backup:
git logto view backup history andgit checkout <commit>to restoreNote: Only
root/andassets/are backed up. The SQLite database is not included.