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] [Unit]
Description=Boussole - auto-compile SCSS files on change Description=Boussole - auto-compile SCSS files on change
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }} WorkingDirectory={{ app_dir }}
Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8" Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8"
ExecStart=/opt/venvs/boussole/bin/boussole watch --backend=yaml --config=boussole.yaml --poll 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] [Unit]
Description=Comment User Mention Generator (Queue Consumer) Description=Comment User Mention Generator (Queue Consumer)
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python comment_user_mentions_generator.py 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] [Unit]
Description=Topic Embedly Extractor (Queue Consumer) Description=Topic Embedly Extractor (Queue Consumer)
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_embedly_extractor.py 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] [Unit]
Description=Topic Interesting Activity Updater (Queue Consumer) Description=Topic Interesting Activity Updater (Queue Consumer)
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_interesting_activity_updater.py 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] [Unit]
Description=Topic Metadata Generator (Queue Consumer) Description=Topic Metadata Generator (Queue Consumer)
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_metadata_generator.py 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] [Unit]
Description=Topic Youtube Scraper (Queue Consumer) Description=Topic Youtube Scraper (Queue Consumer)
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/consumers WorkingDirectory={{ app_dir }}/consumers
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python topic_youtube_scraper.py 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] [Unit]
Description=postgresql_redis_bridge - convert NOTIFY to Redis streams Description=postgresql_redis_bridge - convert NOTIFY to Redis streams
Requires=redis.service Requires=redis.service
@ -6,6 +6,8 @@ After=redis.service
PartOf=redis.service PartOf=redis.service
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }}/scripts WorkingDirectory={{ app_dir }}/scripts
Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}" Environment="INI_FILE={{ app_dir }}/{{ pillar['ini_file'] }}"
ExecStart={{ bin_dir }}/python postgresql_redis_bridge.py 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] [Unit]
Description=Webassets - auto-compile JS files on change Description=Webassets - auto-compile JS files on change
[Service] [Service]
User={{ app_username }}
Group={{ app_username }}
WorkingDirectory={{ app_dir }} WorkingDirectory={{ app_dir }}
ExecStart={{ bin_dir }}/webassets -c webassets.yaml watch ExecStart={{ bin_dir }}/webassets -c webassets.yaml watch
Restart=always Restart=always

Loading…
Cancel
Save