diff --git a/.env b/.env index b1bd93c1404ddba09cfa23202b8e961e5139c910..eb18f05a564052de19c8bd60c1b4b7bc90c38cd0 100644 --- a/.env +++ b/.env @@ -6,4 +6,8 @@ ES_JAVA_OPTS="-Xms512m -Xmx512m" FUSIONAUTH_APP_MEMORY=512M MINIO_USERNAME=workflow-dev -MINIO_PASSWORD=workflow-dev \ No newline at end of file +MINIO_PASSWORD=workflow-dev + +# central envs +CENTRAL_USER_EMAIL=chakshu@samagragovernance.in +CENTRAL_USER_PASS=StrongPassword@1234 \ No newline at end of file diff --git a/central-config/cli.js b/central-config/cli.js deleted file mode 100644 index 950f88fa73353d04367d2e641b39850ed2ce7f54..0000000000000000000000000000000000000000 --- a/central-config/cli.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 ODK Central Developers -// See the NOTICE file at the top-level directory of this distribution and at -// https://github.com/getodk/central-backend/blob/master/NOTICE. -// This file is part of ODK Central. It is subject to the license terms in -// the LICENSE file found in the top-level directory of this distribution and at -// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, -// including this file, may be copied, modified, propagated, or distributed -// except according to the terms contained in the LICENSE file. -// -// This script is our primary administrative utility, providing a packaged way -// for people deploying this server to run basic tasks like creating users and -// resetting their passwords. As much as possible, this file itself tries only -// to parse the command-line input and delegate the actual work to tasks that -// are already defined. - -const { run } = require('../task/task'); -const { createUser, promoteUser, setUserPassword } = require('../task/account'); - -// gets a password interactively if not supplied in cli args. -const prompt = require('prompt'); -const withPassword = (f) => { - prompt.start(); - prompt.get([{ name: 'password', hidden: true, replace: '*' }], (_, { password }) => f(password)); -}; - -// command line nonsense (i'm not a huge fan of this library). -const cli = require('cli'); -const cliArgs = { - email: [ 'u', 'For user create and set password commands, supplies the email.', 'email' ] -}; -const cliCommands = [ 'user-create', 'user-promote', 'user-set-password' ]; -cli.parse(cliArgs, cliCommands); - -// map commands to tasks. -cli.main((args, options) => { - if (cli.command === 'user-create') - withPassword((password) => run(createUser(options.email, password))); - else if (cli.command === 'user-promote') - run(promoteUser(options.email)); - else if (cli.command === 'user-set-password') - withPassword((password) => run(setUserPassword(options.email, password))); -}); diff --git a/docker-compose.gitpod.yaml b/docker-compose.gitpod.yaml index b3e97fb0513de70dd632394fe02cc23a08672596..31f17e489f5bb228e9f37c0f0334611218aff411 100644 --- a/docker-compose.gitpod.yaml +++ b/docker-compose.gitpod.yaml @@ -75,6 +75,7 @@ services: networks: - db_net - search_net + - default restart: unless-stopped ports: - 9011:9011 @@ -137,8 +138,8 @@ services: volumes: - ./mnt/cqube_bucket/minio:/data environment: - MINIO_ROOT_USER: cqube-dev - MINIO_ROOT_PASSWORD: cqubeDevPassTibil + MINIO_ROOT_USER: ${MINIO_USERNAME} + MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD} command: server --console-address ":9001" /data networks: @@ -146,6 +147,7 @@ networks: driver: bridge search_net: driver: bridge + default: volumes: db_data: diff --git a/install-central.sh b/install-central.sh index b9826efe31bf34f633b106ecb484ffff4478e813..84c354641abe2b125b7b91d36f77bb50d96cf659 100644 --- a/install-central.sh +++ b/install-central.sh @@ -11,5 +11,7 @@ docker-compose up -d sleep 30 -docker compose exec service odk-cmd --email chakshu@samagragovernance.in user-create -docker compose exec service odk-cmd --email chakshu@samagragovernance.in user-promote \ No newline at end of file +source ../.env + +echo $CENTRAL_USER_PASS | docker compose exec -T service odk-cmd --email $CENTRAL_USER_EMAIL user-create +docker compose exec service odk-cmd --email $CENTRAL_USER_EMAIL user-promote \ No newline at end of file