nextcloud / files_automatedtagging

:bookmark: An app for Nextcloud that assigns tags to newly uploaded files based on some conditions
https://apps.nextcloud.com/apps/files_automatedtagging
52 stars 23 forks source link

Tagging problem #960

Open ValheruPL opened 2 weeks ago

ValheruPL commented 2 weeks ago

Steps to reproduce

  1. Create flow - File size (Upload) greater / or equals 0MB + Automated tagging some tag "test_tag" for example
  2. Create folder example "test"
  3. enter to test folder and upload some file.

Expected behaviour

only sample file should have a tag, not folder - only sample file is uploaded.

Actual behaviour

folder "test" and sample file have been tagged with "test_tag"

Server configuration

Operating system:
Ubuntu 20.04.6 LTS

Web server: Server version: Apache/2.4.41 (Ubuntu) Server built: 2024-04-10T17:46:26

Database: Type: mysql Version: 10.5.10

PHP version: Version: 8.1.29

Nextcloud version: (see Nextcloud admin page) 29.0.3

Where did you install Nextcloud from: webinstaller

Signing status:

No errors have been found.

List of activated apps: Enabled:

Nextcloud configuration:

{
    "system": {
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "overwritecondaddr": "^192\\.168\\.90\\.99$",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***.***.***",
            "172.17.19.30"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "*****.*****.*****\/",
        "dbtype": "mysql",
        "version": "29.0.3.4",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "ldapUserCleanupInterval": 5,
        "installed": true,
        "forcessl": true,
        "forceSSLforSubdomains": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "log_rotate_size": "10485760",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "3",
        "debug": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "htaccess.RewriteBase": "\/",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_smtpsecure": "ssl",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "default_phone_region": "PL",
        "simpleSignUpLink.shown": false,
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "enable_previews": false,
        "app_install_overwrite": [
            "files_retention",
            "limit_login_to_ip",
            "files_trackdownloads",
            "groupfolders",
            "files_rightclick",
            "issuetemplate"
        ],
        "maintenance_window_start": 1
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... LDAP

Client configuration

Browser: Chrome

Operating system: MacOS / Linux / Windows 10/11

Logs

Nextcloud log (data/owncloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
nickvergessen commented 2 weeks ago

You might need to add a new check Mimetype > is not > Folder then. Folders also have a size of 0 when they are empty, so it might be tagged as well

ValheruPL commented 2 weeks ago

What if I would like to upload folder ? :) Upload means all upload files and folders, so, main folder, I manually created is not uploaded, right? So this feature should not tagged my main folder.

Once again, look at steps:

  1. Create flow - File size (Upload) greater / or equals 0MB + Automated tagging some tag "test_tag" for example
  2. Create MAIN folder example "test"
  3. (!) ENTER TO the "test" folder and (then) upload some file into this MAIN folder.

Actual behaviour: MAIN (not uploaded) folder "test" and (uploaded) sample file have been tagged with "test_tag"

nickvergessen commented 2 weeks ago

Upload means all upload files and folders, so, main folder, I manually created is not uploaded, right?

Size is the only thing that is "upload only". The problem that appears here is that your folder test/ is modified during the upload of the file inside. So it's an upload-request, the size is >= 0 MB => apply tag. While it might not be intended in this case, it definitely is intended to block access with access control in similar cases.

So you have to workaround it manually here.

ValheruPL commented 2 weeks ago

It's not a bug, it's a feature? :)) I think it is bug, because folder is not uploaded actually, so the trigger "upload" does not works correctly. The addon is poorly written, but, what can I say if you think the add-on works properly...

nickvergessen commented 2 weeks ago

There are 2 layers:

  1. Workflow engine (in server repository): handles the conditions and checks
  2. Files automated tagging (this app): if notified when all checks matched and will then apply the tags as selected

The tagging behaves as defined here.

The question is whether the workflow engine is behaving correct. It's notifying us that the folder matched all the rules. And well the rule is applying because an upload is done with an email file.

ValheruPL commented 2 weeks ago

nevertheless, somewhere is issue :)