|
10 | 10 | ENV_SANDBOX_MODE_NONE = "NONE" |
11 | 11 |
|
12 | 12 | USAGE = f""" |
13 | | -Sandboxed execution of the source-declarative-manifest connector. |
| 13 | +------------------------------------------- |
| 14 | +-- source-declarative-manifest-sandboxed -- |
| 15 | +------------------------------------------- |
14 | 16 |
|
15 | | -Usage: source-declarative-manifest-sandboxed [OPTIONS] [CMD] |
| 17 | +Sandboxed execution of the source-declarative-manifest connector. By default, this script |
| 18 | +wraps the source-declarative-manifest command in Firejail to run the connector in a sandboxed |
| 19 | +environment. If Firejail is not available, the connector will run without sandboxing. |
16 | 20 |
|
17 | | -Options: |
18 | | - --help Show this help message and exit. |
19 | | - --check-sandbox Check Firejail availability and exit. |
| 21 | +Environment variable '{ENV_SANDBOX_MODE}' controls the sandboxing behavior. The following values |
| 22 | +are supported: |
| 23 | + - '{ENV_SANDBOX_MODE_FIREJAIL}': Use Firejail to run the connector in a sandboxed environment. |
| 24 | + - '{ENV_SANDBOX_MODE_AUTO}': Use Firejail if available, otherwise run without sandboxing. |
| 25 | + - '{ENV_SANDBOX_MODE_NONE}': Disable sandboxing and run the connector without Firejail. |
| 26 | +
|
| 27 | +Usage: source-declarative-manifest-sandboxed [OPTIONS] [CMD] |
20 | 28 |
|
21 | 29 | CMD: |
22 | 30 | The command to run in the sandboxed environment. This should be the command |
23 | 31 | that would normally be run to start the connector. E.g. "check", "read", etc. |
| 32 | + The command is passed to the source-declarative-manifest entrypoint. |
24 | 33 |
|
25 | | - The command is ignored if specifying --check-sandbox or --help. |
| 34 | + The command is ignored if specifying any of the below options. |
| 35 | +
|
| 36 | +Options: |
| 37 | + --help Show this help message and exit. |
| 38 | + --check-sandbox Check Firejail availability and exit. |
26 | 39 | """ |
27 | 40 |
|
| 41 | + |
28 | 42 | def _wrap_in_sandbox(cmd: list[str]) -> list[str]: |
29 | 43 | """Wrap the given command in Firejail. |
30 | 44 | This function modifies the command to include Firejail options |
|
0 commit comments