Files
wekan/server/ldapAdminSettingsBridge.js
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

20 lines
1.1 KiB
JavaScript

// packages/wekan-ldap (a local Meteor package, its own isolated build unit)
// cannot import the app: an app-tree import inside packages/ resolves at
// runtime and fails with "Cannot find module" when the app boots. This is the app-side half of that boundary: it hands
// the package the app's resolver for login settings (server/lib/authConfig.js
// authEnv: the Admin Panel / People / LDAP value when one is stored, otherwise
// the LDAP_* environment variable), and reschedules LDAP background sync when
// those settings change.
//
// The Sandstorm .spk is built WITHOUT wekan-ldap (releases/sandstorm-slim.mjs,
// docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md), so the package
// is asked for only when it is there: a static import of a package that is not
// in the build stops the server at its first line.
import { authEnv, onAuthConfigChange } from '/server/lib/authConfig';
if (Package['wekan-ldap']) {
const { setLdapSettingsAccessor, reconfigureLdapBackgroundSync } = require('meteor/wekan-ldap');
setLdapSettingsAccessor(authEnv);
onAuthConfigChange('ldap', () => reconfigureLdapBackgroundSync());
}