You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/blog/tauri-1-3.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,10 +74,15 @@ Assuming a **fully trusted** web service on `https://trusted.example` it is now
74
74
Shared domains **MUST NOT** be used for this in any circumstances. We do not limit access to paths or specific files. You can only scope with **trusted**_(sub)domains_[^6]. Another very risky catch is that developers must be sure that the domain ownership does not change over the lifetime of the application. Domain takeover could lead to compromised user devices.
75
75
76
76
[^1]: _Inter-Process Communication_, in this instance the communication between the Tauri core and the frontend code run inside the webview.
77
+
77
78
[^2]: _Security Impact_: What is the theoretical biggest impact of this threat combination? This highly depends on correct scoping of Tauri API endpoints and hardening of custom implemented Tauri commands.
79
+
78
80
[^3]: _Exposure_: Describes the exposed scope items of this feature to either an user or adversary. It is possible to restrict exposure to only certain domains, windows or only to custom implemented commands.
81
+
79
82
[^4]: _Adversary Capabilities_: Which kind of privileges has the adversary? Can range from tricking user into entering malicious input to code execution in the frontend via cross-site-scripting (which is the highest privilege for frontend code in our case). Common capabilities are described in the [OWASP documentation](https://owasp.org/www-community/attacks/).
83
+
80
84
[^5]: _An application can be exploited if it parses user input for making an URL redirection decision, which is then not properly validated._[Wikipedia Source](https://en.wikipedia.org/wiki/Open_redirect)
85
+
81
86
[^6]: see the [Reqwest reference](https://docs.rs/reqwest/latest/reqwest/struct.Url.html#method.domain)
With all the moving pieces in Tauri, you may run into a problem that requires debugging. There are many locations where error details are printed, and Tauri includes some tools to make the debugging process more straightforward.
@@ -22,9 +17,19 @@ One of the most useful tools in your toolkit for debugging is the ability to add
22
17
23
18
```rs frame=none
24
19
fnmain() {
25
-
// Tauri provided convenience function for whether you ran with `tauri dev`.
26
-
letis_dev:bool=tauri::dev();
27
-
// If debug assertions are enabled or not.
20
+
// Whether the current instance was started with `tauri dev` or not.
21
+
#[cfg(dev)]
22
+
{
23
+
// `tauri dev` only code
24
+
}
25
+
ifcfg!(dev) {
26
+
// `tauri dev` only code
27
+
} else {
28
+
// `tauri build` only code
29
+
}
30
+
letis_dev:bool=tauri::is_dev();
31
+
32
+
// Whether debug assertions are enabled or not. This is true for `tauri dev` and `tauri build --debug`.
28
33
#[cfg(debug_assertions)]
29
34
{
30
35
// Debug only code
@@ -37,6 +42,8 @@ fn main() {
37
42
}
38
43
```
39
44
45
+
{/* TODO: js version */}
46
+
40
47
## Rust Console
41
48
42
49
The first place to look for errors is in the Rust Console. This is in the terminal where you ran, e.g., `tauri dev`. You can use the following code to print something to that console from within a Rust file:
@@ -51,10 +58,10 @@ Sometimes you may have an error in your Rust code, and the Rust compiler can giv
51
58
RUST_BACKTRACE=1 tauri dev
52
59
```
53
60
54
-
or like this on Windows:
61
+
or like this on Windows (PowerShell):
55
62
56
-
```shell frame=none
57
-
setRUST_BACKTRACE=1
63
+
```powershell frame=none
64
+
$env:RUST_BACKTRACE=1
58
65
tauri dev
59
66
```
60
67
@@ -125,7 +132,7 @@ The devtools API is private on macOS. Using private APIs on macOS prevents your
125
132
126
133
:::
127
134
128
-
To enable the devtools in production builds, you must enable the `devtools` Cargo feature in the `src-tauri/Cargo.toml` file:
135
+
To enable the devtools in **production builds**, you must enable the `devtools` Cargo feature in the `src-tauri/Cargo.toml` file:
Copy file name to clipboardExpand all lines: src/content/docs/develop/Debug/rustrover.mdx
+3-8Lines changed: 3 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,10 @@
1
1
---
2
-
title: Debug in RustRover
3
-
sidebar:
4
-
badge:
5
-
text: WIP
6
-
variant: caution
2
+
title: Debug in JetBrains IDEs
7
3
---
8
4
9
-
{/* TODO: Update links and internal navigation */}
10
5
{/* TODO: Add support to light/dark mode images */}
11
6
12
-
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
7
+
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process). It also mostly applies to IntelliJ and CLion.
13
8
14
9
## Setting up a Cargo project
15
10
@@ -24,7 +19,7 @@ Alternatively, you could create a top-level Cargo workspace manually by adding t
24
19
members = ["src-tauri"]
25
20
```
26
21
27
-
Before you proceed, make sure that your project is fully loaded. If the Cargo tool window shows all the modules and targets of the workspace, you’re good to go.
22
+
Before you proceed, make sure that your project is fully loaded. If the Cargo tool window shows all the modules and targets of the workspace, you're good to go.
0 commit comments