infobeamer-cms: make usable

This commit is contained in:
Sophie Schiller 2021-12-23 19:36:50 +01:00
parent bf125a73b1
commit bac2a369c4
6 changed files with 209 additions and 17 deletions

View file

@ -0,0 +1,10 @@
[Unit]
Description=infobeamer-cms sync
After=network.target
Requires=infobeamer-cms.service
[Service]
User=infobeamer-cms
Group=infobeamer-cms
WorkingDirectory=/opt/infobeamer-cms
ExecStart=curl http://127.0.0.1:8000/sync

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run infobeamer-cms sync
[Timer]
OnCalendar=*:0/5
Persistent=true
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,18 @@
[Unit]
Description=infobeamer-cms - upload custom info pages to info-beamer
After=network.target
[Service]
Type=exec
Environment=SETTINGS=settings.cfg
Restart=always
RestartSec=5s
ExecStart=/usr/bin/gunicorn frontend:app -b 127.0.0.1:${PORT} -w ${WORKERS} -t 120 -k gevent --max-requests=1000
# You may have to adjust these settings
User=infobeamer-cms
Group=infobeamer-cms
WorkingDirectory=/opt/infobeamer-cms
[Install]
WantedBy=multi-user.target

View file

@ -27,7 +27,7 @@ SETUP_IDS = ${SETUP_IDS}
# Generate some random string. It's used for signing
# urls send to moderators.
URL_KEY = '${URL_KEY}'
URL_KEY = b'${URL_KEY}'
# Push notifications for moderation requests user pushover.
# Specify a target key and the app key to use.

View file

@ -1,12 +1,20 @@
actions = {
'infobeamer-cms_set_directory_permissions': {
'triggered': True,
'command': 'chown -R infobeamer-cms:infobeamer-cms /opt/infobeamer-cms/static/'
},
}
git_deploy = {
'/opt/infobeamer-cms': {
'rev': 'MASTER',
'rev': 'master',
'repo': 'https://github.com/sophieschi/36c3-cms.git',
'needs': {
'directory:/opt/infobeamer-cms',
},
'triggers': {
'svc_systemd:infobeamer-cms:restart',
'action:infobeamer-cms_set_directory_permissions',
},
},
}
@ -27,11 +35,24 @@ files = {
},
},
'/etc/systemd/system/infobeamer-cms.service': {
'content_type': 'mako',
'context': node.metadata.get('infobeamer-cms/config'),
'triggers': {
'action:systemd-reload',
'svc_systemd:infobeamer-cms:restart',
},
}
},
'/etc/systemd/system/infobeamer-cms-runperiodic.timer': {
'triggers': {
'action:systemd-reload',
'svc_systemd:infobeamer-cms-runperiodic.timer:restart',
},
},
'/etc/systemd/system/infobeamer-cms-runperiodic.service': {
'triggers': {
'action:systemd-reload',
},
},
}
pkg_pip = {
@ -46,6 +67,14 @@ svc_systemd = {
'infobeamer-cms': {
'needs': {
'file:/opt/infobeamer-cms/settings.cfg',
'file:/etc/systemd/system/infobeamer-cms.service',
'git_deploy:/opt/infobeamer-cms',
},
},
'infobeamer-cms-runperiodic.timer': {
'needs': {
'file:/etc/systemd/system/infobeamer-cms-runperiodic.timer',
'file:/etc/systemd/system/infobeamer-cms-runperiodic.service',
},
},
}

View file

@ -4,7 +4,9 @@ defaults = {
'gunicorn': {},
'python3-gevent': {},
'python3-flask': {},
'python3-jinja2': {},
'python3-redis': {},
'python3-oauth2client': {},
'python3-virtualenv': {},
'python3-requests': {},
'python3-iso8601': {},
@ -12,23 +14,23 @@ defaults = {
},
'infobeamer-cms': {
'config': {
'GITHUB_CLIENT_ID': 'encrypted1',
'GITHUB_CLIENT_SECRET': 'encryted2',
'GITHUB_CLIENT_ID': repo.vault.decrypt('encrypt$gAAAAABhxJT3JG3Qb1X-gjtBxwOXZmF-GVPjNbDkYo0Eke5Ly4CAKiussQ8Lld-4zoIWnIVBgndfPPGFDV2RlAHgb-_RY5r7jQcAlgsR0RUw4as0jEhiKlQ='),
'GITHUB_CLIENT_SECRET': repo.vault.decrypt('encrypt$gAAAAABhxJUgYzLIm5Efbn9-sEPpQRRiskHKa7fSqNoUxgonpcn7b9e6S_WbNHH_CLGrkKi7oE3pYUticDaLLLSM0bv74lswwElNvkhUuOM-RSeEuyKEhPP-fX-NXIa_AkRkFPVVBLnw'),
'SESSION_COOKIE_NAME': '__Host-sess',
'PREFERRED_URL_SCHEME': 'https',
'HOSTED_API_KEY': 'encrypted3',
'HOSTED_API_KEY': repo.vault.decrypt('encrypt$gAAAAABhxJPH2sIGMAibU2Us1HoCVlNfF0SQQnVl0eiod48Zu8webL_-xk3wDw3yXw1Hkglj-2usl-D3Yd095yTSq0vZMCv2fh-JWwSPdJewQ45x9Ai4vXVD4CNz5vuJBESKS9xQWXTc'),
'MAX_UPLOADS': 5,
'SETUP_IDS': '[123456]',
'URL_KEY': 'encrypted4',
'PUSHOVER_TARGET': 'encrypted5',
'PUSHOVER_APP_KEY': 'encrypted6',
'SETUP_IDS': '[212947]',
'URL_KEY': repo.vault.password_for(f'{node.name} infobeamer-cms url key'),
'PUSHOVER_TARGET': repo.vault.decrypt('encrypt$gAAAAABhxKJJrjd-wBezp1Bl8Lu_8BrMm4jiZvOub_XBnPTXE6mAHCTDCRGqH2-Z---hhuJh50MXroNzzIuA_9uAtwXhtkXkrsR344bcZh-idG6V0tDgzds='),
'PUSHOVER_APP_KEY': repo.vault.decrypt('encrypt$gAAAAABhxJFqFafr8pZhQPn3HXGx0plLNQpnTDtJhM4PnlWYDBKjMZxUVh0Ol4631ZBTO5Sj8SIq79O2-Lx2eu0cGIZuzPQsZIBFuxv-30d81r6ljmLh8RQ='),
'TIME_MIN': 1640039559,
'TIME_MAX': 1640905200,
'VERSION': 1,
'ROOMS': [
{
'name': 'Ada',
'device_id': 5919,
'name': 'Chaos-West TV',
'device_id': 4157489434,
'interrupts': [
{
'name': 'Signal',
@ -37,8 +39,8 @@ defaults = {
],
},
{
'name': 'Borg',
'device_id': 5920,
'name': 'Chaosstudio Hamburg',
'device_id': 157382517,
'interrupts': [
{
'name': 'Signal',
@ -46,7 +48,130 @@ defaults = {
},
],
},
{
'name': 'ChaosZone TV',
'device_id': 3,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'r3s - Monheim/Rhein',
'device_id': 3987908073,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'franconian.net Livestream',
'device_id': 246100657,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'about:future stage',
'device_id': 246100658,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'Sendezentrum Bühne',
'device_id': 246100659,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'Haecksen Stream',
'device_id': 246100660,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'xHain Mainhall',
'device_id': 246100661,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'xHain Workshop-Area',
'device_id': 246100662,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'c-base',
'device_id': 246100663,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'about:future Kitchen',
'device_id': 246100664,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'Haecksen Zur schönen Mary',
'device_id': 246100665,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
{
'name': 'Haecksen Zur magischen Margaret',
'device_id': 246100666,
'interrupts': [
{
'name': 'Signal',
'data': 'signal',
},
],
},
],
'PORT': 8000,
'WORKERS': 4,
'unused': 'foobar',
},
},
@ -63,10 +188,11 @@ def nginx(metadata):
'/': {
'target': 'http://127.0.0.1:8000',
},
'/twitter/': {
'alias': '/export/twitter/',
'/sync': {
'return': 'forbidden',
'mode': 403,
},
'/static/': {
'/static': {
'alias': '/opt/infobeamer-cms/static',
},
}