SMASCH

Install#

Debian/Ubuntu#

Smasch can be installed as a debian package using LCSB repository:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xcb185f4e31872412
sudo apt-add-repository "deb http://repo-r3lab.uni.lu/debian/ stable main"
sudo apt-get update
sudo apt-get install -y smasch

After installation smasch service can be started using:

sudo service smasch start

This will start a gunicorn on port 8888 and smasch is available using url: http://localhost:8888/.

If you are seeing 400 BAD REQUEST message it means that you are trying to access smasch using address that was not defined in the config file. Open /etc/smasch/smasch.py and add your domain into ALLOWED_HOSTS:

ALLOWED_HOSTS = ["127.0.0.1", "localhost", "my_domain"]

There are few more options that should be configured before system is being used.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'db_name',
        'USER': 'db_user',
        'PASSWORD': 'db_password',
        'HOST': 'localhost',
        'PORT': ''  # '' === default one
    }
}

Important: If at any point you change the database you need to reinitialize it. To do so, you have to execute:

source /usr/lib/smasch/env/bin/activate && /usr/lib/smasch/manage.py migrate
EMAIL_HOST = 'smtp.host.com'
EMAIL_HOST_USER = 'smasch-user@host.com'
EMAIL_HOST_PASSWORD = 'smash-user-passwd'
EMAIL_PORT = 25 # change it if necessary
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

Changing configuration requires restart of smasch:

service smasch stop
service smasch start

Next step is to create admin user:

source /usr/lib/smasch/env/bin/activate && /usr/lib/smasch/manage.py superworker --username admin --email john.doe@gmail.com --first-name John --last-name Doe

Now you can log in to the machine using http://localhost:8888/.

Docker#

git clone https://git-r3lab.uni.lu/NCER-PD/scheduling-system.git
cd scheduling-system
git checkout v1.0.1 # pick the version you want to run, docker is supported starting from smasch version 1.0.1
docker-compose build && docker-compose up

Next step is to create admin user. You have to do it from scheduling-system folder:

docker-compose exec web python manage.py superworker --username admin --email john.doe@gmail.com --first-name John --last-name Doe

Now you can log in to the machine using http://localhost:8888/.

Other/Devel#

To install smasch from sources or on other Operating System please refer to development readme.