Cleanup, add deployment job
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
s3lph 2023-01-06 00:00:27 +01:00
parent ddc709beda
commit a836997b5a
Signed by: s3lph
GPG key ID: 8AC98A811E5BEFF5
6 changed files with 68 additions and 59 deletions

View file

@ -2,7 +2,28 @@
pipeline:
build:
image: python:3.10
image: python:3.10-bullseye
commands:
- pip install -r requirements.txt
- ./build.py
upload:
image: python:3.10-bullseye
when:
branch: main
secrets:
- RSYNC_DEST
- SSH_KNOWN_HOSTS
- SSH_PRIVATE_KEY
commands:
- apt-get update
- apt-get install --yes --no-install-recommends rsync openssh-client
- pip3 install -r requirements.txt
- ./build.py
- export SSH_PRIVKEY_FILE=.ssh/id_ed25519
- export SSH_KNOWN_HOSTS=.ssh/known_hosts
- mkdir -p .ssh && chmod 0700 .ssh
- echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVKEY_FILE"
- echo "$SSH_KNOWN_HOSTS" > "$SSH_KNOWN_HOSTS"
- chmod 0600 "$SSH_PRIVKEY_FILE"
- rsync -v --recursive --delete -e "ssh -oUserKnownHostsFile=${SSH_KNOWN_HOSTS} -i ${SSH_PRIVKEY_FILE}" "out/" "${RSYNC_DEST}"

View file

@ -10,7 +10,9 @@ jinja_environment:
baseurl_abs: https://chaostreff.ch/
baseurl: /
spaceapi_proxy_endpoint: /spaceapi
spaceapi_proxy_endpoint: /spaceapi-proxy
htaccess_language_redirect: no
htaccess_spaceapi_proxy: yes
hackerspaces:
@ -25,6 +27,8 @@ jinja_environment:
en: 'Every Tuesday from 19:30'
contact:
web: 'https://ccc-basel.ch/'
ml: 'https://lists.chaostreff.ch/postorius/lists/basel.chaostreff.ch/'
matrix: 'https://mto.kabelsalat.ch/#/#basel:kabelsalat.ch'
spaceapi: '/https/spaceapi.kabelsalat.ch/'
- name: 'CCC Zürich'
@ -38,6 +42,8 @@ jinja_environment:
en: 'Every Wednesday from 19:00'
contact:
web: 'https://ccczh.ch/'
ml: 'https://lists.chaostreff.ch/postorius/lists/zuerich.chaostreff.ch/'
ml: 'https://lists.chaostreff.ch/postorius/lists/bitwaescherei.chaostreff.ch/'
spaceapi: '/https/www.ccczh.ch/api/v13/'
- name: 'Chaostreff Bern'
@ -51,6 +57,8 @@ jinja_environment:
en: 'Every Tuesday from 19:00'
contact:
web: 'https://chaostreffbern.ch/'
ml: 'https://lists.chaostreff.ch/postorius/lists/bern.chaostreff.ch/'
email: 'info(ät)chaostreffbern(punkt)ch'
spaceapi: '/https/www.chaosbern.ch/spaceapi.json'
- name: 'Coredump'
@ -66,32 +74,19 @@ jinja_environment:
web: 'https://coredump.ch/'
spaceapi: '/https/status.crdmp.ch/'
- name: 'FIXME Lausanne'
address: 'Les Ateliers de Renens, Chemin du Closel 3, 1020 Renens'
lat: 46.532372
lon: 6.591292
- name: 'Eastermundingen'
address: 'Steinbruchweg 16, 3072 Ostermundigen'
lat: 46.95151
lon: 7.49408
open:
de: 'Mittwochs ab 19:00'
fr: 'Mercredi à partir de 19:00'
it: 'Mercoledì da 19:00'
en: 'Every Wednesday from 19:00'
de: 'Mittwochs ab 18:00'
fr: 'Mercredi à partir de 18:00'
it: 'Mercoledì da 18:00'
en: 'Every Wednesday from 18:00'
contact:
web: 'https://fixme.ch/'
spaceapi: '/https/fixme.ch/cgi-bin/spaceapi.py'
- name: 'LuXeria'
address: 'Ebikonerstrasse 75, CH-6043 Adligenswil'
lat: 47.073
lon: 8.357
open:
de: 'Mittwochs ab 20:00 <span class="badge bg-primary">Videokonferenz</span>'
fr: 'Mercredi à partir de 20:00 <span class="badge bg-primary">visioconférence</span>'
it: 'Mercoledì da 20:00 <span class="badge bg-primary">videoconferenza</span>'
en: 'Every Wednesday from 20:00 <span class="badge bg-primary">video conference</span>'
contact:
web: 'https://luxeria.ch/'
spaceapi: '/https/luxeria.ch/spaceapi.json'
web: 'https://www.eastermundigen.ch/'
ml: 'https://lists.chaostreff.ch/postorius/lists/bern.chaostreff.ch/'
- name: 'ODENWILUSENZ'
address: 'Hardmorgenweg 21, 8222 Beringen'
lat: 47.6951648
@ -102,21 +97,8 @@ jinja_environment:
it: 'Mercoledì da 19:00'
en: 'Every Wednesday from 19:00'
contact:
web: '/odenwilusenz.ch/'
web: 'https://odenwilusenz.ch/'
- name: 'Post Tenebras Lab'
address: 'Avenue de la Praille 36, 1227 Carouge'
lat: 46.187134981155396
lon: 6.133659482002258
open:
de: 'Dienstags ab 19:00'
fr: 'Mardi à partir de 19:00'
it: 'Martedì da 19:00'
en: 'Every Tuesday from 19:00'
contact:
web: 'https://www.posttenebraslab.ch'
spaceapi: '/https/www.posttenebraslab.ch/status/status.json'
- name: 'Ruum42'
address: 'Andreasstrasse 5, 9000 St. Gallen'
lat: 47.4207758

View file

@ -1,15 +0,0 @@
# Language-specific index based on Accept-Language header
AddHandler type-map .var
DirectoryIndex index.var index.html
# Optional: Redirect to language specific subsite, rather than showing
# language specific content at the root
#Redirect /index.de.html /de/
#Redirect /index.fr.html /fr/
#Redirect /index.it.html /it/
#Redirect /index.en.html /en/
# SpaceAPI proxy service workaround for missing CORS headers
SSLProxyEngine on
RewriteEngine on
RewriteRule /spaceapi/([^/]+)/([^/]+)(/.*+)$ $1://$2/$3 [P,L]

6
run.py
View file

@ -5,9 +5,9 @@ import bottle
import urllib.parse
import requests
@bottle.get('/spaceapi/<schema>/<host>')
@bottle.get('/spaceapi/<schema>/<host>/')
@bottle.get('/spaceapi/<schema>/<host>/<path:path>')
@bottle.get('/spaceapi-proxy/<schema>/<host>')
@bottle.get('/spaceapi-proxy/<schema>/<host>/')
@bottle.get('/spaceapi-proxy/<schema>/<host>/<path:path>')
def spaceapi_proxy(schema, host, path=''):
url = urllib.parse.urlunsplit((schema, host, path, '', ''))
import logging

View file

@ -85,7 +85,7 @@
<td>{{ space.open[lang] }}</td>
<td>
{% for key, url in space.contact.items() %}
<a href="{{ url }}">{{ contacts[key] }}</a>
<a href="{{ url }}">{{ contacts[key] }}</a><br/>
{% endfor %}
</td>
</tr>

21
static-src/.htaccess Normal file
View file

@ -0,0 +1,21 @@
# Language-specific index based on Accept-Language header
DirectoryIndex index.var index.html
# Optional: Redirect to language specific subsite, rather than showing
# language specific content at the root
{% if htaccess_language_redirect %}
{%- for language in languages %}
Redirect /index.{{ language }}.html /{{ language }}/
{%- endfor %}
{%- endif %}
{% if htaccess_spaceapi_proxy %}
# SpaceAPI proxy service workaround for missing CORS headers
RewriteEngine on
{%- for space in hackerspaces %}
{%- if 'spaceapi' in space %}
RewriteRule ^/spaceapi-proxy{{ space.spaceapi }}$ {{ space.spaceapi.split('/', 2)[1] }}://{{ space.spaceapi.split('/', 2)[2] }} [P,L]
{%- endif %}
{%- endfor %}
{%- endif %}