FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bubblewrap_opencode/bubblewrap_opencode at main · ast0815/bubblewrap_opencode · GitHub
ast0815
/
bubblewrap_opencode
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
bubblewrap_opencode
/
bubblewrap_opencode
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (42 loc) · 1.52 KB
Breadcrumbs
bubblewrap_opencode
/
bubblewrap_opencode
Copy path
File metadata and controls
59 lines (42 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!
/usr/bin/env bash
set
-eo pipefail
TARGET_EXECUTABLE=
"
$(
which opencode
)
"
if
[
!
-f
"
${TARGET_EXECUTABLE}
"
]
;
then
echo
"
Could not find opencode executable!
"
fi
#
Save current-folder as that will be mapped in as read-write and the current folder we execute in.
CURRENT_FOLDER=
${PWD}
#
Resolve the real binary path (follows alternatives, flatpak, etc.)
REAL_COMMAND=
"
$(
readlink -f
"
$TARGET_EXECUTABLE
"
)
"
#
Build the full bwrap argument array
bwrap_args=(
bwrap
#
Drop as many privilieges as possible
--unshare-all
#
But allow network access
--share-net
#
Start a fresh session
--new-session
--die-with-parent
#
Mount the whole file system read-only
--ro-bind / /
#
Add dev and proc special binds
--dev /dev
--proc /proc
#
Add some temporary file systems
--tmpfs /tmp
#
SSH doesn't like the "nobody" ownership of ro files
#
Hide global ssh config
--tmpfs /etc/ssh/
#
Also, it might need to create files here
--bind-try
"
${HOME}
/.ssh
"
"
${HOME}
/.ssh
"
#
Access to necessary caches etc
--bind-try
"
${HOME}
/.bun
"
"
${HOME}
/.bun
"
--bind-try
"
${HOME}
/.cache
"
"
${HOME}
/.cache
"
--bind-try
"
${HOME}
/.local/share/opencode
"
"
${HOME}
/.local/share/opencode
"
--bind-try
"
${HOME}
/.local/state/opencode
"
"
${HOME}
/.local/state/opencode
"
--bind-try
"
${XDG_CACHE_HOME}
/opencode
"
"
${XDG_CACHE_HOME}
/opencode
"
#
Make the current directory writable
--bind
"
${CURRENT_FOLDER}
"
"
${CURRENT_FOLDER}
"
)
exec
"
${bwrap_args[@]}
"
--
"
$REAL_COMMAND
"
"
$@
"
Back
|
FazBrowse Home
|
New Git URL