set init script

This commit is contained in:
deflax 2024-01-04 22:57:03 +02:00
parent ec42d02654
commit 141e31bc44
3 changed files with 32 additions and 11 deletions

View file

@ -1,3 +1,9 @@
# Television # Television
Multi channel stream setup with Flask REST API for scheduling channels. Multi channel stream setup with Flask REST API for scheduling channels.
1. run `./init.sh` to prepare data directories and generate self signed certs to bootstrap the load balancer
2. `cp variables.env.dist variables.env` and set the required variables
3. run `./renew-certificates.sh` periodically to generate/update the certificates
4. run the docker-compose stack using `docker-compose up -d --build --remove-orphans`
5. access the admin panel at `https://stream.example.com/ui`

View file

@ -1,11 +0,0 @@
#!/bin/bash
mkdir -p data/certificates
cd data/certificates
openssl genrsa -out default.key 2048
openssl req -new -key default.key -out default.csr
openssl x509 -req -days 3650 -in default.csr -signkey default.key -out default.crt
cat default.key default.crt >> default.pem
rm default.key
rm default.csr
rm default.crt

26
init.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
echo "creating data dir structure"
mkdir -v -p data/restreamer/config
mkdir -v -p data/restreamer/data
mkdir -v -p data/recorder/vod
mkdir -v -p data/recorder/live
mkdir -v -p data/archive
mkdir -v -p data/certbot/etc
mkdir -v -p data/certbot/var
mkdir -v -p logs/certbot
mkdir -v -p data/certificates
echo "generating self signed certificates for haproxy bootstrap"
cd data/certificates
openssl genrsa -out default.key 2048
openssl req -new -key default.key -out default.csr
openssl x509 -req -days 3650 -in default.csr -signkey default.key -out default.crt
cat default.key default.crt >> default.pem
rm default.key
rm default.csr
rm default.crt