Skip to content

Commit 441b2c5

Browse files
authored
Merge pull request #811 from munen/integration
Next Release
2 parents 2820488 + a1f73c6 commit 441b2c5

16 files changed

Lines changed: 131 additions & 52 deletions

File tree

app/assets/stylesheets/_start.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ button {
148148
text-align: center;
149149
}
150150
background: $talk-dark;
151-
151+
152152
}
153153

154154
.pages-publish_talk {
@@ -374,9 +374,9 @@ h1, h2 {
374374
#publishers {
375375
#publisher-collection {
376376
.publisher {
377-
padding: 24px 12px;
377+
/*padding: 24px 12px;*/
378378
float:left;
379-
margin-bottom: 3px;
379+
/*margin-bottom: 3px;*/
380380
h4 {
381381
font-family: $body-font-family;
382382
font-weight: 700;
@@ -527,5 +527,5 @@ h1, h2 {
527527
// button {
528528
// height: 60px;
529529
// }
530-
531-
}
530+
531+
}

app/models/talk.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def archive_from_dump!
504504

505505
# venue.stored_file('dump_1481635942').content_length
506506
def debug_processing
507-
puts "Startet at: #{sarted_at}"
507+
puts "Startet at: #{started_at}"
508508
puts "Ended at: #{ended_at}"
509509
puts "Effective duration: #{effective_duration}"
510510
puts

app/models/venue.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ def icecast_callback_url
194194
Settings.icecast.callback_url
195195
end
196196

197+
def transcoding_script_url
198+
Settings.icecast.transcoding_script_url
199+
end
200+
197201
def icecast_params
198202
{
199203
public_ip_address: public_ip_address,
@@ -467,7 +471,8 @@ def unprovision_test
467471
end
468472

469473
def provision
470-
assign_attributes( source_password: generate_password,
474+
assign_attributes( source_password:
475+
Settings.icecast.stoical_password || generate_password,
471476
admin_password: generate_password,
472477
client_token: generate_client_token,
473478
mount_point: generate_mount_point )

bin/backup_database

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
require 'yaml'
44
require 'fileutils'
55

6-
config_path = File.expand_path(File.join(%w(.. .. config settings.local.yml)), __FILE__)
6+
rel_path = File.join(%w(.. .. config settings.local.yml))
7+
8+
config_path = File.expand_path(rel_path, __FILE__)
9+
10+
puts "Reading config from #{config_path}"
711

812
config = YAML.load(File.read(config_path))
913

@@ -12,13 +16,21 @@ secret_access_key = config['fog']['storage']['aws_secret_access_key']
1216

1317
bucket, region = config['storage']['database_backups'].split('@')
1418

19+
puts "Using bucket #{bucket} in region #{region}"
20+
1521
backup_name = "dumpall-#{Date.today.strftime('%Y%m%d')}.sql.gz"
1622

1723
backup_path = File.expand_path(File.join(%w(.. .. tmp db)), __FILE__)
1824

25+
puts "Creating backup #{backup_name} in #{backup_path}"
26+
1927
FileUtils.mkdir_p backup_path
2028

2129
Dir.chdir backup_path do
30+
puts "Collecting data..."
2231
system("sudo -u postgres pg_dumpall | gzip > #{backup_name}")
23-
system("AWS_ACCESS_KEY_ID=#{access_key_id};AWS_SECRET_ACCESS_KEY=#{secret_access_key};aws s3 mv #{backup_name} s3://#{bucket}/ --region #{region}")
32+
puts "Uploading data..."
33+
system("AWS_ACCESS_KEY_ID=#{access_key_id} AWS_SECRET_ACCESS_KEY=#{secret_access_key} aws s3 mv #{backup_name} s3://#{bucket}/ --region #{region}")
2434
end
35+
36+
puts "Done."

bin/stream.liq

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/liquidsoap -v
2+
3+
set("log.file.path", "./liquidsoap.log")
4+
set("log.stdout", true)
5+
6+
icecast_host = argv(1)
7+
auido_file = argv(2)
8+
9+
icecast_port = 80
10+
icecast_mount = "/live"
11+
icecast_password = "12345"
12+
13+
source = single(audio_file)
14+
15+
ignore(output.icecast(
16+
%vorbis(channels=1),
17+
host=icecast_host,
18+
port=icecast_port,
19+
mount=icecast_mount,
20+
password=icecast_password,
21+
public=false,
22+
mean(source)
23+
))

config/schedule.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
rake "validity:check"
3838
end
3939

40-
#every 3.hours, roles: [:app] do
41-
# rake 'talks:popularity'
42-
#end
40+
every 60.minutes, roles: [:app] do
41+
rake 'talks:popularity'
42+
end
4343

4444
every 24.hours, at: '2:00 am', roles: [:app] do
4545
runner "Metric.snapshot!"

config/settings.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ icecast:
168168
#image: ami-fbc21694 (icebox 3.19 consistent uid/gid)
169169
#image: ami-ecd60583 (icebox 3.20 liquidsoap)
170170
#image: ami-bf4d9ed0 (icebox 3.21 improved live transcoding)
171-
image: ami-bf4d9ed0
171+
#image: ami-1ed57071 (icebox 3.22 fix transc. stereo signals + pull icebox.liq)
172+
#image: ami-d6ca6fb9 (icebox 3.23 fixed docker issue)
173+
image: ami-d6ca6fb9
172174
default_instance_type: t2.micro
173175
security_group: Icecast Servers
174176
key_name: phil-ffm

lib/icecast/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ ENV DEBIAN_FRONTEND noninteractive
1111
RUN groupadd -r icecast && \
1212
useradd -r -g icecast icecast2
1313

14-
RUN echo 'deb-src http://deb.debian.org/debian/ jessie-backports main' \
14+
RUN echo 'deb-src http://httpredir.debian.org/debian/ jessie-backports main' \
1515
>> /etc/apt/sources.list.d/backports.list
16+
1617
RUN apt-get -qq -y update && \
1718
apt-get -qq -y install curl build-essential dpkg-dev libssl-dev && \
1819
apt-get -qq -y -t jessie-backports build-dep icecast2 && \
1920
apt-get -qq -y -t jessie-backports source icecast2
21+
2022
RUN (cd icecast2-2.4.2; dpkg-buildpackage -b)
2123
RUN dpkg -i icecast2_2.4.2-1~bpo8+1_amd64.deb
2224

lib/icecast/icebox.liq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ stream0 = input.http(url,
5656
# on_disconnect=input_disconnect
5757
)
5858

59-
stream1 = fallback(track_sensitive=false, [stream0, interlude1])
59+
stream1 = fallback(track_sensitive=false, [stream0, mean(stream0), interlude1])
6060

6161
stream2 = strip_blank(stream1, max_blank=10.)
6262
#stream2 = strip_blank(stream1, max_blank=10., threshold=-50.)

lib/icecast/start.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ ICECAST_ADMIN_USER="${ICECAST_ADMIN_USER:-admin}"
1818
ICECAST_PID=$!
1919
echo Icecast start with pid $ICECAST_PID
2020

21+
# pull recent transcoding script from app server
22+
# this allows fine tuning the transcoding script
23+
# without having to roll out a new icebox
24+
curl $TRANSCODING_SCRIPT_URL > icebox.liq
25+
2126
# start live transcoder
2227
./run_liquidsoap.sh &
2328

0 commit comments

Comments
 (0)