Skip to content

Allow list of sync exclusions to be managed from the server (including whether to sync hidden files) #22607

Closed

Description

@MarkMaldaba

Hi there,

We have been looking to deploy OwnCloud on our company servers, as a replacement for our existing sync provider, as we don't like the idea of our data being held on third-party servers.

However, there is currently one thing that is blocking us, which is that the default sync settings in the OwnCloud client do not meet the basic sync requirements of file synchronisation, namely there are important files that are excluded from the sync. The specific files that affect us (as a web agency) are .htaccess files, and hidden files in general (though there may be others, as I haven't done an exhaustive check of the list yet).

We have removed .htaccess files from the block list on the server, but it appears that the client is still blocking them.

I am aware that there are settings in the client (or rather, somewhere on the client machine, as you can't remove the .htaccess file exclusion from within the GUI). However, this means that we are dependent on all employees correctly setting these settings on every machine/installation that they use, and hoping they don't get modified when the client is upgraded (as I have read reports of on the forums).

Sync software that doesn't sync everything is, frankly, pointless - in fact, it's downright dangerous if users aren't aware of the exclusions. As a company, we need to be certain that everything we expect to be synced is being synced, always, and not be reliant on individual employees to enforce this.

So enough of the complaining - let's make a constructive suggestion to try and resolve this issue, and turn OwnCloud into a fully enterprise-ready product.

What I would like to see is the ability for the exclusions to be controlled by the server admin, so they can just be set in one place, so the software 'just works', straight out of the box (like most other sync services).

The way I would manage it is by adding a client_config.php file in the config folder, which can be used to set the default client configuration. (The settings could go in config.php but it makes sense for me to separate out the server and client configuration settings.).

Only sync-related settings would be configurable from the server, specifically we would need a sync_hidden_files boolean setting, and an array of ignore_patterns. This latter setting would need to handle the 'can be deleted' flag, so would either be multi-dimensional (with each entry containing two properties, pattern and can_be_deleted) or be split into two arrays, one for each type of exclusion.

It should also provide a way to specify whether the client should allow the user to over-ride these settings (probably on a per-ignore-pattern level).

When the client initiates the sync, it will pull down the server config and then apply whatever additional local config has been specified (respecting the 'can change' settings).

PS - I am well aware of why syncing .htaccess file could be dangerous if you haven't configured your server properly, and that is not relevant to this issue. This issue is about providing appropriate software configuration to support people who are able to secure a server properly and who want their sync software to, well, sync.

Activity

  1. nickvergessen commented on Feb 24, 2016

    @nickvergessen
    Contributor

    You could also change https://github.com/owncloud/client/blob/c46547592c7bcf7d70e37890d82383ce72afb9be/sync-exclude.lst#L22 and compile your own clients.

    However, we are blocking .htaccess for a reason, e.g. #22412

    But maybe @LukasReschke can tell more

  2. LukasReschke commented on Feb 24, 2016

    @LukasReschke
    Contributor

    More of a pure client issue, see also owncloud/client#434

  3. MarkMaldaba commented on Feb 24, 2016

    @MarkMaldaba
    Author

    You could also change [the exclude list] and compile your own clients.

    That's a possibility, though I'm not sure it's foolproof. I doubt we could enforce that our employees only installed our custom build, rather than downloading direct from the Owncloud website. Also, what happens when an auto-update is triggered?

    However, we are blocking .htaccess for a reason, e.g. #22412

    I know, hence my post-script. What is needed is a way for the server to indicate that there is no security issue with .htaccess files, and that therefore this file should not be excluded by the client.

  4. MarkMaldaba commented on Feb 24, 2016

    @MarkMaldaba
    Author

    To help the discussion, I have put together a sample client_config.php file:

    <?php
    
    $CLIENT_CONFIG = array (
        'sync_hidden_files' => false,
        'sync_hidden_files_locked' => false,
    
        'ignore_patterns' => array(
            // Fully-populated array example:
                array(
                    'pattern' => "*~",
                    'may_be_deleted' => false,
                    'is_locked' => true,
                ),
    
            // May be sparsely populated, in which case defaults are used for any
            // missing items.
                array(
                    'pattern' => "].DS_Store",
                    'may_be_deleted' => true,
                ),
    
                array(
                    'pattern' => ".~lock.*",
                ),
    
            // If only a pattern needs to be specified (i.e. if all the flags should be set
            // to the default value), then you can specify the pattern as a string, which
            // simplifies the file a lot for most use-cases:
                "~*.tmp",
                "]*.~*",
                "]Icon\\r*",
    
                // ... etc ...
    
            ),
    );

    Some notes:

    1. The may_be_deleted argument indicates whether the file may be deleted by OwnCloud if the parent folder is deleted (as per the preferences UI). This setting may be omitted, in which case it defaults to false.
    2. The is_locked argument indicates whether the client allows the user to edit/remove the item. May be omitted, in which case it defaults to true.
    3. sync_hidden_files_locked indicates whether the client can change the sync hidden files option, and defaults to false if omitted.

    Points 2 and 3 imply that the client will need to keep track of situations where the client has explicitly deleted/modified a client-supplied pattern, so that changes to the server config are applied correctly (i.e. they don't restore a pattern that the user has deleted). Though, obviously, if the server changes the is_locked setting from false to true then the pattern should re-appear as per the server definition.

    Not that may_be_deleted is a confusing name, but it was chosen to match the confusing ignore list UI. I would much rather invert the flag and call it block_folder_deletion, defaulting to to true, but that might cause issues as it is the inverse of the current implementation.

  5. added this to the backlog milestone on Feb 25, 2016
  6. MarkMaldaba commented on Mar 18, 2016

    @MarkMaldaba
    Author

    @RealRancor: I don't think this is quite a duplicate, though they are similar. This is specifically about providing a server-side implementation of the client's ignore list (which is based on filename patterns, as well as having an 'ignore hidden' flag) whereas #19385 is about ignoring specific files in specific folders. The solutions may or may not overlap (wholly or partially), but it is equally possible for either ticket to be resolved without the other being satisfied.

  7. PVince81 commented on Oct 10, 2016

    @PVince81
    Contributor

    ref: webdav property to tell the clients "do not sync this": #26311

  8. MarkMaldaba commented on Oct 30, 2016

    @MarkMaldaba
    Author

    ref: webdav property to tell the clients "do not sync this": #26311

    I'm not sure whether that's related (it may be, but not wholly).

    This ticket is about allowing the default client configuration options to be controlled by the server admin rather than about implementing server side rules.

    There may be some overlap - certain configurations may allow the server perform blocking actions - but that is not the main thrust of this ticket.

  9. AnrDaemon commented on Oct 31, 2016

    @AnrDaemon

    I'm not sure whether that's related

    No, that's not related.

  10. PVince81 commented on Dec 18, 2017

    @PVince81
    Contributor

    closing in favor of #7956

  11. lock commented on Aug 1, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  12. locked as resolved and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions