Skip to content

Commit

Permalink
Merge pull request #7 from Blowleaf/dev
Browse files Browse the repository at this point in the history
v1.1.2 PR
  • Loading branch information
tavikano committed Mar 28, 2024
2 parents e76e30e + 841970a commit e21e909
Show file tree
Hide file tree
Showing 21 changed files with 211 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ media_files/original/
media_files/hls/
media_files/chunks/
media_files/uploads/
vms-volume-mount/
postgres_data/
streampod_volume/
media_files/
Expand Down
36 changes: 18 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
FROM python:3.11.4-bookworm AS compile-image

VOLUME /home/mediacms.io/mediacms
VOLUME /home/streampod.io/streampod

SHELL ["/bin/bash", "-c"]

# Set up virtualenv
ENV VIRTUAL_ENV=/home/mediacms.io
ENV VIRTUAL_ENV=/home/streampod.io
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PIP_NO_CACHE_DIR=1

RUN mkdir -p /home/mediacms.io/mediacms/{logs} && cd /home/mediacms.io && python3 -m venv $VIRTUAL_ENV
RUN mkdir -p /home/streampod.io/streampod/{logs} && cd /home/streampod.io && python3 -m venv $VIRTUAL_ENV

# Install dependencies:
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . /home/mediacms.io/mediacms
WORKDIR /home/mediacms.io/mediacms

RUN wget -q http://zebulon.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-637.x86_64-unknown-linux.zip && \
unzip Bento4-SDK-1-6-0-637.x86_64-unknown-linux.zip -d ../bento4 && \
mv ../bento4/Bento4-SDK-1-6-0-637.x86_64-unknown-linux/* ../bento4/ && \
rm -rf ../bento4/Bento4-SDK-1-6-0-637.x86_64-unknown-linux && \
rm -rf ../bento4/docs && \
rm Bento4-SDK-1-6-0-637.x86_64-unknown-linux.zip
COPY . /home/streampod.io/streampod
WORKDIR /home/streampod.io/streampod

############ RUNTIME IMAGE ############
FROM python:3.11.4-bookworm as runtime-image
Expand All @@ -43,25 +36,32 @@ ENV ENABLE_CELERY_LONG='yes'
ENV ENABLE_MIGRATIONS='yes'

# Set up virtualenv
ENV VIRTUAL_ENV=/home/mediacms.io
ENV VIRTUAL_ENV=/home/streampod.io
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

COPY --chown=www-data:www-data --from=compile-image /home/mediacms.io /home/mediacms.io
COPY --chown=www-data:www-data --from=compile-image /home/streampod.io /home/streampod.io

# Install Dependency packages
RUN apt-get update -y && apt-get -y upgrade && apt-get install --no-install-recommends \
supervisor nginx imagemagick procps wget xz-utils -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get purge --auto-remove && \
apt-get clean

RUN wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && \
# Install FFMPEG
RUN wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz && \
mkdir -p ffmpeg-tmp && \
tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components 1 -C ffmpeg-tmp && \
tar -xf ffmpeg-release-arm64-static.tar.xz --strip-components 1 -C ffmpeg-tmp && \
cp -v ffmpeg-tmp/ffmpeg ffmpeg-tmp/ffprobe ffmpeg-tmp/qt-faststart /usr/local/bin && \
rm -rf ffmpeg-tmp ffmpeg-release-amd64-static.tar.xz
rm -rf ffmpeg-tmp ffmpeg-release-arm64-static.tar.xz

WORKDIR /home/streampod.io/streampod

WORKDIR /home/mediacms.io/mediacms
# Install Bento4
RUN wget -q https://www.deb-multimedia.org/pool/main/b/bento4-dmo/bento4_1.6.0.640-dmo1_arm64.deb && \
apt-get install -y ./bento4_1.6.0.640-dmo1_arm64.deb

# See Ln 15 of deploy/docker/uwsgi.ini
EXPOSE 9000 80

RUN chmod +x ./deploy/docker/entrypoint.sh
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ RUN pip install -r requirements-dev.txt
COPY . /home/streampod.io/streampod
WORKDIR /home/streampod.io/streampod

# Install Bento4
RUN wget -q https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-641.x86_64-unknown-linux.zip && \
unzip Bento4-SDK-1-6-0-641.x86_64-unknown-linux.zip -d ../bento4 && \
mv ../bento4/Bento4-SDK-1-6-0-641.x86_64-unknown-linux/* ../bento4/ && \
rm -rf ../bento4/Bento4-SDK-1-6-0-641.x86_64-unknown-linux && \
rm -rf ../bento4/docs && \
rm Bento4-SDK-1-6-0-641.x86_64-unknown-linux.zip

############ RUNTIME IMAGE ############
FROM python:3.11.4-bookworm as runtime-image

Expand Down Expand Up @@ -49,16 +57,13 @@ RUN apt-get update -y && apt-get -y upgrade && apt-get install --no-install-reco
apt-get purge --auto-remove && \
apt-get clean

# Install FFMPEG
RUN wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz && \
mkdir -p ffmpeg-tmp && \
tar -xf ffmpeg-release-arm64-static.tar.xz --strip-components 1 -C ffmpeg-tmp && \
cp -v ffmpeg-tmp/ffmpeg ffmpeg-tmp/ffprobe ffmpeg-tmp/qt-faststart /usr/local/bin && \
rm -rf ffmpeg-tmp ffmpeg-release-arm64-static.tar.xz

# Install Bento4
RUN wget -q https://www.deb-multimedia.org/pool/main/b/bento4-dmo/bento4_1.6.0.640-dmo1_arm64.deb && \
apt-get update -y && apt-get install -y ./bento4_1.6.0.640-dmo1_arm64.deb

WORKDIR /home/streampod.io/streampod

EXPOSE 8080 80
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ clean:
@find . -name "*.pyc" -exec rm -rf {} \;
@find . -name "__pycache__" -delete
rm -dr ./media_files
rm -dr ./streampod_volume
rm -dr ./vms-volume-mount
rm -dr ./logs
rm -r ./celerybeat-schedule
rm -dr ../postgres_data
Expand Down
14 changes: 7 additions & 7 deletions cms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
PORTAL_NAME = "StreamPod"
PORTAL_DESCRIPTION = "Video Management System"
LANGUAGE_CODE = "en-us"
TIME_ZONE = "Asia/Tokyo"
TIME_ZONE = "UTC"

# who can add media
# valid options include 'all', 'email_verified', 'advancedUser'
Expand Down Expand Up @@ -44,7 +44,7 @@
ALLOW_RATINGS_CONFIRMED_EMAIL_ONLY = True

# ip of the server should be part of this
ALLOWED_HOSTS = ["*", "mediacms.io", "127.0.0.1", "localhost", "streampod.io"]
ALLOWED_HOSTS = ["*", "mediacms.io", "127.0.0.1", "localhost", "streampod.io", "vms.streampod"]

FRONTEND_HOST = "http://localhost"
# this variable - along with SSL_FRONTEND_HOST is used on several places
Expand Down Expand Up @@ -138,8 +138,7 @@
}


SECRET_KEY = "2dii4cog7k=5n37$fz)8dst)kg(s3&10)^qa*gv(kk+nv-z&cu"
# TODO: this needs to be changed!
SECRET_KEY = os.environ.get("SECRET_KEY")

TEMP_DIRECTORY = "/tmp" # Don't use a temp directory inside BASE_DIR!!!
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -219,8 +218,9 @@
CANNOT_ADD_MEDIA_MESSAGE = ""

# mp4hls command, part of Bento4
MP4HLS_COMMAND = "/usr/bin/mp42hls"
print("MP4HLS Command", MP4HLS_COMMAND) ## debugging
MP4HLS_COMMAND = "/home/streampod.io/bento4/bin/mp4hls"
MP4DASH_COMMAND = "/home/streampod.io/bento4/bin/mp4dash"
MP4INFO_COMMAND = "/home/streampod.io/bento4/bin/mp4info"

# highly experimental, related with remote workers
ADMIN_TOKEN = "c2b8e1838b6128asd333ddc5e24"
Expand Down Expand Up @@ -449,7 +449,7 @@

# TODO: separate settings on production/development more properly, for now
# this should be ok
CELERY_TASK_ALWAYS_EAGER = False
CELERY_TASK_ALWAYS_EAGER = True ## Active for K8s
if os.environ.get("TESTING"):
CELERY_TASK_ALWAYS_EAGER = True

Expand Down
6 changes: 4 additions & 2 deletions deploy/docker/local_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FRONTEND_HOST = 'http://localhost'
PORTAL_NAME = 'StreamPod'
SECRET_KEY = 'ma!s3^b-cw!f#7s6s0m3*jx77a@riw(7701**(r=ww%w!2+yk2'
SECRET_KEY = '{SECRET_KEY}'
POSTGRES_HOST = 'db'
REDIS_LOCATION = "redis://redis:6379/1"

Expand Down Expand Up @@ -29,6 +29,8 @@
BROKER_URL = REDIS_LOCATION
CELERY_RESULT_BACKEND = BROKER_URL

MP4HLS_COMMAND = "mp42hls"
MP4HLS_COMMAND = "/home/streampod.io/bento4/bin/mp4hls"
MP4DASH_COMMAND = "/home/streampod.io/bento4/bin/mp4dash"
MP4INFO_COMMAND = "/home/streampod.io/bento4/bin/mp4info"

DEBUG = False
4 changes: 2 additions & 2 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "3"

volumes:
volume_name:
name: streampod_volume
name: vms-volume-mount

services:
db:
image: postgres:15.2-alpine
volumes:
- ${PWD}/streampod_volume:/var/lib/postgresql/data/
- ${PWD}/vms-volume-mount:/var/lib/postgresql/data/
restart: always
environment:
POSTGRES_DB: 'streampod'
Expand Down
29 changes: 16 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
version: "3"

volumes:
volume_name:
name: vms-volume-mount

services:
migrations:
image: ocano/streampod-vms:v1.1
image: ocano/streampod-vms:v1.1.2
ports:
- 8000
volumes:
- ./:/home/mediacms.io/mediacms/
- ./:/home/streampod.io/streampod/
environment:
ENABLE_UWSGI: 'no'
ENABLE_NGINX: 'no'
Expand All @@ -24,13 +28,13 @@ services:
db:
condition: service_healthy
web:
image: ocano/streampod-vms:v1.1
image: ocano/streampod-vms:v1.1.2
deploy:
replicas: 1
ports:
- "80:80"
volumes:
- ./:/home/mediacms.io/mediacms/
- ./:/home/streampod.io/streampod/
environment:
ENABLE_CELERY_BEAT: 'no'
ENABLE_CELERY_SHORT: 'no'
Expand All @@ -39,11 +43,11 @@ services:
depends_on:
- migrations
celery-beat:
image: ocano/streampod-vms:v1.1
image: ocano/streampod-vms:v1.1.2
ports:
- 6379
volumes:
- ./:/home/mediacms.io/mediacms/
- ./:/home/streampod.io/streampod/
environment:
ENABLE_UWSGI: 'no'
ENABLE_NGINX: 'no'
Expand All @@ -53,13 +57,13 @@ services:
depends_on:
- redis
celery-worker:
image: ocano/streampod-vms:v1.1
image: ocano/streampod-vms:v1.1.2
ports:
- 6379
deploy:
replicas: 1
volumes:
- ./:/home/mediacms.io/mediacms/
- ./:/home/streampod.io/streampod/
environment:
ENABLE_UWSGI: 'no'
ENABLE_NGINX: 'no'
Expand All @@ -72,13 +76,12 @@ services:
ports:
- 5432
volumes:
- ../postgres_data:/var/lib/postgresql/data/
- ${PWD}/vms-volume-mount:/var/lib/postgresql/data/
restart: always
environment:
POSTGRES_USER: mediacms
POSTGRES_PASSWORD: mediacms
POSTGRES_DB: mediacms
TZ: Asia/Tokyo
POSTGRES_USER: streampod
POSTGRES_PASSWORD: streampod
POSTGRES_DB: streampod
healthcheck:
test: ["CMD-SHELL", "pg_isready", "--host=db", "--dbname=$POSTGRES_DB", "--username=$POSTGRES_USER"]
interval: 10s
Expand Down
3 changes: 1 addition & 2 deletions frontend/config/templates/static/aboutPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<h2>About</h2>
<hr />
<p>
<a href="https://streampod.io">StreamPod VMS</a> is a modern, fully featured open source video CMS. It is
developed to meet the needs of modern web platforms for viewing and sharing media.
<a href="https://streampod.io">StreamPod</a>is a modern open core video management system.
</p>
</div>
</div>
Expand Down
56 changes: 56 additions & 0 deletions frontend/config/templates/static/termsPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,62 @@
<h2>Terms</h2>
<hr />
<p>Terms of service</p>
<p>By accessing or using StreamPod, you agree to be bound by these Terms of Service ("Terms") and our Privacy Policy, which is incorporated by reference. If you do not agree to these Terms, please do not use StreamPod.</p>

<h2>1. Eligibility</h2>
<p>StreamPod is intended for users who are at least 18 years old or have reached the age of majority in their jurisdiction. By using StreamPod, you represent and warrant that you meet these eligibility requirements.</p>

<h2>2. User Accounts</h2>
<p>To access certain features of StreamPod, you may be required to create an account. You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account.</p>

<h2>3. User Generated Content</h2>
<p>>StreamPod provides a platform for users to create and deploy Deployments. When users upload or create content on StreamPod, the user and/or organization retains ownership of the intellectual property rights to that content. However, by submitting content to the platform, users grant StreamPod a limited, non-exclusive, royalty-free license to use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and display such content solely for the purpose of operating and providing the StreamPod service. StreamPod does not claim ownership of user-generated content and will not be held liable for any violations of intellectual property rights or illegal content submitted by users.</p>

<h2>4. Open Source Components</h2>
<p>StreamPod incorporates open source software components, which are subject to their respective open source licenses. Users are permitted to use, modify, and distribute these open source components in accordance with the terms and conditions of their respective licenses.</p>

<h2>5. Intellectual Property</h2>
<p>StreamPod and its original content, features, and functionality are owned by Blowleaf Inc. and are protected by intellectual property laws. You may not modify, copy, distribute, transmit, display, reproduce, publish, license, create derivative works from, transfer, or sell any information or services obtained from StreamPod.</p>

<h2>6. Respecting Intellectual Property Rights</h2>
<p>StreamPod respects the intellectual property rights of others and complies with the requirements set forth in the Digital Millennium Copyright Act ("DMCA") and other applicable intellectual property laws. If you believe that any content posted on the StreamPod platform infringes upon your copyrights or other intellectual property rights, please submit a notice following our Intellectual Property Infringement Guidelines. These guidelines provide detailed information about our policies, the required elements for your notice, and the designated channels for submitting such notices. StreamPod takes intellectual property rights seriously and will promptly investigate and respond to any legitimate claims of infringement in accordance with applicable laws and regulations. We encourage our users to respect the intellectual property rights of others and to use the platform in a responsible and lawful manner.</p>

<h2>7. Trademarks</h2>
<p>The StreamPod name, logo, and any other trademarks, service marks, and trade names displayed on the Platform (collectively, the "Marks") are the property of Blowleaf Inc. or their respective owners. You may not use, copy, reproduce, distribute, modify, or display any of the Marks without the prior written permission of Blowleaf Inc. or the respective owner. All rights in the Marks are reserved.</p>

<h2>9. Jurisdictions and Compliance</h2>
<p>StreamPod may be hosted and operate in multiple jurisdictions. You are solely responsible for ensuring that your use of StreamPod and any Deployments comply with all applicable laws, rules, and regulations in the jurisdictions where StreamPod or Deployments are accessed or used.</p>

<h2>9. Prohibited Activities</h2>
<p>You may not use StreamPod or any Deployments for any illegal or unauthorized purposes. This includes, but is not limited to, uploading or distributing content that infringes on intellectual property rights, violates privacy rights, or contains hate speech, obscenity, or explicit violence.</p>

<h2>10. Third-Party Services</h2>
<p>StreamPod may integrate or interact with third-party services, websites, or applications. We are not responsible for the content, privacy policies, or practices of any third-party services, and your use of such services is at your own risk.</p>

<h2>11. Termination</h2>
<p>We reserve the right to suspend or terminate your access to StreamPod or any Deployments at any time, without notice, and for any reason, including but not limited to a violation of these Terms.</p>

<h2>12. Disclaimer of Warranties</h2>
<p>StreamPod and any Deployments are provided "as is" without warranties of any kind, either express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement.</p>

<h2>13. Limitation of Liability</h2>
<p>In no event shall Blowleaf Inc. or its affiliates be liable for any indirect, incidental, special, or consequential damages arising out of or in connection with the use of StreamPod or any Deployments, even if advised of the possibility of such damages.</p>

<h2>14. Indemnification</h2>
<p>You agree to indemnify, defend, and hold harmless Blowleaf Inc., its affiliates, and their respective officers, directors, employees, agents, and representatives from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising out of or in connection with your use of StreamPod or any Deployments, or your violation of these Terms.</p>

<h2>15. Governing Law and Jurisdiction</h2>
<p>These Terms shall be governed by and construed in accordance with the laws of [Governing Jurisdiction]. Any legal action or proceeding arising out of or relating to these Terms shall be brought exclusively in the courts located in [Jurisdiction], and you consent to the personal jurisdiction of such courts.</p>

<h2>16. Changes to the Terms</h2>
<p>We reserve the right to modify or update these Terms at any time. Your continued use of StreamPod after any changes constitutes your acceptance of the revised Terms.</p>

<h2>17. Entire Agreement</h2>
<p>These Terms, along with our Privacy Policy, constitute the entire agreement between you and Blowleaf Inc. regarding your use of StreamPod and any Deployments, and supersede all prior or contemporaneous communications and proposals, whether oral or written.</p>

<p>If you have any questions or concerns about these Terms, please contact us at contact@streampod.com</p>

<p>Last updated: 3/28/24</p>
</div>
</div>
<div class="page-sidebar-content-overlay"></div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/static/favicons/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "StreamPod",
"short_name": "StreamPod",
"description": "StreamPod is a modern open core video management system",
"start_url": "/",
"icons": [
{
"src": "android-chrome-192x192.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function HeaderThemeSwitcher() {

return (
<div className="theme-switch" tabIndex={0} onKeyPress={onKeyPress} onClick={onClick}>
<label id="themeSwitcherLabel">Toggle Dark Mode</label>
<span>Dark Theme</span>
<span>
<label className="checkbox-label right-selectbox">
Expand All @@ -38,6 +39,7 @@ export function HeaderThemeSwitcher() {
tabIndex={-1}
checked={'dark' === currentThemeMode}
onChange={onChange}
aria-labelledby="themeSwitcherLabel"
/>
</span>
</span>
Expand Down

0 comments on commit e21e909

Please sign in to comment.