Commit 2a755393 authored by Deamos's avatar Deamos

Restructured To Allow for Easy Upgrades via Git

parent 63151319

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -46,7 +46,7 @@ RUN set -x ; \
# Configure NGINX
RUN cd /..
ADD nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
ADD setup/nginx /usr/local/nginx/conf/nginx.conf
# Establish the Video and Image Directories
RUN mkdir /var/www && \
......@@ -66,14 +66,14 @@ RUN apk add python2 \
uwsgi-python
# Install OSP Dependancies
ADD requirements.txt /tmp/requirements.txt
ADD setup/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
# Upgrade PIP
RUN pip install --upgrade pip
# Make OSP Install Directory
ADD flask-nginx-rtmp-mgmt/ /opt/osp/
ADD * /opt/osp/
RUN chown -R www-data:www-data /opt/osp
# Setup FFMPEG for recordings and Thumbnails
......@@ -85,7 +85,7 @@ RUN cp /opt/osp/conf/config.py.dist /opt/osp/conf/config.py
# Install Supervisor
RUN apk add supervisor
RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD setup/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
VOLUME ["/var/www", "/usr/local/nginx/conf", "/opt/osp/db", "/opt/osp/conf"]
......
......@@ -46,16 +46,16 @@ And OSP itself is open source with a [public repository](https://gitlab.com/Deam
OSP has only been tested on Ubuntu 16.04 and the installation script may not work properly on other OS's.
Clone the Gitlab Repo
```sh
```
git clone https://gitlab.com/Deamos/flask-nginx-rtmp-manager.git
```
Chmod setup-osp.sh to be Executable.
```sh
cd flask-nginx-rtmp-manager
```
cd flask-nginx-rtmp-manager/setup
chmod +x setup-osp.sh
```
Run the install script
```sh
```
sudo ./setup-osp.sh
```
......@@ -64,12 +64,12 @@ The installation script will install the files in the following location:
* **OSP Files**: /opt/osp
Rename the Configuration File
```sh
```
cd /opt/osp/conf
sudo mv config.py.dist config.py
```
Edit the Default Values in the Configuration File
```sh
```
vi config.py
```
Change the following values from their Default:
......@@ -78,7 +78,7 @@ Change the following values from their Default:
* passwordSalt - Flask Security uses this value for Salting User Passwords, change this!
Restart the OSP service
```sh
```
sudo systemctl restart osp
```
Open a Web Browser and configure OSP
......@@ -126,23 +126,18 @@ To use an authenticated endpoint, ensure you are adding 'X-API-KEY':'\<Your API
## Upgrading
### Standard Upgrade
* Backup your Database File: **If you do not make a backup, it will be overwritten by the default**
* Backup your Database File:
```
cp /opt/osp/db/database.db /opt/osp/db/database.bak
```
* Clone the Git Repo to a temporary location
* Perform a Git Pull
```
cd /tmp
git clone https://gitlab.com/Deamos/flask-nginx-rtmp-manager.git
```
* Rerun the setup-osp.sh script
```
chmod +x setup-osp.sh
sudo ./setup-osp.sh
cd /opt/osp
sudo git pull
```
* Copy your backup script over the default DB
* Reset Ownership of OSP back to www-data
```
cp /opt/osp/db/database.bak /opt/osp/db/database.db
sudo chown -R www-data:www-data /opt/osp
```
* Restart the OSP Service
```
......@@ -166,7 +161,6 @@ sudo service osp restart
- /ban <username> - Bans a user from chatting in a chat room
- /unban <username> - Unbans a user who has been banned
License
----
......
......@@ -70,7 +70,7 @@ class api_1_ListChannels(Resource):
if requestAPIKey != None:
if requestAPIKey.isValid():
args = channelParserPost.parse_args()
newChannel = Channel.Channel(int(requestAPIKey.userID),str(uuid.uuid4()),args['channelName'],int(args['topicID']),args['recordEnabled'],args['chatEnabled'])
newChannel = Channel.Channel(int(requestAPIKey.userID), str(uuid.uuid4()), args['channelName'], int(args['topicID']), args['recordEnabled'], args['chatEnabled'])
db.session.add(newChannel)
db.session.commit()
......
This diff is collapsed.
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
This diff is collapsed.
alpha-3/feature/authenticated-api-v1
\ No newline at end of file
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
......@@ -24,16 +24,16 @@ sudo make install
# Grab Configuration
#cd /tmp
#wget "https://gitlab.com/Deamos/nginx-rtmp-server/raw/master/nginx.conf"
cd $cwd/nginx
cd $cwd/setup/nginx
sudo cp nginx.conf /usr/local/nginx/conf/nginx.conf
# Enable SystemD
cd $cwd/nginx
cd $cwd/setup/nginx
sudo cp nginx.service /lib/systemd/system/nginx.service
sudo systemctl daemon-reload
sudo systemctl enable nginx.service
cd $cwd/gunicorn
cd $cwd/setup/gunicorn
sudo cp osp.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable osp.service
......@@ -53,7 +53,7 @@ sudo chown -R www-data:www-data live-rec
sudo mkdir images
sudo chown -R www-data:www-data images
cd $cwd/flask-nginx-rtmp-mgmt
cd $cwd
sudo cp -R * /opt/osp
sudo chown -R www-data:www-data /opt/osp
......