changes for running icecast (homebrew installed) server on mac os

This commit is contained in:
Nuwan 2021-10-29 15:05:56 +05:30
parent 4f98bb7644
commit 0e66242ce7
5 changed files with 10 additions and 9 deletions

View File

@ -43,10 +43,10 @@ ActiveAdmin.register_page "Bootstrap" do
admin_auth.save! admin_auth.save!
path = IcecastPath.new path = IcecastPath.new
path.base_dir = '/usr/local/Cellar/icecast/2.4.1/share/icecast' path.base_dir = '/opt/homebrew/share/icecast'
path.log_dir = '/usr/local/Cellar/icecast/2.4.1/var/log/icecast' path.log_dir = '/opt/homebrew/var/log/icecast'
path.web_root = '/usr/local/Cellar/icecast/2.4.1/share/icecast/web' path.web_root = '/opt/homebrew/share/icecast/web'
path.admin_root = '/usr/local/Cellar/icecast/2.4.1/share/icecast/admin' path.admin_root = '/opt/homebrew/share/icecast/admin'
path.pid_file = nil path.pid_file = nil
path.save! path.save!

1
ruby/.gitignore vendored
View File

@ -23,3 +23,4 @@ vendor
*.swp *.swp
*.iml *.iml
.byebug_history .byebug_history
.ruby-version

View File

@ -7,7 +7,7 @@ describe IcecastPath do
let(:builder) { ::Builder::XmlMarkup.new(:target => output, :indent => 1) } let(:builder) { ::Builder::XmlMarkup.new(:target => output, :indent => 1) }
it "save default" do it "save default" do
path.save.should be_true path.save.should be_truthy
path.dumpXml(builder) path.dumpXml(builder)
output.rewind output.rewind
@ -38,7 +38,7 @@ describe IcecastPath do
path.deny_ip = Faker::Lorem.characters(10) path.deny_ip = Faker::Lorem.characters(10)
path.alias_source = Faker::Lorem.characters(10) path.alias_source = Faker::Lorem.characters(10)
path.alias_dest = Faker::Lorem.characters(10) path.alias_dest = Faker::Lorem.characters(10)
path.save.should be_true path.save.should be_truthy
path.dumpXml(builder) path.dumpXml(builder)
output.rewind output.rewind

View File

@ -227,9 +227,9 @@ if defined?(Bundler)
config.normalize_mp3_path = ENV['NORMALIZE_MP3_PATH'] || (File.exist?('/usr/local/bin/normalize-mp3') ? '/usr/local/bin/normalize-mp3' : '/usr/bin/normalize-mp3') config.normalize_mp3_path = ENV['NORMALIZE_MP3_PATH'] || (File.exist?('/usr/local/bin/normalize-mp3') ? '/usr/local/bin/normalize-mp3' : '/usr/bin/normalize-mp3')
# if it looks like linux, use init.d script; otherwise use kill # if it looks like linux, use init.d script; otherwise use kill
config.icecast_reload_cmd = ENV['ICECAST_RELOAD_CMD'] || (File.exist?('/usr/local/bin/icecast2') ? "bash -l -c #{Shellwords.escape("sudo /etc/init.d/icecast2 reload")}" : "bash -l -c #{Shellwords.escape("kill -1 `ps -f | grep /usr/local/bin/icecast | grep -v grep | awk \'{print $2}\'`")}") config.icecast_reload_cmd = ENV['ICECAST_RELOAD_CMD'] || (File.exist?('/usr/local/bin/icecast2') ? "bash -l -c #{Shellwords.escape("sudo /etc/init.d/icecast2 reload")}" : "bash -l -c #{Shellwords.escape("kill -1 `ps -f | grep /opt/homebrew/bin/icecast | grep -v grep | awk \'{print $2}\'`")}")
# if it looks like linux, use that path; otherwise use the brew default path # if it looks like linux, use that path; otherwise use the brew default path
config.icecast_config_file = ENV['ICECAST_CONFIG_FILE'] || (File.exist?('/etc/icecast2/icecast.xml') ? '/etc/icecast2/icecast.xml' : '/usr/local/etc/icecast.xml') config.icecast_config_file = ENV['ICECAST_CONFIG_FILE'] || (File.exist?('/etc/icecast2/icecast.xml') ? '/etc/icecast2/icecast.xml' : '/opt/homebrew/etc/icecast.xml')
# this will be the qualifier on the IcecastConfigWorker queue name # this will be the qualifier on the IcecastConfigWorker queue name
config.icecast_server_id = ENV['ICECAST_SERVER_ID'] || 'localhost' config.icecast_server_id = ENV['ICECAST_SERVER_ID'] || 'localhost'
config.icecast_max_missing_check = 2 * 60 # 2 minutes config.icecast_max_missing_check = 2 * 60 # 2 minutes

View File

@ -119,5 +119,5 @@ SampleApp::Application.configure do
config.spa_origin = "http://beta.jamkazam.local:4000" config.spa_origin = "http://beta.jamkazam.local:4000"
config.session_cookie_domain = ".jamkazam.local" #config.session_cookie_domain = ".jamkazam.local"
end end