{# Copyright (C) 2013-2015 GitLab B.V. <https://gitlab.com/>
 # Copyright (C) 2017      Markus Wigge <wigge@beuth-hochschule.de>
 # Copyright (C) 2017      Maciej Delmanowski <drybjed@gmail.com>
 # Copyright (C) 2017      Fabio Bonelli <fb@fabiobonelli.it>
 # Copyright (C) 2017      DebOps <https://debops.org/>
 # SPDX-License-Identifier: MIT
 #}
#
# {{ ansible_managed }}
#

[Unit]
Description=GitLab Pages daemon
PartOf=gitlab.slice

[Service]
Slice=gitlab.slice
Type=simple
User={{ gitlab_user }}
WorkingDirectory={{ gitlab_pages_path }}
SyslogIdentifier=gitlab-pages
PIDFile={{ gitlab_app_root_path }}/gitlab/tmp/pids/gitlab-pages.pid

{% if gitlab_version is version_compare("12.8", operator="ge", strict=True) %}
ExecStart={{ gitlab_app_root_path }}/gitlab-pages/gitlab-pages -config=/etc/default/gitlab-pages
{% else %}
ExecStart={{ gitlab_app_root_path }}/gitlab-pages/gitlab-pages -pages-domain {{ gitlab_pages_domain }} -pages-root {{ gitlab_pages_path }} -listen-proxy 127.0.0.1:{{ gitlab_pages_port }}
{% endif %}

[Install]
WantedBy=multi-user.target
