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 ; \ ...@@ -46,7 +46,7 @@ RUN set -x ; \
# Configure NGINX # Configure NGINX
RUN cd /.. 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 # Establish the Video and Image Directories
RUN mkdir /var/www && \ RUN mkdir /var/www && \
...@@ -66,14 +66,14 @@ RUN apk add python2 \ ...@@ -66,14 +66,14 @@ RUN apk add python2 \
uwsgi-python uwsgi-python
# Install OSP Dependancies # Install OSP Dependancies
ADD requirements.txt /tmp/requirements.txt ADD setup/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt RUN pip install -r /tmp/requirements.txt
# Upgrade PIP # Upgrade PIP
RUN pip install --upgrade pip RUN pip install --upgrade pip
# Make OSP Install Directory # Make OSP Install Directory
ADD flask-nginx-rtmp-mgmt/ /opt/osp/ ADD * /opt/osp/
RUN chown -R www-data:www-data /opt/osp RUN chown -R www-data:www-data /opt/osp
# Setup FFMPEG for recordings and Thumbnails # Setup FFMPEG for recordings and Thumbnails
...@@ -85,7 +85,7 @@ RUN cp /opt/osp/conf/config.py.dist /opt/osp/conf/config.py ...@@ -85,7 +85,7 @@ RUN cp /opt/osp/conf/config.py.dist /opt/osp/conf/config.py
# Install Supervisor # Install Supervisor
RUN apk add supervisor RUN apk add supervisor
RUN mkdir -p /var/log/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"] 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 ...@@ -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. 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 Clone the Gitlab Repo
```sh ```
git clone https://gitlab.com/Deamos/flask-nginx-rtmp-manager.git git clone https://gitlab.com/Deamos/flask-nginx-rtmp-manager.git
``` ```
Chmod setup-osp.sh to be Executable. Chmod setup-osp.sh to be Executable.
```sh ```
cd flask-nginx-rtmp-manager cd flask-nginx-rtmp-manager/setup
chmod +x setup-osp.sh chmod +x setup-osp.sh
``` ```
Run the install script Run the install script
```sh ```
sudo ./setup-osp.sh sudo ./setup-osp.sh
``` ```
...@@ -64,12 +64,12 @@ The installation script will install the files in the following location: ...@@ -64,12 +64,12 @@ The installation script will install the files in the following location:
* **OSP Files**: /opt/osp * **OSP Files**: /opt/osp
Rename the Configuration File Rename the Configuration File
```sh ```
cd /opt/osp/conf cd /opt/osp/conf
sudo mv config.py.dist config.py sudo mv config.py.dist config.py
``` ```
Edit the Default Values in the Configuration File Edit the Default Values in the Configuration File
```sh ```
vi config.py vi config.py
``` ```
Change the following values from their Default: Change the following values from their Default:
...@@ -78,7 +78,7 @@ 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! * passwordSalt - Flask Security uses this value for Salting User Passwords, change this!
Restart the OSP service Restart the OSP service
```sh ```
sudo systemctl restart osp sudo systemctl restart osp
``` ```
Open a Web Browser and configure 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 ...@@ -126,23 +126,18 @@ To use an authenticated endpoint, ensure you are adding 'X-API-KEY':'\<Your API
## Upgrading ## Upgrading
### Standard Upgrade ### 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 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 cd /opt/osp
git clone https://gitlab.com/Deamos/flask-nginx-rtmp-manager.git sudo git pull
```
* Rerun the setup-osp.sh script
```
chmod +x setup-osp.sh
sudo ./setup-osp.sh
``` ```
* 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 * Restart the OSP Service
``` ```
...@@ -166,7 +161,6 @@ sudo service osp restart ...@@ -166,7 +161,6 @@ sudo service osp restart
- /ban <username> - Bans a user from chatting in a chat room - /ban <username> - Bans a user from chatting in a chat room
- /unban <username> - Unbans a user who has been banned - /unban <username> - Unbans a user who has been banned
License License
---- ----
......
...@@ -70,7 +70,7 @@ class api_1_ListChannels(Resource): ...@@ -70,7 +70,7 @@ class api_1_ListChannels(Resource):
if requestAPIKey != None: if requestAPIKey != None:
if requestAPIKey.isValid(): if requestAPIKey.isValid():
args = channelParserPost.parse_args() 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.add(newChannel)
db.session.commit() 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 ...@@ -24,16 +24,16 @@ sudo make install
# Grab Configuration # Grab Configuration
#cd /tmp #cd /tmp
#wget "https://gitlab.com/Deamos/nginx-rtmp-server/raw/master/nginx.conf" #wget "https://gitlab.com/Deamos/nginx-rtmp-server/raw/master/nginx.conf"
cd $cwd/nginx