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 smaschAfter installation smasch service can be started using:
sudo service smasch startThis 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.
- SECRET_KEY - there should be a long random string entered here
- DATABASES - by default smasch would use sqlite. However, we strongly recommend changing it to postgres. The config using postgres backend can look as follows:
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- FORCE_2FA - if you plan to enforce Two-Factor Authentication you need to add
FORCE_2FA=Trueto config - EMAIL configuration - if you plan to send automatically emails from smasch (for daily ETL reports or appointments reports) you need to configure SMTP server:
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 startNext 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 DoeNow 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 upNext 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 DoeNow 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.