Remove SHOUTcast in default installations and provide a manual installer in the admin UI.

This commit is contained in:
Buster "Silver Eagle" Neece 2018-09-27 12:29:05 -05:00
parent d8daf9da9d
commit 38f8527a82
17 changed files with 297 additions and 108 deletions

View File

@ -39,6 +39,8 @@ if (APP_INSIDE_DOCKER) {
define('APP_APPLICATION_ENV', $_ENV['application_env'] ?? $_ENV['APPLICATION_ENV'] ?? 'production');
define('APP_IN_PRODUCTION', APP_APPLICATION_ENV === 'production');
define('APP_DOCKER_REVISION', $_ENV['AZURACAST_DC_REVISION'] ?? 1);
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$_SERVER['HTTPS'] = (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https');
}

View File

@ -52,6 +52,11 @@ return [
'icon' => 'zmdi zmdi-format-list-bulleted',
'permission' => 'administer custom fields',
],
__('Install SHOUTcast') => [
'url' => 'admin:install:shoutcast',
'icon' => 'zmdi zmdi-upload',
'permission' => 'administer all',
],
],
],
];
];

View File

@ -0,0 +1,38 @@
<?php
return [
'method' => 'post',
'enctype' => 'multipart/form-data',
'elements' => [
'details' => [
'markup',
[
'label' => __('Important Notes'),
'markup' => __('<p>SHOUTcast 2 DNAS is not free software, and its restrictive license does not allow AzuraCast to distribute the SHOUTcast binary. In order to install SHOUTcast, you should download the Linux x64 binary from the <a href="%s" target="_blank">SHOUTcast Radio Manager</a> web site. Upload the <code>sc_serv2_linux_x64-latest.tar.gz</code> into the field below to automatically extract it into the proper directory.</p>', 'https://radiomanager.shoutcast.com/register/serverSoftwareFreemium'),
]
],
'binary' => [
'file',
[
'label' => __('Select SHOUTcast 64-bit .tar.gz File'),
'required' => true,
'type' => [
'application/x-gzip',
'application/tar+gzip',
'application/octet-stream',
],
]
],
'submit' => [
'submit',
[
'type' => 'submit',
'label' => __('Upload'),
'class' => 'ui-button btn-lg btn-primary',
]
],
],
];

View File

@ -2,13 +2,13 @@
use App\Entity\Station;
use App\Radio\Adapters;
$frontends = Adapters::listFrontendAdapters();
$frontends = Adapters::listFrontendAdapters(true);
$frontend_types = [];
foreach ($frontends as $adapter_nickname => $adapter_info) {
$frontend_types[$adapter_nickname] = $adapter_info['name'];
}
$backends = Adapters::listBackendAdapters();
$backends = Adapters::listBackendAdapters(true);
$backend_types = [];
foreach ($backends as $adapter_nickname => $adapter_info) {
$backend_types[$adapter_nickname] = $adapter_info['name'];

View File

@ -14,6 +14,13 @@ return function(\Slim\App $app)
->setName('admin:index:sync')
->add([Middleware\Permissions::class, 'administer all']);
$this->group('/install', function () {
$this->map(['GET', 'POST'], '/shoutcast', Controller\Admin\Install\ShoutcastController::class)
->setName('admin:install:shoutcast');
})->add([Middleware\Permissions::class, 'administer all']);
$this->group('/api', function () {
$this->get('', Controller\Admin\ApiController::class.':indexAction')

View File

@ -4,7 +4,7 @@ services:
web:
image: azuracast/azuracast_web:latest
build:
context: ../docker-azuracast-web
context: ./util/docker/web
depends_on:
- mariadb
- influxdb
@ -18,11 +18,12 @@ services:
MYSQL_PASSWORD: "azur4c457" # ^
MYSQL_DATABASE: "azuracast" # ^
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
AZURACAST_DC_REVISION: 2 # Only modified when this Docker Compose file has changed.
AZURACAST_DC_REVISION: 3 # Only modified when this Docker Compose file has changed.
volumes:
- .:/var/azuracast/www
- tmp_data:/var/azuracast/www_tmp
- station_data:/var/azuracast/stations
- shoutcast2_install:/var/azuracast/servers/shoutcast2
init: true
restart: always
@ -121,9 +122,9 @@ services:
stations:
container_name: azuracast_stations
image: azuracast/azuracast_stations:latest
image: azuracast/azuracast_radio:latest
build:
context: ../docker-azuracast-stations
context: ../docker-azuracast-radio
ports:
- '8000:8000'
- '8005:8005'
@ -143,6 +144,7 @@ services:
volumes:
- station_data:/var/azuracast/stations
- nginx_letsencrypt_certs:/etc/nginx/ssl:ro
- shoutcast2_install:/var/azuracast/servers/shoutcast2
init: true
restart: always
@ -168,10 +170,17 @@ services:
ports:
- "127.0.0.1:8081:8081"
blackfire:
image: blackfire/blackfire
environment:
BLACKFIRE_SERVER_ID: ""
BLACKFIRE_SERVER_TOKEN: ""
volumes:
nginx_letsencrypt_certs: {}
nginx_letsencrypt_www: {}
db_data: {}
influx_data: {}
station_data: {}
shoutcast2_install: {}
tmp_data: {}

View File

@ -16,11 +16,12 @@ services:
MYSQL_PASSWORD: "azur4c457" # ^
MYSQL_DATABASE: "azuracast" # ^
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
AZURACAST_DC_REVISION: 2 # Only modified when this Docker Compose file has changed.
AZURACAST_DC_REVISION: 3 # Only modified when this Docker Compose file has changed.
volumes:
- www_data:/var/azuracast/www
- tmp_data:/var/azuracast/www_tmp
- station_data:/var/azuracast/stations
- shoutcast2_install:/var/azuracast/servers/shoutcast2
init: true
restart: always
@ -100,7 +101,7 @@ services:
stations:
container_name: azuracast_stations
image: azuracast/azuracast_stations:latest
image: azuracast/azuracast_radio:latest
ports:
# Uncomment the line below to expose the full range of available station ports.
# Note: This is not recommended currently due to performance and memory usage problems with Docker.
@ -134,6 +135,7 @@ services:
- '8096:8096'
volumes:
- station_data:/var/azuracast/stations
- shoutcast2_install:/var/azuracast/servers/shoutcast2
- nginx_letsencrypt_certs:/etc/nginx/ssl:ro
init: true
restart: always
@ -144,5 +146,6 @@ volumes:
db_data: {}
influx_data: {}
station_data: {}
shoutcast2_install: {}
www_data: {}
tmp_data: {}

View File

@ -7,8 +7,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-09-11T04:40:33+00:00\n"
"PO-Revision-Date: 2018-09-11T04:40:33+00:00\n"
"POT-Creation-Date: 2018-09-27T17:24:43+00:00\n"
"PO-Revision-Date: 2018-09-27T17:24:43+00:00\n"
"Language: \n"
#: /var/azuracast/www/src/Controller/Admin/ApiController.php:54
@ -76,7 +76,7 @@ msgstr ""
#: /var/azuracast/www/src/Controller/Admin/UsersController.php:110
#: /var/azuracast/www/src/Controller/Frontend/ApiKeysController.php:118
#: /var/azuracast/www/src/Controller/Stations/MountsController.php:132
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:419
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:421
#: /var/azuracast/www/src/Controller/Stations/RemotesController.php:114
#: /var/azuracast/www/src/Controller/Stations/StreamersController.php:135
#: /var/azuracast/www/src/Controller/Stations/WebhooksController.php:219
@ -141,6 +141,11 @@ msgstr ""
msgid "Sync Task Output"
msgstr ""
#: /var/azuracast/www/src/Controller/Admin/Install/ShoutcastController.php:67
#: /var/azuracast/www/config/admin/dashboard.php:55
msgid "Install SHOUTcast"
msgstr ""
#: /var/azuracast/www/src/Controller/Admin/PermissionsController.php:101
#: /var/azuracast/www/src/Controller/Admin/PermissionsController.php:109
#: /var/azuracast/www/src/Controller/Admin/PermissionsController.php:127
@ -200,38 +205,38 @@ msgid "Logged in successfully."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:64
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:115
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:184
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:117
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:188
msgid "%s restarted."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:96
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:102
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:115
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:98
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:104
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:117
msgid "Frontend"
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:96
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:165
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:98
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:169
msgid "%s stopped."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:102
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:171
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:104
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:175
msgid "%s started."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:151
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:155
msgid "Song skipped."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:159
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:163
msgid "Streamer disconnected."
msgstr ""
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:165
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:171
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:184
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:169
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:175
#: /var/azuracast/www/src/Controller/Api/Stations/ServicesController.php:188
msgid "Backend"
msgstr ""
@ -277,7 +282,7 @@ msgstr ""
msgid "Edit Profile"
msgstr ""
#: /var/azuracast/www/src/Controller/Frontend/PublicController.php:38
#: /var/azuracast/www/src/Controller/Frontend/PublicController.php:37
msgid "Station not found!"
msgstr ""
@ -352,7 +357,7 @@ msgstr ""
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:223
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:303
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:310
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:419
#: /var/azuracast/www/src/Controller/Stations/PlaylistsController.php:421
#: /var/azuracast/www/resources/templates/frontend/public/index.phtml:46
#: /var/azuracast/www/resources/templates/stations/playlists/index.phtml:14
#: /var/azuracast/www/resources/templates/stations/playlists/index.phtml:15
@ -382,8 +387,8 @@ msgstr ""
#: /var/azuracast/www/config/forms/song.php:33
#: /var/azuracast/www/resources/templates/frontend/public/index.phtml:112
#: /var/azuracast/www/resources/templates/frontend/public/player_component.phtml:8
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:26
#: /var/azuracast/www/resources/templates/stations/reports/timeline.phtml:40
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:26
msgid "Song Title"
msgstr ""
@ -404,6 +409,10 @@ msgstr ""
msgid "Remote Relay"
msgstr ""
#: /var/azuracast/www/src/Controller/Stations/Reports/SoundExchangeController.php:172
msgid "SoundExchange Report"
msgstr ""
#: /var/azuracast/www/src/Controller/Stations/StreamersController.php:54
msgid "Streamers enabled!"
msgstr ""
@ -463,17 +472,17 @@ msgstr ""
msgid "You do not have permission to access this portion of the site."
msgstr ""
#: /var/azuracast/www/src/Radio/Adapters.php:148
#: /var/azuracast/www/src/Radio/Adapters.php:152
#: /var/azuracast/www/src/Radio/Adapters.php:181
#: /var/azuracast/www/src/Radio/Adapters.php:137
#: /var/azuracast/www/src/Radio/Adapters.php:141
#: /var/azuracast/www/src/Radio/Adapters.php:172
msgid "Use <b>%s</b> on this server"
msgstr ""
#: /var/azuracast/www/src/Radio/Adapters.php:156
#: /var/azuracast/www/src/Radio/Adapters.php:145
msgid "Connect to a <b>remote radio server</b>"
msgstr ""
#: /var/azuracast/www/src/Radio/Adapters.php:185
#: /var/azuracast/www/src/Radio/Adapters.php:176
msgid "<b>Do not use</b> an AutoDJ service"
msgstr ""
@ -657,7 +666,7 @@ msgid "System Maintenance"
msgstr ""
#: /var/azuracast/www/config/admin/dashboard.php:15
#: /var/azuracast/www/resources/templates/admin/branding/index.phtml:1
#: /var/azuracast/www/resources/templates/admin/branding/index.phtml:8
msgid "Custom Branding"
msgstr ""
@ -720,7 +729,7 @@ msgstr ""
#: /var/azuracast/www/config/forms/station.php:62
#: /var/azuracast/www/config/forms/station.php:75
#: /var/azuracast/www/config/forms/station.php:107
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:51
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:47
#: /var/azuracast/www/resources/templates/stations/playlists/index.phtml:81
#: /var/azuracast/www/resources/templates/stations/profile/index.phtml:134
#: /var/azuracast/www/resources/templates/stations/profile/index.phtml:147
@ -732,7 +741,7 @@ msgstr ""
#: /var/azuracast/www/config/forms/automation.php:15
#: /var/azuracast/www/config/forms/station.php:63
#: /var/azuracast/www/config/forms/station.php:76
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:49
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:45
#: /var/azuracast/www/resources/templates/stations/profile/index.phtml:127
#: /var/azuracast/www/resources/templates/stations/profile/index.phtml:144
#: /var/azuracast/www/resources/templates/stations/remotes/index.phtml:42
@ -901,6 +910,23 @@ msgstr ""
msgid "Optionally specify an API-friendly name, such as <code>field_name</code>. Leave this field blank to automatically create one based on the name."
msgstr ""
#: /var/azuracast/www/config/forms/install_shoutcast.php:11
#: /var/azuracast/www/config/forms/report_soundexchange.php:10
msgid "Important Notes"
msgstr ""
#: /var/azuracast/www/config/forms/install_shoutcast.php:12
msgid "<p>SHOUTcast 2 DNAS is not free software, and its restrictive license does not allow AzuraCast to distribute the SHOUTcast binary. In order to install SHOUTcast, you should download the Linux x64 binary from the <a href=\"%s\" target=\"_blank\">SHOUTcast Radio Manager</a> web site. Upload the <code>sc_serv2_linux_x64-latest.tar.gz</code> into the field below to automatically extract it into the proper directory.</p>"
msgstr ""
#: /var/azuracast/www/config/forms/install_shoutcast.php:19
msgid "Select SHOUTcast 64-bit .tar.gz File"
msgstr ""
#: /var/azuracast/www/config/forms/install_shoutcast.php:33
msgid "Upload"
msgstr ""
#: /var/azuracast/www/config/forms/login.php:9
#: /var/azuracast/www/config/forms/profile.php:24
#: /var/azuracast/www/config/forms/register.php:13
@ -1218,7 +1244,7 @@ msgid "Play once per day at the specified time. Useful for timely reminders."
msgstr ""
#: /var/azuracast/www/config/forms/playlist.php:119
#: /var/azuracast/www/resources/templates/system/form_page.js.phtml:37
#: /var/azuracast/www/resources/templates/system/form_edit.js.phtml:43
msgid "Advanced"
msgstr ""
@ -1483,10 +1509,6 @@ msgstr ""
msgid "If you are broadcasting using AutoDJ, enter the source password here."
msgstr ""
#: /var/azuracast/www/config/forms/report_soundexchange.php:10
msgid "Important Notes"
msgstr ""
#: /var/azuracast/www/config/forms/report_soundexchange.php:38
msgid "Report Start Date"
msgstr ""
@ -1522,7 +1544,7 @@ msgstr ""
#: /var/azuracast/www/resources/templates/stations/playlists/index.phtml:38
#: /var/azuracast/www/resources/templates/stations/remotes/index.phtml:24
#: /var/azuracast/www/resources/templates/stations/reports/duplicates.phtml:23
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:28
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:28
#: /var/azuracast/www/resources/templates/stations/streamers/index.phtml:23
#: /var/azuracast/www/resources/templates/stations/webhooks/index.phtml:24
msgid "Actions"
@ -2065,10 +2087,10 @@ msgstr ""
#: /var/azuracast/www/config/forms/webhook/generic.php:13
msgid ""
"Web hooks automatically send a HTTP POST request to the URL you specify to \n"
" notify it any time one of the triggers you specify occurs on your station. The body of the POST message\n"
" is the exact same as the <a href=\"%s\" target=\"_blank\">Now Playing API response</a> for your station. \n"
" In order to process quickly, web hooks have a short timeout, so the responding service should be\n"
"Web hooks automatically send a HTTP POST request to the URL you specify to \n"
" notify it any time one of the triggers you specify occurs on your station. The body of the POST message \n"
" is the exact same as the <a href=\"%s\" target=\"_blank\">Now Playing API response</a> for your station. \n"
" In order to process quickly, web hooks have a short timeout, so the responding service should be \n"
" optimized to handle the request in under 2 seconds."
msgstr ""
@ -2283,7 +2305,7 @@ msgstr ""
#: /var/azuracast/www/resources/templates/stations/playlists/index.phtml:64
#: /var/azuracast/www/resources/templates/stations/remotes/index.phtml:35
#: /var/azuracast/www/resources/templates/stations/reports/duplicates.phtml:33
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:53
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:53
#: /var/azuracast/www/resources/templates/stations/streamers/index.phtml:35
#: /var/azuracast/www/resources/templates/stations/webhooks/index.phtml:37
msgid "Delete"
@ -2298,6 +2320,15 @@ msgstr ""
msgid "%s ago"
msgstr ""
#: /var/azuracast/www/resources/templates/admin/install_shoutcast/installed.phtml:1
#: /var/azuracast/www/resources/templates/admin/install_shoutcast/installed.phtml:5
msgid "SHOUTcast is Installed"
msgstr ""
#: /var/azuracast/www/resources/templates/admin/install_shoutcast/installed.phtml:9
msgid "The SHOUTcast 2 DNAS is already installed."
msgstr ""
#: /var/azuracast/www/resources/templates/admin/permissions/index.phtml:24
msgid "Per-Station Permissions"
msgstr ""
@ -2567,24 +2598,24 @@ msgstr ""
msgid "Pause"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:1
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:4
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:2
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:6
msgid "Automated Playlist Assignment"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:7
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:9
msgid "Based on the previous performance of your station's songs, %s can automatically distribute songs evenly among your playlists, placing the highest performing songs in the highest-weighted playlists."
msgstr ""
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:9
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:11
msgid "Once you have configured automated assignment, click the button below to run the automated assignment process. This process will not run at all unless you have selected \"Enable\" below."
msgstr ""
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:11
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:13
msgid "Run Automated Assignment"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:17
#: /var/azuracast/www/resources/templates/stations/automation/index.phtml:19
msgid "Configure Automated Assignment"
msgstr ""
@ -2758,7 +2789,7 @@ msgstr ""
msgid "AutoDJ"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:44
#: /var/azuracast/www/resources/templates/stations/mounts/index.phtml:40
msgid "Default Mount"
msgstr ""
@ -2864,8 +2895,8 @@ msgid "Disconnect Streamer"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/profile/index.phtml:124
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:1
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:11
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:1
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:11
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:83
msgid "Song Requests"
msgstr ""
@ -3092,6 +3123,22 @@ msgstr ""
msgid "Ratio"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:24
msgid "Date Requested"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:25
msgid "Date Played"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:27
msgid "Requester IP"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/reports/requests.phtml:39
msgid "Not Played"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/reports/restricted.phtml:1
#: /var/azuracast/www/resources/templates/stations/reports/restricted.phtml:5
msgid "Report Not Available"
@ -3123,22 +3170,6 @@ msgstr ""
msgid "Live Broadcast"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:24
msgid "Date Requested"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:25
msgid "Date Played"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:27
msgid "Requester IP"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/requests/index.phtml:39
msgid "Not Played"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:19
msgid "<b>Ready to Broadcast?</b><br>Click to Start Station"
msgstr ""
@ -3167,19 +3198,23 @@ msgstr ""
msgid "Duplicate Songs"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:95
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:91
msgid "SoundExchange Royalties"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:98
msgid "Utilities"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:99
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:102
msgid "Automated Assignment"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:102
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:105
msgid "Restart Broadcasting"
msgstr ""
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:117
#: /var/azuracast/www/resources/templates/stations/sidebar.phtml:120
msgid "Please wait..."
msgstr ""
@ -3269,11 +3304,11 @@ msgstr ""
msgid "Test"
msgstr ""
#: /var/azuracast/www/resources/templates/system/form_page.js.phtml:50
#: /var/azuracast/www/resources/templates/system/form_page.js.phtml:51
#: /var/azuracast/www/resources/templates/system/form_edit.js.phtml:13
#: /var/azuracast/www/resources/templates/system/form_edit.js.phtml:14
msgid "Select..."
msgstr ""
#: /var/azuracast/www/resources/templates/system/form_page.js.phtml:52
#: /var/azuracast/www/resources/templates/system/form_edit.js.phtml:15
msgid "No results found!"
msgstr ""

View File

@ -0,0 +1,11 @@
<?php $this->layout('main', ['title' => __('SHOUTcast is Installed'), 'manual' => true]) ?>
<div class="card">
<div class="card-header ch-alt">
<h2><?=__('SHOUTcast is Installed') ?></h2>
</div>
<div class="card-body card-padding">
<p><?=__('The SHOUTcast 2 DNAS is already installed.') ?></p>
</div>
</div>

View File

@ -0,0 +1,70 @@
<?php
namespace App\Controller\Admin\Install;
use App\Http\Request;
use App\Http\Response;
use App\Radio\Frontend\SHOUTcast;
use Slim\Http\UploadedFile;
class ShoutcastController
{
/** @var array */
protected $form_config;
/**
* @param array $form_config
* @see \App\Provider\AdminProvider
*/
public function __construct(array $form_config)
{
$this->form_config = $form_config;
}
public function __invoke(Request $request, Response $response): Response
{
if (SHOUTcast::isInstalled()) {
return $request
->getView()
->renderToResponse($response, 'admin/install_shoutcast/installed');
}
$form = new \AzuraForms\Form($this->form_config, []);
if ($request->isPost() && $form->isValid($_POST)) {
try
{
$sc_base_dir = dirname(APP_INCLUDE_ROOT) . '/servers/shoutcast2';
$files = $request->getUploadedFiles();
/** @var UploadedFile $import_file */
$import_file = $files['binary'];
if ($import_file->getError() === \UPLOAD_ERR_OK) {
$sc_tgz_path = $sc_base_dir.'/sc_serv.tar.gz';
$import_file->moveTo($sc_tgz_path);
$sc_tgz = new \PharData($sc_tgz_path);
$sc_tgz->decompress();
$sc_tar_path = $sc_base_dir.'/sc_serv.tar';
$sc_tar = new \PharData($sc_tar_path);
$sc_tar->extractTo($sc_base_dir);
}
return $response->withRedirect($request->getUri()->getPath());
} catch(\Exception $e) {
$form
->getField('binary')
->addError(get_class($e).': '.$e->getMessage());
}
}
return $request->getView()->renderToResponse($response, 'system/form_page', [
'form' => $form,
'render_mode' => 'edit',
'title' => __('Install SHOUTcast'),
]);
}
}

View File

@ -21,6 +21,7 @@ class Plugins
$plugins = (new Finder())
->ignoreUnreadableDirs()
->directories()
->depth('== 0')
->in($dir);
foreach($plugins as $plugin_dir) {

View File

@ -112,5 +112,14 @@ class AdminProvider implements ServiceProviderInterface
])
);
};
$di[Admin\Install\ShoutcastController::class] = function($di) {
/** @var \App\Config $config */
$config = $di[\App\Config::class];
return new Admin\Install\ShoutcastController(
$config->get('forms/install_shoutcast')
);
};
}
}

View File

@ -127,7 +127,7 @@ class Adapters
/**
* @return array
*/
public static function listFrontendAdapters(): array
public static function listFrontendAdapters($check_installed = false): array
{
static $adapters;
@ -146,8 +146,10 @@ class Adapters
'class' => Frontend\Remote::class,
],
];
}
$adapters = array_filter($adapters, function($adapter_info) {
if ($check_installed) {
return array_filter($adapters, function($adapter_info) {
/** @var \App\Radio\AdapterAbstract $adapter_class */
$adapter_class = $adapter_info['class'];
return $adapter_class::isInstalled();
@ -160,7 +162,7 @@ class Adapters
/**
* @return array
*/
public static function listBackendAdapters(): array
public static function listBackendAdapters($check_installed = false): array
{
static $adapters;
@ -175,8 +177,10 @@ class Adapters
'class' => Backend\None::class,
],
];
}
$adapters = array_filter($adapters, function ($adapter_info) {
if ($check_installed) {
return array_filter($adapters, function ($adapter_info) {
/** @var \App\Radio\AdapterAbstract $adapter_class */
$adapter_class = $adapter_info['class'];
return $adapter_class::isInstalled();

View File

@ -203,10 +203,13 @@ class SHOUTcast extends FrontendAbstract
{
$new_path = dirname(APP_INCLUDE_ROOT) . '/servers/shoutcast2/sc_serv';
if (APP_INSIDE_DOCKER || file_exists($new_path)) {
// Docker versions before 3 included the SC binary across the board.
if (APP_INSIDE_DOCKER && APP_DOCKER_REVISION < 3) {
return $new_path;
}
return false;
return file_exists($new_path)
? $new_path
: false;
}
}

View File

@ -63,25 +63,3 @@
shell: "opam init -y && opam update && opam install -y taglib.0.3.3 mad.0.4.5 faad.0.4.0 fdkaac.0.2.1 lame.0.3.3 vorbis.0.7.0 cry.0.6.0 opus.0.1.2 flac.0.1.2 liquidsoap.1.3.4"
args:
chdir: "{{ app_base }}"
- name: Download ShoutCast 2 (x86)
get_url:
url: http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux-latest.tar.gz
dest: "{{ app_base }}/servers/shoutcast2/sc_serv.tar.gz"
when: ansible_architecture == 'i386'
- name: Download ShoutCast 2 (x64)
get_url:
url: http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_x64-latest.tar.gz
dest: "{{ app_base }}/servers/shoutcast2/sc_serv.tar.gz"
when: ansible_architecture == 'x86_64'
- name: Extract ShoutCast 2 Binary
unarchive:
src: "{{ app_base }}/servers/shoutcast2/sc_serv.tar.gz"
dest: "{{ app_base }}/servers/shoutcast2"
remote_src: yes
mode: "u=rwx,g=rx,o=rx"
owner: "azuracast"
group: "www-data"
# creates: "{{ app_base }}/servers/shoutcast2/sc_serv"

View File

@ -4,3 +4,8 @@ ENV PATH="${PATH}:/var/azuracast/.composer/vendor/bin"
RUN apt-get update \
&& apt-get install -q -y php7.2-xdebug
RUN mkdir -p /tmp/blackfire \
&& curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire /usr/bin/blackfire \
&& rm -Rf /tmp/blackfire

View File

@ -0,0 +1,9 @@
FROM azuracast/azuracast_web:latest
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > /etc/php/7.2/fpm/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz