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
Nextcloud backup: allow subdir #4077
Conversation
@fabianfrz do you have time to spin this for a test? |
@AdSchellevis crashes immediately: Fatal error: Uncaught Error: Call to undefined function OPNsense\Backup\basedir() in /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php:147 Stack trace: #0 /usr/local/www/diag_backup.php(286): OPNsense\Backup\Nextcloud->backup() #1 {main} thrown in /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php on line 147 |
log after fixing the issue by replacing it by basename(), opnsense/backup as file name: config[60397]: Error while fetching filelist from Nextcloud {
"url":"https:\/\/nextcloud.test\/remote.php\/dav\/files\/opnsensebkp\/Backup",
"content_type":"text\/html; charset=UTF-8",
"http_code":404,
"header_size":1220,
"request_size":205,
"filetime":-1,
"ssl_verify_result":0,
...
} Tested on OPNsense 20.1.r_12 (amd64/LibreSSL) - I don't think somebody changed the nextcloud code inbetween |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code is broken and not ready to deploy. Test failed.
Hi @fabianfrz thanks for the feedback. About the last issue, one question: does |
I'm sorry for the misspelled function name, I meant to use |
now the php error is gone but the backup still fails. |
Does the parent directory exist? |
nope, but that is what the code is expected to do, create the full directory hierarchy if missing. |
Ok, I will implement that. I asked two comments ago but got not answer... |
Sorry I forgot the answer but if you read the source, there is already MKCOL implemented which is doing this so yes, it is the current behaviour. |
I've updated the patch and merge against current master, I hope it's fine now |
Any chance to get another review? |
Hii,
Thanks in advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some improvements for the models but if this changes are in the PR, I can give it a test run.
src/opnsense/mvc/app/models/OPNsense/Backup/NextcloudSettings.xml
Outdated
Show resolved
Hide resolved
src/opnsense/mvc/app/models/OPNsense/Backup/NextcloudSettings.xml
Outdated
Show resolved
Hide resolved
As per @fabianfrz feedback
Tested now successfully: @AdSchellevis you can merge it now if you like. |
@maxxer @fabianfrz thanks! I will merge it to master |
Fixes #3988