This commit is contained in:
mwiegand 2021-06-11 14:12:24 +02:00
parent 4fa1bb5057
commit d4a68bc3cc
3 changed files with 23 additions and 49 deletions

View file

@ -1,5 +1,5 @@
APP_NAME = ckn-gitea
RUN_USER = gitea
RUN_USER = git
RUN_MODE = prod
[repository]

View file

@ -1,27 +1,21 @@
downloads = {
'/usr/local/bin/gitea': {
'url': 'https://dl.gitea.io/gitea/{version}/gitea-{version}-linux-amd64'.format(version=node.metadata['gitea']['version']),
'sha256': node.metadata['gitea']['sha256'],
'triggers': {
'svc_systemd:gitea:restart',
},
'preceded_by': {
'action:stop_gitea',
},
downloads['/usr/local/bin/gitea'] = {
'url': 'https://dl.gitea.io/gitea/{version}/gitea-{version}-linux-amd64'.format(version=node.metadata['gitea']['version']),
'sha256': node.metadata['gitea']['sha256'],
'triggers': {
'svc_systemd:gitea:restart',
},
'preceded_by': {
'action:stop_gitea',
},
}
users = {
'gitea': {},
}
users['git'] = {}
directories = {
'/var/lib/gitea': {
'owner': 'gitea',
'mode': '0700',
'triggers': {
'svc_systemd:gitea:restart',
},
directories['/var/lib/gitea'] = {
'owner': 'git',
'mode': '0700',
'triggers': {
'svc_systemd:gitea:restart',
},
}
@ -39,12 +33,11 @@ actions = {
},
}
files = {
'/etc/gitea/app.ini': {
'content_type': 'mako',
'context': node.metadata['gitea'],
'triggers': {
'svc_systemd:gitea:restart',
},
files['/etc/gitea/app.ini'] = {
'content_type': 'mako',
'owner': 'git',
'context': node.metadata['gitea'],
'triggers': {
'svc_systemd:gitea:restart',
},
}

View file

@ -36,8 +36,8 @@ defaults = {
'Service': {
'RestartSec': '2s',
'Type': 'simple',
'User': 'gitea',
'Group': 'gitea',
'User': 'git',
'Group': 'git',
'WorkingDirectory': '/var/lib/gitea/',
'ExecStart': '/usr/local/bin/gitea web -c /etc/gitea/app.ini',
'Restart': 'always',
@ -81,22 +81,3 @@ def nginx(metadata):
},
},
}
@metadata_reactor.provides(
'icinga2_api/gitea/services',
)
def icinga_check_for_new_release(metadata):
return {
'icinga2_api': {
'gitea': {
'services': {
'GITEA UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release go-gitea/gitea v{}'.format(metadata.get('gitea/version')),
'vars.notification.mail': True,
'check_interval': '60m',
},
},
},
},
}