-
-
Notifications
You must be signed in to change notification settings - Fork 618
fix: enable Open Original File using plugin-opener (closes #688) #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| up to date, audited 901 packages in 3s | ||
|
|
||
| 165 packages are looking for funding | ||
| run `npm fund` for details | ||
|
|
||
| 1 moderate severity vulnerability | ||
|
|
||
| To address all issues, run: | ||
| npm audit fix | ||
|
|
||
| Run `npm audit` for details. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,6 +136,28 @@ | |
| "fs:default", | ||
| "dialog:default", | ||
| "store:default", | ||
| "opener:allow-reveal-item-in-dir" | ||
| "opener:allow-reveal-item-in-dir", | ||
| "opener:allow-open-path", | ||
| "opener:allow-open-url", | ||
| "opener:allow-default-urls", | ||
| { | ||
| "identifier": "opener:allow-open-path", | ||
| "allow": [ | ||
| { | ||
| "path": "**" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "identifier": "opener:allow-open-url", | ||
| "allow": [ | ||
| { | ||
| "url": "https://*" | ||
| }, | ||
| { | ||
| "url": "http://*" | ||
| } | ||
| ] | ||
| } | ||
|
Comment on lines
+139
to
+161
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check the migrated.json file structure
echo "=== Migrated.json opener permissions ==="
rg -n "opener:" frontend/src-tauri/capabilities/migrated.json -A1 -B1
echo ""
echo "=== Search for opener plugin imports ==="
rg -r '@tauri-apps/plugin-opener' frontend/src --type ts --type tsx --type js
echo ""
echo "=== Search for openUrl calls ==="
rg -n 'openUrl\s*\(' frontend/src --type ts --type tsx --type js -A2 -B2 || echo "No openUrl calls found"
echo ""
echo "=== Search for openPath calls ==="
rg -n 'openPath\s*\(' frontend/src --type ts --type tsx --type js -A2 -B2 || echo "No openPath calls found"
echo ""
echo "=== Search for http:// URL patterns in frontend ==="
rg 'http://' frontend/src --type ts --type tsx --type js | head -20
echo ""
echo "=== Search for getVersion or URL scheme patterns ==="
rg 'allow-default-urls' frontend/src-tauri/capabilities/ -B5 -A5 || echo "No default-urls context"Repository: AOSSIE-Org/PictoPy Length of output: 1614 🏁 Script executed: #!/bin/bash
echo "=== Search src-tauri Rust files for opener usage ==="
find frontend/src-tauri -name "*.rs" -type f | head -20
echo ""
echo "=== Search for opener in Rust code ==="
rg -n 'opener' frontend/src-tauri --type rust -i -A3 -B3 2>/dev/null || echo "No opener matches in Rust"
echo ""
echo "=== Search for openPath or openUrl in Rust ==="
rg -n 'open_path|openPath|open_url|openUrl' frontend/src-tauri -i -A3 -B3 2>/dev/null || echo "No openPath/openUrl matches"
echo ""
echo "=== Check file structure in src-tauri ==="
ls -la frontend/src-tauri/ | head -30
echo ""
echo "=== Check for any references to http in config ==="
rg 'http://' frontend/src-tauri/capabilities/ -B2 -A2Repository: AOSSIE-Org/PictoPy Length of output: 2282 🏁 Script executed: #!/bin/bash
echo "=== Search for Tauri command handlers or invoke patterns ==="
rg -n '#\[command\]|#\[tauri::command\]' frontend/src-tauri/src -A5 2>/dev/null | head -40
echo ""
echo "=== Search for any async invoke or command patterns ==="
rg -n 'invoke\s*\(|Command|command' frontend/src-tauri/src --type rust -i -A2 | head -40
echo ""
echo "=== Check what lib.rs exports ==="
cat -n frontend/src-tauri/src/lib.rs
echo ""
echo "=== Check README or docs for opener context ==="
find . -name "README*" -o -name "*.md" | xargs grep -l 'opener\|open.*file\|open.*url' 2>/dev/null | head -5
echo ""
echo "=== Look at git history for migrated.json changes ==="
git log --oneline frontend/src-tauri/capabilities/migrated.json 2>/dev/null | head -10
echo ""
echo "=== Check app purpose - look at tauri.conf ==="
cat frontend/src-tauri/tauri.conf.jsonRepository: AOSSIE-Org/PictoPy Length of output: 3068 🏁 Script executed: #!/bin/bash
echo "=== Search for invocations through Tauri API calls ==="
rg -n 'invoke.*opener|window\.__TAURI__' frontend/src --type js -A3 -B1 2>/dev/null | head -50
echo ""
echo "=== Search for references to issue 688 ==="
rg -rn '688|Open Original File|reveal.*item' frontend/src-tauri frontend/src --type js --type rust 2>/dev/null | head -20
echo ""
echo "=== Check frontend structure ==="
find frontend -name "*.ts" -o -name "*.tsx" | grep -v node_modules | head -20
echo ""
echo "=== Search main frontend files for any opener/url/path opens ==="
find frontend/src -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) ! -path "*/node_modules/*" | head -10 | xargs cat 2>/dev/null | grep -i 'open\|url\|path' | head -30Repository: AOSSIE-Org/PictoPy Length of output: 1351 Tighten opener permissions: The feature enables "Open Original File" (#688) but the allowlists are unnecessarily broad:
If the webview is exposed to XSS (the app's CSP asset scope is already broad with |
||
| ] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove/relocate this accidental audit artifact file.
A file named
frontend/src-tauri/2with plain npm-audit output looks unintentional and doesn’t belong insrc-tauri. Consider deleting it or moving it to a clearly named docs location if you want to track audit status.🤖 Prompt for AI Agents