-
Notifications
You must be signed in to change notification settings - Fork 0
StoKa TV
Ruben Horn edited this page Jan 28, 2023
·
6 revisions
A TV application for displaying images and ads in the StoKa.
The code is available in this repository.
- Create a deployment with
podman-compose -f deployment-compose.yaml up --build -d
.
(Before logging out you might need to runloginctl enable-linger $UID
to avoid the container being stopped.) - Remove a deployment with
podman-compose -f deployment-compose.yaml down
. - To check if the app is ready, you can check if the ports 3100, 3101 and 3102 are open using
sudo netstat -tulpna | grep LISTEN
. - If you change the nginx config, you should run
sudo nginx -s reload
.
The following modified files were used to cerate for the deployment.
(This file should be placed in /etc/nginx/sites-enabled/stoka-tv.conf
.)
server {
server_name stoka-tv.storm.vu;
listen 80;
listen [::]:80;
location /.well-known {
root /usr/share/nginx/html/;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
server_name stoka-tv.storm.vu;
listen [::]:443 ssl http2; # managed by Certbot
listen 443 ssl http2;
location /.well-known {
root /usr/share/nginx/html/;
}
location / {
access_log off;
expires 1h;
proxy_pass http://localhost:3101;
}
location /api {
access_log off;
expires 1h;
proxy_pass http://localhost:3100;
}
location /admin {
proxy_pass http://localhost:3102/;
}
ssl_certificate <REDACTED>;
ssl_certificate_key <REDACTED>;
}
# Deployment compose file:
version: '3.8'
volumes:
media:
services:
admin:
hostname: admin
image: filegator/filegator
restart: unless-stopped
volumes:
- media:/var/www/filegator/repository
# Persist configuration (credentials, etc.)
- /var/www/filegator/private
ports:
- 3102:8080
backend:
hostname: backend
restart: always
volumes:
- media:/srv/media:ro
build:
context: ./backend
environment:
- NODE_ENV=production
- DEBUG=""
command: [ npm, run, start ]
ports:
- 3100:8080
frontend:
depends_on:
- backend
hostname: frontend
restart: always
build:
context: ./frontend
ports:
- 3101:80
(
- Get root_folder_id from a Google Drive URL (https://drive.google.com/drive/u/0/folders/<root_folder_id>)
- Follow the rclone documentation to create a service account file in the Google Cloud console and download the private key as a JSON file.
- Set up a new entry in the rclone configuration file.
[google-drive-stoka-tv]
type = drive
scope = drive
root_folder_id = <root_folder_id>
service_account_file = <path/to/service_account_file.json>
- Add a new CRON job that runs every five minutes by running
crontab -e
and adding the following line using the email address of the corresponding Google Drive accounts:
# */5 * * * * rclone sync google-drive-stoka-tv: ~/stoka-tv-media --drive-impersonate <REDACTED>
Slackbot [4 days ago] STORM!