Skip to content

Mount options GUI for external storage - #14925

Merged
RobinMcCorkell merged 2 commits into
masterfrom
ext-mountoptions-ui
Mar 26, 2015
Merged

RobinMcCorkell merged 2 commits into
masterfrom
ext-mountoptions-ui

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Requires #11884 to be merged first.

@icewind1991 @DeepDiver1975 @Xenopathic FYI

mountoptions

@jancborchardt I hope the look of this dropdown is ok for now (there will be more checkboxes soon)

@PVince81 PVince81 added this to the 8.1-current milestone Mar 16, 2015
@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Nice!

@karlitschek

Copy link
Copy Markdown
Contributor

nice 👍

@jancborchardt

Copy link
Copy Markdown
Contributor

@PVince81 yes, for now the look is ok. We can polish the popovers for 8.2 then.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Needs rebasing

@PVince81

Copy link
Copy Markdown
Contributor Author

in progress

@PVince81
PVince81 force-pushed the ext-mountoptions-ui branch from 4fcfe87 to 9b4daf0 Compare March 20, 2015 13:22
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased onto master.

@icewind1991 do we already have an option name for disabling the scanner ?

@icewind1991

Copy link
Copy Markdown
Contributor

Same as the global config one 'filesystem_check_changes'

@PVince81

Copy link
Copy Markdown
Contributor Author

Cool, thanks. I'll add it.

  • add "filesystem_check_changes" option in dropdown

@PVince81

Copy link
Copy Markdown
Contributor Author

I have added the option, but there seems to be a problem when reading it.
The config becomes this:

{
    "user": {
        "all": {
            "\/$user\/files\/SFTP": {
                "id": 1,
                "class": "\\OC\\Files\\Storage\\SFTP",
                "options": {
                    "host": "localhost",
                    "user": "vincent",
                    "password": "",
                    "root": "\/home\/vincent\/temp\/sftpmount",
                    "undefined": "100",
                    "password_encrypted": "REMOVED"
                },
                "priority": 100,
                "mountOptions": {
                    "previews": "false",
                    "filesystem_check_changes": "true"
                },
                "storage_id": "13"
            }
        }
    }
}

When debugging the code here https://github.com/owncloud/core/blob/master/lib/private/files/storage/common.php#L336 the value was not set / empty array.
Will try and debug this further.

  • BUG: FS option not read properly (or possibly options not stored in correct location)

Also:

  • BUG: "undefined" property, possibly a bug with priority

@PVince81

Copy link
Copy Markdown
Contributor Author

Ok, turns out the option is available, but the booleans are converted to strings somehow.
Also the watcher is not a bool but an int.

  • properly convert data types (or maybe POST the data as JSON instead of form-encoded)
  • use select box + int for watcher

@PVince81

Copy link
Copy Markdown
Contributor Author

I fixed all the issues.

I also noticed that the default watcher policy (1) doesn't even seem to work ? Raised as #15081

@PVince81

Copy link
Copy Markdown
Contributor Author

Here we go Mr Jenkins #15082

@MorrisJobke

Copy link
Copy Markdown
Contributor

Rebase needed :(

@MorrisJobke

Copy link
Copy Markdown
Contributor

Looks nice so far :)

Added option to disable autoscan of external storages
Mount option file system scan is now an int
Move priority field to avoid undefined field in storage options

All input elements inside the storage options block get parsed into
storage options.

Moving the priority field outside prevents it to appear in the storage
config, as expected. It is still parsed by special code.
@PVince81
PVince81 force-pushed the ext-mountoptions-ui branch from 554a827 to ca6b715 Compare March 26, 2015 10:21
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased.

Note: while you can change the watcher setting, the watched might not work properly, which will be addressed in #15081

@PVince81

Copy link
Copy Markdown
Contributor Author

Jenkins PR second edition: #15213

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81 Is this ready to review or still WIP? (see label) ;)

@PVince81

Copy link
Copy Markdown
Contributor Author

To review. Thanks.

@karlitschek

Copy link
Copy Markdown
Contributor

still 👍 from my side

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

👍

@PVince81

Copy link
Copy Markdown
Contributor Author
  • BUG: policy value is read as string instead of int, so the policy isn't applied properly

I'm on it.

str_replace for $user substitution was converting the data type of
mountOptions to string. This fix prevents this to happen by making sure
only strings are processed by substitution.

Also added a int conversion when reading the watcher policy
@PVince81

Copy link
Copy Markdown
Contributor Author

Fixed reading the mount options, which now actually make the watcher work properly.
Please re-review.

To test:

  1. Mount a SMB storage
  2. Add a file directly on SMB
  3. Refresh the web UI: new file appears
  4. Set the watcher policy to "Never"
  5. Create a file directly on SMB
  6. Refresh the web UI: no change, new file not detected
  7. Switch watcher policy to "Always" (third option)
  8. Refresh the web UI: last file appears

@PVince81

Copy link
Copy Markdown
Contributor Author

Jenkins PR: #15236

@icewind1991

Copy link
Copy Markdown
Contributor

Code looks good 👍

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 4066 Issues, 127 Patches

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

👍

RobinMcCorkell pushed a commit that referenced this pull request Mar 26, 2015
Mount options GUI for external storage
@RobinMcCorkell
RobinMcCorkell merged commit c290935 into master Mar 26, 2015
@RobinMcCorkell
RobinMcCorkell deleted the ext-mountoptions-ui branch March 26, 2015 21:36
@oquidave

Copy link
Copy Markdown

Wouldn't it be cool to have an option that lets you mount external storage directly as a users home directory? Supposing I've owncloud installed on $5 DigitalOcean VPS. I only have about 10GB on that box. But I can buy cheaper storage from Amazon S3 and hook it up to my owncloud. But it shouldn't appear as "external storage folder". Instead, I should have the option of having an S3 bucket as the primary storage. Thanks

@PVince81

Copy link
Copy Markdown
Contributor Author

@oquidave yes it would be cool. Please raise it as a separate ticket to make sure this doesn't get lost.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants