CreateCommunitySupportUser
struct CreateCommunitySupportUser : AsyncMigration
A Migration that creates the admin user upon startup. The password and recovery key are
read from environment variables ADMIN_PASSWORD and RECOVERY_KEY if present, otherwise
defaults are used.
The defaults are intended and fine for development and testing, but should never be
used in production. If not set to proper values in docker-compose.yml (or whatever
other environment of your choice), reminders are printed to console during startup.
Creates the shared @CommunitySupport account, the phantom user behind the Community Support mailbox. Nobody can log in as it:
its password and recovery key are random and immediately discarded.
If an ordinary user already holds the name (case-insensitively), that account is renamed first so the unique-username constraint doesn’t fail the migration on a real database.
-
prepare(on:Asynchronous) Declaration
Swift
func prepare(on database: Database) async throws -
revert(on:Asynchronous) Deletes only the CommunitySupport account. (Don’t copy
CreateMicroKaraokeUser.revert, which deletes the admin accounts.)Declaration
Swift
func revert(on database: Database) async throws
View on GitHub