diff --git a/provisioning/roles/jean-cloud-common/tasks/main.yml b/provisioning/roles/jean-cloud-common/tasks/main.yml index 2bd3a87..8b3575d 100644 --- a/provisioning/roles/jean-cloud-common/tasks/main.yml +++ b/provisioning/roles/jean-cloud-common/tasks/main.yml @@ -94,6 +94,7 @@ } #TODO add this to /etc/docker/daemon.json +# TODO no it breaks containers acces to internet #{ # "iptables": false #} diff --git a/services/radiodemo-back.oma-radio.fr/docker-compose.yml b/services/radiodemo-back.oma-radio.fr/docker-compose.yml index 1f15f22..1029050 100644 --- a/services/radiodemo-back.oma-radio.fr/docker-compose.yml +++ b/services/radiodemo-back.oma-radio.fr/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: anthracite_jukebox: - image: jeancloud/jukebox:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-jukebox:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_TelecommandeHost: $RADIO_HOST @@ -22,7 +22,7 @@ services: memory: 100M azurite_jukebox_simulator: - image: jeancloud/jukebox-simulator:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-jukebox-simulator:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_TelecommandeHost: $RADIO_HOST @@ -45,7 +45,7 @@ services: agate_importer: - image: jeancloud/baseimport:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-baseimport:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_TelecommandeHost: $RADIO_HOST @@ -63,7 +63,7 @@ services: rubis_base_mg: - image: jeancloud/base-mg:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-base-mg:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_TelecommandeHost: $RADIO_HOST diff --git a/services/radiodemo.oma-radio.fr/docker-compose.yml b/services/radiodemo.oma-radio.fr/docker-compose.yml index cc9baa9..e1a4c7f 100644 --- a/services/radiodemo.oma-radio.fr/docker-compose.yml +++ b/services/radiodemo.oma-radio.fr/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: ambre_mux: - image: jeancloud/mux:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/moa-mux:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_Client1Host: $NET.108 @@ -22,7 +22,7 @@ services: saphir_telecom_server: - image: jeancloud/telecom-server:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-telecom-server:$OMA_DOCKER_VERSION env_file: .env ports: - $TELECOM_SERVER_PORT:3490 @@ -37,7 +37,7 @@ services: memory: 100M amarante_webserver: - image: jeancloud/webserver:$OMA_DOCKER_VERSION + image: registry.gitlab.com/omaradio/core/oma-webserver:$OMA_DOCKER_VERSION env_file: .env environment: OMA_CONFIG_TelecommandeHost: $NET$TELECOM @@ -58,7 +58,7 @@ services: image: savonet/liquidsoap:v2.1.4 env_file: .env volumes: - - ./icecast.liq:/transcode.liq + - ./liquidsoap.liq:/transcode.liq - $SOUNDBASE_DIR:/soundbase command: /transcode.liq restart: unless-stopped diff --git a/services/radiodemo.oma-radio.fr/icecast.liq b/services/radiodemo.oma-radio.fr/icecast.liq deleted file mode 100644 index dd8fd7b..0000000 --- a/services/radiodemo.oma-radio.fr/icecast.liq +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/liquidsoap - -def clean_and_check (filename) - ts = string.split(separator='/', filename) - ts = int_of_string(list.hd(string.split(separator='\.', list.nth(ts, list.length(ts)-1)))) - integrity_check (ts) - clean_old_pige (ts) -end - -def clean_and_check (filename) - -end - -def integrity_check(filename) - if ts mod 60 != 0 then - log.important("#{filename} is to fix") - end -end - -# Mux -input1 = mksafe(input.harbor("direct.ogg",port=8000,password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f")) - -# Direct mp3 -output.icecast( - %mp3(bitrate=128, samplerate=22050, stereo=false), - mount="/direct.mp3", - host="icecast", port=8000, password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f", - input1) - -# Radioking -#output.icecast( -# %mp3(bitrate=128, samplerate=22050, stereo=false), -# mount="/test355", -# host="live.radioking.com", port=80, user="", password="", -# input) - -# Direct ogg -output.icecast( - %vorbis(samplerate=44100, channels=1, quality=0.2), - mount="/direct.ogg", - host="icecast", port=8000, password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f", - input1) - -# Pige -output.file(%vorbis(samplerate=44100, channels=1, quality=0.2), {"/soundbase/pige/#{int_of_float(time())}.ogg"}, input1, reopen_when={0s}, reopen_delay=1.0, on_close=clean_and_check) - diff --git a/services/radiodemo.oma-radio.fr/liquidsoap.liq b/services/radiodemo.oma-radio.fr/liquidsoap.liq new file mode 100644 index 0000000..abdd4bf --- /dev/null +++ b/services/radiodemo.oma-radio.fr/liquidsoap.liq @@ -0,0 +1,79 @@ +#!/usr/bin/liquidsoap + +# Extract timestamp from pige path +def ts_from_filepath (filepath) + splitpath = string.split(separator='/', filepath) + # Keep only filename + filename = list.nth(splitpath,list.length(splitpath)-1) + int_of_string(list.hd(string.split(separator='\\.', filename))) +end + +# Remove pige from now-1month +def clean_single_old_pige(ts) + # ts of one month sooner + ts = ts - 2678400 + filepath = "/soundbase/pige/#{ts}.ogg" + if file.exists("#{filepath}") then + process.run("rm #{filepath}") + end +end + +# Remove a pige file if it is too old +def clean_if_old(filename) + filepath = "/soundbase/pige/#{filename}" + if ( ts_from_filepath (filename) < int_of_float(time()) - 2678400 ) then + process.run("rm #{filepath}") + end +end + +# Check that the timestamp starts exactly on a minute +def integrity_check(ts) + if ts mod 60 != 0 then + log.important("#{ts} is to fix") + end +end + +# Routine integrity check for each files +def clean_and_check (filepath) + ts = ts_from_filepath (filepath) + integrity_check (ts) + clean_single_old_pige (ts) +end + +# Exaustive integrity check +def clean_and_check_all () + list.iter(clean_if_old, file.ls("/soundbase/pige/")) + list.iter(clean_and_check, file.ls("/soundbase/pige/")) +end + + + +# Mux +input1 = mksafe(input.harbor("direct.ogg",port=8000,password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f")) + +# Direct mp3 +output.icecast( + %mp3(bitrate=128, samplerate=22050, stereo=false), + mount="/direct.mp3", + host="icecast", port=8000, password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f", + input1) + +# Radioking +#output.icecast( +# %mp3(bitrate=128, samplerate=22050, stereo=false), +# mount="/test355", +# host="live.radioking.com", port=80, user="", password="", +# input) + +# Direct ogg +output.icecast( + %vorbis(samplerate=44100, channels=1, quality=0.2), + mount="/direct.ogg", + host="icecast", port=8000, password="JsCabjWJUZXrrrKCaaRZma5wD4YKj5LQLXv6f", + input1) + +# Pige +output.file(%vorbis(samplerate=44100, channels=1, quality=0.2), {"/soundbase/pige/#{int_of_float(time())}.ogg"}, input1, reopen_when={0s}, reopen_delay=1.0, on_close=clean_and_check) + +# Integrity checks +clean_and_check_all()