qubicl-cli 0.1.0-dev.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -19
- package/dist/SBOM.spdx.json +222 -0
- package/dist/THIRD_PARTY_NOTICES.txt +244 -0
- package/dist/assets/chromium-seccomp.json +181 -0
- package/dist/assets/computer/BROWSER_SKILLS_THIRD_PARTY_NOTICES.txt +23 -0
- package/dist/assets/computer/Dockerfile +191 -49
- package/dist/assets/computer/PLAYWRIGHT_THIRD_PARTY_NOTICES.txt +217 -0
- package/dist/assets/computer/SKILLS_THIRD_PARTY_NOTICES.txt +29 -0
- package/dist/assets/computer/THIRD_PARTY_NOTICES.txt +28 -0
- package/dist/assets/computer/WEB_THIRD_PARTY_NOTICES.txt +42 -0
- package/dist/assets/computer/browser-skills-requirements.txt +12 -0
- package/dist/assets/computer/chromium-wrapper.sh +12 -0
- package/dist/assets/computer/control.mjs +112 -52
- package/dist/assets/computer/entrypoint.sh +272 -35
- package/dist/assets/computer/libreoffice-registrymodifications.xcu +8 -0
- package/dist/assets/computer/manifests/browser.json +72 -0
- package/dist/assets/computer/manifests/computer.json +76 -0
- package/dist/assets/computer/manifests/file-system.json +42 -0
- package/dist/assets/computer/manifests/workstation.json +78 -0
- package/dist/assets/computer/node_modules/playwright-core/LICENSE +202 -0
- package/dist/assets/computer/node_modules/playwright-core/NOTICE +5 -0
- package/dist/assets/computer/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
- package/dist/assets/computer/node_modules/playwright-core/browsers.json +75 -0
- package/dist/assets/computer/node_modules/playwright-core/index.js +17 -0
- package/dist/assets/computer/node_modules/playwright-core/index.mjs +28 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/bootstrap.js +88 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/coreBundle.js +74830 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/utilsBundle.js +90764 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +2179 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/dist/assets/computer/node_modules/playwright-core/lib/xdg-open +1267 -0
- package/dist/assets/computer/node_modules/playwright-core/package.json +34 -0
- package/dist/assets/computer/skills/core/docx/LICENSE +21 -0
- package/dist/assets/computer/skills/core/docx/SKILL.md +21 -0
- package/dist/assets/computer/skills/core/docx/references/revisions-and-comments.md +88 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_comments.py +289 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_common.py +94 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_create.py +177 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_edit.py +250 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_read.py +149 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_revisions.py +147 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_template.py +70 -0
- package/dist/assets/computer/skills/core/docx/scripts/docx_validate.py +156 -0
- package/dist/assets/computer/skills/core/ocr-and-documents/LICENSE +21 -0
- package/dist/assets/computer/skills/core/ocr-and-documents/SKILL.md +24 -0
- package/dist/assets/computer/skills/core/ocr-and-documents/scripts/ocr_document.py +132 -0
- package/dist/assets/computer/skills/core/pdf/LICENSE +21 -0
- package/dist/assets/computer/skills/core/pdf/SKILL.md +25 -0
- package/dist/assets/computer/skills/core/pdf/references/forms.md +100 -0
- package/dist/assets/computer/skills/core/pdf/scripts/_raster.py +76 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_create.py +130 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_fill_form.py +97 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_form_layout.py +168 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_make_form.py +145 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_merge.py +50 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_meta.py +115 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_page_image.py +99 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_read.py +153 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_secure.py +71 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_split.py +84 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_stamp.py +143 -0
- package/dist/assets/computer/skills/core/pdf/scripts/pdf_watermark.py +51 -0
- package/dist/assets/computer/skills/core/plan/LICENSE +21 -0
- package/dist/assets/computer/skills/core/plan/SKILL.md +21 -0
- package/dist/assets/computer/skills/core/powerpoint/LICENSE +21 -0
- package/dist/assets/computer/skills/core/powerpoint/SKILL.md +18 -0
- package/dist/assets/computer/skills/core/powerpoint/scripts/pptx_create.py +214 -0
- package/dist/assets/computer/skills/core/powerpoint/scripts/pptx_edit.py +436 -0
- package/dist/assets/computer/skills/core/powerpoint/scripts/pptx_from_template.py +88 -0
- package/dist/assets/computer/skills/core/powerpoint/scripts/pptx_read.py +131 -0
- package/dist/assets/computer/skills/core/powerpoint/scripts/pptx_render.py +93 -0
- package/dist/assets/computer/skills/core/xlsx/LICENSE +21 -0
- package/dist/assets/computer/skills/core/xlsx/SKILL.md +22 -0
- package/dist/assets/computer/skills/core/xlsx/references/restructuring.md +71 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/csv_to_xlsx.py +104 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_create.py +259 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_edit.py +263 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_read.py +160 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_recalc.py +110 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_restructure.py +337 -0
- package/dist/assets/computer/skills/core/xlsx/scripts/xlsx_to_csv.py +69 -0
- package/dist/assets/computer/skills/core-catalog.json +246 -0
- package/dist/assets/computer/skills-requirements.txt +18 -0
- package/dist/assets/computer/web-provider.py +592 -0
- package/dist/assets/computer/web-requirements.txt +37 -0
- package/dist/assets/gateway/Dockerfile +3 -1
- package/dist/assets/gateway/gateway.mjs +69 -40
- package/dist/assets/image-catalog.json +183 -0
- package/dist/qubicl.mjs +297 -167
- package/package.json +8 -8
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
+
runtime_role="${QUBICL_RUNTIME_ROLE:-control}"
|
|
5
|
+
if [[ "$runtime_role" == egress || "$runtime_role" == web ]]; then
|
|
6
|
+
exec node /opt/qubicl/control.mjs
|
|
7
|
+
fi
|
|
8
|
+
|
|
4
9
|
target_uid="${QUBICL_HOST_UID:-1000}"
|
|
5
10
|
target_gid="${QUBICL_HOST_GID:-1000}"
|
|
6
11
|
if [[ "$(id -g qubicl)" != "$target_gid" ]]; then
|
|
@@ -10,46 +15,278 @@ if [[ "$(id -u qubicl)" != "$target_uid" ]]; then
|
|
|
10
15
|
usermod --non-unique --uid "$target_uid" --gid "$target_gid" qubicl
|
|
11
16
|
fi
|
|
12
17
|
|
|
13
|
-
install -d -o qubicl -g qubicl /home/qubicl
|
|
14
|
-
if [[ ! -e /home/qubicl/.qubicl-initialized ]]; then
|
|
15
|
-
cp -a /etc/skel/. /home/qubicl/ 2>/dev/null || true
|
|
16
|
-
touch /home/qubicl/.qubicl-initialized
|
|
17
|
-
fi
|
|
18
18
|
expected_owner="${target_uid}:${target_gid}"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
owner_marker=/home/qubicl/.qubicl-owner
|
|
20
|
+
initialized_marker=/home/qubicl/.qubicl-initialized
|
|
21
|
+
if [[ ! -d /home/qubicl ]]; then
|
|
22
|
+
install -d -o qubicl -g qubicl /home/qubicl
|
|
23
|
+
fi
|
|
24
|
+
if [[ "${QUBICL_INITIALIZE_HOME:-0}" == 1 ]]; then
|
|
25
|
+
if [[ -e "$owner_marker" ]]; then
|
|
26
|
+
if [[ ! -f "$owner_marker" ]] || [[ -L "$owner_marker" ]] || [[ "$(cat "$owner_marker")" != "$expected_owner" ]]; then
|
|
27
|
+
echo "Qubicl home ownership does not match this host (${expected_owner})." >&2
|
|
28
|
+
echo "Stop this computer, then run: qubicl repair ownership ${QUBICL_NAME:-<name>}" >&2
|
|
29
|
+
exit 78
|
|
30
|
+
fi
|
|
31
|
+
else
|
|
32
|
+
if find /home/qubicl -mindepth 1 -maxdepth 1 -print -quit | grep -q .; then
|
|
33
|
+
echo "Qubicl found a non-empty home without an ownership marker." >&2
|
|
34
|
+
echo "Stop this computer, then run: qubicl repair ownership ${QUBICL_NAME:-<name>}" >&2
|
|
35
|
+
exit 78
|
|
36
|
+
fi
|
|
37
|
+
runuser -u qubicl -- cp -a --no-preserve=ownership /etc/skel/. /home/qubicl/ 2>/dev/null || true
|
|
38
|
+
runuser -u qubicl -- touch "$initialized_marker"
|
|
39
|
+
printf '%s\n' "$expected_owner" >"$owner_marker"
|
|
40
|
+
chown qubicl:qubicl "$owner_marker"
|
|
41
|
+
fi
|
|
42
|
+
else
|
|
43
|
+
for _ in $(seq 1 300); do
|
|
44
|
+
[[ -e "$owner_marker" ]] && break
|
|
45
|
+
sleep 0.1
|
|
46
|
+
done
|
|
47
|
+
if [[ ! -f "$owner_marker" ]] || [[ -L "$owner_marker" ]] || [[ "$(cat "$owner_marker" 2>/dev/null || true)" != "$expected_owner" ]]; then
|
|
48
|
+
echo "Qubicl's isolated runtime could not verify the initialized durable home (${expected_owner})." >&2
|
|
49
|
+
exit 78
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
# Copying /etc/skel with archive semantics can inherit the skeleton directory's
|
|
53
|
+
# mode onto the mount root. Keep the managed user-home directory private while
|
|
54
|
+
# leaving all user-created contents and their modes untouched.
|
|
55
|
+
chmod 0700 /home/qubicl
|
|
56
|
+
|
|
57
|
+
baked_profile="${QUBICL_IMAGE_STARTUP_PROFILE:?image startup profile is missing}"
|
|
58
|
+
requested_profile="${QUBICL_STARTUP_PROFILE:-$baked_profile}"
|
|
59
|
+
if [[ "$requested_profile" != "$baked_profile" ]]; then
|
|
60
|
+
echo "Qubicl startup profile mismatch: host requested ${requested_profile}, image provides ${baked_profile}." >&2
|
|
61
|
+
exit 78
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
pids=()
|
|
65
|
+
start_as_user() {
|
|
66
|
+
user_network_env=()
|
|
67
|
+
if [[ -v QUBICL_PROXY_URL ]]; then
|
|
68
|
+
user_network_env+=(HTTP_PROXY="$QUBICL_PROXY_URL" HTTPS_PROXY="$QUBICL_PROXY_URL" http_proxy="$QUBICL_PROXY_URL" https_proxy="$QUBICL_PROXY_URL")
|
|
69
|
+
fi
|
|
70
|
+
runuser -u qubicl -- env -i \
|
|
71
|
+
HOME=/home/qubicl USER=qubicl LOGNAME=qubicl SHELL=/bin/bash \
|
|
72
|
+
PATH=/opt/qubicl/skills-venv/bin:/home/qubicl/.local/bin:/usr/local/bin:/usr/bin:/bin \
|
|
73
|
+
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
|
74
|
+
XDG_CONFIG_HOME=/home/qubicl/.config \
|
|
75
|
+
XDG_DATA_HOME=/home/qubicl/.local/share \
|
|
76
|
+
XDG_CACHE_HOME=/home/qubicl/.cache \
|
|
77
|
+
XDG_RUNTIME_DIR=/tmp/qubicl-runtime \
|
|
78
|
+
"${user_network_env[@]}" \
|
|
79
|
+
"$@" &
|
|
80
|
+
pids+=("$!")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
start_control_as_user() {
|
|
84
|
+
control_env=(
|
|
85
|
+
HOME=/home/qubicl USER=qubicl LOGNAME=qubicl SHELL=/bin/bash
|
|
86
|
+
PATH=/opt/qubicl/skills-venv/bin:/home/qubicl/.local/bin:/usr/local/bin:/usr/bin:/bin
|
|
87
|
+
LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
88
|
+
XDG_CONFIG_HOME=/home/qubicl/.config
|
|
89
|
+
XDG_DATA_HOME=/home/qubicl/.local/share
|
|
90
|
+
XDG_CACHE_HOME=/home/qubicl/.cache
|
|
91
|
+
XDG_RUNTIME_DIR=/tmp/qubicl-runtime
|
|
92
|
+
QUBICL_RUNTIME_ROLE=control
|
|
93
|
+
QUBICL_ID="${QUBICL_ID:?}"
|
|
94
|
+
QUBICL_NAME="${QUBICL_NAME:?}"
|
|
95
|
+
QUBICL_INTERNAL_KEY="${QUBICL_INTERNAL_KEY:?}"
|
|
96
|
+
QUBICL_CONTROL_PORT="${QUBICL_CONTROL_PORT:-3212}"
|
|
97
|
+
QUBICL_EXPECTED_MANIFEST_SHA256="${QUBICL_EXPECTED_MANIFEST_SHA256:?}"
|
|
98
|
+
QUBICL_EXECUTOR_URL="${QUBICL_EXECUTOR_URL:?}"
|
|
99
|
+
QUBICL_EXECUTOR_KEY="${QUBICL_EXECUTOR_KEY:?}"
|
|
100
|
+
QUBICL_EXECUTOR_HOST="${QUBICL_EXECUTOR_HOST:?}"
|
|
101
|
+
QUBICL_PUBLIC_PREVIEW_BASE="${QUBICL_PUBLIC_PREVIEW_BASE:?}"
|
|
102
|
+
QUBICL_INTERNAL_PREVIEW_BASE="${QUBICL_INTERNAL_PREVIEW_BASE:?}"
|
|
103
|
+
QUBICL_BROKER_URL="${QUBICL_BROKER_URL:?}"
|
|
104
|
+
QUBICL_BROKER_KEY="${QUBICL_BROKER_KEY:?}"
|
|
105
|
+
QUBICL_WEB_URL="${QUBICL_WEB_URL:?}"
|
|
106
|
+
QUBICL_WEB_KEY="${QUBICL_WEB_KEY:?}"
|
|
107
|
+
QUBICL_AUDIT_PATH="${QUBICL_AUDIT_PATH:?}"
|
|
108
|
+
QUBICL_RESOURCE_ENVELOPE_JSON="${QUBICL_RESOURCE_ENVELOPE_JSON:?}"
|
|
109
|
+
QUBICL_POLICY_PATH="${QUBICL_POLICY_PATH:?}"
|
|
110
|
+
)
|
|
111
|
+
if [[ -v QUBICL_SESSION_URL ]]; then control_env+=(QUBICL_SESSION_URL="$QUBICL_SESSION_URL"); fi
|
|
112
|
+
if [[ -v QUBICL_SESSION_KEY ]]; then control_env+=(QUBICL_SESSION_KEY="$QUBICL_SESSION_KEY"); fi
|
|
113
|
+
if [[ -v QUBICL_MANIFEST_PATH ]]; then control_env+=(QUBICL_MANIFEST_PATH="$QUBICL_MANIFEST_PATH"); fi
|
|
114
|
+
if [[ "${QUBICL_TOKEN_METRICS:-0}" == 1 ]]; then control_env+=(QUBICL_TOKEN_METRICS=1); fi
|
|
115
|
+
if [[ -v DISPLAY ]]; then control_env+=(DISPLAY="$DISPLAY"); fi
|
|
116
|
+
runuser -u qubicl -- env -i "${control_env[@]}" node /opt/qubicl/control.mjs &
|
|
117
|
+
pids+=("$!")
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
start_internal_executor() {
|
|
121
|
+
executor_env=(
|
|
122
|
+
HOME=/root USER=root LOGNAME=root PATH=/usr/local/bin:/usr/bin:/bin LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
123
|
+
QUBICL_RUNTIME_ROLE=executor
|
|
124
|
+
QUBICL_LISTEN_HOST=127.0.0.1
|
|
125
|
+
QUBICL_RUNNER_KEY="${QUBICL_EXECUTOR_KEY:?}"
|
|
126
|
+
QUBICL_HOST_UID="$target_uid"
|
|
127
|
+
QUBICL_HOST_GID="$target_gid"
|
|
128
|
+
QUBICL_EXECUTOR_FENCE_UID="${QUBICL_EXECUTOR_FENCE_UID:-1}"
|
|
129
|
+
)
|
|
130
|
+
if [[ -v DISPLAY ]]; then executor_env+=(DISPLAY="$DISPLAY"); fi
|
|
131
|
+
if [[ -v QUBICL_PROXY_URL ]]; then executor_env+=(QUBICL_PROXY_URL="$QUBICL_PROXY_URL"); fi
|
|
132
|
+
if [[ -v QUBICL_WORKLOAD_ENV_JSON ]]; then executor_env+=(QUBICL_WORKLOAD_ENV_JSON="$QUBICL_WORKLOAD_ENV_JSON"); fi
|
|
133
|
+
env -i "${executor_env[@]}" node /opt/qubicl/control.mjs &
|
|
134
|
+
pids+=("$!")
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
start_internal_session() {
|
|
138
|
+
session_env=(
|
|
139
|
+
HOME=/root USER=root LOGNAME=root PATH=/usr/local/bin:/usr/bin:/bin LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
140
|
+
QUBICL_RUNTIME_ROLE=session
|
|
141
|
+
QUBICL_LISTEN_HOST=127.0.0.1
|
|
142
|
+
QUBICL_RUNNER_KEY="${QUBICL_SESSION_KEY:?}"
|
|
143
|
+
QUBICL_HOST_UID="$target_uid"
|
|
144
|
+
QUBICL_HOST_GID="$target_gid"
|
|
145
|
+
QUBICL_COMPATIBILITY="${QUBICL_COMPATIBILITY:?}"
|
|
146
|
+
QUBICL_BROWSER_EXECUTABLE="${QUBICL_BROWSER_EXECUTABLE:-/usr/local/bin/qubicl-chromium}"
|
|
147
|
+
QUBICL_POINTER_URL="${QUBICL_POINTER_URL:?}"
|
|
148
|
+
DISPLAY="${DISPLAY:-:0}"
|
|
149
|
+
)
|
|
150
|
+
if [[ -v QUBICL_PROXY_URL ]]; then session_env+=(QUBICL_PROXY_URL="$QUBICL_PROXY_URL"); fi
|
|
151
|
+
if [[ -v QUBICL_WORKLOAD_ENV_JSON ]]; then session_env+=(QUBICL_WORKLOAD_ENV_JSON="$QUBICL_WORKLOAD_ENV_JSON"); fi
|
|
152
|
+
env -i "${session_env[@]}" node /opt/qubicl/control.mjs &
|
|
153
|
+
pids+=("$!")
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
start_internal_web() {
|
|
157
|
+
web_env=(
|
|
158
|
+
HOME=/tmp USER=nobody LOGNAME=nobody PATH=/opt/qubicl/web-venv/bin:/usr/local/bin:/usr/bin:/bin LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
159
|
+
QUBICL_RUNTIME_ROLE=web
|
|
160
|
+
QUBICL_LISTEN_HOST=127.0.0.1
|
|
161
|
+
QUBICL_RUNNER_KEY="${QUBICL_WEB_KEY:?}"
|
|
162
|
+
QUBICL_NETWORK_POLICY="${QUBICL_NETWORK_POLICY:?}"
|
|
163
|
+
)
|
|
164
|
+
if [[ -v QUBICL_PROXY_URL ]]; then web_env+=(QUBICL_PROXY_URL="$QUBICL_PROXY_URL"); fi
|
|
165
|
+
runuser -u nobody -- env -i "${web_env[@]}" node /opt/qubicl/control.mjs &
|
|
166
|
+
pids+=("$!")
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
start_ssh() {
|
|
170
|
+
install -d -m 0755 /run/sshd
|
|
171
|
+
install -d -m 0700 -o qubicl -g qubicl /run/qubicl-ssh
|
|
172
|
+
# The inherited system account is password-locked, which also blocks
|
|
173
|
+
# public-key SSH. Password and interactive authentication remain disabled.
|
|
174
|
+
passwd -d qubicl >/dev/null
|
|
175
|
+
printf '%s\n' "${QUBICL_SSH_PUBLIC_KEY:?}" >/run/qubicl-ssh/authorized_keys
|
|
176
|
+
chmod 0600 /run/qubicl-ssh/authorized_keys
|
|
177
|
+
chown qubicl:qubicl /run/qubicl-ssh/authorized_keys
|
|
178
|
+
ssh-keygen -A >/dev/null
|
|
179
|
+
ssh_network_settings=()
|
|
180
|
+
if [[ -v QUBICL_PROXY_URL ]]; then
|
|
181
|
+
ssh_network_settings+=("SetEnv HTTP_PROXY=$QUBICL_PROXY_URL HTTPS_PROXY=$QUBICL_PROXY_URL http_proxy=$QUBICL_PROXY_URL https_proxy=$QUBICL_PROXY_URL")
|
|
182
|
+
fi
|
|
183
|
+
/usr/sbin/sshd -D -e \
|
|
184
|
+
-o Port=2222 \
|
|
185
|
+
-o ListenAddress=0.0.0.0 \
|
|
186
|
+
-o PasswordAuthentication=no \
|
|
187
|
+
-o KbdInteractiveAuthentication=no \
|
|
188
|
+
-o PermitRootLogin=no \
|
|
189
|
+
-o AllowUsers=qubicl \
|
|
190
|
+
-o PubkeyAuthentication=yes \
|
|
191
|
+
-o AuthorizedKeysFile=/run/qubicl-ssh/authorized_keys \
|
|
192
|
+
-o AllowTcpForwarding=yes \
|
|
193
|
+
-o GatewayPorts=no \
|
|
194
|
+
-o PermitTunnel=no \
|
|
195
|
+
-o X11Forwarding=no \
|
|
196
|
+
"${ssh_network_settings[@]}" &
|
|
197
|
+
pids+=("$!")
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
install -d -m 0700 -o qubicl -g qubicl /tmp/qubicl-runtime
|
|
201
|
+
|
|
202
|
+
start_display() {
|
|
203
|
+
export DISPLAY="${DISPLAY:-:0}"
|
|
204
|
+
# Docker creates a fresh named-volume root as root:root/0755. Xvfb runs as
|
|
205
|
+
# the unprivileged computer user, so make only this conventional X11 socket
|
|
206
|
+
# directory sticky/world-writable before it creates the shared socket.
|
|
207
|
+
install -d -m 1777 /tmp/.X11-unix
|
|
208
|
+
chmod 1777 /tmp/.X11-unix
|
|
209
|
+
rm -f /tmp/.X0-lock /tmp/.X11-unix/X0
|
|
210
|
+
start_as_user Xvfb "$DISPLAY" -screen 0 1440x900x24 -nolisten tcp -ac
|
|
211
|
+
for _ in $(seq 1 100); do
|
|
212
|
+
if runuser -u qubicl -- xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then return; fi
|
|
213
|
+
sleep 0.1
|
|
214
|
+
done
|
|
215
|
+
echo "Qubicl display did not become ready." >&2
|
|
216
|
+
exit 1
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
start_viewer() {
|
|
220
|
+
runuser -u qubicl -- env DISPLAY="$DISPLAY" xset s off -dpms >/dev/null 2>&1 || true
|
|
221
|
+
start_as_user env DISPLAY="$DISPLAY" x11vnc -display "$DISPLAY" -forever -shared -viewonly -localhost -nopw -rfbport 5900 -o /tmp/x11vnc-view.log
|
|
222
|
+
start_as_user env DISPLAY="$DISPLAY" x11vnc -display "$DISPLAY" -forever -shared -localhost -nopw -rfbport 5901 -o /tmp/x11vnc-control.log
|
|
223
|
+
start_as_user websockify --web=/usr/share/novnc 6080 localhost:5900
|
|
224
|
+
start_as_user websockify 6081 localhost:5901
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if [[ "$runtime_role" == session || "$runtime_role" == computer ]]; then
|
|
228
|
+
case "$baked_profile" in
|
|
229
|
+
file-system)
|
|
230
|
+
unset DISPLAY
|
|
231
|
+
;;
|
|
232
|
+
browser)
|
|
233
|
+
start_display
|
|
234
|
+
start_as_user env DISPLAY="$DISPLAY" dbus-run-session -- openbox-session
|
|
235
|
+
start_viewer
|
|
236
|
+
start_as_user env DISPLAY="$DISPLAY" chromium \
|
|
237
|
+
--no-first-run \
|
|
238
|
+
--no-default-browser-check \
|
|
239
|
+
--remote-debugging-address=127.0.0.1 \
|
|
240
|
+
--remote-debugging-port=9222 \
|
|
241
|
+
--user-data-dir=/home/qubicl/.local/share/qubicl/browser-profile \
|
|
242
|
+
about:blank
|
|
243
|
+
;;
|
|
244
|
+
desktop|workstation)
|
|
245
|
+
start_display
|
|
246
|
+
start_as_user env DISPLAY="$DISPLAY" dbus-run-session -- startxfce4
|
|
247
|
+
start_viewer
|
|
248
|
+
;;
|
|
249
|
+
*)
|
|
250
|
+
echo "Unknown Qubicl startup profile ${baked_profile}." >&2
|
|
251
|
+
exit 78
|
|
252
|
+
;;
|
|
253
|
+
esac
|
|
23
254
|
fi
|
|
24
255
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
256
|
+
case "$runtime_role" in
|
|
257
|
+
control)
|
|
258
|
+
start_control_as_user
|
|
259
|
+
;;
|
|
260
|
+
computer)
|
|
261
|
+
start_internal_executor
|
|
262
|
+
start_internal_web
|
|
263
|
+
if [[ "$baked_profile" != file-system ]]; then start_internal_session; fi
|
|
264
|
+
if [[ -v QUBICL_SSH_PUBLIC_KEY ]]; then start_ssh; fi
|
|
265
|
+
start_control_as_user
|
|
266
|
+
;;
|
|
267
|
+
executor)
|
|
268
|
+
env QUBICL_RUNTIME_ROLE=executor node /opt/qubicl/control.mjs &
|
|
269
|
+
pids+=("$!")
|
|
270
|
+
;;
|
|
271
|
+
session)
|
|
272
|
+
env QUBICL_RUNTIME_ROLE=session node /opt/qubicl/control.mjs &
|
|
273
|
+
pids+=("$!")
|
|
274
|
+
;;
|
|
275
|
+
ssh)
|
|
276
|
+
start_ssh
|
|
277
|
+
;;
|
|
278
|
+
*)
|
|
279
|
+
echo "Unknown Qubicl runtime role ${runtime_role}." >&2
|
|
280
|
+
exit 78
|
|
281
|
+
;;
|
|
282
|
+
esac
|
|
48
283
|
|
|
49
284
|
shutdown() {
|
|
50
|
-
|
|
51
|
-
|
|
285
|
+
if (( ${#pids[@]} )); then
|
|
286
|
+
kill "${pids[@]}" 2>/dev/null || true
|
|
287
|
+
wait 2>/dev/null || true
|
|
288
|
+
fi
|
|
52
289
|
}
|
|
53
290
|
trap shutdown TERM INT EXIT
|
|
54
|
-
wait -n "$
|
|
291
|
+
wait -n "${pids[@]}"
|
|
55
292
|
exit 1
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"preset": "browser",
|
|
4
|
+
"compatibility": "browser",
|
|
5
|
+
"capabilities": [
|
|
6
|
+
"shell",
|
|
7
|
+
"process",
|
|
8
|
+
"files",
|
|
9
|
+
"desktop",
|
|
10
|
+
"viewer",
|
|
11
|
+
"browser"
|
|
12
|
+
],
|
|
13
|
+
"tools": [
|
|
14
|
+
"get_computer_status",
|
|
15
|
+
"acquire_lease",
|
|
16
|
+
"renew_lease",
|
|
17
|
+
"release_lease",
|
|
18
|
+
"exec_command",
|
|
19
|
+
"write_stdin",
|
|
20
|
+
"stop_process",
|
|
21
|
+
"list_ports",
|
|
22
|
+
"publish_port",
|
|
23
|
+
"list_previews",
|
|
24
|
+
"unpublish_port",
|
|
25
|
+
"broker_request",
|
|
26
|
+
"skills_list",
|
|
27
|
+
"skill_view",
|
|
28
|
+
"skill_manage",
|
|
29
|
+
"web_search",
|
|
30
|
+
"web_extract",
|
|
31
|
+
"list_files",
|
|
32
|
+
"get_file_info",
|
|
33
|
+
"read_file",
|
|
34
|
+
"write_file",
|
|
35
|
+
"edit_file",
|
|
36
|
+
"copy_path",
|
|
37
|
+
"move_path",
|
|
38
|
+
"delete_path",
|
|
39
|
+
"take_screenshot",
|
|
40
|
+
"control_computer",
|
|
41
|
+
"browser_navigate",
|
|
42
|
+
"browser_snapshot",
|
|
43
|
+
"browser_screenshot",
|
|
44
|
+
"browser_click",
|
|
45
|
+
"browser_type",
|
|
46
|
+
"browser_select",
|
|
47
|
+
"browser_press",
|
|
48
|
+
"browser_scroll",
|
|
49
|
+
"browser_history",
|
|
50
|
+
"browser_wait",
|
|
51
|
+
"browser_tabs",
|
|
52
|
+
"browser_use_tab",
|
|
53
|
+
"browser_new_tab",
|
|
54
|
+
"browser_close_tab",
|
|
55
|
+
"browser_reset",
|
|
56
|
+
"browser_click_at",
|
|
57
|
+
"browser_double_click_at",
|
|
58
|
+
"browser_hover_at",
|
|
59
|
+
"browser_drag",
|
|
60
|
+
"browser_scroll_at",
|
|
61
|
+
"browser_type_focused",
|
|
62
|
+
"browser_inspect_at",
|
|
63
|
+
"browser_computer",
|
|
64
|
+
"read_clipboard",
|
|
65
|
+
"write_clipboard"
|
|
66
|
+
],
|
|
67
|
+
"viewer": true,
|
|
68
|
+
"controlProtocolVersion": 10,
|
|
69
|
+
"qubiclVersion": "0.1.1",
|
|
70
|
+
"revision": "dac0e16a11b8cbc0ed7f8b0e9eb9e16a3aa2f45d",
|
|
71
|
+
"startupProfile": "browser"
|
|
72
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"preset": "computer",
|
|
4
|
+
"compatibility": "computer",
|
|
5
|
+
"capabilities": [
|
|
6
|
+
"shell",
|
|
7
|
+
"process",
|
|
8
|
+
"files",
|
|
9
|
+
"desktop",
|
|
10
|
+
"viewer",
|
|
11
|
+
"browser",
|
|
12
|
+
"desktop-apps"
|
|
13
|
+
],
|
|
14
|
+
"tools": [
|
|
15
|
+
"get_computer_status",
|
|
16
|
+
"acquire_lease",
|
|
17
|
+
"renew_lease",
|
|
18
|
+
"release_lease",
|
|
19
|
+
"exec_command",
|
|
20
|
+
"write_stdin",
|
|
21
|
+
"stop_process",
|
|
22
|
+
"list_ports",
|
|
23
|
+
"publish_port",
|
|
24
|
+
"list_previews",
|
|
25
|
+
"unpublish_port",
|
|
26
|
+
"broker_request",
|
|
27
|
+
"skills_list",
|
|
28
|
+
"skill_view",
|
|
29
|
+
"skill_manage",
|
|
30
|
+
"web_search",
|
|
31
|
+
"web_extract",
|
|
32
|
+
"list_files",
|
|
33
|
+
"get_file_info",
|
|
34
|
+
"read_file",
|
|
35
|
+
"write_file",
|
|
36
|
+
"edit_file",
|
|
37
|
+
"copy_path",
|
|
38
|
+
"move_path",
|
|
39
|
+
"delete_path",
|
|
40
|
+
"take_screenshot",
|
|
41
|
+
"control_computer",
|
|
42
|
+
"browser_navigate",
|
|
43
|
+
"browser_snapshot",
|
|
44
|
+
"browser_screenshot",
|
|
45
|
+
"browser_click",
|
|
46
|
+
"browser_type",
|
|
47
|
+
"browser_select",
|
|
48
|
+
"browser_press",
|
|
49
|
+
"browser_scroll",
|
|
50
|
+
"browser_history",
|
|
51
|
+
"browser_wait",
|
|
52
|
+
"browser_tabs",
|
|
53
|
+
"browser_use_tab",
|
|
54
|
+
"browser_new_tab",
|
|
55
|
+
"browser_close_tab",
|
|
56
|
+
"browser_reset",
|
|
57
|
+
"browser_click_at",
|
|
58
|
+
"browser_double_click_at",
|
|
59
|
+
"browser_hover_at",
|
|
60
|
+
"browser_drag",
|
|
61
|
+
"browser_scroll_at",
|
|
62
|
+
"browser_type_focused",
|
|
63
|
+
"browser_inspect_at",
|
|
64
|
+
"browser_computer",
|
|
65
|
+
"read_clipboard",
|
|
66
|
+
"write_clipboard",
|
|
67
|
+
"open_desktop_application",
|
|
68
|
+
"list_desktop_applications",
|
|
69
|
+
"close_desktop_application"
|
|
70
|
+
],
|
|
71
|
+
"viewer": true,
|
|
72
|
+
"controlProtocolVersion": 10,
|
|
73
|
+
"qubiclVersion": "0.1.1",
|
|
74
|
+
"revision": "dac0e16a11b8cbc0ed7f8b0e9eb9e16a3aa2f45d",
|
|
75
|
+
"startupProfile": "desktop"
|
|
76
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"preset": "file-system",
|
|
4
|
+
"compatibility": "file-system",
|
|
5
|
+
"capabilities": [
|
|
6
|
+
"shell",
|
|
7
|
+
"process",
|
|
8
|
+
"files"
|
|
9
|
+
],
|
|
10
|
+
"tools": [
|
|
11
|
+
"get_computer_status",
|
|
12
|
+
"acquire_lease",
|
|
13
|
+
"renew_lease",
|
|
14
|
+
"release_lease",
|
|
15
|
+
"exec_command",
|
|
16
|
+
"write_stdin",
|
|
17
|
+
"stop_process",
|
|
18
|
+
"list_ports",
|
|
19
|
+
"publish_port",
|
|
20
|
+
"list_previews",
|
|
21
|
+
"unpublish_port",
|
|
22
|
+
"broker_request",
|
|
23
|
+
"skills_list",
|
|
24
|
+
"skill_view",
|
|
25
|
+
"skill_manage",
|
|
26
|
+
"web_search",
|
|
27
|
+
"web_extract",
|
|
28
|
+
"list_files",
|
|
29
|
+
"get_file_info",
|
|
30
|
+
"read_file",
|
|
31
|
+
"write_file",
|
|
32
|
+
"edit_file",
|
|
33
|
+
"copy_path",
|
|
34
|
+
"move_path",
|
|
35
|
+
"delete_path"
|
|
36
|
+
],
|
|
37
|
+
"viewer": false,
|
|
38
|
+
"controlProtocolVersion": 10,
|
|
39
|
+
"qubiclVersion": "0.1.1",
|
|
40
|
+
"revision": "dac0e16a11b8cbc0ed7f8b0e9eb9e16a3aa2f45d",
|
|
41
|
+
"startupProfile": "file-system"
|
|
42
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"preset": "workstation",
|
|
4
|
+
"compatibility": "workstation",
|
|
5
|
+
"capabilities": [
|
|
6
|
+
"shell",
|
|
7
|
+
"process",
|
|
8
|
+
"files",
|
|
9
|
+
"desktop",
|
|
10
|
+
"viewer",
|
|
11
|
+
"browser",
|
|
12
|
+
"desktop-apps",
|
|
13
|
+
"development",
|
|
14
|
+
"office"
|
|
15
|
+
],
|
|
16
|
+
"tools": [
|
|
17
|
+
"get_computer_status",
|
|
18
|
+
"acquire_lease",
|
|
19
|
+
"renew_lease",
|
|
20
|
+
"release_lease",
|
|
21
|
+
"exec_command",
|
|
22
|
+
"write_stdin",
|
|
23
|
+
"stop_process",
|
|
24
|
+
"list_ports",
|
|
25
|
+
"publish_port",
|
|
26
|
+
"list_previews",
|
|
27
|
+
"unpublish_port",
|
|
28
|
+
"broker_request",
|
|
29
|
+
"skills_list",
|
|
30
|
+
"skill_view",
|
|
31
|
+
"skill_manage",
|
|
32
|
+
"web_search",
|
|
33
|
+
"web_extract",
|
|
34
|
+
"list_files",
|
|
35
|
+
"get_file_info",
|
|
36
|
+
"read_file",
|
|
37
|
+
"write_file",
|
|
38
|
+
"edit_file",
|
|
39
|
+
"copy_path",
|
|
40
|
+
"move_path",
|
|
41
|
+
"delete_path",
|
|
42
|
+
"take_screenshot",
|
|
43
|
+
"control_computer",
|
|
44
|
+
"browser_navigate",
|
|
45
|
+
"browser_snapshot",
|
|
46
|
+
"browser_screenshot",
|
|
47
|
+
"browser_click",
|
|
48
|
+
"browser_type",
|
|
49
|
+
"browser_select",
|
|
50
|
+
"browser_press",
|
|
51
|
+
"browser_scroll",
|
|
52
|
+
"browser_history",
|
|
53
|
+
"browser_wait",
|
|
54
|
+
"browser_tabs",
|
|
55
|
+
"browser_use_tab",
|
|
56
|
+
"browser_new_tab",
|
|
57
|
+
"browser_close_tab",
|
|
58
|
+
"browser_reset",
|
|
59
|
+
"browser_click_at",
|
|
60
|
+
"browser_double_click_at",
|
|
61
|
+
"browser_hover_at",
|
|
62
|
+
"browser_drag",
|
|
63
|
+
"browser_scroll_at",
|
|
64
|
+
"browser_type_focused",
|
|
65
|
+
"browser_inspect_at",
|
|
66
|
+
"browser_computer",
|
|
67
|
+
"read_clipboard",
|
|
68
|
+
"write_clipboard",
|
|
69
|
+
"open_desktop_application",
|
|
70
|
+
"list_desktop_applications",
|
|
71
|
+
"close_desktop_application"
|
|
72
|
+
],
|
|
73
|
+
"viewer": true,
|
|
74
|
+
"controlProtocolVersion": 10,
|
|
75
|
+
"qubiclVersion": "0.1.1",
|
|
76
|
+
"revision": "dac0e16a11b8cbc0ed7f8b0e9eb9e16a3aa2f45d",
|
|
77
|
+
"startupProfile": "workstation"
|
|
78
|
+
}
|