diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46096f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +package-lock.json +.DS_Store diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..2036e24 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +jsmpeg.min.js +.git +output.css diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..564f627 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,20 @@ +module.exports = { + printWidth: 100, + useTabs: true, + tabWidth: 4, + singleQuote: true, + semi: true, + trailingComma: 'all', + arrowParens: 'always', + bracketSameLine: true, + overrides: [ + { + files: '*.html', + + options: { + useTabs: false, + tabWidth: 2, + }, + }, + ], +}; diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cabce2d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["Elem", "jsmpeg", "lowerthirds", "nofailover", "rtmp"] +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..204a013 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: * + +pretty: + npx prettier --write . + shfmt -w . + +install: + sudo ./setup-nginx-docker.sh + +front: + npx nodemon server.js + +run: + docker compose up + +build: + docker compose build + +exec: + docker exec -it nginx_server bash + +dev: build run + +css: + npx tailwindcss -i ./html/css/input.css -o ./html/css/output.css --watch diff --git a/README.md b/README.md index fb0d565..7b14511 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,45 @@ +> This repository has been moved to a different account: +> [https://github.com/isha-live/MLS](https://github.com/isha-live/MLS) +> +--- + # NGINX Server -Default login/password for server is admin/nimda +The default login/password for the server is admin/nimda + +## Need to install on Ubuntu 16.04 -# Need to install on Ubuntu 16.04 Don't use Ubuntu minimal. Use the regular 16.04 image -#Steps to Install -1. On the terminal, type: cd ~ && sudo git clone git://github.com/regstuff/MLS.git && cd MLS && sudo ./install-nginx.sh -2. The install is automatic, except for the initial part where you need to choose your timezone for time and date configguration. (Note: Installation may take upto an hour on a single CPU instance) -3. Once installation is complete, on the terminal, type: sudo visudo -4. To the bottom of the file that opens up, add: www-data ALL=NOPASSWD: /bin/bash, /bin/ls -5. Ctrl+o to save the file, Ctrl+X to exit the notepad editor. This process is needed to give the NGINX server access to the shell scripting -6. If you want to allow uploading of lowerthirds from the settings page, on the terminal, type: sudo nano /etc/php/7.0/fpm/php.ini -7. Find the line ;file_uploads = On --> Usually around line 800. Ctrl+Shift+_ and type 800 to get there quick -8. Remove the semicolon in front of the line to uncomment it. -9. Ctrl+o to save the file, Ctrl+X to exit the notepad editor. -10. Optional additional step: By default, all server logs are cleared on instance boot. This will ensure hardisk space isn't consumed too much. If you wish, you can retain them. On the terminal, type: sudo nano /etc/init.d/nginxrestart.sh -11. In the editor, comment the line (Add # before it): sudo rm /usr/local/nginx/logs/*.log -12. Ctrl+o to save the file, Ctrl+X to exit the notepad editor. -13. Installation is complete +## Steps to Install + +1. On the terminal, type: + The installation is automatic, except for the initial part where you need to choose your timezone for time and date configuration. + Note: Installation may take up to an hour on a single CPU instance. +1. Once installation is complete, on the terminal, type: `sudo visudo` +1. To the bottom of the file that opens up, add: `www-data ALL=NOPASSWD: /bin/bash, /bin/ls` +1. `Ctrl+o` to save the file, `Ctrl+X` to exit the notepad editor. This process is needed to give the `NGINX` server access to the shell scripting. + +## Steps to Update + +There is no need to install large libraries if you want to just update the source code. In this case, you can run: + +```sh +sudo ./update-mls.sh +``` + +### Uploading Lowerthirds From The Settings + +1. If you want to allow uploading of lowerthirds from the settings page, on the terminal, `type: sudo nano /etc/php/7.0/fpm/php.ini` +1. Find the line `;file_uploads = On` –> Usually around line 800. `Ctrl+Shift+_` and type 800 to get there quickly. +1. Remove the semicolon in front of the line to uncomment it. +1. `Ctrl+o` to save the file, `Ctrl+X` to exit the notepad editor. + +### Optional additional step: +By default, all server logs are cleared on instance boot. This will ensure hardisk space isn't consumed too much. If you wish, you can retain them. +1. On the terminal, type: `sudo nano /etc/init.d/nginxrestart.sh` +1. In the editor, comment on the line (Add # before it): `sudo rm /usr/local/nginx/logs/*.log` +1. `Ctrl+o` to save the file, `Ctrl+X` to exit the notepad editor. +1. Installation is complete! diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a340f8e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: '3' + +services: + nginx: + image: alfg/nginx-rtmp:v1.6.0 + container_name: 'nginx-mls' + ports: + - 8080:80 + - 1935:1935 + volumes: + - ./nginx/nginx.conf:/etc/nginx/nginx.conf.template + - .:/app + depends_on: + - php + networks: + - internal + + php: + image: php:7.0-fpm-alpine + container_name: 'php-mls' + volumes: + - .:/app + networks: + - internal + +networks: + internal: + driver: bridge diff --git a/generate-config.sh b/generate-config.sh new file mode 100755 index 0000000..6b94a56 --- /dev/null +++ b/generate-config.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +truncate -s 0 blank.txt + +STREAM_NUM=$1 +OUT_NUM=$2 + +for ((i = 1; i <= STREAM_NUM; i++)); do + for ((j = 1; j <= OUT_NUM; j++)); do + output="__stream${i}__out${j}__" + echo $output >>blank.txt + done + echo "" >>blank.txt +done diff --git a/html/1.php b/html/1.php deleted file mode 100755 index cfadca5..0000000 --- a/html/1.php +++ /dev/null @@ -1,74 +0,0 @@ - - diff --git a/html/50x.html b/html/50x.html index f60f5e7..a7cb464 100755 --- a/html/50x.html +++ b/html/50x.html @@ -1,21 +1,25 @@ - + -
-Sorry, the page you are looking for is currently unavailable.
-Please try again later.
If you are the system administrator of this resource then you should check -the error log for details.
-Faithfully yours, nginx.
- + } + + + +
+ Sorry, the page you are looking for is currently unavailable.
+ Please try again later.
+
+ If you are the system administrator of this resource then you should check the + error log for details. +
+Faithfully yours, nginx.
+