#Global scope

62 messages Β· Page 1 of 1 (latest)

drifting patrol
#

How can i allow my tauri app content policy to allow all directories even i create dir after i run tauri project

timber canyon
#

either you add the required paths dynamically in rust at runtime (eg app.fs_scope().allow_dir() ) or **/* should work as well if you're okay with us looking at you weird :P

drifting patrol
#

why would you look at me weird πŸ˜„

drifting patrol
#

Unhandled Promise Rejection: forbidden path

#

my scope

        "security": {
            "csp": null,
            "assetProtocol": {
                "enable": true,
                "scope": [
                    "$APPCONFIG/**/*",
                    "$APPCACHE/**/*",
                    "$APPDATA/**/*",
                    "*/**",
                    "**/*"
                ]
            }
timber canyon
timber canyon
drifting patrol
#

what?

timber canyon
drifting patrol
#

can you be more clear please

timber canyon
#

no

drifting patrol
#

okay thx

timber canyon
#

man chill i'm not that quick x)

drifting patrol
#

no problem πŸ˜„

timber canyon
drifting patrol
#

we both typed at the same time. we had conflict πŸ˜„

timber canyon
#
        "security": {
            "csp": null,
            "assetProtocol": {
                "enable": true,
                "scope": {
                  "requireLiteralLeadingDot": "false",
                  "allow": [
                    "$APPCONFIG/**/*",
                    "$APPCACHE/**/*",
                    "$APPDATA/**/*",
                    "*/**",
                    "**/*"
                  ]
                }
            }
``` from the link above: 
> requireLiteralLeadingDot boolean | null Whether or not paths that contain components that start with a . will require that . appears literally in the pattern; *, ?, **, or [...] will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files. Defaults to true on Unix systems and false on Windows
drifting patrol
#

ahhh

#

i see

#

i guess

drifting patrol
#

like the code you provide

timber canyon
#

yes

drifting patrol
#

ah

#

hm

#

i guess i have a problem tho

#

πŸ˜„

#

isn't **/* includes all subfolders etc.

#

or i have to add **/**/*

#
/home/fenish/.cache/dev.fenish.test/dynamic_folder2/d45b25012aa429abf783f27cd4b79efd.

                        /\
                        ||

i sometimes put folders outside identifier or basically my files inside child of child folder

timber canyon
#

**/* should include all subfolders, no matter how far they're nested

drifting patrol
#

yea

#
Unhandled Promise Rejection: forbidden path: /home/fenish/.cache/dev.fenish.test2/lowres/d45b25012aa429abf783f27cd4b79efd.png
#
                "scope": {
                    "requireLiteralLeadingDot": false,
                    "allow": [
                        "$APPCONFIG/**/*",
                        "$APPCACHE/**/*",
                        "$APPDATA/**/*",
                        "*/**",
                        "**/*",
#

if i use dev.fenist.test it works

timber canyon
#

that's an error you get when requesting something from the asset protocol?

timber canyon
drifting patrol
#

$APPCACHE = dev.fenish.test

#

and its inside .cache

#

if i use different folder than appcache

#

i can't reach with asset protocol

timber canyon
#

that's weird

drifting patrol
#

even i add

"/home/fenish/.cache/**/*"
timber canyon
#

does this happen with multiple files/paths or just this?

drifting patrol
#

i tried this folders and none worked

/home/fenish/.cache/dev.fenish.test2/lowres/d45b25012aa429abf783f27cd4b79efd.png
/home/fenish/.cache/dev.fenish.test3/lowres/d45b25012aa429abf783f27cd4b79efd.png
/home/fenish/.cache/different/lowres/d45b25012aa429abf783f27cd4b79efd.png

but this works because this is APPCACHE dir

/home/fenish/.cache/dev.fenish.test/lowres/d45b25012aa429abf783f27cd4b79efd.png
timber canyon
#

hmm, i don't really have an idea. i've seen it work a few times on this server and use it in on of my bug testing app as well πŸ€”

#

this can't really be cached but maybe still try to delete the target dir and rebuild?

drifting patrol
#

let me try

#
"security": {
            "csp": null,
            "assetProtocol": {
                "enable": true,
                "scope": {
                    "requireLiteralLeadingDot": false,
                    "allow": [
                        "$APPCONFIG/**/*",
                        "$APPCACHE/**/*",
                        "$APPDATA/**/*",
                        "*/**",
                        "**/*"
                    ]
                }
            }
        },
        "withGlobalTauri": true
#

i deleted and i will try with these settings

#

technically it allows every file in my filesystem

#

nnaah

quasi sapphire
#

are you sure you are not using the fs plugin instead of the asset protocol?

#

also I think it may work if you only have the full glob in there

#
            "assetProtocol": {
                "enable": true,
                "scope": {
                    "requireLiteralLeadingDot": false,
                    "allow": [
                        "**/*"
                    ]
                }
            }
drifting patrol
#

i tried second method but no result