@scalio-cloud/ui 0.105.2 → 0.107.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 -1
- package/nginx/security-headers.conf +3 -2
- package/package.json +1 -1
- package/react/mail.js +37 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ fails on an export without a type, a type without an export, and an `exports` pa
|
|
|
53
53
|
|
|
54
54
|
`nginx/security-headers.conf` holds the security headers of every Scalio app (security review M6): `nosniff`,
|
|
55
55
|
framing only by the own origin, no plugins, `Referrer-Policy`, no camera/microphone/location. From 0.104.0 also HSTS
|
|
56
|
-
(one year, `includeSubDomains
|
|
56
|
+
(one year, without `includeSubDomains`, from 0.106.0) and a Content-Security-Policy (BL-1080): scripts only from the own origin (no inline
|
|
57
57
|
script, no `eval`), inline styles allowed, images also `data:`, `blob:` and HTTPS, fonts `data:`, connections to
|
|
58
58
|
HTTPS/WSS. The file explains every exception. An app that needs more (another script host, `eval`) must say so
|
|
59
59
|
before it upgrades; test the upgrade on dev with the browser console open (CSP errors show there).
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
# app's Dockerfile to /etc/nginx/snippets/. Include it in the server block AND in every location that has its own
|
|
3
3
|
# add_header: nginx drops the server-level add_header lines in such a location.
|
|
4
4
|
#
|
|
5
|
-
# HSTS: one year,
|
|
5
|
+
# HSTS: one year, no includeSubDomains (self-hosted apps often run on the customer's apex domain, so all its
|
|
6
|
+
# subdomains would be forced to HTTPS for a year), no preload (preload cannot be undone quickly). Browsers ignore it over plain
|
|
6
7
|
# HTTP, so an instance without TLS keeps working.
|
|
7
8
|
#
|
|
8
9
|
# Content-Security-Policy, what each part allows and why:
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
# frame-ancestors 'self' framing only by the own origin (same as X-Frame-Options)
|
|
20
21
|
# object-src 'none'; base-uri 'self' no plugins, no <base> from injected markup
|
|
21
22
|
# No form-action: the Microsoft sign-in leaves by redirect, and Chrome checks form-action on redirects as well.
|
|
22
|
-
add_header Strict-Transport-Security "max-age=31536000
|
|
23
|
+
add_header Strict-Transport-Security "max-age=31536000" always;
|
|
23
24
|
add_header X-Content-Type-Options "nosniff" always;
|
|
24
25
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
25
26
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https: wss:; frame-src 'self' blob:; worker-src 'self' blob:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'" always;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.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
|
@@ -7,6 +7,8 @@ const h = React.createElement;
|
|
|
7
7
|
const Icons = require("./icons");
|
|
8
8
|
const { SettingsSection, SettingsField: Field } = require("./settings");
|
|
9
9
|
|
|
10
|
+
const CLOUD_SHELL_URL = "https://shell.azure.com/powershell";
|
|
11
|
+
|
|
10
12
|
const LABELS = {
|
|
11
13
|
de: {
|
|
12
14
|
transportTitle: "E-Mail-Versand",
|
|
@@ -69,6 +71,14 @@ const LABELS = {
|
|
|
69
71
|
copy: "Kopieren",
|
|
70
72
|
copied: "Skript kopiert",
|
|
71
73
|
copyFailed: "Kopieren nicht möglich. Bitte markieren und kopieren.",
|
|
74
|
+
cloudShell: "In Azure Cloud Shell ausführen",
|
|
75
|
+
cloudShellHint: "Auf dem Mac scheitert das Skript oft am lokalen Modul ExchangeOnlineManagement. In der Azure Cloud Shell ist es schon da.",
|
|
76
|
+
cloudShellCopied: "Skript kopiert. Die Azure Cloud Shell öffnet sich in einem neuen Tab: dort einfügen.",
|
|
77
|
+
cloudShellSteps: [
|
|
78
|
+
"Melden Sie sich in der Azure Cloud Shell mit einem Exchange-Administrator Ihres eigenen Tenants an.",
|
|
79
|
+
"Wählen Sie beim ersten Start «Kein Speicherkonto erforderlich» bzw. eine kurzlebige Sitzung (keine Azure-Kosten).",
|
|
80
|
+
"Fügen Sie das Skript ein (Rechtsklick oder Cmd+V) und warten Sie, bis «InScope True» erscheint. Danach hier «Status prüfen».",
|
|
81
|
+
],
|
|
72
82
|
testMailbox: "Testinstanz: Solange hier kein eigener Weg gespeichert ist, gehen Mails über das Testpostfach. Mails gehen nur an Adressen der Testdomains.",
|
|
73
83
|
testInstance: "Testinstanz: Mails gehen über die Einstellungen hier, aber nur an Adressen der Testdomains.",
|
|
74
84
|
save: "Speichern",
|
|
@@ -167,6 +177,14 @@ const LABELS = {
|
|
|
167
177
|
copy: "Copy",
|
|
168
178
|
copied: "Script copied",
|
|
169
179
|
copyFailed: "Copying is not possible. Please select and copy.",
|
|
180
|
+
cloudShell: "Run in Azure Cloud Shell",
|
|
181
|
+
cloudShellHint: "On a Mac the script often fails on the local ExchangeOnlineManagement module. Azure Cloud Shell already has it.",
|
|
182
|
+
cloudShellCopied: "Script copied. Azure Cloud Shell opens in a new tab: paste it there.",
|
|
183
|
+
cloudShellSteps: [
|
|
184
|
+
"Sign in to Azure Cloud Shell with an Exchange administrator of your own tenant.",
|
|
185
|
+
"On the first start choose «No storage account required» or a short-lived session (no Azure costs).",
|
|
186
|
+
"Paste the script (right click or Cmd+V) and wait until «InScope True» appears. Then click «Check status» here.",
|
|
187
|
+
],
|
|
170
188
|
testMailbox: "Test instance: as long as no own way is saved here, mails go through the test mailbox. Mails only go to addresses of the test domains.",
|
|
171
189
|
testInstance: "Test instance: mails go through the settings here, but only to addresses of the test domains.",
|
|
172
190
|
save: "Save",
|
|
@@ -479,6 +497,19 @@ function MailTransport(props) {
|
|
|
479
497
|
if (props.notify) props.notify(text, tone);
|
|
480
498
|
else setScriptMsg({ tone: tone === "error" ? "error" : "ok", text });
|
|
481
499
|
};
|
|
500
|
+
// «In Azure Cloud Shell ausführen»: copy first (needs the click), then open the shell in a new tab
|
|
501
|
+
const runInCloudShell = async () => {
|
|
502
|
+
let text = L.cloudShellCopied, tone = "success";
|
|
503
|
+
try {
|
|
504
|
+
await navigator.clipboard.writeText(script);
|
|
505
|
+
} catch (e) {
|
|
506
|
+
text = L.copyFailed;
|
|
507
|
+
tone = "error";
|
|
508
|
+
}
|
|
509
|
+
window.open(CLOUD_SHELL_URL, "_blank", "noopener,noreferrer");
|
|
510
|
+
if (props.notify) props.notify(text, tone);
|
|
511
|
+
else setScriptMsg({ tone: tone === "error" ? "error" : "ok", text });
|
|
512
|
+
};
|
|
482
513
|
const grant = async () => {
|
|
483
514
|
setGranting(true);
|
|
484
515
|
setScriptMsg(null);
|
|
@@ -663,8 +694,13 @@ function MailTransport(props) {
|
|
|
663
694
|
? h(React.Fragment, null,
|
|
664
695
|
h("pre", { className: "scalio-mail-script", "data-testid": "mail-rights-script" }, script),
|
|
665
696
|
h("div", { className: "scalio-settings-section-footer" },
|
|
697
|
+
h("button", { type: "button", className: "scalio-btn is-primary", onClick: runInCloudShell, "data-testid": "mail-rights-cloudshell" },
|
|
698
|
+
h(Icons.CornerDownLeft, { className: "scalio-icon" }), L.cloudShell),
|
|
666
699
|
h("button", { type: "button", className: "scalio-btn", onClick: copyScript, "data-testid": "mail-rights-copy" },
|
|
667
|
-
h(Icons.Copy, { className: "scalio-icon" }), L.copy))
|
|
700
|
+
h(Icons.Copy, { className: "scalio-icon" }), L.copy)),
|
|
701
|
+
h("p", { className: "scalio-settings-help" }, L.cloudShellHint),
|
|
702
|
+
h("ol", { className: "scalio-settings-help", "data-testid": "mail-rights-cloudshell-steps" },
|
|
703
|
+
L.cloudShellSteps.map((t) => h("li", { key: t }, t))))
|
|
668
704
|
: h("div", { className: "scalio-settings-section-footer" },
|
|
669
705
|
h("button", { type: "button", className: auto ? "scalio-btn is-ghost" : "scalio-btn", onClick: showScript, disabled: scriptBusy, "data-testid": "mail-rights-show" },
|
|
670
706
|
auto ? L.rightsScriptAlso : L.showScript)),
|