...
 
Commits (12)
stages:
- test
- build
- deploy
make_test:
......@@ -24,7 +25,7 @@ make_docs:
- build/docs
make_deb_package:
stage: deploy
stage: build
image: git-registry.hack-hro.de:443/lohro/lohrothek/thekno/build:buster
tags:
- kahlo
......@@ -40,10 +41,13 @@ make_deb_package:
- schedules
- merge_requests
- web
- develop
deploy_staging:
stage: deploy
image: node:lts-alpine
dependencies:
- make_deb_package
tags:
- kahlo
script:
......@@ -58,3 +62,20 @@ deploy_staging:
url: https://staging.$APPS_DOMAIN
only:
- master
deploy_develop:
image: alpine
dependencies:
- make_deb_package
stage: deploy
only:
- web
- develop
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- 'echo "$(echo "$DEV_SSH_PRIVATE_KEY" | xargs)==" | base64 -d | ssh-add - >/dev/null'
- mkdir -p -m 700 ~/.ssh
- echo "$DEV_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- scp -r $DEV_DEPLOY_SSH_FLAGS ./build/deb/*.deb $DEV_DEPLOY_HOST:/srv/local-apt-repository/
- ssh $DEV_DEPLOY_SSH_FLAGS $DEV_DEPLOY_HOST 'sleep 30 && apt update && apt install -y --reinstall "thekno"'
#!/usr/bin/dh-exec
system-files/nginx-spa.conf /etc/nginx/snippets/thekno-spa.conf
system-files/nginx-spa.conf => /etc/nginx/snippets/thekno-spa.conf
......@@ -22,7 +22,7 @@ function handleEarlyResponseFailure (e) {
}
function handleResponseProcessingFailure (e) {
if (/^Unexpected token/.test(e.message)) {
if (e instanceof SyntaxError) {
// Looks like the response could not be parsed as JSON.
// Maybe the default route handler kicked in returning the index.html.
// Try the current origin for the API and if that fails give up.
......
......@@ -9,7 +9,17 @@ const supportsAudioCodec = mem(function hasSupportFor (codec, container) {
if (codec === 'audio/opus') {
// browsers are picky about these type of questions
codec = `${container}; codecs="opus"`
} else if (codec === 'audio/mpeg') {
// While Chrome happily accepts `audio/mp3`, Firefox needs a bit more info.
codec = `audio/mpeg; codecs="mp3"`
} else if (codec === 'audio/aac' && container === 'audio/mp4') {
// Same for AAC, but Firefox currently only supports AAC in MP4 containers.
// So if our container is MP4, use the appropriate format. Otherwise don't
// touch it, Chrome should return `probably` and Firefox `maybe` which means
// this returns false.
codec = `audio/mp4; codecs="mp4a.40.2"`
}
return hasSupportFor.audio.canPlayType(codec) === 'probably'
})
......
......@@ -9,5 +9,7 @@ server {
listen [::]:5000 default_server;
root /usr/share/thekno/html;
set $origin_trial "";
include /etc/nginx/snippets/thekno-spa.conf;
}