Giter VIP home page Giter VIP logo

elyssif-api's Introduction

 Elyssif API

Elyssif Lets You Securely Send Important Files

Elyssif is a user-friendly app that allows you to send sensitive or important files via the platform of your choice without worrying about your data being stolen or sold, thanks to strong asymmetric encryption. Elyssif allows to ask for a Bitcoin payment for the recipient to decrypt the file. This repository holds the webservice (REST API) to make this application work.

Installing

Prerequisites

  • Git
  • PHP >= 7.2
  • MariaDB server >= 10.3
  • Apache 2 (or Nginx)
  • Composer
  • Supervisor
  • npm >= 6.9.0
  • node >= v10.15.0
  • xdebug
  • Redis
  • Bitcoin Core (bitcoind) >= 0.18.0
  • Python3 (Optional)
  • VirtualBox and Vagrant (Optional but recommended)
  • Postman (Optional but recommended)

Recommended OS: Ubuntu 18.04 and up.

Using Vagrant (recommended)

  1. Clone the repository using git clone.
  2. Open a terminal and cd to the project's root directory.
  3. If your host is running Windows: open boostrap.sh and comment npm install and npm run dev. (Near the end of the file)
  4. Run vagrant up. Vagrant will download a box, install it and provision it. This will take a few minutes. Wait for the operation to finish.
  5. Your work environment is ready.
  6. If your host is running Windows: open boostrap.sh and uncomment npm install and npm run dev. (Near the end of the file)
  7. If your host is running Windows: run npm install && npm run dev from the host. (Use npm from the host from now on)

The provision should have installed and configured everything you need to start working. You can access your web server from your host machine via http://127.0.0.1:4567.

Mysql root credentials:

Username: root
Password: root
Database name: elyssif
Testing database name: elyssif_test
Charset: utf8_general_ci

Mysql laravel credentials:

Username: laravel
Password: secret

Virtual Machine credentials:

Username: vagrant
Password: vagrant

Manually

  1. Clone the repository using git clone.
  2. Check if you meet all the requirements.
  3. Create a new virtual host in you web server. Enable the rewrite mod if not already enabled.
  4. Create a database with the utf8_general_ci charset.
  5. Open a terminal and cd to the project's root directory.
  6. Make sure the www-data user has write access to the storage and bootstrap directories.
  7. Copy env.example and change its content to match your local configuration.
  8. Configure your web server by creating a new virtual host for the project. The document root must be the project's root.
  9. Create the following files:
  • /etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /vagrant/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/vagrant/storage/logs/worker.log
  • /etc/supervisor/conf.d/laravel-echo.conf
[program:laravel-echo]
directory=/var/www
process_name=%(program_name)s_%(process_num)02d
command=laravel-echo-server start
autostart=true
autorestart=true
user=vagrant
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/echo.log
  1. Configure /etc/bitcoin/bitcoin.conf with the following entries:
regtest=1
bind=127.0.0.1:18445
walletnotify=php /path/to/project/artisan bitcoin:transaction %s
blocknotify=php /path/to/project/artisan bitcoin:confirmations
  1. Run the following commands (replacing the path with your path):
composer install

php artisan key:generate

php artisan migrate:install
php artisan migrate
php artisan db:seed

php artisan passport:install

cp laravel-echo-server.json.example laravel-echo-server.json

# Generate rpc auth and append them to your .env file
python3 /path/to/project/rpcauth.py laravel /etc/bitcoin/bitcoin.conf /path/to/project/.env

supervisorctl reread
supervisorctl update
supervisorctl start laravel-worker:*
supervisorctl start laravel-echo:*

service bitcoind start
# If you want to run bitcoind on startup
# systemctl enable bitcoind

line="* * * * * php /path/to/project/artisan schedule:run >> /dev/null 2>&1"
(crontab -u www-data -l; echo "$line" ) | crontab -u www-data -

npm install
npm run dev

Running the tests

To run the automated tests, simply run : php ./vendor/phpunit/phpunit/phpunit when your current directory is the root of the project. A code coverage report will be generated in the report folder.

See the Client

elyssif-api's People

Contributors

firtha avatar shidraw avatar system-glitch avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

elyssif-api's Issues

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.