-
Notifications
You must be signed in to change notification settings - Fork 759
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
backup nextcloud v2 #2289
backup nextcloud v2 #2289
Conversation
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.
looks good, I'll work on integrating SCP like this as well now
|
@fichtner SCP is slightly different because it may be harder to do a directory listing. One of the big advantages is, that it can be safe to put the modules into plugins since it is a single file. |
|
@fabianfrz I'll try to review this weekend and pull it in, great work! |
|
@AdSchellevis @fichtner If there are many backup implementations, it would make sense to use tabs but it's ok for now. |
|
Still, no-dependency backup features can go into the core. And listing is easy as long as ssh is allowed as well. 😊
Tabs are useful until we have too many plugins. Could break them out into the menu eventually?
… On 24. Mar 2018, at 16:08, Fabian Franz BSc ***@***.***> wrote:
@AdSchellevis @fichtner If there are many backup implementations, it would make sense to use tabs but it's ok for now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Like Interfaces? May slow down the web interface and is not often needed. Probably better where it is now. |
|
no, static and cached via its own Menu.xml |
| $config = $cnf->object(); | ||
| foreach ($fields as &$field) { | ||
| $fieldname = $field['name']; | ||
| if (isset($config->system->remotebackup->$fieldname)) { |
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.
maybe better to place the settings in it's own container (for example system->backup->nextcloud->..), even better would be to use a model class to handle validations.
| $input_errors[] = gettext('The Backup Directory can only consist of alphanumeric characters.'); | ||
| } | ||
| // required fields | ||
| if (isset($config['system']['remotebackup']['nextcloud_enabled']) && $config['system']['remotebackup']['nextcloud_enabled']) |
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.
$config not known here, either push the validations to a model or fetch the config object like
core/src/opnsense/mvc/app/library/OPNsense/Backup/GDrive.php
Lines 143 to 146 in d5cddde
| $config = Config::getInstance()->object(); | |
| if (!isset($config->system->remotebackup)) { | |
| $config->system->remotebackup = array(); | |
| } |
| } | ||
| foreach ($this->getConfigurationFields() as $field) { | ||
| $fieldname = $field['name']; | ||
| if ($field['type'] == 'file') { |
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.
In case you're not using a model (which would need a refactoring of this section), you could ditch the file handling here, the settings don't seem to require file type inputs.
|
@AdSchellevis hope it is ok now - please note that there is some stuff inside the code, which should not be in (imho):
|
|
@fabianfrz Thanks! there is indeed room for improvement, let me pull this in and refactor some when I have some time available. |
|
@fabianfrz can you try this d465ef2 602e42f ? I don't have a nextcloud account available to test. |
|
Does nothing anymore. Probably the changes in the "if" will stop it working. |
|
no logging, nothing? |
|
nothing. |
|
I can make you an account on my nextcloud instance if you like. |
|
sure, it's probably something small. just to be sure, you did save settings? I moved all the properties... When I add random data, I do have entries in syslog like: |
|
Found out the issue: the behaviour has changed. before your refactoring the test did run even when the "enabled" flag was When it is enabled, it is working. |
|
ok, nice, thanks for testing. I think it's better to skip testing when disabled. |
|
so no account needed ;) |
|
nope, easier on my end :) |
|
I get these in the background, probably during a migration run: |
|
the first line says it fails in runMigrations - however there is probably no data to migrate |
|
@fichtner add the following defaults? |
|
I don't know, maybe we shouldn't render unused models. it seems silly to enforce this. In any case, the error is bad and everyone will report it... |
|
@fichtner maybw the migration script should check if the mount piont exist before running a migration. That would fix some other models in the plugins as well. |
|
@fabianfrz @fichtner I have two possible solutions here, use constraints between fields, added DependConstraint type which could help here. Let me push a simple model fix |
|
yes, that looks good to me The basic trouble is we want to render model defaults in new model versions so we can use them unconditionally, but then again sometimes that makes no sense at all because it's not used unconditionally :) |
|
works perfectly ❤️ |
|
Cool new feature, thanks! No work on my I use CaCert on |
|
yes. you need a trusted certificate. |
|
Ok. No way to add |
|
@wols The GUI currently does not support it. It relies on the Mozilla certificate bundle. You have to add it manually and keep in mind that an update of the certificate bundle may undo your changes. |
|
Thanks a lot - I added CaCert and it works: |
@AdSchellevis here is an updated version