gitea config
This commit is contained in:
@@ -4,11 +4,35 @@
|
||||
%}
|
||||
{% set basepath = salt.pillar.get('gitea:path') %}
|
||||
|
||||
wget {{ url }} -O {{ basepath }}/bin/gitea && chmod +x {{ basepath }}/bin/gitea && echo {{ ver }} > {{ basepath }}/VERSION:
|
||||
'download gitea':
|
||||
cmd.run:
|
||||
- name: 'wget {{ url }} -O {{ basepath }}/bin/gitea && chmod +x {{ basepath }}/bin/gitea && echo {{ ver }} > {{ basepath }}/VERSION'
|
||||
- unless: grep -P '^{{ ver }}$' {{ basepath }}/VERSION
|
||||
- runas: {{ salt.pillar.get('gitea:user') }}
|
||||
- require:
|
||||
- sls: gitea.dirs
|
||||
|
||||
# need to setup etc/
|
||||
{{basepath}}/etc/secrets.json:
|
||||
file.managed:
|
||||
- user: {{ salt.pillar.get('gitea:user') }}
|
||||
- group: {{ salt.pillar.get('gitea:user') }}
|
||||
- mode: 400
|
||||
{% if not salt.file.contains(basepath + '/etc/secrets.json', 'INTERNAL_TOKEN') %}
|
||||
- source: 'salt://gitea/files/secrets_json.jinja'
|
||||
- template: jinja
|
||||
{% else %}
|
||||
- replace: False
|
||||
{% endif %}
|
||||
- require:
|
||||
- cmd: download gitea
|
||||
|
||||
{{basepath}}/etc/app.ini:
|
||||
file.managed:
|
||||
- source: salt://gitea/files/app_ini.jinja
|
||||
- template: jinja
|
||||
- user: {{ salt.pillar.get('gitea:user') }}
|
||||
- group: {{ salt.pillar.get('gitea:user') }}
|
||||
- mode: 640
|
||||
- require:
|
||||
- file: {{basepath}}/etc/secrets.json
|
||||
|
||||
|
||||
Reference in New Issue
Block a user