Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.dev-exemple
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ REDIS_TAG=redis:alpine3.16
### In case of value changing, you have to rebuild and restart your container.
### All yours datas will be kept.
DOCKER_ENV=light
## PEERTUBE SECRETS
POSTGRES_PASSWORD=<PWD>
PEERTUBE_SECRET=<SECRET>
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pod/main/static/custom/img
!pod/custom/settings_local.py.example
settings_local.py
transcription/*
docker-volume

# Unit test utilities #
#######################
Expand All @@ -73,6 +74,7 @@ compile-model
*.crt
*.key
*.pem
*.pub

# NPM stuffs #
################
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,9 @@ endif
sudo rm -rf ./pod/db.sqlite3
sudo rm -rf ./pod/db_remote.sqlite3
sudo rm -rf ./pod/media

# Ouvre un shell avec le contexte Django dans le conteneur pod
shell:
docker exec -it pod-activitypub-with-volumes pip install ipython
docker exec -it pod-activitypub-with-volumes env DJANGO_SETTINGS_MODULE=pod.settings ipython --ext=autoreload -c "%autoreload 2" -i
# then it is needed to call import django; django.setup()
45 changes: 45 additions & 0 deletions docker-compose-full-dev-with-volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ services:
- ./.env.dev
volumes: *pod-volumes

pod-activitypub:
container_name: pod-activitypub-with-volumes
build:
context: .
dockerfile: dockerfile-dev-with-volumes/pod-activitypub/Dockerfile
depends_on:
- pod-back
- redis
env_file:
- ./.env.dev
volumes: *pod-volumes

elasticsearch:
container_name: elasticsearch-with-volumes
hostname: elasticsearch.localhost
Expand All @@ -79,6 +91,39 @@ services:
ports:
- 6379:6379

peertube:
container_name: peertube
hostname: peertube.localhost
image: chocobozzz/peertube:v7.2.0-bookworm
ports:
- 9000:9000
- 3000:3000
env_file:
- ./dockerfile-dev-with-volumes/peertube/peertube.env
- ./.env.dev
depends_on:
- postgres
- redis
- postfix
volumes:
- ./dockerfile-dev-with-volumes/peertube/dev.yaml:/app/config/dev.yaml
command: sh -c "yarn install && npm run dev"
restart: "always"

postgres:
image: postgres:13-alpine
env_file:
- ./dockerfile-dev-with-volumes/peertube/peertube.env
- ./.env.dev
restart: "always"

postfix:
image: mwader/postfix-relay
env_file:
- ./dockerfile-dev-with-volumes/peertube/peertube.env
- ./.env.dev
restart: "always"

# redis-commander:
# container_name: redis-commander
# hostname: redis-commander.localhost
Expand Down
2 changes: 1 addition & 1 deletion dockerfile-dev-with-volumes/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Vous devriez obtenir ce message une fois esup-pod lancé
----
$ pod-dev-with-volumes | Superuser created successfully.
----
L'application esup-pod est dès lors disponible via cette URL : localhost:8000
L'application esup-pod est dès lors disponible via cette URL : pod.localhost:8000

=== Arrêt de la stack
$ CTRL+C dans la fenetre depuis laquelle l'application esup-pod a été lancée
Expand Down
142 changes: 142 additions & 0 deletions dockerfile-dev-with-volumes/peertube/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
listen:
hostname: '::'
port: 9000

webserver:
https: false

secrets:
peertube: 'my super dev secret'

rates_limit:
api:
window: 10 seconds
max: 500
signup:
window: 5 minutes
max: 200
download_generate_video:
window: 5 seconds
max: 500000

database:
hostname: '127.0.0.1'
port: 5432

redis:
hostname: '127.0.0.1'

smtp:
hostname: null
port: 1025
tls: false
disable_starttls: true
from_address: 'test-admin@localhost'
username: null
password: null

log:
level: 'debug'

open_telemetry:
metrics:
enabled: true
playback_stats_interval: '13 seconds'

contact_form:
enabled: true

peertube:
check_latest_version:
enabled: false

redundancy:
videos:
check_interval: '5 minutes'
strategies:
-
size: '1000MB'
min_lifetime: '10 minutes'
strategy: 'most-views'
-
size: '1000MB'
min_lifetime: '10 minutes'
strategy: 'trending'
-
size: '1000MB'
min_lifetime: '10 minutes'
strategy: 'recently-added'
min_views: 1

cache:
previews:
size: 10
captions:
size: 10
torrents:
size: 10

signup:
enabled: true
requires_email_verification: false

live:
enabled: true

allow_replay: true

transcoding:
enabled: true
threads: 2

resolutions:
360p: true
720p: true

import:
videos:
concurrency: 2
http:
enabled: true
torrent:
enabled: true
video_channel_synchronization:
enabled: true
max_per_user: 10
check_interval: 5 minutes
videos_limit_per_synchronization: 3

instance:
default_nsfw_policy: 'display'

# Set by API when the field is not provided and put as default value in client
defaults:
publish:
licence: 2

plugins:
index:
check_latest_versions_interval: '10 minutes'

federation:
prevent_ssrf: false
videos:
cleanup_remote_interactions: false

views:
videos:
remote:
max_age: -1

watching_interval:
anonymous: '6 seconds'
users: '4 seconds'

geo_ip:
enabled: true

video_studio:
enabled: true

transcoding:
keep_original_file: false
60 changes: 60 additions & 0 deletions dockerfile-dev-with-volumes/peertube/peertube.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
NODE_VERSION=21.7.1
NODE_ENV=dev
NODE_DB_LOG=false

# Database / Postgres service configuration
POSTGRES_USER=postgres
# Postgres database name "peertube"
POSTGRES_DB=peertube_dev
# The database name used by PeerTube will be PEERTUBE_DB_NAME (only if set) *OR* 'peertube'+PEERTUBE_DB_SUFFIX
#PEERTUBE_DB_NAME=<MY POSTGRES DB NAME>
#PEERTUBE_DB_SUFFIX=_prod
# Database username and password used by PeerTube must match Postgres', so they are copied:
PEERTUBE_DB_USERNAME=$POSTGRES_USER
PEERTUBE_DB_PASSWORD=$POSTGRES_PASSWORD
PEERTUBE_DB_SSL=false
# Default to Postgres service name "postgres" in docker-compose.yml
PEERTUBE_DB_HOSTNAME=postgres

# PeerTube server configuration
# If you test PeerTube in local: use "peertube.localhost" and add this domain to your host file resolving on 127.0.0.1
PEERTUBE_WEBSERVER_HOSTNAME=peertube.localhost
# If you just want to test PeerTube on local
PEERTUBE_WEBSERVER_PORT=9000
PEERTUBE_WEBSERVER_HTTPS=false
# If you need more than one IP as trust_proxy
# pass them as a comma separated array:
PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback", "172.18.0.0/16"]

# E-mail configuration
# If you use a Custom SMTP server
#PEERTUBE_SMTP_USERNAME=
#PEERTUBE_SMTP_PASSWORD=
# Default to Postfix service name "postfix" in docker-compose.yml
# May be the hostname of your Custom SMTP server
PEERTUBE_SMTP_HOSTNAME=postfix
PEERTUBE_SMTP_PORT=25
PEERTUBE_SMTP_FROM=[email protected]
PEERTUBE_SMTP_TLS=false
PEERTUBE_SMTP_DISABLE_STARTTLS=false
PEERTUBE_ADMIN_EMAIL=[email protected]

# Postfix service configuration
POSTFIX_myhostname=example.org
# If you need to generate a list of sub/DOMAIN keys
# pass them as a whitespace separated string <DOMAIN>=<selector>
OPENDKIM_DOMAINS=example.org=peertube
# see https://github.com/wader/postfix-relay/pull/18
OPENDKIM_RequireSafeKeys=no

PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PUBLIC="public-read"
PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PRIVATE="private"

#PEERTUBE_LOG_LEVEL=info

# /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\
#PEERTUBE_SIGNUP_ENABLED=true
#PEERTUBE_TRANSCODING_ENABLED=true
#PEERTUBE_CONTACT_FORM_ENABLED=true

PEERTUBE_REDIS_HOSTNAME=redis-with-volumes
35 changes: 35 additions & 0 deletions dockerfile-dev-with-volumes/pod-activitypub/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#------------------------------------------------------------------------------------------------------------------------------
# (\___/)
# (='.'=) Dockerfile multi-stages node & python
# (")_(")
#------------------------------------------------------------------------------------------------------------------------------
# Conteneur node
ARG PYTHON_VERSION
# TODO
#FROM harbor.urba.univ-lille.fr/store/node:19 as source-build-js

#------------------------------------------------------------------------------------------------------------------------------
# Conteneur python
FROM $PYTHON_VERSION
WORKDIR /tmp/pod
COPY ./pod/ .
# TODO
#FROM harbor.urba.univ-lille.fr/store/python:3.7-buster

RUN apt-get clean && apt-get update && apt-get install -y netcat

WORKDIR /usr/src/app

COPY ./requirements.txt .
COPY ./requirements-conteneur.txt .
COPY ./requirements-encode.txt .
COPY ./requirements-dev.txt .

RUN pip3 install --no-cache-dir -r requirements-dev.txt \
&& pip3 install elasticsearch==7.17.9

# ENTRYPOINT :
COPY ./dockerfile-dev-with-volumes/pod-activitypub/my-entrypoint-activitypub.sh /tmp/my-entrypoint-activitypub.sh
RUN chmod 755 /tmp/my-entrypoint-activitypub.sh

ENTRYPOINT ["bash", "/tmp/my-entrypoint-activitypub.sh"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
echo "Launching commands into pod-dev"
until nc -z pod.localhost 8000; do echo waiting for pod-back; sleep 10; done;
# Worker ActivityPub
celery --app pod.activitypub.tasks worker --loglevel INFO --queues activitypub --concurrency 1 --hostname activitypub
sleep infinity
Loading
Loading