Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame^] | 1 | #!/bin/ash |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 2 | |
| 3 | export SIMPLE_SETTINGS=${SIMPLE_SETTINGS:-sf_notifier.settings.production} |
| 4 | export SF_NOTIFIER_ALERT_ID_HASH_FUNC=${SF_NOTIFIER_ALERT_ID_HASH_FUNC:-sha256} |
Michal Kobus | e7589f7 | 2020-09-11 14:29:37 +0200 | [diff] [blame] | 5 | export SF_NOTIFIER_ADD_LINKS=${SF_NOTIFIER_ADD_LINKS:-False} |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 6 | |
| 7 | WORKERS=${SF_NOTIFIER_WORKERS:-4} |
| 8 | BUFFER=${SF_NOTIFIER_BUFFER_SIZE:-32768} |
| 9 | PORT=${SF_NOTIFIER_APP_PORT:-5000} |
Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame^] | 10 | LOGPATH=/var/log/sf-notifier |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 11 | |
Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame^] | 12 | mkdir -p $LOGPATH |
| 13 | chown -R 1000:1000 $LOGPATH |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 14 | |
Michal Kobus | aa3accf | 2019-06-05 12:25:09 +0200 | [diff] [blame] | 15 | uwsgi -p ${WORKERS} \ |
Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame^] | 16 | --uid 1000 \ |
| 17 | --gid 1000 \ |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 18 | --http 0.0.0.0:${PORT} \ |
| 19 | --wsgi-file sf_notifier/server.py \ |
| 20 | --callable app_dispatch \ |
| 21 | --buffer-size=${BUFFER} \ |
| 22 | --max-worker-lifetime 300 \ |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 23 | --master |