Explorar el Código

Read initial admin email and password from env vars.

David Lievrouw hace 1 año
padre
commit
1d19c29bb0
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      backend/setup.js

+ 4 - 2
backend/setup.js

@@ -21,11 +21,13 @@ const setupDefaultUser = () => {
 		.then((row) => {
 			if (!row.count) {
 				// Create a new user and set password
+				let email = process.env.INITIAL_ADMIN_EMAIL || '[email protected]';
+				let password = process.env.INITIAL_ADMIN_PASSWORD || 'changeme';
 				logger.info('Creating a new user: [email protected] with password: changeme');
 
 				let data = {
 					is_deleted: 0,
-					email:      '[email protected]',
+					email:      email,
 					name:       'Administrator',
 					nickname:   'Admin',
 					avatar:     '',
@@ -41,7 +43,7 @@ const setupDefaultUser = () => {
 							.insert({
 								user_id: user.id,
 								type:    'password',
-								secret:  'changeme',
+								secret:  password,
 								meta:    {},
 							})
 							.then(() => {