Browse Source

Run app-related services under the app user

merge-requests/126/merge
Deimos 4 years ago
parent
commit
88944bed17
  1. 4
      salt/salt/boussole.service.jinja2
  2. 4
      salt/salt/consumers/comment_user_mentions_generator.service.jinja2
  3. 4
      salt/salt/consumers/topic_embedly_extractor.service.jinja2
  4. 4
      salt/salt/consumers/topic_interesting_activity_updater.service.jinja2
  5. 4
      salt/salt/consumers/topic_metadata_generator.service.jinja2
  6. 4
      salt/salt/consumers/topic_youtube_scraper.service.jinja2
  7. 4
      salt/salt/postgresql_redis_bridge.service.jinja2
  8. 4
      salt/salt/webassets.service.jinja2

4
salt/salt/boussole.service.jinja2

@ -1,8 +1,10 @@
{% from 'common.jinja2' import app_dir -%}
{% from 'common.jinja2' import app_dir, app_username -%}
[Unit]
Description=Boussole - auto-compile SCSS files on change
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}
Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8"
ExecStart=/opt/venvs/boussole/bin/boussole watch --backend=yaml --config=boussole.yaml --poll

4
salt/salt/consumers/comment_user_mentions_generator.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Comment User Mention Generator (Queue Consumer)
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python comment_user_mentions_generator.py

4
salt/salt/consumers/topic_embedly_extractor.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Topic Embedly Extractor (Queue Consumer)
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_embedly_extractor.py

4
salt/salt/consumers/topic_interesting_activity_updater.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Topic Interesting Activity Updater (Queue Consumer)
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_interesting_activity_updater.py

4
salt/salt/consumers/topic_metadata_generator.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Topic Metadata Generator (Queue Consumer)
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_metadata_generator.py

4
salt/salt/consumers/topic_youtube_scraper.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Topic Youtube Scraper (Queue Consumer)
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_youtube_scraper.py

4
salt/salt/postgresql_redis_bridge.service.jinja2

@ -1,4 +1,4 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=postgresql_redis_bridge - convert NOTIFY to Redis streams
Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/scripts
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python postgresql_redis_bridge.py

4
salt/salt/webassets.service.jinja2

@ -1,8 +1,10 @@
{% from 'common.jinja2' import app_dir, bin_dir -%}
{% from 'common.jinja2' import app_dir, app_username, bin_dir -%}
[Unit]
Description=Webassets - auto-compile JS files on change
[Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}
ExecStart={{ bin_dir }}/webassets -c webassets.yaml watch
Restart=always

Loading…
Cancel
Save