jam-cloud/db/up/icecast.sql

309 lines
13 KiB
MySQL
Raw Normal View History

2014-01-07 20:32:12 +00:00
-- see http://www.icecast.org/docs/icecast-2.3.3/icecast2_config_file.html#limits
CREATE TABLE icecast_limits (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- number of listening clients
clients INTEGER NOT NULL DEFAULT 1000,
--number of sources include souce clients and relays
sources INTEGER NOT NULL DEFAULT 50,
-- maximum size (in bytes) of the stream queue
queue_size INTEGER NOT NULL DEFAULT 102400,
-- does not appear to be used
client_timeout INTEGER DEFAULT 10,
-- The maximum time (in seconds) to wait for a request to come in once
-- the client has made a connection to the server.
-- In general this value should not need to be tweaked.
header_timeout INTEGER DEFAULT 15,
-- If a connected source does not send any data within this
-- timeout period (in seconds), then the source connection
-- will be removed from the server.
source_timeout INTEGER DEFAULT 10,
-- The burst size is the amount of data (in bytes)
-- to burst to a client at connection time.
burst_size INTEGER DEFAULT 65536,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_admin_authentications (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- The unencrypted password used by sources to connect to icecast2.
-- The default username for all source connections is 'source' but
-- this option allows to specify a default password. This and the username
-- can be changed in the individual mount sections.
2014-01-10 21:03:33 +00:00
source_password VARCHAR(64) NOT NULL DEFAULT 'icejam321',
2014-01-07 20:32:12 +00:00
-- Used in the master server as part of the authentication when a slave requests
-- the list of streams to relay. The default username is 'relay'
2014-01-10 21:03:33 +00:00
relay_user VARCHAR(64) NOT NULL DEFAULT 'relay',
relay_password VARCHAR(64) NOT NULL DEFAULT 'jkrelayhack',
2014-01-07 20:32:12 +00:00
--The username/password used for all administration functions.
2014-01-10 21:03:33 +00:00
admin_user VARCHAR(64) NOT NULL DEFAULT 'jkadmin',
admin_password VARCHAR(64) NOT NULL DEFAULT 'jKadmin123',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
--contains all the settings for listing a stream on any of the Icecast2 YP Directory servers.
-- Multiple occurances of this section can be specified in order to be listed on multiple directory servers.
2014-01-10 21:03:33 +00:00
create table icecast_directories (
2014-01-07 20:32:12 +00:00
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
2014-01-10 21:03:33 +00:00
yp_url_timeout INTEGER not null default 15,
yp_url VARCHAR(1024) not null UNIQUE default 'http://dir.xiph.org/cgi-bin/yp-cgi',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_servermiscs (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- This is the DNS name or IP address that will be used for the stream directory lookups or possibily
-- the playlist generation if a Host header is not provided. While localhost is shown as an example,
-- in fact you will want something that your listeners can use.
2014-01-10 21:03:33 +00:00
hostname VARCHAR(256) not null default 'concertsvr.jamkazam.com',
2014-01-07 20:32:12 +00:00
--This sets the location string for this icecast instance. It will be shown e.g in the web interface.
2014-01-10 21:03:33 +00:00
location VARCHAR(128) not null default 'earth',
2014-01-07 20:32:12 +00:00
--This should contain contact details for getting in touch with the server administrator.
2014-01-10 21:03:33 +00:00
admin VARCHAR(128) not null default 'icemaster@localhost',
2014-01-07 20:32:12 +00:00
-- This flag turns on the icecast2 fileserver from which static files can be served.
-- All files are served relative to the path specified in the <paths><webroot> configuration
-- setting. By default the setting is enabled so that requests for the images
-- on the status page are retrievable.
fileserve INTEGER not null default 1,
-- This optional setting allows for the administrator of the server to override the
-- default server identification. The default is icecast followed by a version number
-- and most will not care to change it however this setting will change that.
2014-01-10 21:03:33 +00:00
server_id VARCHAR(128) not null default 'icecast 2.3',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_listen_sockets (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- The TCP port that will be used to accept client connections.
2014-01-10 21:03:33 +00:00
port INTEGER not null default 8001,
2014-01-07 20:32:12 +00:00
-- An optional IP address that can be used to bind to a specific network card.
-- If not supplied, then it will bind to all interfaces.
2014-01-10 21:03:33 +00:00
bind_address VARCHAR(128),
2014-01-07 20:32:12 +00:00
2014-01-10 21:03:33 +00:00
shoutcast_mount VARCHAR(128) default NULL,
2014-01-07 20:32:12 +00:00
shoutcast_compat INTEGER not null default 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_mastersvr_relays (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- ip address of the master icecast server and port number
2014-01-10 21:03:33 +00:00
master_server VARCHAR(128) not null,
master_server_port INTEGER not null,
2014-01-07 20:32:12 +00:00
--The interval (in seconds) that the Relay Server will poll the Master Server for any new mountpoints to relay.
2014-01-10 21:03:33 +00:00
master_update_interval INTEGER not null default 120,
2014-01-07 20:32:12 +00:00
-- This is the relay username on the master server. It is used to query the server for a list of
-- mountpoints to relay. If not specified then 'relay' is used
2014-01-10 21:03:33 +00:00
master_username VARCHAR(64) not null default 'relay',
master_password VARCHAR(64) not null,
2014-01-07 20:32:12 +00:00
--Global on-demand setting for relays. Because you do not have individual relay options when
-- using a master server relay, you still may want those relays to only pull the stream when
-- there is at least one listener on the slave. The typical case here is to avoid surplus
-- bandwidth costs when no one is listening.
relays_on_demand INTEGER default 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
--make sure this combo is unique
--CONSTRAINT serverID UNIQUE KEY (master_server,master_server_port)
);
create table icecast_relays (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- ip address of server we are relaying from and port number
2014-01-10 21:03:33 +00:00
server VARCHAR(128) not null,
port INTEGER not null default 8001,
2014-01-07 20:32:12 +00:00
-- mount at server. eg /example.ogg
2014-01-10 21:03:33 +00:00
mount VARCHAR(128) not null,
2014-01-07 20:32:12 +00:00
-- eg /different.ogg
2014-01-10 21:03:33 +00:00
local_mount VARCHAR(128) not null,
2014-01-07 20:32:12 +00:00
-- eg joe. could be null
2014-01-10 21:03:33 +00:00
username VARCHAR(64) default NULL ,
2014-01-07 20:32:12 +00:00
-- user password
2014-01-10 21:03:33 +00:00
password VARCHAR(64) default null ,
2014-01-07 20:32:12 +00:00
relay_shoutcast_metadata INTEGER default 0,
--- relay only if we have someone wanting to listen
on_demand INTEGER default 0,
2014-01-10 21:03:33 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
2014-01-07 20:32:12 +00:00
);
create TABLE icecast_user_authentications(
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
--"htpasswd or url"
2014-01-10 21:03:33 +00:00
-- real name is type
stype VARCHAR(16) DEFAULT NULL ,
2014-01-07 20:32:12 +00:00
-- these are for httpasswd
2014-01-10 21:03:33 +00:00
filename VARCHAR(256) default NULL,
2014-01-07 20:32:12 +00:00
allow_duplicate_users INTEGER DEFAULT 0,
-- these options are for url
-- eg value="http://myauthserver.com/stream_start.php"
2014-01-10 21:03:33 +00:00
mount_add VARCHAR(256) default NULL,
2014-01-07 20:32:12 +00:00
--value="http://myauthserver.com/stream_end.php"
2014-01-10 21:03:33 +00:00
mount_remove VARCHAR(256) default NULL,
2014-01-07 20:32:12 +00:00
--value="http://myauthserver.com/listener_joined.php"
2014-01-10 21:03:33 +00:00
listener_add VARCHAR(256) default NULL,
2014-01-07 20:32:12 +00:00
--value="http://myauthserver.com/listener_left.php"
2014-01-10 21:03:33 +00:00
listener_remove VARCHAR(256) default NULL,
2014-01-07 20:32:12 +00:00
-- value="user"
2014-01-10 21:03:33 +00:00
username VARCHAR(64) default NULL,
2014-01-07 20:32:12 +00:00
-- value="pass"
2014-01-10 21:03:33 +00:00
password VARCHAR(64) default NULL,
2014-01-07 20:32:12 +00:00
-- value="icecast-auth-user: 1"
2014-01-10 21:03:33 +00:00
auth_header VARCHAR(64) default NULL,
2014-01-07 20:32:12 +00:00
-- value="icecast-auth-timelimit:"
2014-01-10 21:03:33 +00:00
timelimit_header VARCHAR(64) default NULL,
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_mounts (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
-- eg/example-complex.ogg
2014-01-10 21:03:33 +00:00
mount_name VARCHAR(128) UNIQUE NOT NULL,
username VARCHAR(64) NOT NULL DEFAULT 'jamsource',
password VARCHAR(64) NOT NULL DEFAULT 'jamksource',
2014-01-07 20:32:12 +00:00
max_listeners INTEGER NOT NULL DEFAULT 4,
max_listener_duration INTEGER NOT NULL DEFAULT 3600,
-- dump of the stream coming through on this mountpoint.
-- eg /tmp/dump-example1.ogg
2014-01-10 21:03:33 +00:00
dump_file VARCHAR(256) DEFAULT NULL,
2014-01-07 20:32:12 +00:00
-- intro music to play
-- This optional value specifies a mountpoint that clients are automatically moved to
-- if the source shuts down or is not streaming at the time a listener connects.
2014-01-10 21:03:33 +00:00
intro VARCHAR(256) NOT NULL DEFAULT '/intro.ogg',
fallback_mount VARCHAR(256) NOT NULL DEFAULT '/sourcedown.ogg',
2014-01-07 20:32:12 +00:00
-- When enabled, this allows a connecting source client or relay on this mountpoint
-- to move listening clients back from the fallback mount.
fallback_override INTEGER DEFAULT 1,
-- When set to 1, this will cause new listeners, when the max listener count for the mountpoint
-- has been reached, to move to the fallback mount if there is one specified.
fallback_when_full INTEGER DEFAULT 1,
--For non-Ogg streams like MP3, the metadata that is inserted into the stream often
-- has no defined character set.
2014-01-10 21:03:33 +00:00
charset VARCHAR(256) NOT NULL DEFAULT 'ISO8859-1',
2014-01-07 20:32:12 +00:00
-- possilble values are -1, 0, 1
2014-01-10 21:03:33 +00:00
-- real name is public but this is reserved word in ruby
publicc INTEGER DEFAULT 1,
2014-01-07 20:32:12 +00:00
2014-01-10 21:03:33 +00:00
stream_name VARCHAR(256) NOT NULL DEFAULT 'My Jamkazam Audio Stream',
stream_description VARCHAR(256) NOT NULL DEFAULT 'My JK audio description',
2014-01-07 20:32:12 +00:00
-- direct to user page
2014-01-10 21:03:33 +00:00
stream_url VARCHAR(256) NOT NULL DEFAULT 'http://wwww.jamakazam.com#user_id',
2014-01-07 20:32:12 +00:00
-- get this from the session info
2014-01-10 21:03:33 +00:00
genre VARCHAR(64) NOT NULL DEFAULT 'Unknown',
2014-01-07 20:32:12 +00:00
bitrate integer NOT NULL default 92,
2014-01-10 21:03:33 +00:00
-- real name is type but this is reserved name in ruby
mtype VARCHAR(64) NOT NULL DEFAULT 'application/ogg' ,
subtype VARCHAR(64) NOT NULL DEFAULT 'vorbis',
2014-01-07 20:32:12 +00:00
-- Enable this to prevent this mount from being shown on the xsl pages.
-- This is mainly for cases where a local relay is configured and you do
-- not want the source of the local relay to be shown
hidden INTEGER DEFAULT 1,
-- This optional setting allows for providing a burst size which overrides the
-- default burst size as defined in limits. The value is in bytes.
burst_size INTEGER DEFAULT 65536,
mp3_metadata_interval INTEGER DEFAULT 4096,
--called when the source connects or disconnects. The scripts are called with the name of the mount
2014-01-10 21:03:33 +00:00
on_connect VARCHAR(256) DEFAULT '/home/icecast/bin/source-start',
on_disconnect VARCHAR(256) DEFAULT '/home/icecast/bin/source-end',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
2014-01-10 21:03:33 +00:00
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
2014-01-07 20:32:12 +00:00
);
create table icecast_paths (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
2014-01-10 21:03:33 +00:00
basedir VARCHAR(256) NOT NULL DEFAULT './',
logdir VARCHAR(256) NOT NULL DEFAULT './logs',
pidfile VARCHAR(256) NOT NULL DEFAULT './icecast.pid',
webroot VARCHAR(256) NOT NULL DEFAULT './web',
adminroot VARCHAR(256) NOT NULL DEFAULT './admin',
allow_ip VARCHAR(256) NOT NULL DEFAULT '/path/to/ip_allowlist',
deny_ip VARCHAR(256) NOT NULL DEFAULT '/path_to_ip_denylist',
--real name is alias but alias is reserved in ruby
aliass VARCHAR(256) DEFAULT 'source="/foo" dest="/bar"',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create table icecast_loggings (
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
2014-01-10 21:03:33 +00:00
accesslog VARCHAR(256) NOT NULL DEFAULT 'access.log',
errorlog VARCHAR(256) NOT NULL DEFAULT 'error.log',
playlistlog VARCHAR(256) NOT NULL DEFAULT 'playlist.log',
2014-01-07 20:32:12 +00:00
-- 4 Debug, 3 Info, 2 Warn, 1 Error
loglevel INTEGER NOT NULL DEFAULT 4 ,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
2014-01-10 21:03:33 +00:00
create table icecast_securities (
2014-01-07 20:32:12 +00:00
id VARCHAR(64) PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
chroot INTEGER NOT NULL DEFAULT 0,
2014-01-10 21:03:33 +00:00
changeowner_user VARCHAR(64) DEFAULT 'nobody',
changeowner_group VARCHAR(64) DEFAULT 'nogroup',
2014-01-07 20:32:12 +00:00
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create TABLE icecast_servers(
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
icecast_limit_id VARCHAR(64) REFERENCES icecast_limits(id)
-- configs
-- mounts
);