CreateAdminUsers
struct CreateAdminUsers : AsyncMigrationA 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.
- 
                  prepare(on:Asynchronous) Required by Migrationprotocol. Creates the admin user after a bit of sanity check caution.DeclarationSwift func prepare(on database: Database) async throwsParametersdatabaseA connection to the database, provided automatically. Return ValueVoid. 
- 
                  revert(on:Asynchronous) Required by Migrationprotocol. Deletes all admin users.DeclarationSwift func revert(on database: Database) async throwsParametersconnThe database connection. Return ValueVoid. 
- 
                  createAdminUser(on:Asynchronous) Admin user gets their password and recovery key from the ADMIN_PASSWORDandADMIN_RECOVERY_KEYenvironment variables. These are usually set in the appropriate .env file in “Private Swiftarr Config” directory. For the production environment, this file will be “production.env”.DeclarationSwift func createAdminUser(on database: Database) async throws
- 
                  createPrometheusUser(on:Asynchronous) Prometheus user gets their password from the PROMETHEUS_PASSWORD. Recovery key is randomly generated and thrown away. environment variables. These are usually set in the appropriate .env file in “Private Swiftarr Config” directory. For the production environment, this file will be “production.env”.DeclarationSwift func createPrometheusUser(on database: Database) async throws
- 
                  createTHOUser(on:Asynchronous) THO is a special acct for JoCo home office. There’s several specific things this account can do, such as settings announcements and daily themes. This account’s password and recovery key are set up in the same way as the admin acct. DeclarationSwift func createTHOUser(on database: Database) async throws
- 
                  createModeratorUser(on:Asynchronous) By design, nobody can log in as Moderator–the password is set to a randomly-generated value that is immediately forgotten. However, anyone with moderotor access may post content as moderator, in which case the moderator account becomes the author of the content instead of the current user. “Content’ in this sense means tweets, forum posts, fez messages. DeclarationSwift func createModeratorUser(on database: Database) async throws
- 
                  createTwitarrTeamUser(on:Asynchronous) By design, nobody can log in as TwitarrTeam–the password is set to a randomly-generated value that is immediately forgotten. However, anyone with TwitarrTeam access may post content as TwitarrTeam, in which case the TwitarrTeam account becomes the author of the content instead of the current user. “Content’ in this sense means tweets, forum posts, fez messages. DeclarationSwift func createTwitarrTeamUser(on database: Database) async throws
 View on GitHub
            View on GitHub
           CreateAdminUsers Structure Reference
      CreateAdminUsers Structure Reference