-
Notifications
You must be signed in to change notification settings - Fork 22
/
firstrun.sh
35 lines (27 loc) · 1.59 KB
/
firstrun.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
chmod 777 -R /etc/airtime/
service apache2 restart
# Wait a moment for apache to do it's thing..
sleep 5
# Configure (This is the same as running in the web-ui)
IP="127.0.0.1"
# Database - Variables are mapped in via Docker Compose environment variables...
curl -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
--data "dbUser=$POSTGRES_USER&dbPass=$POSTGRES_PASSWORD&dbName=$POSTGRES_DB_NAME&dbHost=libretime-postgres&dbErr=" \
"http://${IP}/setup/setup-functions.php?obj=DatabaseSetup"
# RabbitMQ - Variables are mapped in via Docker Compose environment variables...
curl -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
--data "rmqUser=$RABBITMQ_DEFAULT_USER&rmqPass=$RABBITMQ_DEFAULT_PASS&rmqHost=libretime-rabbitmq&rmqPort=5672&rmqVHost=$RABBITMQ_DEFAULT_VHOST&rmqErr=" \
"http://${IP}/setup/setup-functions.php?obj=RabbitMQSetup"
# Web Interface
curl -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
--data "generalHost=$EXTERNAL_HOSTNAME&generalPort=80&generalErr=" \
"http://${IP}/setup/setup-functions.php?obj=GeneralSetup"
# Media Settings
curl -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
--data 'mediaFolder=%2Fexternal-media%2F&mediaErr=' \
"http://${IP}/setup/setup-functions.php?obj=MediaSetup"