65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
users = {
|
|
'git': {
|
|
'home': '/var/lib/forgejo',
|
|
},
|
|
}
|
|
|
|
directories = {
|
|
'/var/lib/forgejo/.ssh': {
|
|
'mode': '0700',
|
|
'owner': 'git',
|
|
'group': 'git',
|
|
},
|
|
'/var/lib/forgejo': {
|
|
'owner': 'git',
|
|
'mode': '0700',
|
|
'triggers': {
|
|
'svc_systemd:forgejo:restart',
|
|
},
|
|
},
|
|
}
|
|
|
|
files = {
|
|
'/usr/local/lib/systemd/system/forgejo.service': {
|
|
'content_type': 'mako',
|
|
'context': node.metadata.get('forgejo'),
|
|
'triggers': {
|
|
'action:systemd-reload',
|
|
'svc_systemd:forgejo:restart',
|
|
},
|
|
},
|
|
'/etc/forgejo/app.ini': {
|
|
'content_type': 'mako',
|
|
'context': node.metadata.get('forgejo'),
|
|
'triggers': {
|
|
'svc_systemd:forgejo:restart',
|
|
},
|
|
},
|
|
'/usr/local/bin/forgejo': {
|
|
'content_type': 'download',
|
|
'source': 'https://codeberg.org/forgejo/forgejo/releases/download/v{0}/forgejo-{0}-linux-amd64'.format(node.metadata.get('forgejo/version')),
|
|
'content_hash': node.metadata.get('forgejo/sha1', None),
|
|
'mode': '0755',
|
|
'triggers': {
|
|
'svc_systemd:forgejo:restart',
|
|
},
|
|
},
|
|
}
|
|
|
|
if node.metadata.get('forgejo/install_ssh_key', False):
|
|
files['/var/lib/forgejo/.ssh/id_ed25519'] = {
|
|
'content': repo.vault.decrypt_file(f'forgejo/files/ssh-keys/{node.name}.key.vault'),
|
|
'mode': '0600',
|
|
'owner': 'git',
|
|
'group': 'git',
|
|
}
|
|
|
|
svc_systemd = {
|
|
'forgejo': {
|
|
'needs': {
|
|
'file:/etc/forgejo/app.ini',
|
|
'file:/usr/local/bin/forgejo',
|
|
'file:/usr/local/lib/systemd/system/forgejo.service',
|
|
},
|
|
},
|
|
}
|