Files
wekan/client/components/settings/emailToCardSettings.jade
T
Lauri Ojansivu e413cd4720 The Sandstorm .spk leaves out every login method but Sandstorm's, and FerretDB's other database handlers.
A grain has one login (Sandstorm's), one database (FerretDB on SQLite) and one
mailbox (the grain's own address), but the .spk carried every login package
WeKan has and a FerretDB with the PostgreSQL, MySQL and SAP HANA handlers.

releases/sandstorm-slim-spk.sh, used by sandstorm.yml, release-all.yml's
build-sandstorm job and build.sh's "Make the .spk package", builds with the
package profile of releases/sandstorm-slim.mjs - accounts-password, 2FA,
passwordless, lockout, OAuth2/OIDC, CAS, LDAP, SAML and the seven social
logins removed from a copy of .meteor/packages for that one build, then
restored - trims the bundle for a linux/x64 grain, verifies none of those
packages got in and packs with spk pack (meteor-spk pack rebuilds and would
undo the trim). sandstorm-src/build-deps.sh builds FerretDB from source with
ferretdb_no_postgresql,ferretdb_no_mysql.

Under Sandstorm the Admin Panel hides the E-mail, Login, Locked users, SAML,
LDAP, OAuth2, CAS, Header login, OAuth providers and Passwordless panes,
Attachments / Database migration, the Email-to-card IMAP and webhook settings,
the New user button and the password fields; a hidden pane opened by URL lands
on the first visible one. POST /users/login and /users/register answer 404
sandstorm-sso-only, database migration is refused and the IMAP/webhook
settings are not stored. Without accounts-password the server creates
Accounts.emailTemplates with the package's defaults and marks useraccounts
initialised, which otherwise stopped the first grain.

Against wekan-12.63-sandstorm.spk, built from the same source: 181,307,364
instead of 185,271,476 bytes (-3.8 MiB, -2.1 %), unpacked 26.7 MiB smaller.
Docker, Snap and the bundles build from the full package list, and a test fails
if that list is slimmed. Tested on a local Sandstorm 0.308: a grain starts, a
board, a list and a card are created, and the removed options are not shown.
tests/sandstormSlim.test.cjs and tests/playwright/specs/sandstorm-slim.e2e.js
pin it. Design: docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md.

Thanks to xet7 !
2026-10-23 19:34:34 +03:00

154 lines
8.7 KiB
Plaintext

//- Email to card (#794) in Notification Settings, at all three levels
//- (models/lib/emailToCard.js, server/emailToCard.js):
//- scope 'admin' Admin Panel - on/off, the address domain, the provider
//- webhook and its secret, the IMAP mailboxes and their
//- passwords. The only place servers and passwords are set;
//- a secret is never shown back, only whether one is saved.
//- scope 'board' Board Settings - on/off, the list and swimlane cards go
//- to, which parts of an email are used (board admins), and
//- the member's own address for this board.
//- scope 'member' Member Settings - the member's own on/off and parts.
template(name="emailToCardSettings")
details.notification-delivery-settings.email-to-card-settings(data-scope="{{scope}}")
summary.title
i.fa.fa-inbox
| {{_ 'email-to-card'}}
p.quiet {{_ 'email-to-card-description'}}
if isAdminScope
if admin
with admin
a.flex.js-etc-admin-enabled(role="checkbox" aria-checked="{{#if enabled}}true{{else}}false{{/if}}")
.materialCheckBox(class="{{#if enabled}}is-checked{{/if}}")
span {{_ 'email-to-card-admin-enabled'}}
//- On Sandstorm mail reaches a grain only through the grain's own
//- address, never IMAP or a provider webhook, so those settings are
//- not drawn there - not even before the address is known
//- (docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md).
if isSandstorm
if sandstormAddress
p.notification-delivery-label {{_ 'email-to-card-sandstorm-address'}}
p
code.js-etc-copy {{sandstormAddress}}
else
p.quiet {{_ 'email-to-card-off-sandstorm-no-session'}}
else
label.notification-delivery-label
| {{_ 'email-to-card-domain'}}
input.js-etc-domain(type="text" value="{{domain}}" placeholder="boards.example.com" autocomplete="off")
p.notification-delivery-label {{_ 'email-to-card-webhook'}}
p
code {{webhookUrl}}
label.notification-delivery-label
| {{_ 'email-to-card-webhook-secret'}}
input.js-etc-webhook-secret(type="password" autocomplete="new-password" placeholder="{{#if webhookSecretSet}}{{_ 'email-to-card-secret-saved'}}{{/if}}")
if webhookSecretSet
a.flex.js-etc-clear-secret(role="checkbox" aria-checked="{{#if clearSecret}}true{{else}}false{{/if}}")
.materialCheckBox(class="{{#if clearSecret}}is-checked{{/if}}")
span {{_ 'email-to-card-clear-secret'}}
p.notification-delivery-label {{_ 'email-to-card-imap-accounts'}}
each accounts
fieldset.email-to-card-account(data-id="{{id}}")
label.notification-delivery-label
| {{_ 'email-to-card-account-label'}}
input.js-etc-account(data-key="label" type="text" value="{{label}}")
label.notification-delivery-label
| {{_ 'email-to-card-imap-host'}}
input.js-etc-account(data-key="host" type="text" value="{{host}}" placeholder="imap.example.com" autocomplete="off")
label.notification-delivery-label
| {{_ 'email-to-card-imap-port'}}
input.js-etc-account(data-key="port" type="number" min="1" max="65535" value="{{port}}")
label.notification-delivery-label
| {{_ 'email-to-card-imap-security'}}
select.js-etc-account(data-key="secure")
option(value="true" selected="{{#if secure}}selected{{/if}}") TLS
option(value="false" selected="{{#unless secure}}selected{{/unless}}") STARTTLS
label.notification-delivery-label
| {{_ 'username'}}
input.js-etc-account(data-key="username" type="text" value="{{username}}" autocomplete="off")
label.notification-delivery-label
| {{_ 'password'}}
input.js-etc-account-password(type="password" autocomplete="new-password" placeholder="{{#if passwordSet}}{{_ 'email-to-card-secret-saved'}}{{/if}}")
label.notification-delivery-label
| {{_ 'email-to-card-imap-mailbox'}}
input.js-etc-account(data-key="mailbox" type="text" value="{{mailbox}}")
label.notification-delivery-label
| {{_ 'email-to-card-imap-after'}}
select.js-etc-account(data-key="after")
option(value="seen" selected="{{#if $eq after 'seen'}}selected{{/if}}") {{_ 'email-to-card-imap-after-seen'}}
option(value="delete" selected="{{#if $eq after 'delete'}}selected{{/if}}") {{_ 'email-to-card-imap-after-delete'}}
label.notification-delivery-label
| {{_ 'email-to-card-imap-enabled'}}
select.js-etc-account(data-key="enabled")
option(value="true" selected="{{#if enabled}}selected{{/if}}") {{_ 'yes'}}
option(value="false" selected="{{#unless enabled}}selected{{/unless}}") {{_ 'no'}}
if lastError
p.warning {{lastError}}
else if lastPollAt
p.quiet {{_ 'email-to-card-imap-last-poll'}} {{lastPollAt}}
button.js-etc-remove-account(type="button") {{_ 'delete'}}
button.js-etc-add-account(type="button") {{_ 'email-to-card-add-imap'}}
button.primary.js-etc-admin-save(type="button") {{_ 'save'}}
//- The limits, each an environment variable this overrides
//- (models/lib/authConfigCatalog.js, section inboundEmail).
+authProviderSettings(inboundLimitsData)
if isSandstorm
label.notification-delivery-label
| {{_ 'email-to-card-sandstorm-board'}}
select.js-etc-sandstorm-board
option(value="") {{_ 'email-to-card-sandstorm-board-none'}}
each sandstormBoards
option(value="{{_id}}" selected="{{#if selected}}selected{{/if}}") {{title}}
else
p.quiet {{_ 'loading'}}
if isBoardScope
if canEditBoard
a.flex.js-etc-board-enabled(role="checkbox" aria-checked="{{#if boardEnabled}}true{{else}}false{{/if}}")
.materialCheckBox(class="{{#if boardEnabled}}is-checked{{/if}}")
span {{_ 'email-to-card-board-enabled'}}
label.notification-delivery-label
| {{_ 'email-to-card-list'}}
select.js-etc-board-place(data-key="listId")
option(value="") {{_ 'email-to-card-first-list'}}
each boardLists
option(value="{{_id}}" selected="{{#if selected}}selected{{/if}}") {{title}}
label.notification-delivery-label
| {{_ 'email-to-card-swimlane'}}
select.js-etc-board-place(data-key="swimlaneId")
option(value="") {{_ 'email-to-card-default-swimlane'}}
each boardSwimlanes
option(value="{{_id}}" selected="{{#if selected}}selected{{/if}}") {{title}}
+emailToCardParts(rows=partRows)
p.notification-delivery-label {{_ 'email-to-card-your-address'}}
if address.enabled
p
code.js-etc-copy {{address.address}}
if address.subjectTag
p.quiet {{_ 'email-to-card-sandstorm-subject'}}
p
code.js-etc-copy {{address.subjectTag}}
p.quiet {{_ 'email-to-card-address-private'}}
button.js-etc-new-address(type="button") {{_ 'email-to-card-new-address'}}
else
p.quiet {{_ addressOffKey}}
if isMemberScope
label.notification-delivery-label
| {{_ 'email-to-card-member-enabled'}}
select.js-etc-member-enabled
option(value="" selected="{{#if $eq memberEnabled ''}}selected{{/if}}") {{_ 'default'}}
option(value="true" selected="{{#if $eq memberEnabled 'true'}}selected{{/if}}") {{_ 'yes'}}
option(value="false" selected="{{#if $eq memberEnabled 'false'}}selected{{/if}}") {{_ 'no'}}
+emailToCardParts(rows=partRows)
if message
p.quiet.js-etc-message {{message}}
//- Which parts of an email the card gets. "Default" inherits the board (for
a member) or WeKan's defaults (for a board).
template(name="emailToCardParts")
p.notification-delivery-label {{_ 'email-to-card-parts'}}
each rows
label.notification-delivery-label
| {{_ labelKey}}
select.js-etc-part(data-part="{{name}}" disabled="{{#if readOnly}}disabled{{/if}}")
each options
option(value="{{value}}" selected="{{#if selected}}selected{{/if}}") {{_ labelKey}}