Git Product home page Git Product logo

ansible-zero2hero's Introduction

Configure DB

Admin config

#1) disable security (/etc/mongod.conf) --> Restart Mongodb 
#>  security:
#>    authorization: "disabled"

#2) drop admin user if exist
mongo admin --eval 'db.dropUser("superadmin")'
#3) create admin user
mongo admin --eval 'db.createUser({ user: "superadmin", pwd: "passwd123", roles: [{ role: "clusterAdmin", db: "admin" }, { role: "userAdminAnyDatabase", db: "admin" }] })'

#4) enable security (/etc/mongod.conf) --> Restart Mongodb
#>  security
#>    authorization: "enabled"

App user config

mongo admin --eval 'db.createUser({user: "todo", pwd: "todo", roles: [{ role: "readWrite, db: "test" }] })'

Network config

  • Replace the value of bindIp in /etc/mongod.conf
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongod.conf

Run manuall

** Check connectivity with DB**

nc -zv <db-hostname> 27017

From source code

export DB_CONNECTION=mongodb://user:pass@localhost:27017 DB_NAME=test
go run main.go

Or From build artifact

export DB_CONNECTION=mongodb://user:pass@localhost:27017 DB_NAME=test
/artifact-build-file

Run Production grade

1 - Create Systemd Service Todo which populates (2) & manages (3) -> notify: systemctl reload-daemon 2 - Put env vars in separated file (/etc/todo.env) 3 - Move build file from /tmp/todo to a standard place (/usr/local/bin/todo) -> notify: systemctl restart todo

Deploy

  • systemd service

Run Production grade

npm install pm2 -g
# Set REACT_APP_API_ENDPOINT, then
# Start APP with pm2
pm2 start node_modules/react-scripts/scripts/start.js --name todo

ansible-zero2hero's People

Contributors

my0k0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.