diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c210439..0e538d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ gemnasium-python-dependency_scanning: stages: - test + - deploy test: stage: test @@ -20,3 +21,12 @@ test: - apt-get update -qy - apt-get install -y python3-dev python3-pip build-essential sqlite3 - pip3 install -r requirements.txt + +deployToDev: + stage: deploy + script: + - deployToDev + tags: + - cp1 + only: + - develop \ No newline at end of file diff --git a/README.md b/README.md index a809700..59edcbe 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,36 @@ The project is a web based implementation of couch potato. +## Requirements +- Python 3 +- Virtualenv +- GCC +- Git +- MongoDB +- SQLite + +### Ubuntu 18+ +```bash +sudo apt-get update +sudo apt-get install python3 python3-venv python3-dev build-essential git mongodb libmysqlclient-dev -y +``` + ## Installation -```bash +```bash cd python-cp-gui python3 -m venv env source env/bin/activate pip3 install -r requirements.txt +# Configure config-bos-mint.yaml +cd couchpotato +cp example-config-bos-mint.yaml config-bos-mint.yaml ``` - - ### First Run -Modify config-bos-mint.yaml - ```bash +cd python-cp-gui source env/bin/activate cd couchpotato/scripts/ ./install.sh @@ -26,7 +40,9 @@ cd couchpotato/scripts/ This operation will clear all the existing users ## Usage + ```bash +cd python-cp-gui source env/bin/activate cd couchpotato python3 manage.py runserver 0.0.0.0:9010 diff --git a/couchpotato/example-config-bos-mint.yaml b/couchpotato/example-config-bos-mint.yaml new file mode 100644 index 0000000..197984f --- /dev/null +++ b/couchpotato/example-config-bos-mint.yaml @@ -0,0 +1,37 @@ +debug: FALSE +project_name: PYTHON COUCH POTATO +project_sub_name: The Python Couch Potato project +secret_key: THINK CLOCK SMOG FLAG SMACK TINKER FLUNK # enter any random string +advanced_features: True + +sql_database: "sqlite:///{cwd}/bookied-local.db" + +connection: + use: hercules # enter your desired chain + + hercules: + node: + - wss://hercules.peerplays.download/api + nobroadcast: False + num_retries: 1 + +allowed_assets: + - BTFUN + - PPY + - TEST + - BTF + +potatoNames: + - cpx + - cpy + +bosApis: + - http://hercules.peerplays.download:8010/trigger + +token: + - 1111111 + +token_telegram: '' + +telegram_chat_ids: + - '' \ No newline at end of file diff --git a/couchpotato/uwsgi.ini b/couchpotato/uwsgi.ini new file mode 100644 index 0000000..ef5c165 --- /dev/null +++ b/couchpotato/uwsgi.ini @@ -0,0 +1,9 @@ +[uwsgi] +module = couchpotato.wsgi:application +master = true +callable = application +processes = 5 +socket = /tmp/cp.sock +chmod-socket = 666 +vacuum = true +die-on-term = true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 56bffce..5e8b30d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -django-sslserver bookiesports bos-mint bos-incidents +django-sslserver aiohttp==3.7.4 appdirs==1.4.4 @@ -15,25 +15,31 @@ blinker==1.4 bos-sync==0.3.0 certifi==2020.12.5 chardet==3.0.4 -click==7.1.2 click-datetime==0.2 +click==7.1.2 colorlog==4.6.2 +coreapi==2.3.3 +coreschema==0.0.4 dateutils==0.6.12 decorator==4.4.2 +django-rest-swagger==2.2.0 +django-rest-swagger==2.2.0 Django==3.1.6 djangorestframework==3.12.2 dnspython==2.0.0 +drf-yasg==1.20.0 +drf-yasg==1.20.0 ecdsa==0.13.3 email-validator==1.1.2 Events==0.4 expiringdict==1.2.1 -Flask==1.1.2 Flask-Assets==2.0 Flask-Mail==0.9.1 Flask-Markdown==0.3 Flask-Script==2.0.6 Flask-SQLAlchemy==2.4.4 Flask-WTF==0.14.3 +Flask==1.1.2 future==0.18.2 graphenelib==1.0.1 idna==2.8 @@ -49,6 +55,7 @@ MarkupSafe==1.1.1 multidict==5.1.0 mysqlclient numpy==1.19.4 +openapi-codec==1.3.2 pandas parso==0.7.1 peerplays==0.3.0 @@ -57,24 +64,31 @@ pickleshare==0.7.5 prettytable==2.0.0 prompt-toolkit==3.0.8 ptyprocess==0.6.0 +pyasn1==0.4.8 +pycparser==2.20 pycryptodome==3.9.9 Pygments==2.7.4 pylibscrypt==1.8.0 pymongo==3.11.2 +pyparsing==2.4.7 pyrsistent==0.17.3 python-dateutil==2.8.1 pytz==2020.4 PyYAML==5.4 requests==2.22.0 +ruamel.yaml==0.16.12 scrypt==0.8.17 +simplejson==3.17.2 six==1.15.0 SQLAlchemy==1.3.20 sqlparse==0.4.1 strict-rfc3339==0.7 +telegram tqdm==4.54.1 traitlets treelib==1.6.1 typing-extensions==3.7.4.3 +uritemplate urllib3==1.24.3 uWSGI wcwidth==0.2.5 @@ -84,17 +98,4 @@ websockets==8.1 Werkzeug==1.0.1 WTForms==2.3.3 yarl==1.6.3 -zipp==3.4.0 -uritemplate -django-rest-swagger==2.2.0 -drf-yasg==1.20.0 -django-rest-swagger==2.2.0 -drf-yasg==1.20.0 -openapi-codec==1.3.2 -coreapi==2.3.3 -coreschema==0.0.4 -pyasn1==0.4.8 -pycparser==2.20 -pyparsing==2.4.7 -ruamel.yaml==0.16.12 -simplejson==3.17.2 +zipp==3.4.0 \ No newline at end of file