Registrations currently disabled due to spam. Contact me externally if you need an account

Commit b45bb41e authored by Diego Sampaio's avatar Diego Sampaio
Browse files

Fix admin user creation via env vars

Closes #2943
parent b813ec8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ Meteor.startup ->
						console.log 'Username provided is invalid; Ignoring environment variables ADMIN_USERNAME'.red
				console.log "Username: #{adminUser.username}".green

				adminUser.type = 'user'

				id = RocketChat.models.Users.create adminUser

				Accounts.setPassword id, process.env.ADMIN_PASS
+8 −0
Original line number Diff line number Diff line
RocketChat.Migrations.add({
	version: 46,
	up: function() {
		if (RocketChat && RocketChat.models && RocketChat.models.Users) {
			RocketChat.models.Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true });
		}
	}
});