项目作者: Madpilot0

项目描述 :
AdminLTE Dashboard using Flask/MySQL
高级语言: HTML
项目地址: git://github.com/Madpilot0/FlaskDashboard.git
创建时间: 2018-02-23T09:09:23Z
项目社区:https://github.com/Madpilot0/FlaskDashboard

开源协议:MIT License

下载


FlaskDashboard

A Dashboard using the AdminLTE theme with authentication.

Functionalities

  • User Creation & Authentication
  • Group creating
  • Role based access - Admins and ‘other’ usergroups
  • Basis for a customizable dashboard

Installation

  1. sudo apt update
  2. sudo apt upgrade
  3. sudo apt install python3 python3-dev python3-pip mysql-server libmysqlclient-dev
  4. #Optional
  5. sudo apt install nginx
  1. sudo pip3 install -r requirements.txt
  1. mysql -u root -p
  2. mysql>CREATE DATABASE FlaskDashboard;
  3. mysql>exit

The default username/password is ‘admin:password1234’
If you want to change the default user’s name or password, edit the database.sql file. The password can be generated like this:

  1. python3
  2. >>> import bcrypt
  3. >>> pass = "YourNewPassword"
  4. >>> bcrypt.hashpw(pass.encode('utf-8'), bcrypt.gensalt(10))

This will print a string which looks like this:
$2b$10$3DMGei4SVxcjfrNsV62.5ug8Q4FusVhQpQkWl9SqPoGfiqrQU5DRa
Paste this into the database.sql file

  1. mysql -u root -p FlaskDashboard < database.sql

Rename and edit the config file

  1. mv config.yaml.default config.yaml
  2. vi config.yaml

Edit nav.py for more menu’s

This project is WIP.

Nginx config for SSL setup

  1. server {
  2. listen 80;
  3. server_name example.com;
  4. listen 443 ssl;
  5. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  6. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  7. include /etc/letsencrypt/options-ssl-nginx.conf;
  8. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
  9. if ($scheme != "https") {
  10. return 301 https://$host$request_uri;
  11. }
  12. location / {
  13. proxy_pass https://127.0.0.1:22222;
  14. proxy_redirect off;
  15. proxy_set_header Host $host;
  16. proxy_set_header X-Real-IP $remote_addr;
  17. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  18. proxy_set_header X-Forwarded-Proto $scheme;
  19. }
  20. }

Login page
Admin page