@geekity/cms 0.8.0 → 0.10.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 +344 -47
- package/admin/components/admin-bar.njk +26 -0
- package/admin/components/public-admin-bar.njk +41 -0
- package/admin/layouts/base.njk +1 -0
- package/admin/layouts/shell.njk +8 -19
- package/admin/pages/comments/all.njk +3 -0
- package/admin/pages/settings/discussion.njk +53 -0
- package/admin/pages/settings/email.njk +20 -0
- package/admin/pages/tools/personal-data.njk +67 -0
- package/admin/pages/users/edit.njk +1 -1
- package/admin/static/admin-bar.css +137 -0
- package/admin/static/admin.css +1 -102
- package/dist/admin/comments.d.ts +5 -0
- package/dist/admin/comments.d.ts.map +1 -1
- package/dist/admin/comments.js +15 -1
- package/dist/admin/comments.js.map +1 -1
- package/dist/admin/headers.d.ts +14 -5
- package/dist/admin/headers.d.ts.map +1 -1
- package/dist/admin/headers.js +18 -6
- package/dist/admin/headers.js.map +1 -1
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/menu.d.ts.map +1 -1
- package/dist/admin/menu.js +5 -1
- package/dist/admin/menu.js.map +1 -1
- package/dist/admin/personal-data.d.ts +35 -0
- package/dist/admin/personal-data.d.ts.map +1 -0
- package/dist/admin/personal-data.js +94 -0
- package/dist/admin/personal-data.js.map +1 -0
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +1 -1
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +20 -3
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/session.d.ts +42 -1
- package/dist/admin/session.d.ts.map +1 -1
- package/dist/admin/session.js +74 -4
- package/dist/admin/session.js.map +1 -1
- package/dist/admin/settings-discussion.d.ts.map +1 -1
- package/dist/admin/settings-discussion.js +9 -1
- package/dist/admin/settings-discussion.js.map +1 -1
- package/dist/admin/settings-email.d.ts.map +1 -1
- package/dist/admin/settings-email.js +10 -1
- package/dist/admin/settings-email.js.map +1 -1
- package/dist/admin/settings.d.ts +39 -0
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +144 -0
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/store.d.ts +65 -0
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +130 -5
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/templates.d.ts +2 -0
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +2 -0
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/tools.d.ts +2 -0
- package/dist/admin/tools.d.ts.map +1 -1
- package/dist/admin/tools.js +3 -2
- package/dist/admin/tools.js.map +1 -1
- package/dist/avatars/avatars.d.ts +112 -0
- package/dist/avatars/avatars.d.ts.map +1 -0
- package/dist/avatars/avatars.js +259 -0
- package/dist/avatars/avatars.js.map +1 -0
- package/dist/avatars/index.d.ts +4 -0
- package/dist/avatars/index.d.ts.map +1 -0
- package/dist/avatars/index.js +3 -0
- package/dist/avatars/index.js.map +1 -0
- package/dist/avatars/routes.d.ts +11 -0
- package/dist/avatars/routes.d.ts.map +1 -0
- package/dist/avatars/routes.js +33 -0
- package/dist/avatars/routes.js.map +1 -0
- package/dist/comments/index.d.ts +2 -2
- package/dist/comments/index.d.ts.map +1 -1
- package/dist/comments/index.js +1 -1
- package/dist/comments/index.js.map +1 -1
- package/dist/comments/records.d.ts +58 -2
- package/dist/comments/records.d.ts.map +1 -1
- package/dist/comments/records.js +244 -47
- package/dist/comments/records.js.map +1 -1
- package/dist/comments/routes.d.ts.map +1 -1
- package/dist/comments/routes.js +8 -2
- package/dist/comments/routes.js.map +1 -1
- package/dist/comments/viewer.d.ts +13 -0
- package/dist/comments/viewer.d.ts.map +1 -1
- package/dist/comments/viewer.js +13 -1
- package/dist/comments/viewer.js.map +1 -1
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -1
- package/dist/contact/index.d.ts +1 -1
- package/dist/contact/index.d.ts.map +1 -1
- package/dist/contact/index.js +1 -1
- package/dist/contact/index.js.map +1 -1
- package/dist/contact/records.d.ts +8 -2
- package/dist/contact/records.d.ts.map +1 -1
- package/dist/contact/records.js +13 -6
- package/dist/contact/records.js.map +1 -1
- package/dist/env.d.ts +25 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/delivery.d.ts +3 -1
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +6 -1
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +3 -0
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/inbox.d.ts +7 -5
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +15 -32
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +2 -0
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +1 -0
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/mount.js +6 -1
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/profiles.d.ts +95 -0
- package/dist/federation/profiles.d.ts.map +1 -0
- package/dist/federation/profiles.js +171 -0
- package/dist/federation/profiles.js.map +1 -0
- package/dist/federation/quotes.d.ts +2 -0
- package/dist/federation/quotes.d.ts.map +1 -1
- package/dist/federation/quotes.js +4 -0
- package/dist/federation/quotes.js.map +1 -1
- package/dist/federation/relays.d.ts +3 -1
- package/dist/federation/relays.d.ts.map +1 -1
- package/dist/federation/relays.js +6 -1
- package/dist/federation/relays.js.map +1 -1
- package/dist/federation/replies.d.ts +36 -4
- package/dist/federation/replies.d.ts.map +1 -1
- package/dist/federation/replies.js +71 -15
- package/dist/federation/replies.js.map +1 -1
- package/dist/images/icons.d.ts.map +1 -1
- package/dist/images/icons.js +3 -2
- package/dist/images/icons.js.map +1 -1
- package/dist/images/index.d.ts +2 -2
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/markup.d.ts +15 -4
- package/dist/images/markup.d.ts.map +1 -1
- package/dist/images/markup.js +24 -15
- package/dist/images/markup.js.map +1 -1
- package/dist/images/paths.d.ts +11 -0
- package/dist/images/paths.d.ts.map +1 -1
- package/dist/images/paths.js +17 -1
- package/dist/images/paths.js.map +1 -1
- package/dist/images/variants.d.ts +13 -3
- package/dist/images/variants.d.ts.map +1 -1
- package/dist/images/variants.js +13 -11
- package/dist/images/variants.js.map +1 -1
- package/dist/index.d.ts +34 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -18
- package/dist/index.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/optouts.d.ts +6 -0
- package/dist/notifications/optouts.d.ts.map +1 -1
- package/dist/notifications/optouts.js +17 -0
- package/dist/notifications/optouts.js.map +1 -1
- package/dist/notifications/routes.js +1 -1
- package/dist/notifications/routes.js.map +1 -1
- package/dist/privacy/erase.d.ts +45 -0
- package/dist/privacy/erase.d.ts.map +1 -0
- package/dist/privacy/erase.js +76 -0
- package/dist/privacy/erase.js.map +1 -0
- package/dist/privacy/policy.d.ts +32 -0
- package/dist/privacy/policy.d.ts.map +1 -0
- package/dist/privacy/policy.js +37 -0
- package/dist/privacy/policy.js.map +1 -0
- package/dist/privacy/retention.d.ts +79 -0
- package/dist/privacy/retention.d.ts.map +1 -0
- package/dist/privacy/retention.js +133 -0
- package/dist/privacy/retention.js.map +1 -0
- package/dist/web/admin-bar.d.ts +21 -0
- package/dist/web/admin-bar.d.ts.map +1 -0
- package/dist/web/admin-bar.js +145 -0
- package/dist/web/admin-bar.js.map +1 -0
- package/dist/web/assets.d.ts +29 -1
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +48 -3
- package/dist/web/assets.js.map +1 -1
- package/dist/web/compression.d.ts +19 -0
- package/dist/web/compression.d.ts.map +1 -0
- package/dist/web/compression.js +160 -0
- package/dist/web/compression.js.map +1 -0
- package/dist/web/context.d.ts +5 -1
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +5 -2
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +9 -1
- package/dist/web/conversation.d.ts.map +1 -1
- package/dist/web/conversation.js +79 -17
- package/dist/web/conversation.js.map +1 -1
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +1 -0
- package/dist/web/index.js.map +1 -1
- package/dist/web/maintenance.d.ts.map +1 -1
- package/dist/web/maintenance.js +7 -2
- package/dist/web/maintenance.js.map +1 -1
- package/dist/web/render.d.ts +27 -0
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +77 -38
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +67 -28
- package/dist/web/routes.js.map +1 -1
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +9 -2
- package/dist/web/templates.js.map +1 -1
- package/dist/web/well-known.d.ts +21 -0
- package/dist/web/well-known.d.ts.map +1 -0
- package/dist/web/well-known.js +66 -0
- package/dist/web/well-known.js.map +1 -0
- package/dist/webmention/fetch-public.d.ts +34 -0
- package/dist/webmention/fetch-public.d.ts.map +1 -0
- package/dist/webmention/fetch-public.js +101 -0
- package/dist/webmention/fetch-public.js.map +1 -0
- package/dist/webmention/reply-context.d.ts.map +1 -1
- package/dist/webmention/reply-context.js +12 -89
- package/dist/webmention/reply-context.js.map +1 -1
- package/dist/webmention/service.d.ts.map +1 -1
- package/dist/webmention/service.js +5 -1
- package/dist/webmention/service.js.map +1 -1
- package/package.json +1 -1
- package/templates/site/content/_data/site.json +7 -1
- package/templates/site/content/pages/privacy.md +127 -0
- package/themes/default/README.md +165 -22
- package/themes/default/layouts/base.njk +51 -10
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
{% if row.address %}
|
|
61
61
|
· <code title="A salted hash of the address it came from">{{ row.address }}</code>
|
|
62
62
|
{% endif %}
|
|
63
|
+
{% if row.removed %}
|
|
64
|
+
· {{ row.removed }}
|
|
65
|
+
{% endif %}
|
|
63
66
|
</p>
|
|
64
67
|
|
|
65
68
|
<div class="admin-comment-body">{{ row.html | safe }}</div>
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
{% extends "layouts/settings-page.njk" %}
|
|
3
3
|
{% import "components/fields.njk" as field %}
|
|
4
4
|
|
|
5
|
+
{# What a retention field says about the period as it stands: kept forever at
|
|
6
|
+
0, removed after so many days otherwise. Nothing for a value the form is
|
|
7
|
+
about to refuse, which has its own error line. #}
|
|
8
|
+
{% macro retention(days) %}
|
|
9
|
+
{%- if days == '0' -%}
|
|
10
|
+
<strong>Kept forever.</strong>
|
|
11
|
+
{%- elif days | int > 0 -%}
|
|
12
|
+
<strong>Removed after {{ days }} day{% if days != '1' %}s{% endif %}.</strong>
|
|
13
|
+
{%- endif -%}
|
|
14
|
+
{% endmacro %}
|
|
15
|
+
|
|
5
16
|
{% block settingsFields %}
|
|
6
17
|
<h2>Comments</h2>
|
|
7
18
|
|
|
@@ -41,6 +52,48 @@
|
|
|
41
52
|
{% endset %}
|
|
42
53
|
{{ field.checkbox('settings-webmentions-receive', fields.webmentionsReceive,
|
|
43
54
|
'Accept webmentions sent here', checked=form.webmentionsReceive, hint=receiveHint) }}
|
|
55
|
+
|
|
56
|
+
<h2>Keeping personal data</h2>
|
|
57
|
+
|
|
58
|
+
<p class="admin-hint">
|
|
59
|
+
How long the site keeps what commenters and people writing through the
|
|
60
|
+
contact form hand it, in days from when it arrived; <code>0</code> keeps
|
|
61
|
+
it forever. A site that has never set these keeps everything, so upgrading
|
|
62
|
+
removes nothing. The recommended periods are 180 days for emails, 30 for
|
|
63
|
+
address hashes and 365 for contact messages, which is what a new site
|
|
64
|
+
starts with. A sweep removes whatever has outlived its period every few
|
|
65
|
+
hours. Tools › Personal data erases one person's data on request.
|
|
66
|
+
</p>
|
|
67
|
+
|
|
68
|
+
{% set emailHint %}
|
|
69
|
+
{{ retention(form.commentEmailRetentionDays) }}
|
|
70
|
+
Past this a comment loses its author's email. The comment, its place in
|
|
71
|
+
the thread and its moderation status stay; the author is no longer told
|
|
72
|
+
about replies, and their next comment waits for a moderator. Recommended:
|
|
73
|
+
<code>180</code>.
|
|
74
|
+
{% endset %}
|
|
75
|
+
{{ field.text('settings-comment-email-retention', fields.commentEmailRetentionDays,
|
|
76
|
+
'Keep commenter emails for', form.commentEmailRetentionDays, type='number', min='0',
|
|
77
|
+
step='1', error=problems.commentEmailRetentionDays, hint=emailHint) }}
|
|
78
|
+
|
|
79
|
+
{% set hashHint %}
|
|
80
|
+
{{ retention(form.addressHashRetentionDays) }}
|
|
81
|
+
The salted hash of the address a comment, webmention or contact message
|
|
82
|
+
came from, which shows a moderator that two came from one place.
|
|
83
|
+
Recommended: <code>30</code>.
|
|
84
|
+
{% endset %}
|
|
85
|
+
{{ field.text('settings-address-hash-retention', fields.addressHashRetentionDays,
|
|
86
|
+
'Keep address hashes for', form.addressHashRetentionDays, type='number', min='0',
|
|
87
|
+
step='1', error=problems.addressHashRetentionDays, hint=hashHint) }}
|
|
88
|
+
|
|
89
|
+
{% set contactHint %}
|
|
90
|
+
{{ retention(form.contactMessageRetentionDays) }}
|
|
91
|
+
Past this a contact message is deleted from the Messages screen and from
|
|
92
|
+
<code>data/contact/</code>. Recommended: <code>365</code>.
|
|
93
|
+
{% endset %}
|
|
94
|
+
{{ field.text('settings-contact-message-retention', fields.contactMessageRetentionDays,
|
|
95
|
+
'Keep contact messages for', form.contactMessageRetentionDays, type='number', min='0',
|
|
96
|
+
step='1', error=problems.contactMessageRetentionDays, hint=contactHint) }}
|
|
44
97
|
{% endblock %}
|
|
45
98
|
|
|
46
99
|
{% block settingsPanels %}
|
|
@@ -39,6 +39,26 @@
|
|
|
39
39
|
{% endset %}
|
|
40
40
|
{{ field.text('settings-contact-email', fields.contactEmail, 'Contact address',
|
|
41
41
|
form.contactEmail, error=problems.contactEmail, hint=contactHint, inputmode='email') }}
|
|
42
|
+
|
|
43
|
+
<h2>Security contact</h2>
|
|
44
|
+
|
|
45
|
+
{% set securityContactsHint %}
|
|
46
|
+
Where somebody who finds a vulnerability in this site should report it, one per line:
|
|
47
|
+
an email address, an <code>https://</code> URL or a <code>tel:</code> number. They are
|
|
48
|
+
published at <a href="/.well-known/security.txt"><code>/.well-known/security.txt</code></a>,
|
|
49
|
+
which is not served at all while this is empty.
|
|
50
|
+
{% endset %}
|
|
51
|
+
{{ field.textarea('settings-security-contacts', fields.securityContacts, 'Contacts',
|
|
52
|
+
form.securityContacts, error=problems.securityContacts, hint=securityContactsHint,
|
|
53
|
+
rows='2', spellcheck='false') }}
|
|
54
|
+
|
|
55
|
+
{{ field.text('settings-security-policy', fields.securityPolicy, 'Disclosure policy',
|
|
56
|
+
form.securityPolicy, error=problems.securityPolicy, inputmode='url',
|
|
57
|
+
hint='Optional. An https:// URL for the page that says how reports are handled.') }}
|
|
58
|
+
|
|
59
|
+
{{ field.text('settings-security-languages', fields.securityLanguages, 'Preferred languages',
|
|
60
|
+
form.securityLanguages, error=problems.securityLanguages,
|
|
61
|
+
hint='Optional. The languages a report may be written in, such as en, fr.') }}
|
|
42
62
|
{% endblock %}
|
|
43
63
|
|
|
44
64
|
{% block settingsPanels %}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{# /admin/tools/personal-data: erasing one person's data when they ask
|
|
2
|
+
(TASK-135). Looking is a step of its own because erasing cannot be undone. #}
|
|
3
|
+
{% extends "layouts/shell.njk" %}
|
|
4
|
+
{% import "components/fields.njk" as field %}
|
|
5
|
+
|
|
6
|
+
{% block title %}{{ heading }}{% endblock %}
|
|
7
|
+
|
|
8
|
+
{% block content %}
|
|
9
|
+
<h1>{{ heading }}</h1>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
When somebody asks for what this site holds about them to be erased, type
|
|
13
|
+
the email address they commented or wrote in under. Their comments stay in
|
|
14
|
+
their threads, with their words and their moderation status, signed
|
|
15
|
+
<strong>{{ erasedName }}</strong> and with their email, website and address
|
|
16
|
+
hash removed. Their contact messages are deleted, and the address comes off
|
|
17
|
+
the list of people who asked not to be emailed about replies.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
{% if found %}
|
|
21
|
+
<form class="admin-settings" method="post" action="{{ actionUrl }}">
|
|
22
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
23
|
+
<input type="hidden" name="{{ fields.email }}" value="{{ email }}" />
|
|
24
|
+
<input type="hidden" name="{{ fields.confirm }}" value="1" />
|
|
25
|
+
|
|
26
|
+
<h2>What this site holds for {{ email }}</h2>
|
|
27
|
+
|
|
28
|
+
<ul>
|
|
29
|
+
<li>{{ found.comments }}</li>
|
|
30
|
+
<li>{{ found.messages }}</li>
|
|
31
|
+
<li>
|
|
32
|
+
{% if found.optedOut %}On{% else %}Not on{% endif %} the list of addresses not
|
|
33
|
+
to email about replies
|
|
34
|
+
</li>
|
|
35
|
+
</ul>
|
|
36
|
+
|
|
37
|
+
{% if found.anything %}
|
|
38
|
+
<p>
|
|
39
|
+
Erasing cannot be undone. A copy of a comment file in git history or in a
|
|
40
|
+
backup keeps what it held; this changes the site as it is now.
|
|
41
|
+
</p>
|
|
42
|
+
<p class="admin-settings-buttons">
|
|
43
|
+
<button type="submit">Erase it</button>
|
|
44
|
+
<a href="{{ actionUrl }}">Cancel</a>
|
|
45
|
+
</p>
|
|
46
|
+
{% else %}
|
|
47
|
+
<p>There is nothing to erase for that address.</p>
|
|
48
|
+
<p class="admin-settings-buttons"><a href="{{ actionUrl }}">Look for another</a></p>
|
|
49
|
+
{% endif %}
|
|
50
|
+
</form>
|
|
51
|
+
{% else %}
|
|
52
|
+
<form class="admin-settings" method="post" action="{{ actionUrl }}">
|
|
53
|
+
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
54
|
+
{{ field.text('personal-data-email', fields.email, 'Email address', email,
|
|
55
|
+
type='email', error=problem) }}
|
|
56
|
+
<p class="admin-settings-buttons">
|
|
57
|
+
<button type="submit">Look for it</button>
|
|
58
|
+
</p>
|
|
59
|
+
</form>
|
|
60
|
+
{% endif %}
|
|
61
|
+
|
|
62
|
+
<p class="admin-hint">
|
|
63
|
+
Comments are found by the email they carry, so a comment whose email the
|
|
64
|
+
retention sweep has already removed, a webmention and a fediverse reply are
|
|
65
|
+
not found here. Delete those one by one from the Comments screen.
|
|
66
|
+
</p>
|
|
67
|
+
{% endblock %}
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
Resetting a colleague's password from under them is deliberately not
|
|
214
214
|
offered — a fresh account is what that is for. #}
|
|
215
215
|
{% if account.you %}
|
|
216
|
-
<form class="admin-settings" method="post" action="{{ changePasswordUrl }}">
|
|
216
|
+
<form class="admin-settings" id="change-password" method="post" action="{{ changePasswordUrl }}">
|
|
217
217
|
<input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
|
|
218
218
|
|
|
219
219
|
<h2>Change your password</h2>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The admin bar: the dark strip across the top of every admin screen, and of
|
|
3
|
+
* every public page a signed-in user reads (TASK-183).
|
|
4
|
+
*
|
|
5
|
+
* Self-contained, because on the public site it is inlined into the bar's
|
|
6
|
+
* shadow root, under a host reset to `all: initial`: nothing here may lean on
|
|
7
|
+
* admin.css or on whatever theme the site wears. Sizes are in pixels for the
|
|
8
|
+
* same reason, since a `rem` is the theme's root font size. The colours are
|
|
9
|
+
* declared on `:host` there and on `:root` in the admin, where admin.css
|
|
10
|
+
* reads them too.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
:root,
|
|
14
|
+
:host {
|
|
15
|
+
--admin-bar: #1d2327;
|
|
16
|
+
--admin-nav: #2c3338;
|
|
17
|
+
--admin-nav-text: #f0f0f1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.admin-bar,
|
|
21
|
+
.admin-bar * {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Site name on the left, the shortcuts beside it, who you are on the right. */
|
|
26
|
+
|
|
27
|
+
.admin-bar {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0 16px;
|
|
32
|
+
padding: 0 16px;
|
|
33
|
+
min-height: 40px;
|
|
34
|
+
background: var(--admin-bar);
|
|
35
|
+
color: var(--admin-nav-text);
|
|
36
|
+
font:
|
|
37
|
+
14px/40px -apple-system,
|
|
38
|
+
BlinkMacSystemFont,
|
|
39
|
+
'Segoe UI',
|
|
40
|
+
Roboto,
|
|
41
|
+
sans-serif;
|
|
42
|
+
anchor-name: --admin-bar;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.admin-bar a {
|
|
46
|
+
color: var(--admin-nav-text);
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.admin-bar a:hover,
|
|
52
|
+
.admin-bar a:focus {
|
|
53
|
+
color: #72aee6;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.admin-bar-site {
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.admin-bar-spacer {
|
|
61
|
+
flex: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.admin-bar-account {
|
|
65
|
+
padding: 0;
|
|
66
|
+
border: 0;
|
|
67
|
+
background: none;
|
|
68
|
+
color: var(--admin-nav-text);
|
|
69
|
+
font: inherit;
|
|
70
|
+
text-align: right;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
anchor-name: --admin-account;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* On a phone the bar wraps, and the greeting keeps to the right of its line
|
|
76
|
+
so the menu under it opens inside the screen. */
|
|
77
|
+
|
|
78
|
+
.admin-bar-spacer + .admin-bar-account {
|
|
79
|
+
margin-left: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.admin-bar-account:hover,
|
|
83
|
+
.admin-bar-account:focus-visible,
|
|
84
|
+
.admin-bar-account:popover-open {
|
|
85
|
+
color: #72aee6;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.admin-bar-account::after {
|
|
89
|
+
content: ' \25BE' / '';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* The menu is in the top layer, so it is placed rather than laid out: under
|
|
93
|
+
the greeting where anchor positioning exists, at the bar's right edge
|
|
94
|
+
where it does not. */
|
|
95
|
+
|
|
96
|
+
.admin-account-menu {
|
|
97
|
+
inset: 40px 0 auto auto;
|
|
98
|
+
margin: 0;
|
|
99
|
+
min-width: 160px;
|
|
100
|
+
padding: 4px 0;
|
|
101
|
+
border: 0;
|
|
102
|
+
background: var(--admin-nav);
|
|
103
|
+
color: var(--admin-nav-text);
|
|
104
|
+
line-height: 1.6;
|
|
105
|
+
box-shadow: 0 3px 5px rgb(0 0 0 / 20%);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@supports (top: anchor(--admin-bar bottom)) {
|
|
109
|
+
.admin-account-menu {
|
|
110
|
+
inset: anchor(--admin-bar bottom) anchor(--admin-account right) auto auto;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.admin-account-menu a,
|
|
115
|
+
.admin-account-menu button[type='submit'] {
|
|
116
|
+
display: block;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
width: 100%;
|
|
119
|
+
margin: 0;
|
|
120
|
+
padding: 8px 16px;
|
|
121
|
+
border: 0;
|
|
122
|
+
border-radius: 0;
|
|
123
|
+
background: none;
|
|
124
|
+
color: var(--admin-nav-text);
|
|
125
|
+
font: inherit;
|
|
126
|
+
text-align: left;
|
|
127
|
+
text-decoration: none;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.admin-account-menu a:hover,
|
|
132
|
+
.admin-account-menu a:focus-visible,
|
|
133
|
+
.admin-account-menu button[type='submit']:hover,
|
|
134
|
+
.admin-account-menu button[type='submit']:focus-visible {
|
|
135
|
+
background: var(--admin-bar);
|
|
136
|
+
color: #72aee6;
|
|
137
|
+
}
|
package/admin/static/admin.css
CHANGED
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
:root {
|
|
11
|
-
--admin-bar
|
|
12
|
-
--admin-nav: #2c3338;
|
|
13
|
-
--admin-nav-text: #f0f0f1;
|
|
11
|
+
/* --admin-bar, --admin-nav and --admin-nav-text are in admin-bar.css. */
|
|
14
12
|
--admin-nav-current: #2271b1;
|
|
15
13
|
--admin-field: #f0f0f1;
|
|
16
14
|
--admin-surface: #fff;
|
|
@@ -44,105 +42,6 @@ a {
|
|
|
44
42
|
color: var(--admin-link);
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
/* The top bar: site name on the left, who you are on the right. */
|
|
48
|
-
|
|
49
|
-
.admin-bar {
|
|
50
|
-
display: flex;
|
|
51
|
-
align-items: center;
|
|
52
|
-
gap: 1rem;
|
|
53
|
-
padding: 0 1rem;
|
|
54
|
-
min-height: 2.5rem;
|
|
55
|
-
background: var(--admin-bar);
|
|
56
|
-
color: var(--admin-nav-text);
|
|
57
|
-
anchor-name: --admin-bar;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.admin-bar a {
|
|
61
|
-
color: var(--admin-nav-text);
|
|
62
|
-
text-decoration: none;
|
|
63
|
-
white-space: nowrap;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.admin-bar a:hover,
|
|
67
|
-
.admin-bar a:focus {
|
|
68
|
-
color: #72aee6;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.admin-bar-site {
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.admin-bar-spacer {
|
|
76
|
-
flex: 1;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.admin-bar-account {
|
|
80
|
-
padding: 0;
|
|
81
|
-
border: 0;
|
|
82
|
-
background: none;
|
|
83
|
-
color: var(--admin-nav-text);
|
|
84
|
-
font: inherit;
|
|
85
|
-
text-align: right;
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
anchor-name: --admin-account;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.admin-bar-account:hover,
|
|
91
|
-
.admin-bar-account:focus-visible,
|
|
92
|
-
.admin-bar-account:popover-open {
|
|
93
|
-
color: #72aee6;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.admin-bar-account::after {
|
|
97
|
-
content: ' \25BE' / '';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* The menu is in the top layer, so it is placed rather than laid out: under
|
|
101
|
-
the greeting where anchor positioning exists, at the bar's right edge
|
|
102
|
-
where it does not. */
|
|
103
|
-
|
|
104
|
-
.admin-account-menu {
|
|
105
|
-
inset: 2.5rem 0 auto auto;
|
|
106
|
-
margin: 0;
|
|
107
|
-
min-width: 10rem;
|
|
108
|
-
padding: 0.25rem 0;
|
|
109
|
-
border: 0;
|
|
110
|
-
background: var(--admin-nav);
|
|
111
|
-
color: var(--admin-nav-text);
|
|
112
|
-
box-shadow: 0 3px 5px rgb(0 0 0 / 20%);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@supports (top: anchor(--admin-bar bottom)) {
|
|
116
|
-
.admin-account-menu {
|
|
117
|
-
inset: anchor(--admin-bar bottom) anchor(--admin-account right) auto auto;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.admin-account-menu a,
|
|
122
|
-
.admin-account-menu button[type='submit'] {
|
|
123
|
-
display: block;
|
|
124
|
-
box-sizing: border-box;
|
|
125
|
-
width: 100%;
|
|
126
|
-
margin: 0;
|
|
127
|
-
padding: 0.5rem 1rem;
|
|
128
|
-
border: 0;
|
|
129
|
-
border-radius: 0;
|
|
130
|
-
background: none;
|
|
131
|
-
color: var(--admin-nav-text);
|
|
132
|
-
font: inherit;
|
|
133
|
-
text-align: left;
|
|
134
|
-
text-decoration: none;
|
|
135
|
-
cursor: pointer;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.admin-account-menu a:hover,
|
|
139
|
-
.admin-account-menu a:focus-visible,
|
|
140
|
-
.admin-account-menu button[type='submit']:hover,
|
|
141
|
-
.admin-account-menu button[type='submit']:focus-visible {
|
|
142
|
-
background: var(--admin-bar);
|
|
143
|
-
color: #72aee6;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
45
|
/* The shell: navigation column beside the screen itself. */
|
|
147
46
|
|
|
148
47
|
.admin-shell {
|
package/dist/admin/comments.d.ts
CHANGED
|
@@ -67,6 +67,11 @@ export interface CommentRow {
|
|
|
67
67
|
submitted: string;
|
|
68
68
|
/** A short form of the address hash, for spotting one machine's run of them. */
|
|
69
69
|
address: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* What privacy took off it, in a few words, or `null` when nothing was
|
|
72
|
+
* (TASK-135): so a moderator can tell an email removed from one never given.
|
|
73
|
+
*/
|
|
74
|
+
removed: string | null;
|
|
70
75
|
/** The post's title, or its slug when the post is not in the index. */
|
|
71
76
|
post: string;
|
|
72
77
|
/** Where the post can be read, or `null` when it is not published. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/admin/comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAC;AAO1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,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AAC;IACvB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,uEAAuE;AACvE,MAAM,WAAW,0BAA0B;IACzC,oFAAoF;IACpF,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EACrB,OAAO,EAAE,0BAA0B,GAClC,IAAI,CA+IN;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEzD;AAED,yCAAyC;AACzC,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,SAAI,GAAG,MAAM,CAG/D"}
|
package/dist/admin/comments.js
CHANGED
|
@@ -194,9 +194,22 @@ export function listUrl(status, page = 1) {
|
|
|
194
194
|
function statusOf(value) {
|
|
195
195
|
return COMMENT_STATUSES.includes(value) ? value : 'pending';
|
|
196
196
|
}
|
|
197
|
+
/** What a moderator is told was removed from a comment for privacy. */
|
|
198
|
+
function removedNote(redacted) {
|
|
199
|
+
if (redacted === undefined)
|
|
200
|
+
return null;
|
|
201
|
+
if (redacted.includes('author'))
|
|
202
|
+
return 'author erased on request';
|
|
203
|
+
if (redacted.includes('email'))
|
|
204
|
+
return 'email removed after the retention period';
|
|
205
|
+
if (redacted.includes('addressHash'))
|
|
206
|
+
return 'address hash removed after the retention period';
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
197
209
|
/** The files and the index this request writes through. */
|
|
198
210
|
function recordsOf(c) {
|
|
199
|
-
|
|
211
|
+
const { contentDir, dataDir } = c.var.config;
|
|
212
|
+
return { admin: c.var.admin, contentDir, dataDir };
|
|
200
213
|
}
|
|
201
214
|
/** One stored comment as the screen shows it. */
|
|
202
215
|
function commentRow(c, comment) {
|
|
@@ -214,6 +227,7 @@ function commentRow(c, comment) {
|
|
|
214
227
|
// The first eight characters are enough to see that two comments came from
|
|
215
228
|
// one place, which is the only question the hash is there to answer.
|
|
216
229
|
address: comment.addressHash === null ? null : comment.addressHash.slice(0, 8),
|
|
230
|
+
removed: removedNote(comment.redacted),
|
|
217
231
|
post: document === undefined ? comment.slug : postLabel(document),
|
|
218
232
|
postUrl: comment.permalink === '' ? null : comment.permalink,
|
|
219
233
|
editUrl: document === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/admin/comments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,YAAY,WAAW,CAAC;AAExD,kDAAkD;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE3C,kCAAkC;AAClC,MAAM,CAAC,MAAM,sBAAsB,GAAG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AAC,SAAS;KAC7B,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,CAAsB;IAC3C,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvE,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC;IAEjC,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrF,OAAO,IAAI,EAAE,QAAQ,IAAI,YAAY,CAAC;AACxC,CAAC;AAED,qFAAqF;AACrF,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC"}
|
package/dist/admin/headers.d.ts
CHANGED
|
@@ -12,13 +12,22 @@ export declare const NONCE_BYTES = 16;
|
|
|
12
12
|
/**
|
|
13
13
|
* The headers every response gets, admin or not.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* the one to believe, which constrains nothing a theme might want to do, and
|
|
15
|
+
* `nosniff` says the `Content-Type` the CMS sends is the one to believe, and
|
|
17
16
|
* HSTS is about the host rather than the page — the admin and the public site
|
|
18
17
|
* are the same origin, so sending it on one and not the other would be a
|
|
19
|
-
* distinction the browser does not make.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* distinction the browser does not make. Neither can be configured away.
|
|
19
|
+
*
|
|
20
|
+
* Then the site's `securityHeaders`, which default to
|
|
21
|
+
* `DEFAULT_SECURITY_HEADERS` in config.ts: a referrer policy, framing by the site
|
|
22
|
+
* itself only, powerful browser features off, and a browsing context of its
|
|
23
|
+
* own. None of them restricts what a page may load. That is the line
|
|
24
|
+
* the public site does not cross: there is no content policy, no `script-src`
|
|
25
|
+
* or `img-src`, because a theme is somebody else's HTML and the CMS has no
|
|
26
|
+
* business deciding what it may reference. The one CSP directive sent,
|
|
27
|
+
* `frame-ancestors`, is about who may frame the page, not what is in it.
|
|
28
|
+
*
|
|
29
|
+
* A configured header goes on only when the response has none by that name,
|
|
30
|
+
* so the admin's stricter values, set further in, are never replaced.
|
|
22
31
|
*/
|
|
23
32
|
export declare const baselineSecurityHeaders: MiddlewareHandler<GeekityEnv>;
|
|
24
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/admin/headers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAa,CAAC;AAEvC,mFAAmF;AACnF,eAAO,MAAM,UAAU,wCAA+C,CAAC;AAEvE,kFAAkF;AAClF,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/admin/headers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAa,CAAC;AAEvC,mFAAmF;AACnF,eAAO,MAAM,UAAU,wCAA+C,CAAC;AAEvE,kFAAkF;AAClF,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,UAAU,CAGjE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,UAAU,CAa9D,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAehE"}
|
package/dist/admin/headers.js
CHANGED
|
@@ -12,13 +12,22 @@ export const NONCE_BYTES = 16;
|
|
|
12
12
|
/**
|
|
13
13
|
* The headers every response gets, admin or not.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* the one to believe, which constrains nothing a theme might want to do, and
|
|
15
|
+
* `nosniff` says the `Content-Type` the CMS sends is the one to believe, and
|
|
17
16
|
* HSTS is about the host rather than the page — the admin and the public site
|
|
18
17
|
* are the same origin, so sending it on one and not the other would be a
|
|
19
|
-
* distinction the browser does not make.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* distinction the browser does not make. Neither can be configured away.
|
|
19
|
+
*
|
|
20
|
+
* Then the site's `securityHeaders`, which default to
|
|
21
|
+
* `DEFAULT_SECURITY_HEADERS` in config.ts: a referrer policy, framing by the site
|
|
22
|
+
* itself only, powerful browser features off, and a browsing context of its
|
|
23
|
+
* own. None of them restricts what a page may load. That is the line
|
|
24
|
+
* the public site does not cross: there is no content policy, no `script-src`
|
|
25
|
+
* or `img-src`, because a theme is somebody else's HTML and the CMS has no
|
|
26
|
+
* business deciding what it may reference. The one CSP directive sent,
|
|
27
|
+
* `frame-ancestors`, is about who may frame the page, not what is in it.
|
|
28
|
+
*
|
|
29
|
+
* A configured header goes on only when the response has none by that name,
|
|
30
|
+
* so the admin's stricter values, set further in, are never replaced.
|
|
22
31
|
*/
|
|
23
32
|
export const baselineSecurityHeaders = async (c, next) => {
|
|
24
33
|
await next();
|
|
@@ -93,12 +102,15 @@ export function adminContentSecurityPolicy(nonce) {
|
|
|
93
102
|
"frame-src 'self'",
|
|
94
103
|
].join('; ');
|
|
95
104
|
}
|
|
96
|
-
/** The two headers every response carries. */
|
|
97
105
|
function applyBaseline(headers, config) {
|
|
98
106
|
headers.set('X-Content-Type-Options', 'nosniff');
|
|
99
107
|
// The same test the session cookie's `Secure` uses, so the two can never
|
|
100
108
|
// disagree about whether the site is served over https.
|
|
101
109
|
if (usesSecureCookies(config))
|
|
102
110
|
headers.set('Strict-Transport-Security', HSTS_VALUE);
|
|
111
|
+
for (const [name, value] of Object.entries(config.securityHeaders)) {
|
|
112
|
+
if (!headers.has(name))
|
|
113
|
+
headers.set(name, value);
|
|
114
|
+
}
|
|
103
115
|
}
|
|
104
116
|
//# sourceMappingURL=headers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../src/admin/headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,mFAAmF;AACnF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,YAAY,qBAAqB,CAAC;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../src/admin/headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,mFAAmF;AACnF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,YAAY,qBAAqB,CAAC;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,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sB;QACtB,uBAAuB;QACvB,kBAAkB;QAClB,oBAAoB;QACpB,kBAAkB;KACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAC,OAAgB,EAAE,MAAsB;IAC7D,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;IACjD,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,iBAAiB,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;IACpF,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;QACnE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -39,9 +39,9 @@ export { addUserProblems, changePasswordProblems, CHANGE_PASSWORD_PATH, deleteUs
|
|
|
39
39
|
export type { AddUserProblems, ChangePasswordProblems, MountUsersOptions } from './users.ts';
|
|
40
40
|
export { FORGOT_PATH, mountRecovery, newPasswordProblem, PASSWORD_CHANGED_TEMPLATE, RECOVERY_ANSWER, RECOVERY_FIELDS, RESET_PATH, RESET_TEMPLATE, RESET_TOKEN_LIFETIME_SECONDS, resetLink, } from './recovery.ts';
|
|
41
41
|
export type { MountRecoveryOptions } from './recovery.ts';
|
|
42
|
-
export { ADMIN_PREFIX, clearSessionCookie, CSRF_FIELD, csrfTokenMatches, SESSION_COOKIE, sessionIdFrom, setSessionCookie, usesSecureCookies, } from './session.ts';
|
|
42
|
+
export { ADMIN_PREFIX, clearSessionCookie, CSRF_FIELD, csrfTokenMatches, SECURE_SESSION_COOKIE, SESSION_COOKIE, sessionCookieName, sessionIdFrom, setSessionCookie, usesSecureCookies, } from './session.ts';
|
|
43
43
|
export { COMMENT_KINDS, COMMENT_SOURCES, COMMENT_STATUSES, DELIVERY_STATUSES, openAdminStore, RELAY_STATES, SESSION_ID_BYTES, } from './store.ts';
|
|
44
|
-
export type { AdminStore, CommentAuthor, CommentContent, CommentKind, CommentRecord, CommentSource, CommentStatus, ListCommentsOptions, PostComment, CreatePasswordResetInput, CreateSessionInput, Delivery, DeliveryStatus, FlashKind, FlashMessage, Follower, InboxActivity, LegacyActorKey, LegacySetting, LegacyUser, ListPageOptions, NewDelivery, NewFollower, NewInboxActivity, NewRelay, IssuedPasswordReset, OpenAdminStoreOptions, PasswordReset, Relay, RelayState, Session, } from './store.ts';
|
|
44
|
+
export type { AdminStore, CommentAuthor, CommentContent, CommentKind, CommentRecord, CommentSource, CommentStatus, ListCommentsOptions, PostComment, CreatePasswordResetInput, CreateSessionInput, Delivery, DeliveryStatus, FlashKind, FlashMessage, ActorProfile, StoredActorProfile, Follower, InboxActivity, LegacyActorKey, LegacySetting, LegacyUser, ListPageOptions, NewDelivery, NewFollower, NewInboxActivity, NewRelay, IssuedPasswordReset, OpenAdminStoreOptions, PasswordReset, Relay, RelayState, Session, } from './store.ts';
|
|
45
45
|
export { ADMIN_TEMPLATES, createAdminTemplateEnvironment, PACKAGED_ADMIN_DIR, } from './templates.ts';
|
|
46
46
|
export type { CreateAdminTemplateEnvironmentOptions } from './templates.ts';
|
|
47
47
|
export { mountUploads, refuseOversizedUpload, refusedUpload, storeUpload, tooLargeMessage, uploadMarkdown, UPLOAD_ENVELOPE_BYTES, UPLOAD_FIELD, UPLOADS_PATH, } from './uploads.ts';
|