Giter VIP home page Giter VIP logo

dongtai-webapi's Introduction

DongTai-webapi

django-project DongTai-project DongTai-webapi Deploy DongTai WebApi To AWS

中文版本(Chinese version)

Whit is DongTai-WebApi?

DongTai-WebAPI is used to user resource management ,including:

  • Project management
  • Vulnerability management
  • User data retrieval
  • System resources configuration
  • User/role management
  • Agent deployment management
  • Tenant management
  • Deployment document retrieval

Deploy

  • Source code deployment
  • Docker deployment

Source code deployment

1.Install the required dependencies

python -m pip install -r requirements-test.txt

2.Initialize the database

  • Install MySql 5.7, create the database DongTai-webapi, and run the database file conf/db.sql
  • Enter the webapi directory and run the python manage.py createsuperuser command to create an administrator

OR use docker way to host a database

  • Pull the corresponding database images and run it
docker pull  registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest 
docker run -itd --name dongtai-mysql -p 3306:3306 registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest 

3.Modify the configuration file

  • Copy the configuration file conf/config.ini.example to conf/config.ini and change the configuration; the url corresponding to engine is the service address of DongTai-engine, and the url corresponding to apiserver is the service address of DongTai-openapi

4.Run the service

  • Run python manage.py runserver to start the service

Container deployment

1.Initialize the database

  • Pull the corresponding database images and run it
docker pull  registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest 
docker run -itd --name dongtai-mysql -p 3306:3306 registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-mysql:latest 
  1. Modify the configuration file

Copy the configuration file conf/config.ini.example to conf/config.ini and change the configuration; among them:

  • The URL corresponding to the engine is the service address of DongTai-engine
  • The url corresponding to apiserver is the service address of DongTai-openapi

3.Build the image

$ docker build -t huoxian/dongtai-webapi:latest .

4.Start the container

$ docker run -d -p 8000:8000 --restart=always --name dongtai-webapi huoxian/dongtai-webapi:latest

Document

  • API documentation corresponding to the project
  1. Add document-related parameters when starting the container :
$ docker run -d -p 8000:8000 --restart=always -e environment=DOC --name dongtai-webapi huoxian/dongtai-webapi:latest

Here you need to start the corresponding mysql database. If you only want to start the webapi project to view the document, you need to add the following parameter -e database=sqlite (only start the webapi project to view the document, and does not guarantee the compatibility under sqlite ), the complete command is:

$ docker run -d -p 8000:8000 --restart=always -e environment=DOC -e database=sqlite --name dongtai-webapi huoxian/dongtai-webapi:latest
  1. Access the corresponding API in the container:

Swagger-ui address is http://<containerip:port>/api/XZPcGFKoxYXScwGjQtJx8u/schema/swagger-ui/#/

The Redoc address is http://<containerip:port>/api/XZPcGFKoxYXScwGjQtJx8u/schema/redoc/

If you need to separately export swagger.json The address is http://<containerip:port>/api/XZPcGFKoxYXScwGjQtJx8u/schema/

  1. The specific API authentication mode has been included in the API document, and the corresponding token can be found on the installation agent part of the web.

More resources

dongtai-webapi's People

Contributors

bidaya0 avatar exexute avatar jinghao1 avatar quantyork avatar hardy4yooz avatar dependabot[bot] avatar

Watchers

James Cloos avatar  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.