GithubHelp home page GithubHelp logo

qpc-github / avalon-management-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canaan-creative/avalon-management-system

1.0 2.0 1.0 1.39 MB

License: GNU General Public License v3.0

Shell 1.27% JavaScript 23.69% Python 58.67% CSS 1.63% HTML 14.75%

avalon-management-system's Introduction

AMS - Avalon Management System

A toolset to manage BTC Farm

Installation

Requirements

As root

$ sudo apt-get install apache2 mysql-server mysql-client \
  libapache2-mod-wsgi-py3 python3 python3-pip redis-server
$ sudo -H pip3 install Flask setuptools python-jose redis
$ sudo -H pip3 install --egg mysql-connector-python-rf
MySQL Setup
  • init mysql ( NOTE: if this is NOT the first time you install mysql in current OS, SKIP this step ):

    $ sudo mysql_secure_installation
    
  • Login with root:

    $ mysql -u root -p
    
  • Add new user ams and new database ams:

    > CREATE database ams;
    > GRANT ALL PRIVILEGES ON ams.* TO ams@localhost IDENTIFIED BY "PASSWD";
    > GRANT FILE ON *.* TO ams@localhost;
    > FLUSH PRIVILEGES;
    

    Note: replace PASSWD with the real password. It will be used in /etc/ams.conf

Install from tar.gz
  • Download the tar.gz files of ams-server and ams-client from releases.

  • Install server:

    $ tar xzpvf ams-server-VERSION.tar.gz
    $ cd ams-server-VERSION
    $ sudo python3 setup.py install
    
  • Install client:

    $ tar zxpvf ams-client-VERSION.tar.gz
    $ sudo mkdir /var/www/html/ams
    $ sudo cp -r ams-client/* /var/www/html/ams/
    

    Note: replace VERSION with the real version number.

Configuration
  • Modify AMS config file /etc/ams.conf. At least fill correct DataBase password.

  • Clone code to local

    $ git clone https://github.com/Canaan-Creative/Avalon-Management-System.git ams-git
    
  • Copy Apache2 config file:

    $ sudo cp ams-git/simple-cdd/extras/root/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf
    $ sudo a2enmod wsgi headers
    $ sudo service apache2 restart
    
  • Load crontab file:

    $ crontab ams-git/config/cron.tab
    
  • Initialize database and add ui user:

    $ amscli init
    $ amscli adduser USERNAME PASSWORD
    

    NOTE: this USERNAME & PASSWORD are used to login web site

  • Add Avalon miners

    • login to http://127.0.0.1/ams with above USERNME & PASSWORD
    • go to "setting" page
    • add miners with ip address, port (4028 usually), modules (number of Avalon miners under this ip)
    • click "Save" button

Build (for Developer)

  • server:

    cd server
    python3 setup.py sdist
    
  • client:

    Requirement:

    sudo apt-get install npm
    sudo ln -s /usr/bin/nodejs /usr/bin/node
    sudo npm install -g grunt-cli jshint
    
    

    Build:

    cd client
    npm install
    grunt prereq
    grunt build
    

Structure

```
Database: /usr/local/lib/python3.5/dist-packages/ams/
Config file: /etc/ams.conf
Tools: /usr/local/bin/amscli
Frontend: /var/www/html/ams
```

Known Issues

####Apache Error: 'assert tlock is not None'

  • Reason:

    mod_wsgi version is too low (<= 3.4).

  • Solution:

    As root

    pip3 install mod_wsgi
    rm /usr/lib/apache2/modules/mod_wsgi.so
    ln -s /usr/local/lib/python3.4/dist-packages/mod_wsgi/server/mod_wsgi-py34.cpython-34m.so /usr/lib/apache2/modules/mod_wsgi.so
    service apache2 restart
    

    NOTE: the version number in python3.4 and mod_wsgi-py34.cpython-34m.so may vary.

####MySQL5.7: Create table failed with invalid date

avalon-management-system's People

Contributors

archangdcc avatar jianxiongz avatar qinfengling avatar binsgit avatar cai-canaan avatar

Stargazers

 avatar

Watchers

 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.