Registry Mirror
Skip to content

public share expiration enforcement policy #8837

Closed

Description

@r2evans

The current policy of enforced expiration length for shared public links appears to be from the date the file was originally shared. I suggest that it should instead be from "now", the date that the user is re-configuring the share.

  • If an admin is using this policy to prevent stale links, then by nature of a user manually updating the link's expiration date, we are confident that the shared link is still relevant and therefore not "stale".
  • If an admin is using this policy to prevent a file from being shared too long (perhaps to discourage the use of this public-link-sharing), then the user need only unshare/reshare to bypass the admin's intent. (In this case, the admin should either define a "soft" company policy and/or just disable the public share functionality entirely.)

The unshare/reshare method would likely result in a different share URL, which requires re-sending the new link to all recipients (arguably undesirable).

Steps to reproduce

  1. Set sharing "default expiration date" to expire after "n" days, and select "enforce expiration date".
  2. Share a file publicly, note the enforced expiration date.
  3. Some time later (at least a day later, but before the expiration date), update/change the expiration date.

Expected behaviour

The ability to change the expiration date to up to "n" days from the moment we are trying to make the change (i.e., max of "now" plus "n" days).

Actual behaviour

The max allowable expiration date is "n" days from the time the file was first shared, so no change possible.

Server configuration

Operating system: ubuntu xenial, 16.04.4 LTS

Web server: nginx-1.13

Database: postgresql-9.6

PHP version: PHP 7.0.27-1+ubuntu14.04.1+deb.sury.org+1

Nextcloud version: 12.0.5

Updated from an older Nextcloud/ownCloud or fresh install: updated

Where did you install Nextcloud from: over time, through 9.0.53, 11.0.1, 11.0.3, 12.0.1, 12.0.2, 12.0.4

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.5.2
  - admin_audit: 1.2.0
  - bruteforcesettings: 1.0.3
  - calendar: 1.5.8
  - comments: 1.2.0
  - contacts: 2.1.2
  - dav: 1.3.1
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - impersonate: 1.0.2
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - user_ldap: 1.2.1
  - workflowengine: 1.2.0
Disabled:
  - encryption
  - files_external
  - user_external

Nextcloud configuration:

Config report
{
    "system": {
        "redis": {
            "host": "redis",
            "port": 6379
        },
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "12.0.5.3",
        "dbname": "nextcloud_db",
        "dbhost": "postgresql:5432",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "ocw0r7c4btrm",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_from_address": "me",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpsecure": "ssl",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "session_timeout": 7200,
        "session_keepalive": false,
        "lost_password_link": "disabled",
        "ldapIgnoreNamingRules": false,
        "appstore.experimental.enabled": true,
        "loglevel": 1,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "theme": ""
    }
}

Are you using external storage, if yes which one: none

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory (samba-ad-dc)

LDAP configuration (delete this part if not used)

LDAP config
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration                 |                                                                                                                                                |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 1                                                                                                                                              |
| hasPagedResultSupport         |                                                                                                                                                |
| homeFolderNamingRule          |                                                                                                                                                |
| lastJpegPhotoLookup           | 0                                                                                                                                              |
| ldapAgentName                 | AD\someuser                                                                                                                                    |
| ldapAgentPassword             | ***                                                                                                                                            |
| ldapAttributesForGroupSearch  |                                                                                                                                                |
| ldapAttributesForUserSearch   |                                                                                                                                                |
| ldapBackupHost                |                                                                                                                                                |
| ldapBackupPort                |                                                                                                                                                |
| ldapBase                      | cn=Users,dc=AD,dc=mydomain,dc=com                                                                                                              |
| ldapBaseGroups                | cn=Users,dc=AD,dc=mydomain,dc=com                                                                                                              |
| ldapBaseUsers                 | cn=Users,dc=AD,dc=mydomain,dc=com                                                                                                              |
| ldapCacheTTL                  | 600                                                                                                                                            |
| ldapConfigurationActive       | 1                                                                                                                                              |
| ldapDefaultPPolicyDN          |                                                                                                                                                |
| ldapDynamicGroupMemberURL     |                                                                                                                                                |
| ldapEmailAttribute            | mail                                                                                                                                           |
| ldapExperiencedAdmin          | 0                                                                                                                                              |
| ldapExpertUUIDGroupAttr       |                                                                                                                                                |
| ldapExpertUUIDUserAttr        |                                                                                                                                                |
| ldapExpertUsernameAttr        | sAMAccountName                                                                                                                                 |
| ldapGidNumber                 | gidNumber                                                                                                                                      |
| ldapGroupDisplayName          | cn                                                                                                                                             |
| ldapGroupFilter               |                                                                                                                                                |
| ldapGroupFilterGroups         |                                                                                                                                                |
| ldapGroupFilterMode           | 0                                                                                                                                              |
| ldapGroupFilterObjectclass    |                                                                                                                                                |
| ldapGroupMemberAssocAttr      | uniqueMember                                                                                                                                   |
| ldapHost                      | myserver.AD.mydomain.com                                                                                                                       |
| ldapIgnoreNamingRules         |                                                                                                                                                |
| ldapLoginFilter               | (&(&(|(objectclass=organizationalPerson))(|(|(memberof=CN=myusers,CN=Users,DC=AD,DC=mydomain,DC=com))))(samaccountname=%uid))                  |
| ldapLoginFilterAttributes     |                                                                                                                                                |
| ldapLoginFilterEmail          | 0                                                                                                                                              |
| ldapLoginFilterMode           | 0                                                                                                                                              |
| ldapLoginFilterUsername       | 1                                                                                                                                              |
| ldapNestedGroups              | 0                                                                                                                                              |
| ldapOverrideMainServer        |                                                                                                                                                |
| ldapPagingSize                | 500                                                                                                                                            |
| ldapPort                      | 389                                                                                                                                            |
| ldapQuotaAttribute            |                                                                                                                                                |
| ldapQuotaDefault              |                                                                                                                                                |
| ldapTLS                       | 0                                                                                                                                              |
| ldapUserDisplayName           | displayname                                                                                                                                    |
| ldapUserDisplayName2          |                                                                                                                                                |
| ldapUserFilter                | (&(|(objectclass=organizationalPerson))(|(|(memberof=CN=myusers,CN=Users,DC=AD,DC=mydomain,DC=com))))                                          |
| ldapUserFilterGroups          | myusers                                                                                                                                        |
| ldapUserFilterMode            | 1                                                                                                                                              |
| ldapUserFilterObjectclass     | organizationalPerson                                                                                                                           |
| ldapUuidGroupAttribute        | auto                                                                                                                                           |
| ldapUuidUserAttribute         | auto                                                                                                                                           |
| turnOffCertCheck              | 0                                                                                                                                              |
| turnOnPasswordChange          | 0                                                                                                                                              |
| useMemberOfToDetectMembership | 1                                                                                                                                              |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+

Client configuration

Browser: FF-59.0

Operating system: win10

Logs

Web server error log

Web server error log
(nothing related)

Nextcloud log (data/nextcloud.log)

Nextcloud log
(nothing relevant, just a lot of "File accessed" ...)

Browser log

Browser log
(nothing relevant)

Activity

  1. added
    good first issue
    on Mar 16, 2018
  2. MorrisJobke commented on Mar 16, 2018

    @MorrisJobke
    Member

    Makes sense ... but maybe we should finish the cleanup of the sharing code. cc @nextcloud/sharing

  3. added
    stale
    on Jun 20, 2018
  4. removed
    stale
    on Oct 1, 2018
  5. added
    0. Needs triage
    on Aug 20, 2020
  6. szaimen commented on Jun 9, 2021

    @szaimen
    Contributor

    cc @nextcloud/sharing Do we really want this? It would allow to widen the share expiration practically indefinitely...

  7. skjnldsv commented on Jun 9, 2021

    @skjnldsv
    Member

    Yeah, it's a bug. I think there is an actual opened ticket for this 🤔
    I think the backend actually checks the current date?

  8. szaimen commented on Jun 9, 2021

    @szaimen
    Contributor

    I don't find another on either

  9. added
    1. to develop
    and removed
    0. Needs triage
    on Jun 9, 2021
  10. added
    needs review
    and removed
    good first issue
    on Nov 7, 2024
  11. joshtrichards commented on Oct 23, 2026

    @joshtrichards
    Member

    Closed by #40927

  12. r2evans commented on Oct 23, 2026

    @r2evans
    Author

    How does "Allow share expiry dates lower than enforced limits" (which allows shorter limits) relate to this?

    @joshtrichards

  13. github-actions commented on Nov 7, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for more than 14 days. As we do not monitor closed issues, we are locking this issue to prevent further comments from getting lost in the noise.
    Please open a new issue if you have a similar problem instead. For general discussions, please use our forum: https://help.nextcloud.com

  14. locked as resolved and limited conversation to collaborators on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developenhancementfeature: sharingneeds review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions