Code Monkey home page Code Monkey logo

fomalhaut-panel's Introduction

fomalhaut-panel

Web Panel for fomalhaut, still in development.

这是 fomalhaut 项目的 Web 控制台,目前仍然在开发中。

页面效果

访问日志

dashboard

应用配置

config

访问日志

access_log

日志详情

access_log_detail

环境和依赖

目前只在 Python 2.7 环境下测试过

# database
redis
mysql
mongodb

配置文件

可以导入 json 配置文件,参考样例在 /doc/export_config.json

部署

请使用 Supervisor + Gunicorn + Nginx 来部署 Django

配置

settings.py,更多配置请查看该文件

# Redis 配置
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_PASSWORD = 'your_password'
REDIS_MAX_CONNECTIONS = 100

# MongoDB 配置
MONGO_HOST = '127.0.0.1'
MONGO_PORT = 27017
MONGO_USERNAME = 'api_gateway_user'
MONGO_PASSWORD = 'api_gateway_password'
MONGO_DBNAME = 'api_gateway'

# 访问日志,数据库保存天数,超过指定天数会删除
ACCESS_LOG_KEEP_DAYS = 60

在 MongoDB 中创建索引

大部分 Collection 的索引会由 MongoEngine 自动创建, 但是有几个 GridFS 的索引需要手动创建, 进入 MongoDB shell 后, 执行如下命令

db.request_body.files.createIndex( { md5: 1} );
db.request_headers.files.createIndex( { md5: 1} );
db.response_body.files.createIndex( { md5: 1} );
db.response_headers.files.createIndex( { md5: 1} );

邮件通知

账号系统实现了忘记密码邮件通知, 需要安装 Postfix, 可以参考 Python 使用 Postfix 发送邮件

初始化数据

python manage.py makemigrations 
python manage.py makemigrations djkombu 
python manage.py migrate 

Celery

定时解析访问统计数据的任务,依赖于 Celery,推荐使用 supervisor 来管理进程。启动 beat 和 worker:

python manage.py celery beat --loglevel=info
python manage.py celery worker --loglevel=info

TODO

  • Client, API Endpoint 配置
  • 用户账号
  • 访问日志
  • 首页的访问统计
  • IP 白名单, 黑名单配置

fomalhaut-panel's People

Contributors

restran 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.