@scalio-cloud/ui 0.94.0 → 0.96.0
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 +1 -0
- package/nginx/access-limit.sh +9 -1
- package/package.json +1 -1
- package/react/mail.js +19 -1
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ server {
|
|
|
78
78
|
| `ALLOWED_CLIENT_IPS` | Addresses and networks, comma separated (`198.51.100.7, 203.0.113.0/24, 2001:db8::/32`) |
|
|
79
79
|
| `ALLOWED_COUNTRIES` | ISO country codes (`CH, LI, DE`); needs the geoip2 module and a country database |
|
|
80
80
|
| `TRUSTED_PROXIES` | Proxies whose `X-Forwarded-For` counts (Caddy, Azure front end); the last entry is used |
|
|
81
|
+
| `ALLOWED_API_OPEN` | `1` = the public API (`/api/public/v1`) and the MCP server (`/mcp`, ADR 0084) stay open for every address (switch «API und MCP von überall», from 0.96.0); any other value or no list: no effect |
|
|
81
82
|
| `SCALIO_APP` | App name (`nexus`, …) for the app-specific machine paths |
|
|
82
83
|
| `SCALIO_GEOIP_DB` | Country database, default `/etc/nginx/geoip/dbip-country.mmdb` |
|
|
83
84
|
| `SCALIO_ACCESS_STATUS` | Public status file, default `/usr/share/nginx/html/access-status.json` (from 0.93.0) |
|
package/nginx/access-limit.sh
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
# ALLOWED_COUNTRIES ISO country codes, comma separated ("CH,DE,AT"); needs SCALIO_GEOIP_DB and the geoip2 module
|
|
8
8
|
# loaded in nginx.conf (load_module, or modules/*.conf as in the Alpine package)
|
|
9
9
|
# TRUSTED_PROXIES CIDR list of the proxy in front (Caddy network, Azure ingress); its X-Forwarded-For counts
|
|
10
|
+
# ALLOWED_API_OPEN "1" = the public API (/api/public/v1) and the MCP server (/mcp) of ADR 0084 stay open for every
|
|
11
|
+
# address (switch «API und MCP von überall», zugang/Z4); they have their own keys and tokens.
|
|
12
|
+
# Any other value: they are limited like the rest. Without a list it changes nothing.
|
|
10
13
|
# SCALIO_APP nexus, citadel, … : picks the app's machine paths (machine-paths.txt)
|
|
11
14
|
# SCALIO_ACCESS_STATUS public status file for the settings page, default /usr/share/nginx/html/access-status.json
|
|
12
15
|
# (active yes/no, number of IP ranges, countries; never an address); cannot be written: only a log line
|
|
@@ -68,6 +71,7 @@ write_status() {
|
|
|
68
71
|
IPS=$(words "${ALLOWED_CLIENT_IPS:-}")
|
|
69
72
|
COUNTRIES=$(words "${ALLOWED_COUNTRIES:-}" | tr 'a-z' 'A-Z')
|
|
70
73
|
PROXIES=$(words "${TRUSTED_PROXIES:-}")
|
|
74
|
+
API_OPEN="${ALLOWED_API_OPEN:-}"
|
|
71
75
|
mkdir -p "$(dirname "$HTTP_CONF")" "$(dirname "$SERVER_CONF")"
|
|
72
76
|
|
|
73
77
|
if [ -z "$IPS" ] && [ -z "$COUNTRIES" ]; then
|
|
@@ -136,6 +140,10 @@ write_status true "$(echo "$IPS" | wc -w | tr -d ' ')" "$COUNTRIES_SHOWN" "$geo_
|
|
|
136
140
|
esac
|
|
137
141
|
fi
|
|
138
142
|
done
|
|
143
|
+
if [ "$API_OPEN" = "1" ]; then
|
|
144
|
+
echo " /api/public/v1 1;"; echo " ~^/api/public/v1/ 1;"
|
|
145
|
+
echo " /mcp 1;"; echo " ~^/mcp/ 1;"
|
|
146
|
+
fi
|
|
139
147
|
echo "}"
|
|
140
148
|
echo "map \"\$scalio_ip_allowed\$scalio_country_allowed\$scalio_machine_path\" \$scalio_access_denied {"
|
|
141
149
|
echo " default 0;"
|
|
@@ -155,4 +163,4 @@ location @scalio_access_denied {
|
|
|
155
163
|
return 200 '<!doctype html><html lang="de"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Zugriff nicht freigegeben</title><body style="font-family:system-ui,sans-serif;max-width:36rem;margin:4rem auto;padding:0 1rem;line-height:1.5"><h1 style="font-size:1.4rem">Zugriff nicht freigegeben</h1><p>Der Zugriff von Ihrer Adresse <b>$remote_addr</b> $scalio_country ist für diese Instanz nicht freigegeben. Bitten Sie Ihre Administration, die Adresse in Scalio Compass unter «Zugriff eingrenzen» einzutragen.</p><p lang="en" style="color:#666">Access from your address <b>$remote_addr</b> $scalio_country is not allowed for this instance. Ask your administrator to add it in Scalio Compass under «Restrict access».</p></body></html>';
|
|
156
164
|
}
|
|
157
165
|
CONF
|
|
158
|
-
log "access limited: $(echo "$IPS" | wc -w | tr -d ' ') IP range(s), countries: ${COUNTRIES:-none}, trusted proxies: ${PROXIES:-none}"
|
|
166
|
+
log "access limited: $(echo "$IPS" | wc -w | tr -d ' ') IP range(s), countries: ${COUNTRIES:-none}, trusted proxies: ${PROXIES:-none}, API and MCP open: $([ "$API_OPEN" = 1 ] && echo yes || echo no)"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.0",
|
|
4
4
|
"description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"private": false,
|
package/react/mail.js
CHANGED
|
@@ -306,6 +306,17 @@ function select(id, value, options, onChange, extra) {
|
|
|
306
306
|
// With scalio-platform 0.45.0 the status names a `reason` when the app can not set the send right itself: the button
|
|
307
307
|
// «Senderecht setzen» stays visible but greyed out with that reason (grantOffHint {read_only, no_exchange, identity}:
|
|
308
308
|
// the app's own texts, e.g. Citadel «Mit Scalio Schreiben setzt Citadel das Senderecht selbst»).
|
|
309
|
+
// With scalio-platform 0.60.0 settings and the test mail answer carry from_name_applies, from_name_hint and
|
|
310
|
+
// from_name_hint_de: when applies is false (e.g. Microsoft 365 sends with the mailbox's display name) the sender name
|
|
311
|
+
// has no effect; the field is locked and the hint shown. Without these fields (older backends) nothing changes.
|
|
312
|
+
function pickNameInfo(src) {
|
|
313
|
+
return { applies: src.from_name_applies !== false, hint: src.from_name_hint || "", hint_de: src.from_name_hint_de || "" };
|
|
314
|
+
}
|
|
315
|
+
function nameHintText(info, lang) {
|
|
316
|
+
if (!info || info.applies) return "";
|
|
317
|
+
return (lang === "en" ? info.hint : info.hint_de || info.hint) || (lang === "en" ? info.hint_de : info.hint) || "";
|
|
318
|
+
}
|
|
319
|
+
|
|
309
320
|
function settlingTime(iso, lang) {
|
|
310
321
|
const d = new Date(iso);
|
|
311
322
|
if (isNaN(d.getTime())) return iso;
|
|
@@ -327,6 +338,7 @@ function MailTransport(props) {
|
|
|
327
338
|
const [scriptMsg, setScriptMsg] = React.useState(null);
|
|
328
339
|
const [rightsInfo, setRightsInfo] = React.useState(null); // {mode, state, detail, sender} (scalio-platform 0.43.0)
|
|
329
340
|
const [granting, setGranting] = React.useState(false);
|
|
341
|
+
const [nameInfo, setNameInfo] = React.useState(null); // from_name_* of the last test mail answer (scalio-platform 0.60.0)
|
|
330
342
|
const [mbxList, setMbxList] = React.useState(null); // shared mailboxes of the chosen tenant, or null
|
|
331
343
|
const [mbxOther, setMbxOther] = React.useState(false);
|
|
332
344
|
const [testOk, setTestOk] = React.useState(false);
|
|
@@ -428,6 +440,7 @@ function MailTransport(props) {
|
|
|
428
440
|
setTestMsg(null);
|
|
429
441
|
try {
|
|
430
442
|
const r = await client.test(to.trim());
|
|
443
|
+
if (r && typeof r.from_name_applies === "boolean") setNameInfo(pickNameInfo(r));
|
|
431
444
|
const text = L.testSent.replace("{to}", (r && r.to) || to);
|
|
432
445
|
setTestOk(true);
|
|
433
446
|
if (props.notify) props.notify(text, "success");
|
|
@@ -487,6 +500,9 @@ function MailTransport(props) {
|
|
|
487
500
|
const providers = (form.providers || ["off", "smtp", "graph"]).filter((id) => L.providers[id]);
|
|
488
501
|
// ADR 0090: the default from Compass or the installation (scalio-platform 0.19.0); never a secret in it
|
|
489
502
|
const dflt = form.default || null;
|
|
503
|
+
const nameInfoNow = nameInfo || (typeof form.from_name_applies === "boolean" ? pickNameInfo(form) : null);
|
|
504
|
+
const nameLocked = !!(nameInfoNow && !nameInfoNow.applies);
|
|
505
|
+
const nameHint = nameHintText(nameInfoNow, lang);
|
|
490
506
|
const defaultUsable = !!(dflt && dflt.available);
|
|
491
507
|
const defaultBlock = () => {
|
|
492
508
|
if (!defaultUsable) return h("div", { className: "scalio-notice is-info", "data-testid": "mail-default-none" }, L.defaultNone);
|
|
@@ -497,6 +513,7 @@ function MailTransport(props) {
|
|
|
497
513
|
h("p", { className: "scalio-field-label" }, `${L.defaultFrom[dflt.source] || L.defaultFrom.compass}: ${L.defaultWays[dflt.provider] || dflt.provider}`),
|
|
498
514
|
h("dl", { className: "scalio-mail-default-facts" },
|
|
499
515
|
facts.filter((f) => f[1]).map((f) => h(React.Fragment, { key: f[0] }, h("dt", null, f[0]), h("dd", null, f[1])))),
|
|
516
|
+
nameHint ? h("p", { className: "scalio-settings-help", "data-testid": "mail-from-name-hint" }, nameHint) : null,
|
|
500
517
|
h("p", { className: "scalio-settings-help" }, L.defaultHint));
|
|
501
518
|
};
|
|
502
519
|
const transport = h(
|
|
@@ -520,7 +537,8 @@ function MailTransport(props) {
|
|
|
520
537
|
: null,
|
|
521
538
|
form.provider !== "off" && form.provider !== "default"
|
|
522
539
|
? h("div", { className: "scalio-mail-grid" },
|
|
523
|
-
h(Field, { id: "mail-from-name", label: L.fromName
|
|
540
|
+
h(Field, { id: "mail-from-name", label: L.fromName, hint: nameHint || undefined },
|
|
541
|
+
input("mail-from-name", form.from_name, (v) => set({ from_name: v }), { maxLength: 80, disabled: busy || nameLocked })),
|
|
524
542
|
form.provider === "smtp"
|
|
525
543
|
? h(Field, { id: "mail-from", label: L.fromAddress }, input("mail-from", form.from_address, (v) => set({ from_address: v }),
|
|
526
544
|
{ type: "email", maxLength: 254, placeholder: "noreply@example.com", disabled: busy }))
|