jcash(Jibrel jCash backend)
"Authorization: Token {token}". To get token use: POST /auth/login/
First of all - get Docker-Compose. Then:
- just start all components with one command:
docker-compose pull && docker-compose up - build on your computer and start:
docker-compose up --build
Login to admin panel with default credentials:
- login:
admin - email:
[email protected] - password:
Koochoo7eishiD8iex5theexeisahHah
After login - create new user for yourself and disable default admin user for security reasons.
Don't delete it - or this account will be recreated with default password.
sudo apt-get update
sudo apt-get install gcc build-essential autoconf libtool pkg-config libssl-dev libffi-dev python3-dev virtualenv
sudo apt-get install git nginx
sudo apt-get install postgresql postgresql-contribhttps://linoxide.com/ubuntu-how-to/install-setup-rabbitmq-ubuntu-16-04/
sudo apt-get update
sudo apt-get install rabbitmq-server
sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server
sudo systemctl status rabbitmq-server
sudo rabbitmqctl add_user rabbituser rabbitpassword
sudo rabbitmqctl add_vhost rabbitvhost
sudo rabbitmqctl set_permissions -p rabbitvhost rabbituser ".*" ".*" ".*"sudo -u postgres psql
postgres=# CREATE DATABASE mysaleuser;
postgres=# CREATE USER mysaleuser WITH PASSWORD 'password';
postgres=# ALTER ROLE mysaleuser SET client_encoding TO 'utf8';
postgres=# ALTER ROLE mysaleuser SET default_transaction_isolation TO 'read committed';
postgres=# ALTER ROLE mysaleuser SET timezone TO 'UTC';
postgres=# GRANT ALL PRIVILEGES ON DATABASE mysaledb TO mysaleuser;
postgres=# \q
cd /home/jibrelnetwork
git clone https://github.com/jibrelnetwork/jibrel-jcash-backend
cd jibrel-jcash-backend
virtualenv -p /usr/bin/python3.6 venv
source venv/bin/activatepip install -r requirements.txt
pip install --editable ./Check settings ./jcash/settings.py
You can create dotenv file ./jcash/.env and put all env vars here
python jcash/manage.py migratepython jcash/manage.py runservercd ~/jcash
source venv/bin/activate
gunicorn --bind 0.0.0.0:8000 -w 4 jcash.wsgisudo nano /etc/systemd/system/jcash.service[Unit]
Description=jcash daemon
After=network.target
[Service]
User=jibrelnetwork
Group=www-data
WorkingDirectory=/home/jibrelnetwork/jibrel-jcash-backend/
ExecStart=/home/jibrelnetwork/jibrel-jcash-backend/venv/bin/gunicorn --access-logfile - --workers 4 --bind unix:/home/jibrelnetwork/jibrel-jcash-backend/jcash.sock jcash.wsgi:application
[Install]
WantedBy=multi-user.target
Commands
sudo systemctl start jcash
sudo systemctl restart jcash
sudo systemctl stop jcash
curl -H "Content-Type: application/json" -X POST -d '{"email":"test1@local","password":"password"}' http://localhost:8080/auth/login/
mkdir -p ./celery-sys/
mkdir -p ./celery-log/
source venv/bin/activate
celery -A jcash worker \
--pidfile="./celery-sys/%n.pid" \
--logfile="./celery-log/%n-%i.log" \
--loglevel=INFO
python jcash/manage.py collectstatic