Mirror of l'Hubl
Go to file
Jean-Baptiste Pasquier 0f5b0ed8e5
update: README.md - waiting review
2019-04-29 14:46:13 +02:00
src ui: update to 0.7 2019-04-26 21:34:30 +02:00
www ui: update to 0.7 2019-04-26 21:34:30 +02:00
.babelrc fix: ES6 modules dependencies 2019-01-07 16:39:06 +01:00
.gitignore less javascript for user img 2019-04-16 14:56:25 +02:00
LICENSE Add LICENSE 2018-11-01 20:29:31 +00:00
Makefile fix: staging & prod makefile 2019-04-23 10:42:53 +02:00
README.md update: README.md - waiting review 2019-04-29 14:46:13 +02:00
copy_lib.js refactoring 2018-09-28 21:20:15 +02:00
lib_list.txt add dot syntax 2018-10-18 15:03:32 +02:00
package-lock.json fix: ES6 modules dependencies 2019-01-07 16:39:06 +01:00
package.json fix: ES6 modules dependencies 2019-01-07 16:39:06 +01:00
server.js bugfix: disable browser-sync tunnel 2018-11-14 16:33:03 +01:00

README.md

SiB App

SiB App is the magic tool that allows the Happy Dev network to thrive in a decentralized way.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

To install SiB App, you'll need to have:

  • Python3 & Pip
  • NodeJS & NPM
  • A Prosody Server
  • (Optional) A SMTP Server

Installing

At first, you'll need to deploy a sib-manager server, then configure it.

sib-manager installation or update

$ pip3 install -U sib-manager

sib-manager deploy

$ sib startproject sibserver -m djangoldp_project -m oidc_provider:django-oidc-provider -m djangoldp_circle -m djangoldp_joboffer -m djangoldp_profile -m djangoldp_skill -m djangoldp_account -m djangoldp_notification -m djangoldp_conversation --venv

We're using

  • djangoldp_project,
  • django-oidc-provider,
  • djangoldp_circle,
  • djangoldp_joboffer,
  • djangoldp_profile,
  • djangoldp_skill,
  • djangoldp_account,
  • djangoldp_notification,
  • djangoldp_conversation

As dependencies, if you don't want them, just remove the -m packagename.

The --venv mean that sib-manager will create and use a virtual env, if you want to use your system env remove it.

sibserver is the name of the folder that sib-manager will create, choose it wisely.

sibserver configuration

You'll have to change some settings on the sibserver files.

  • Change oidc_provider from packages.py to settings.py:

    • Remove oidc_provider line in ./sibserver/packages.py
    • Add oidc_provider on INSTALLED_APPS in ./sibserver/settings.py
  • Add your server name to ALLOWED_HOSTS

    • In settings.py, add your hostname on ALLOWED_HOSTS, eg:
      ALLOWED_HOSTS = ['api.myserver.com', 'localhost']
      
  • Around line 75-79 of settings.py set your PROSODY_HTTP_URL, JABBER_DEFAULT_HOST & BASE_URL, eg:

    PROSODY_HTTP_URL = 'https://jabber.happy-dev.fr'
    JABBER_DEFAULT_HOST = 'happy-dev.fr'
    BASE_URL = 'https://localhost:8000'
    
  • If you wish use another database than sqlite, you can also configure it on DATABASES in settings.py

  • If you want to receive mails from notifications, you need to add these lines & configure them at the end of settings.py

    EMAIL_HOST = "your.smtp.srv"
    EMAIL_HOST_USER = "user@email.com"
    EMAIL_HOST_PASSWORD = "password"
    EMAIL_USE_TLS = True #Or False
    

sibserver migrate

On the first sibserver folder:

$ ./manage.py migrate

Add an RSA Key for oidc

On the first sibserver folder:

$ ./manage.py creatersakey

sib-manager launching

On the first sibserver folder

$ sib runserver

You can also launch it directly from manage.py. Don't forget to activate the venv if so.

Create a Client ID for Prosody & Client

  • Go to localhost:8000/admin/
  • Login with previously created account.
    • If needed you can create another admin account with ./manage.py createsuperadmin
  • Add a Clients on OpenID Connect Provider section
    • Name it as you wish
    • Client type: Public
    • Response types: id_token token (Implicit Flow)
    • Redirect URIs:
      http://localhost:3000
      http://127.0.0.1:3000
      http://0.0.0.0:3000
      http://localhost:8000
      https://myserver.com
      
  • Keep the 6-digits newly create Client ID somewhere

Then, you'll have to install the client.

Clone this repository

# With SSH
$ git clone git@git.happy-dev.fr:startinblox/applications/sib-app.git

# Or with HTTPS
$ git clone https://git.happy-dev.fr/startinblox/applications/sib-app.git

Install dependencies

$ cd sib-app
$ npm install
$ node copy_lib.js
$ cp -n src/config.sample.json src/config.json

Configure config.json

On the newly created ./src/config.json change the dev configuration like this:

  "dev": {
    "sdn": "http://api.myserver.com", # Or localhost:8000
    "cdn": "https://cdn.happy-dev.fr",
    "xmpp": "https://prosody.myserver.com/http-bind/",
    "client_id": "000000" # <- Here goes your previously created Client ID
  },

That's all! Now let's run it!

# For dev
$ make watch

# Or for prod
$ make build

# Then on another terminal
$ make serve

Deployment

Deployment will need a registered RSA Key on production servers.

On Alpha

$ make syncprod

On Staging

$ make sync

Built With

Architecture

Some general schema of the existing StartinBlox applications architecture can be found here.