2020-11-10 12:23:22 +00:00
|
|
|
users = {
|
|
|
|
'git': {},
|
|
|
|
}
|
|
|
|
|
2020-08-20 13:34:27 +00:00
|
|
|
directories = {
|
2020-11-10 12:23:22 +00:00
|
|
|
'/home/git': {
|
|
|
|
'mode': '0755',
|
|
|
|
'owner': 'git',
|
|
|
|
'group': 'git',
|
|
|
|
},
|
2021-07-09 14:15:38 +00:00
|
|
|
'/home/git/.ssh': {
|
|
|
|
'mode': '0755',
|
|
|
|
'owner': 'git',
|
|
|
|
'group': 'git',
|
|
|
|
},
|
2020-08-20 13:34:27 +00:00
|
|
|
'/var/lib/gitea': {
|
|
|
|
'owner': 'git',
|
|
|
|
'mode': '0700',
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:gitea:restart',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/systemd/system/gitea.service': {
|
|
|
|
'content_type': 'mako',
|
2021-09-22 14:38:27 +00:00
|
|
|
'context': node.metadata.get('gitea'),
|
2020-08-20 13:34:27 +00:00
|
|
|
'triggers': {
|
|
|
|
'action:systemd-reload',
|
2021-02-20 14:47:35 +00:00
|
|
|
'svc_systemd:gitea:restart',
|
2020-08-20 13:34:27 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/gitea/app.ini': {
|
|
|
|
'content_type': 'mako',
|
2021-09-22 14:38:27 +00:00
|
|
|
'context': node.metadata.get('gitea'),
|
2020-08-20 13:34:27 +00:00
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:gitea:restart',
|
|
|
|
},
|
|
|
|
},
|
2021-09-17 11:07:04 +00:00
|
|
|
'/usr/local/bin/gitea': {
|
|
|
|
'content_type': 'download',
|
2022-02-06 14:24:46 +00:00
|
|
|
#'source': 'https://dl.gitea.io/gitea/{version}/gitea-{version}-linux-amd64'.format(version=node.metadata.get('gitea/version')),
|
|
|
|
'source': 'https://github.com/go-gitea/gitea/releases/download/v{version}/gitea-{version}-linux-amd64'.format(
|
|
|
|
version=node.metadata.get('gitea/version'),
|
|
|
|
),
|
2021-09-22 14:38:27 +00:00
|
|
|
'content_hash': node.metadata.get('gitea/sha1', None),
|
2021-09-17 11:07:04 +00:00
|
|
|
'mode': '0755',
|
|
|
|
'preceded_by': {
|
|
|
|
'svc_systemd:gitea:stop',
|
|
|
|
},
|
|
|
|
},
|
2020-08-20 13:34:27 +00:00
|
|
|
}
|
|
|
|
|
2021-05-01 12:27:31 +00:00
|
|
|
if node.metadata['gitea'].get('install_ssh_key', False):
|
|
|
|
files['/home/git/.ssh/id_ed25519'] = {
|
|
|
|
'content': repo.vault.decrypt_file(f'gitea/files/ssh-keys/{node.name}.key.vault'),
|
|
|
|
'mode': '0600',
|
|
|
|
'owner': 'git',
|
|
|
|
'group': 'git',
|
|
|
|
}
|
|
|
|
|
2020-08-20 13:34:27 +00:00
|
|
|
svc_systemd = {
|
|
|
|
'gitea': {
|
|
|
|
'needs': {
|
|
|
|
'file:/etc/gitea/app.ini',
|
2021-09-17 11:07:04 +00:00
|
|
|
'file:/etc/systemd/system/gitea.service',
|
|
|
|
'file:/usr/local/bin/gitea',
|
2020-08-20 13:34:27 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|