-
Notifications
You must be signed in to change notification settings - Fork 693
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
opnsense/core: automatically remove trailing slash #3361
Conversation
Wouldn't it be easier to add this to the validation? |
@fichtner would be an option too - in this case it would autocorrect which is probably also a benefit for the user as he does not have to change it and save it again. |
It's obscure. I'd rather want to go for a hard fail with a clear validation message. the damage is already done so to speak. We can make a not in the release notes... |
@fichtner, ok then I will change it. |
@fichtner this should throw an error in case the user does input something stupid |
Co-Authored-By: fabianfrz <fabianfrz@users.noreply.github.com>
src/opnsense/mvc/app/models/OPNsense/Backup/NextcloudSettings.xml
Outdated
Show resolved
Hide resolved
Co-Authored-By: fabianfrz <fabianfrz@users.noreply.github.com>
Merged, thanks! |
@@ -9,6 +9,8 @@ | |||
</enabled> | |||
<url type="TextField"> | |||
<Required>N</Required> | |||
<mask>/^https?:\/\/.*[^\/]$/</mask> |
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.
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.
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.
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.
@opnsenseuser What do you want to tell me with your screenshot? It is very unlikely that the validation fails with your URL.
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.
sorry, I have mispronounced myself. I just wanted to say that cloudnow settings work here as well.
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'm sure that other cloud services would also be configurable via the input mask. So would not it be advantageous to replace the term nextcloud with a generic term?
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.
@fabianfrz I just wanted to make an improvement proposal. I imagine a drop down box, where you can select different cloud services. eg nextcloud, owncloud, cloudnow, etc. the data are then eg already pre-filled but still modifiable. I imagine that as in the dyndns settings Plugin from opnsense. what do you think?
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.
@opnsenseuser nextcloud and owncloud are usually on premise solutions, so you have to explicitly configure the URL or the hostname anyway. In my case I have my own nextcloud on my own domain which I used for testing this module against. The reason why it is called nextcloud is that I do not test it against an owncloud instance (even if it very likely works because the same WebDAV library is working under the hood).
SAAS services are different. If it works, that's fine but I don't want to test against all of them (never ending story) and I currently cannot add anything else then the input fields (for example no JS to create something like a template directly in my file but that should be pluggable). Please note that this must follow the paths of nextcloud to work. Other WebDAV variants will not work as the nextcloud paths and responses are hardcoded in the file.
(cherry picked from commit cec7691)
removes also spaces for more safety.
closes #2647