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: docs/content/docs/Actions.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,33 +11,35 @@ Actions allow apps to expose an autogenerated UI for simple backend actions. For
11
11
First, define the parameters to be exposed in the form UI. Create a `params.star` file with the [params]({{< ref "/docs/develop/#app-parameters" >}}). For example,
12
12
13
13
```python {filename="params.star"}
14
-
param("dir", description="The directory to list files from", default="/tmp")
14
+
param("repo", description="The GitHub repository to look up", default="openrundev/openrun")
15
15
16
-
param("detail", type=BOOLEAN, description="Whether to show file details", default=True)
16
+
param("show_issues", type=BOOLEAN, description="Whether to show the open issues count", default=True)
17
17
```
18
18
19
-
This app defines a run handler which runs `ls` on the specified directory. The output text is returned.
19
+
This app defines a run handler which calls the GitHub API for the specified repository, using the [http plugin]({{< ref "docs/plugins/overview" >}}), and returns the stats as text.
20
20
21
21
```python {filename="app.star"}
22
-
load ("exec.in", "exec")
22
+
load ("http.in", "http")
23
23
24
24
defrun(dry_run, args):
25
-
ifargs.dir =="."or args.dir.startswith("./") or args.dir ==".."orargs.dir.startswith("../"):
26
-
return ace.result("Validation failed", param_errors={"dir": "relative paths not supported"})
@@ -44,7 +45,7 @@ and an `~/myapp4/index.go.html` file with
44
45
<!doctype html>
45
46
<html>
46
47
<head>
47
-
<title>File List</title>
48
+
<title>Repo List</title>
48
49
{{ template "openrun_gen_import" . }}
49
50
</head>
50
51
<body>
@@ -61,11 +62,7 @@ and an `~/myapp4/index.go.html` file with
61
62
62
63
Run `openrun app create --auth=none --dev --approve ~/myapp4 /hello4`. After that, the app is available at `/hello4`. Note that the `--dev` option is required for the `openrun_gen_import` file to be generated which is required for live reload.
63
64
64
-
This app uses the `exec` plugin to run the ls command. The output of the command is shown when the app is accessed. To allow the app to run the plugin command, use the `openrun app approve` command.
65
-
66
-
{{<callouttype="warning" >}}
67
-
**Note:** If running on Windows, change `ls` to `dir`. Else, use the `fs` plugin to make this platform independent. See https://github.com/openrundev/apps/blob/main/system/disk_usage/app.star.
68
-
{{</callout>}}
65
+
This app uses the `http` plugin to call the GitHub API. The repo listing is shown when the app is accessed. To allow the app to make the plugin call, use the `openrun app approve` command.
Copy file name to clipboardExpand all lines: docs/content/docs/Applications/AppSecurity.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,10 @@ This security model allows for the following:
31
31
32
32
As an example, the disk usage analysis app requires [two permissions](https://github.com/openrundev/openrun/blob/8b8975cea2d650c9f80dab6eb70cc5b2ddbe5c40/examples/disk_usage/app.star#L42)
33
33
34
+
{{<callouttype="warning" >}}
35
+
**Note:** The `exec.in` plugin is disallowed by default at the server level (`permissions.disallow`) since it runs commands on the server host, and it requires an authenticated caller. To run apps that use it, like this example, see [default plugin permissions]({{< ref "/docs/configuration/security/#default-plugin-permissions" >}}).
Copy file name to clipboardExpand all lines: docs/content/docs/Configuration/Security.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,15 @@ secrets = []
96
96
97
97
The `http.in` default only auto-allows outbound HTTP calls to the app's own container (`<CONTAINER_URL>...`), so a Starlark frontend can call its own backend without an approval. The pattern is anchored with `^` because the argument matcher is unanchored — without it an app could embed `<CONTAINER_URL>` inside an external URL to bypass the restriction. Calls to any other host fall back to requiring an approved `http.in` permission. To allow all outbound HTTP (which opens an SSRF surface, since these calls originate from the server's network position and can reach internal or metadata endpoints), use `arguments = ["regex:.*"]`; to allow specific hosts, list them, e.g. `arguments = ["regex:^https://api\\.example\\.com/.*"]`.
98
98
99
+
`permissions.disallow` blocks matching plugin calls for **every app**, even when the app's approved permissions (or the `permissions.allow` list) would permit them. Entries match with the same options as `allow`: an empty `method` matches every method of the plugin, and `arguments` (exact or `regex:`) narrow the block to matching calls. By default the `exec.in` plugin is disallowed, since it runs arbitrary commands on the server host:
100
+
101
+
```toml {filename="openrun.toml"}
102
+
[[permissions.disallow]]
103
+
plugin = "exec.in"
104
+
```
105
+
106
+
To enable exec for apps, override the list in `openrun.toml` — an empty list clears the default (`disallow = []` under `[permissions]`). The exec plugin is additionally a privileged system plugin: like `openrun_admin` and `build`, it requires an authenticated (non-anonymous) caller unless `security.unsafe_allow_system_plugins_anon` is set.
107
+
99
108
The default OpenRun server config already includes two implicit approvals used by containerized apps:
Copy file name to clipboardExpand all lines: docs/content/docs/Develop.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,27 +120,29 @@ For containerized apps, all params specified for the app (including ones not spe
120
120
For use cases where an existing CLI application or API needs to be exposed as a web app, actions provide an easy solution. First, define the parameters to be exposed in the form UI. Create a `params.star` file with the params. For example,
121
121
122
122
```python {filename="params.star"}
123
-
param("dir", description="The directory to list files from", default="/tmp")
123
+
param("repo", description="The GitHub repository to look up", default="openrundev/openrun")
124
124
```
125
125
126
-
The app defines a run handler which runs `ls` on the specified directory. The output text is returned.
126
+
The app defines a run handler which calls the GitHub API for the specified repository, using the [http plugin]({{< ref "docs/plugins/overview" >}}), and returns the stats as text.
127
127
128
128
```python {filename="app.star"}
129
-
load ("exec.in", "exec")
129
+
load ("http.in", "http")
130
130
131
131
defrun(dry_run, args):
132
-
out =exec.run("ls", ["-Lla"]).value
133
-
return ace.result("File listing for "+ args.dir, out)
Copy file name to clipboardExpand all lines: docs/content/docs/QuickStart.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,27 +120,29 @@ See [containerized apps]({{< ref "container/overview/" >}}) for details.
120
120
For use cases where an existing CLI application or API needs to be exposed as a web app, actions provide an easy solution. First, define the parameters to be exposed in the form UI. Create a `params.star` file with the params. For example,
121
121
122
122
```python {filename="params.star"}
123
-
param("dir", description="The directory to list files from", default="/tmp")
123
+
param("repo", description="The GitHub repository to look up", default="openrundev/openrun")
124
124
```
125
125
126
-
The app defines a run handler which runs `ls` on the specified directory. The output text is returned.
126
+
The app defines a run handler which calls the GitHub API for the specified repository, using the [http plugin]({{< ref "docs/plugins/overview" >}}), and returns the stats as text.
127
127
128
128
```python {filename="app.star"}
129
-
load ("exec.in", "exec")
129
+
load ("http.in", "http")
130
130
131
131
defrun(dry_run, args):
132
-
out =exec.run("ls", ["-Lla"]).value
133
-
return ace.result("File listing for "+ args.dir, out)
returnnil, fmt.Errorf("app %s is not permitted to call %s.%s: the call is disallowed by the server config (permissions.disallow)", a.Path, modulePath, functionName)
0 commit comments