This commit is contained in:
parent
ddc709beda
commit
a836997b5a
6 changed files with 68 additions and 59 deletions
|
@ -2,7 +2,28 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: python:3.10
|
image: python:3.10-bullseye
|
||||||
commands:
|
commands:
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- ./build.py
|
- ./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}"
|
||||||
|
|
60
config.yml
60
config.yml
|
@ -10,7 +10,9 @@ jinja_environment:
|
||||||
|
|
||||||
baseurl_abs: https://chaostreff.ch/
|
baseurl_abs: https://chaostreff.ch/
|
||||||
baseurl: /
|
baseurl: /
|
||||||
spaceapi_proxy_endpoint: /spaceapi
|
spaceapi_proxy_endpoint: /spaceapi-proxy
|
||||||
|
htaccess_language_redirect: no
|
||||||
|
htaccess_spaceapi_proxy: yes
|
||||||
|
|
||||||
hackerspaces:
|
hackerspaces:
|
||||||
|
|
||||||
|
@ -25,6 +27,8 @@ jinja_environment:
|
||||||
en: 'Every Tuesday from 19:30'
|
en: 'Every Tuesday from 19:30'
|
||||||
contact:
|
contact:
|
||||||
web: 'https://ccc-basel.ch/'
|
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/'
|
spaceapi: '/https/spaceapi.kabelsalat.ch/'
|
||||||
|
|
||||||
- name: 'CCC Zürich'
|
- name: 'CCC Zürich'
|
||||||
|
@ -38,6 +42,8 @@ jinja_environment:
|
||||||
en: 'Every Wednesday from 19:00'
|
en: 'Every Wednesday from 19:00'
|
||||||
contact:
|
contact:
|
||||||
web: 'https://ccczh.ch/'
|
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/'
|
spaceapi: '/https/www.ccczh.ch/api/v13/'
|
||||||
|
|
||||||
- name: 'Chaostreff Bern'
|
- name: 'Chaostreff Bern'
|
||||||
|
@ -51,6 +57,8 @@ jinja_environment:
|
||||||
en: 'Every Tuesday from 19:00'
|
en: 'Every Tuesday from 19:00'
|
||||||
contact:
|
contact:
|
||||||
web: 'https://chaostreffbern.ch/'
|
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'
|
spaceapi: '/https/www.chaosbern.ch/spaceapi.json'
|
||||||
|
|
||||||
- name: 'Coredump'
|
- name: 'Coredump'
|
||||||
|
@ -66,32 +74,19 @@ jinja_environment:
|
||||||
web: 'https://coredump.ch/'
|
web: 'https://coredump.ch/'
|
||||||
spaceapi: '/https/status.crdmp.ch/'
|
spaceapi: '/https/status.crdmp.ch/'
|
||||||
|
|
||||||
- name: 'FIXME Lausanne'
|
- name: 'Eastermundingen'
|
||||||
address: 'Les Ateliers de Renens, Chemin du Closel 3, 1020 Renens'
|
address: 'Steinbruchweg 16, 3072 Ostermundigen'
|
||||||
lat: 46.532372
|
lat: 46.95151
|
||||||
lon: 6.591292
|
lon: 7.49408
|
||||||
open:
|
open:
|
||||||
de: 'Mittwochs ab 19:00'
|
de: 'Mittwochs ab 18:00'
|
||||||
fr: 'Mercredi à partir de 19:00'
|
fr: 'Mercredi à partir de 18:00'
|
||||||
it: 'Mercoledì da 19:00'
|
it: 'Mercoledì da 18:00'
|
||||||
en: 'Every Wednesday from 19:00'
|
en: 'Every Wednesday from 18:00'
|
||||||
contact:
|
contact:
|
||||||
web: 'https://fixme.ch/'
|
web: 'https://www.eastermundigen.ch/'
|
||||||
spaceapi: '/https/fixme.ch/cgi-bin/spaceapi.py'
|
ml: 'https://lists.chaostreff.ch/postorius/lists/bern.chaostreff.ch/'
|
||||||
|
|
||||||
- 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'
|
|
||||||
|
|
||||||
- name: 'ODENWILUSENZ'
|
- name: 'ODENWILUSENZ'
|
||||||
address: 'Hardmorgenweg 21, 8222 Beringen'
|
address: 'Hardmorgenweg 21, 8222 Beringen'
|
||||||
lat: 47.6951648
|
lat: 47.6951648
|
||||||
|
@ -102,21 +97,8 @@ jinja_environment:
|
||||||
it: 'Mercoledì da 19:00'
|
it: 'Mercoledì da 19:00'
|
||||||
en: 'Every Wednesday from 19:00'
|
en: 'Every Wednesday from 19:00'
|
||||||
contact:
|
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'
|
- name: 'Ruum42'
|
||||||
address: 'Andreasstrasse 5, 9000 St. Gallen'
|
address: 'Andreasstrasse 5, 9000 St. Gallen'
|
||||||
lat: 47.4207758
|
lat: 47.4207758
|
||||||
|
|
15
httpd.conf
15
httpd.conf
|
@ -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
6
run.py
|
@ -5,9 +5,9 @@ import bottle
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@bottle.get('/spaceapi/<schema>/<host>')
|
@bottle.get('/spaceapi-proxy/<schema>/<host>')
|
||||||
@bottle.get('/spaceapi/<schema>/<host>/')
|
@bottle.get('/spaceapi-proxy/<schema>/<host>/')
|
||||||
@bottle.get('/spaceapi/<schema>/<host>/<path:path>')
|
@bottle.get('/spaceapi-proxy/<schema>/<host>/<path:path>')
|
||||||
def spaceapi_proxy(schema, host, path=''):
|
def spaceapi_proxy(schema, host, path=''):
|
||||||
url = urllib.parse.urlunsplit((schema, host, path, '', ''))
|
url = urllib.parse.urlunsplit((schema, host, path, '', ''))
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
<td>{{ space.open[lang] }}</td>
|
<td>{{ space.open[lang] }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% for key, url in space.contact.items() %}
|
{% for key, url in space.contact.items() %}
|
||||||
<a href="{{ url }}">{{ contacts[key] }}</a>
|
<a href="{{ url }}">{{ contacts[key] }}</a><br/>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
21
static-src/.htaccess
Normal file
21
static-src/.htaccess
Normal 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 %}
|
Loading…
Reference in a new issue