Add peertube

master
Quentin Duchemin 2021-08-05 15:33:12 +02:00
parent fdcad0f0e4
commit f946a16bbf
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
6 changed files with 190 additions and 56 deletions

View File

@ -47,3 +47,7 @@
tags:
- docker
- hugo
- role: peertube
tags:
- docker
- peertube

View File

@ -1,57 +1,60 @@
$ANSIBLE_VAULT;1.1;AES256
35386630383434653837646263616338303762666436323533643632396138316237373766653932
3236353733343830396466636462633031376265633439380a656166613065613964383737383737
62613962353162616363373837333466633766613061343031636366373466626336373939373130
6264356231346263330a616634396530336566663037656132663736356163353166333339653433
38326338336162663137373262616661636562666630646633656364363365666134363234663639
63656165373463653365323133383139303131646437363836333063633036373430383562353665
37626263383134633266383930303235653461633130646162643966396534636330383264373737
64303336663931616634613231343361363765346330643563353963633338353665386339313530
39636330613230643837613432343834306264346264303861383162616162333465643539656133
30373964616130306662626531333732373035353630663834356233643332373637626133373939
32313666343864643365346161623866653065633236363035373966346337313334633566386366
39303237353538303233376537653230326238663963663936666530356136623837383833383835
37323637646537373932623133633935303830393535376139376536303762356132663237663133
66336639353632623533646639346437373234326361376437363866616536386461336130636236
63376161663934316330656335666331393335373332626537363534333834376132653964643063
34336365626661623263323238333836636436653935363331323037666132343364326265646631
38313136386261663961316565383134303134636561373938626166643939653336306261646338
31316563393532623835636538636664666236306133393134346166306332376539373938353038
62646437303763623030303362306166666165646362663564643764663965626533366162333661
30666537386264663363663735646430663032326633383463393461333731666261313733623336
62333632393235656131643461313263363162623332336462643633316663396637343432373738
38663139653765393031643132616563666230643765346665663733613738386133386366366263
66396132653634326635653266383031323431343161356536333266313333663137643864663031
37343435356534373033346362633433363736616466646632363130613666616231386432363937
66316233316263363235366434346361643036326533373033636638303430313131613036373064
38363234616362653234353635363261353230636163616665643837336636653361343238613937
65343931393639643961626336643031643862353537353063326330633165626563346366396665
35633339326533396362346632666632303263643130373063323665646539353533393366326566
30633330336632373632386532663434623365613062653437646233656261653336313733613664
38656530303134316537323133343530353063313334623535653838386533363365386530313838
35643134393863646430353266393736306632636436623134356630353465343035313439376164
34363932316166666530396236633131316231643966663361373835346335613738663038383737
33666532626231663061653963353239316232643364613434653834343137313064306135373832
66336161376161313761643635393234643864383261393137306233633135383831353332663033
34623737333834363763643731343830656661346632616265326561383839303636343333626635
30323336643737623337333634656361623930326632313935653236353630666439363637616435
62343933663837393662316234623735303961313761613865653764383935656165616433366561
63333363376632663334353432323833393436306636353064303361393565326532343964323761
30393539656537356365633637326662333561373439623433613662376637633465343932363035
37343339363933366264313134396132343163303162363663626536646333376134646437323333
37643338326238663464346238363231353366623364623362303266663961323565653433333232
34616335616134643232323937613537313263633265333461393838643866336332613031653561
38336537316130636162343036363363323865333833646330336335656637626332653830373035
63313039353230343666363462626236393332346637393433363063313737623036626538373363
36663131316433343731623831363637333838623734336438346665373633333530623734383361
32313333323966396338333436623738623330663737363237656565323938383831303733653164
38313837356634346565316537346263623233303962356562393665373565636530623532653532
33346664363534623962633532383138363862363333356166613865363232363338373939643564
64346565656266623437363063333130303263343765623332376230373230363163616239643032
33373863386535353437653663666365353465343837653565326333623630336265303631373531
61663266643461343836396464323963623337373439653363393239666663363835343430313564
61366639383835646235653638303338303738643264383433303433653165643037316661613666
62333535663030613866633138653738393430633738613538343434363866616261613536373164
32353331643163366337656134623265336263313465333961353464616238396162326464386365
66663166363766626134346563316432363333386134656139633033633130636531623064323435
35303532373732343464
30373861346437303564663566333331376533653532616632353433313934323539306138663234
3864333561626431303039313263626339343134633932300a343764653165333638323031353738
30666330613461386239353964303234653361346562663163303836613237623763643133306439
3339393535393066630a633463316135363731366435333333313762373463363663393433613061
33303733383762366534663762316534386133643237323232653634386264386637646261613334
34383930666634313666393431643633623338343133663466626561383833333934653063623832
30613637386234373363633539373366303066356431613633653031396164333036623665666339
30396639373435373664333233373036383866656138363266613364333535366131356232643637
62653861353939333266356531333565616335353438386561386564363732636161323030303162
37383762663635303733366166386666366237373636653333393534386632353539353239383864
31386362343538363164636633336330626435343133646564633962373935333564303837646565
36633663336136666335343463633635393534383036346237343762323937396636386665616235
62303932363232616431373065393532323937616561393034343361666562383039333436636535
61636563653939636665393964346430636131363432333464626238333433656366393765313965
37643165613732636365323730633735633933323566653434636463326263366165313664663634
61623238626339383732383539313237383663663631353132653131656264373630666339653461
30333166333361376564393834393937656365363433653836353663666362363835643730366335
39613530353864333133393533343034376231663339393562656435363530663431363864356330
35633064313334636337663537633836316561626463396632353932633163373262303366643930
31613730636465326230616564633761633764383234336336623934623234353237393166306161
37366363613230336264396539643438303166306337376666333031353331323236343039303736
65346537653662653738666237353765336164643231303334653566353530346131343333326664
39616363333630663061623836386134666634653161353734613637356537663032636261653734
61633238363533643938376139326566646130346336636532663963633764656538373463373437
30343935643066633566663732373933323130393864636266396464336430343134623661663734
38386338366665343163323738386237653164633235616130323431326338383830393438656261
32346234646230363664363036636464633834653135373166373535633638623065303139633261
35346630646138353131393638393863623863623732633233636138653566613264336132333261
36333136346339616532343461316663366662646464623562313437333332643537643936313531
36343039353334346139323432633332353137326437373137323062656162373063303464303931
39616630393162313637643934346131376237636566626361616161316333623635316132363234
32383537633535656339336365643061306430666636393230623466353164306564353963303131
66306132346337656163353937383362343061363863313633663165616662326531366232336334
34376633623238306538373464373164653035626236376335363866376631366538666335343933
35613433343364386366376238633563376436316662326632303634626235323631336331313032
65326133396430643339636262323764626237643936386131636632336666613838393638336137
61386532383532666331626664656438303964383534336330653036623537306262396439313732
35303534626361633830643130343939653833323038303365666532336337333635333934666366
36653439386635393331653866376362626534306435643639643565383130313830383538383064
62656130303736383834366439663361356532396561666136353033643733326561643638323433
63396337636462653430343461326661623738656666643961633334386631656134373432303765
61363361393831303463353866383563303930323961646335643466303739613263616332626163
63646635306132393235346338343266633632646534313164366263393335623432393265643662
66336433386264636335336166313364363263386439303838366165383731346230303033313131
39353039633466326166323566363030623539633439363165636666313366613333306235306263
38396539636663633232343730663463636432316433633437373563623862346137343437366533
31663138333839356331613135356462613131383834666136623164646431316330353666393333
34623937336633396166656632653038633830343234376436633834313434353665396135343037
61323664356331343632373634643035323839653462636438633933343130313238613163613934
35373064373565653335666134663866666664383638306136643030656533343833343139646563
63636461653563666131623066356239313662363262656434656239646632326633353334306439
37346534333466396434303664313338323736396161336337643864353265656466326139326430
39393162316262663266333665383732386430646366333731633630633566303437623866393236
35303165636163323836323363633939663435666563646164616632326234363037393030326435
33393465353433366135383235656363653339326630326265663066653539323130663661303761
37353161373133336234326330613631323162623030666234376130666461343435353339613562
31663138616531343130613636623634383133313239383361343261313832643564643838356665
39336664653363306564663336626663336333323738383739663066323334363939316238663436
326364626232636338656335616439326662

View File

@ -0,0 +1,28 @@
---
- name: Create Peertube directory
file:
path: "{{ peertube_folder_name }}"
state: directory
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0755
- name: Copy Peertube templates (env file and Compose)
template:
src: "{{ item }}"
# Remove .j2 extension
dest: "{{ peertube_folder_name }}/{{ (item | splitext)[0] }}"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
loop:
- docker-compose.yml.j2
- conf.env.j2
- name: Ensure container is up to date
community.docker.docker_compose:
project_src: "{{ peertube_folder_name }}"
remove_orphans: yes
pull: yes
recreate: smart
state: present

View File

@ -0,0 +1,33 @@
# Database / Postgres service configuration
POSTGRES_USER=peertube
POSTGRES_PASSWORD={{ peertube_db_password }}
# Postgres database name "peertube"
POSTGRES_DB=peertube
PEERTUBE_DB_USERNAME=peertube
PEERTUBE_DB_PASSWORD={{ peertube_db_password }}
PEERTUBE_DB_SSL=false
PEERTUBE_DB_HOSTNAME={{ peertube_db_container_name }}
# Server configuration
PEERTUBE_WEBSERVER_HOSTNAME={{ peertube_subdomain }}.{{ domain_name }}
# 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_subdomain }}
PEERTUBE_SMTP_PASSWORD={{ peertube_mail_password }}
PEERTUBE_SMTP_HOSTNAME=mail.gandi.net
PEERTUBE_SMTP_PORT=587
PEERTUBE_SMTP_FROM={{ peertube_subdomain }}@{{ domain_name }}
PEERTUBE_SMTP_TLS=true
PEERTUBE_SMTP_DISABLE_STARTTLS=false
PEERTUBE_ADMIN_EMAIL=quentinduchemin@tuta.io
# /!\ 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={{ peertube_redis_container }}

View File

@ -0,0 +1,58 @@
version: "{{ compose_version }}"
networks:
proxy:
name: "{{ traefik_network }}"
db:
name: peertube_db
redis:
name: peertube_redis
volumes:
db:
name: peertube_db
assets:
name: peertube_assets
redis:
name: peertube_redis
services:
app:
image: "chocobozzz/peertube:{{ peertube_version }}-buster"
container_name: peertube
networks:
- proxy
- db
- redis
volumes:
- assets:/app/client/dist
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
env_file: conf.env
labels:
traefik.http.routers.peertube.entrypoints: websecure
traefik.http.routers.peertube.rule: "Host(`{{ peertube_subdomain }}.{{ domain_name }}`)"
traefik.http.services.peertube.loadbalancer.server.port: 9000
# Note : for streaming I must add RMTP port (1935)
# idc for now
traefik.enable: true
restart: unless-stopped
db:
image: "postgres:{{ postgres_version }}"
container_name: "{{ peertube_db_container_name }}"
env_file: conf.env
volumes:
- db:/var/lib/postgresql/data
networks:
- db
restart: unless-stopped
redis:
image: "redis:{{ redis_version }}"
container_name: "{{ peertube_redis_container }}"
volumes:
- redis:/data
networks:
- db
restart: unless-stopped

View File

@ -0,0 +1,8 @@
peertube_version: "v3.3.0"
peertube_folder_name: "{{ docker_files }}/peertube"
peertube_subdomain: tube
peertube_db_container_name: "peertube_db"
postgres_version: "13"
redis_version: "6"
peertube_redis_container: "peertube_redis"
peertube_instance_name: "Babil"