-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dc729fe
Showing
43 changed files
with
1,744 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist | ||
build | ||
*~ | ||
local.rb | ||
puppet.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "modules/box"] | ||
path = modules/box | ||
url = ../puppet-box |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright © 2010 Alban Peignier, Florent Peyraud | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General public License for more details. | ||
|
||
You should have received a copy of the GNU General public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source :gemcutter | ||
|
||
gem "rake" | ||
gem "system-builder", '>= 0.0.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
== SYNOPSYS | ||
|
||
Setup your environment : | ||
|
||
rake setup WORKING_DIR=/var/tmp/streambox | ||
|
||
Create a streambox disk image (in dist/) : | ||
|
||
rake streambox:dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
require 'rubygems' | ||
|
||
require 'system_builder' | ||
require 'system_builder/task' | ||
|
||
load './local.rb' if File.exists?("./local.rb") | ||
|
||
release_number = Time.now.strftime('%Y%m%d-%H%M') | ||
release_name = "stagebox-#{release_number}" | ||
|
||
boot = SystemBuilder::DebianBoot.new("build/root") | ||
boot.configurators << SystemBuilder::PuppetConfigurator.new(:release_name => release_name) | ||
|
||
SystemBuilder::Task.new(:stagebox) do | ||
SystemBuilder::DiskSquashfsImage.new("dist/disk").tap do |image| | ||
image.boot = boot | ||
image.size = 500.megabytes | ||
end | ||
end | ||
|
||
SystemBuilder::Task.new(:"stagebox-demo") do | ||
SystemBuilder::IsoSquashfsImage.new("dist/iso").tap do |image| | ||
image.boot = boot | ||
end | ||
end | ||
|
||
desc "Setup your environment to build a stagebox image" | ||
task :setup => "stagebox:setup" do | ||
if ENV['WORKING_DIR'] | ||
%w{build dist}.each do |subdir| | ||
working_subdir = File.join ENV['WORKING_DIR'], subdir | ||
puts "* create and link #{working_subdir}" | ||
mkdir_p working_subdir | ||
ln_sf working_subdir, subdir | ||
end | ||
end | ||
end | ||
|
||
task :clean do | ||
sh "sudo sh -c \"fuser $PWD/build/root || rm -r build/root\"" if File.exists?("build/root") | ||
rm_rf "dist" | ||
mkdir_p "dist" | ||
end | ||
|
||
def create_latest_file(latest_file, release_name, release_number) | ||
checksum = %x{sha256sum dist/upgrade.tar}.split.first | ||
File.open(latest_file, "w") do |f| | ||
f.puts "name: #{release_name}" | ||
f.puts "url: http://download.tryphon.eu/stagebox/stagebox-#{release_number}.tar" | ||
f.puts "checksum: #{checksum}" | ||
f.puts "status_updated_at: #{Time.now}" | ||
f.puts "description_url: http://www.tryphon.eu/release/#{release_name}" | ||
end | ||
end | ||
|
||
namespace :buildbot do | ||
task :dist do | ||
mkdir_p target_directory = "#{ENV['HOME']}/dist/stagebox" | ||
cp "dist/disk", "#{target_directory}/stagebox-#{release_number}.disk" | ||
cp "dist/iso", "#{target_directory}/stagebox-#{release_number}.iso" | ||
cp "dist/upgrade.tar", "#{target_directory}/stagebox-#{release_number}.tar" | ||
create_latest_file "#{target_directory}/latest.yml", release_name, release_number | ||
end | ||
end | ||
|
||
task :buildbot => [:clean, "dist:all", "buildbot:dist"] | ||
|
||
namespace :dist do | ||
desc "Create all distribuable artifacts" | ||
task :all => [:disk, :iso, :upgrade] | ||
|
||
desc "Create disk image" | ||
task :disk => "stagebox:dist" | ||
|
||
desc "Create iso image" | ||
task :iso => "stagebox-demo:dist" | ||
|
||
desc "Create upgrade files" | ||
task :upgrade do | ||
rm_rf "dist/upgrade" | ||
mkdir_p "dist/upgrade" | ||
ln_s File.expand_path("build/filesystem.squashfs"), "dist/upgrade/filesystem-#{release_name}.squashfs" | ||
ln_s File.expand_path("build/root/vmlinuz"), "dist/upgrade/vmlinuz-#{release_name}" | ||
ln_s File.expand_path("build/root/initrd.img"), "dist/upgrade/initrd-#{release_name}.img" | ||
sh "tar -cf dist/upgrade.tar --dereference -C dist/upgrade ." | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh -x | ||
|
||
if [ "$USER" != "root" -o "$1" != "sudo" ]; then | ||
exec sudo -p "Password for $0:" $0 sudo $1 | ||
fi | ||
|
||
[ "$1" = "sudo" ] && shift | ||
|
||
bridge=br0 | ||
local_interface=eth0 | ||
|
||
ifconfig br0 down | ||
brctl delbr br0 | ||
|
||
dhclient $local_interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh -x | ||
|
||
if [ "$USER" != "root" -o "$1" != "sudo" ]; then | ||
exec sudo -p "Password for $0:" $0 sudo $1 | ||
fi | ||
|
||
[ "$1" = "sudo" ] && shift | ||
|
||
ip addr flush $1 | ||
|
||
bridge=br0 | ||
local_interface=eth0 | ||
|
||
ip addr flush $local_interface | ||
|
||
brctl addbr $bridge | ||
brctl addif $bridge $1 | ||
brctl addif $bridge $local_interface | ||
|
||
ip link set $bridge up | ||
ip link set $1 up | ||
|
||
dhclient $bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh -x | ||
|
||
if [ "$USER" != "root" -o "$1" != "sudo" ]; then | ||
exec sudo -p "Password for $0:" $0 sudo $1 | ||
fi | ||
|
||
[ "$1" = "sudo" ] && shift | ||
|
||
/sbin/ifconfig $1 172.20.0.1 | ||
|
||
interfaces=`/sbin/ifconfig -s | awk '/^eth/ { print $1 }'` | ||
|
||
for tun_interface in `/sbin/ifconfig -s | awk '/^tun/ { print $1 }'`; do | ||
/sbin/ifconfig $tun_interface | grep -q "172.20." | ||
if [ $? == 0 ]; then | ||
interfaces="$interfaces $tun_interface" | ||
fi | ||
done | ||
|
||
for interface in $interfaces; do | ||
/sbin/iptables -t nat -A POSTROUTING -s 172.20.0.1/24 -o $interface -j MASQUERADE | ||
done | ||
|
||
/sbin/sysctl -w net.ipv4.ip_forward=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<VirtualHost *:80> | ||
ServerName streambox.local | ||
ServerAdmin [email protected] | ||
|
||
DNSSDServiceName "Tryphon StreamBox" | ||
|
||
DocumentRoot /usr/share/streamcontrol/public | ||
PassengerDefaultUser www-data | ||
PassengerMaxPoolSize 3 | ||
PassengerMaxRequests 10000 | ||
PassengerLogLevel 3 | ||
<Directory /usr/share/streamcontrol/public> | ||
AllowOverride None | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
|
||
Alias /munin /var/www/munin | ||
<Directory /var/www/munin> | ||
Options Indexes FollowSymLinks MultiViews | ||
AllowOverride None | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
|
||
<Location /munin> | ||
PassengerEnabled off | ||
</Location> | ||
|
||
LogLevel warn | ||
|
||
# Use only syslog | ||
ErrorLog syslog | ||
CustomLog "|/usr/bin/logger -p local1.info -t apache2/access" combined | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# this section describes general aspects of the live streaming session | ||
[general] | ||
duration = 0 # duration of encoding, in seconds. 0 means forever | ||
bufferSecs = 5 # size of internal slip buffer, in seconds | ||
reconnect = yes # reconnect to the server(s) if disconnected | ||
|
||
# this section describes the audio input that will be streamed | ||
[input] | ||
device = /dev/dsp # OSS DSP soundcard device for the audio input | ||
sampleRate = 44100 # sample rate in Hz. try 11025, 22050 or 44100 | ||
bitsPerSample = 16 # bits per sample. try 16 | ||
channel = 2 # channels. 1 = mono, 2 = stereo | ||
|
||
# this section describes a streaming connection to an IceCast2 server | ||
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7] | ||
# these can be mixed with [icecast-x] and [shoutcast-x] sections | ||
[icecast2-0] | ||
bitrateMode = vbr # average bit rate | ||
format = vorbis # format of the stream: ogg vorbis | ||
quality = 0.5 # bitrate of the stream sent to the server | ||
server = localhost | ||
# host name of the server | ||
port = 8000 # port of the IceCast2 server, usually 8000 | ||
password = hackme # source password to the IceCast2 server | ||
mountPoint = main # mount point of this stream on the IceCast2 server | ||
# name = StreamBox stream | ||
# name of the stream | ||
# description = | ||
# description of the stream | ||
# url = http://www.yourserver.com | ||
# URL related to the stream | ||
# genre = my own # genre of the stream | ||
# public = yes # advertise this stream? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Defaults for darkice initscript | ||
# sourced by /etc/init.d/darkice | ||
# installed at /etc/default/darkice by the maintainer scripts | ||
|
||
# | ||
# This is a POSIX shell fragment | ||
# | ||
RUN=yes | ||
# Additional options that are passed to the Daemon. | ||
DAEMON_OPTS="-c /etc/darkice/darkice.cfg --pidfile $PIDFILE" | ||
USER=root | ||
GROUP=audio | ||
|
||
DAEMON=/usr/bin/darkice-safe |
Oops, something went wrong.