From c542463701b288773855f718503c8b594d2eab39 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Tue, 1 Nov 2022 19:41:28 +0000 Subject: [PATCH] adding tube archivist (#42) --- group_vars/servers.yml | 2 + host_vars/qnap.yml | 15 +-- .../files/dashboards/dashy-config.yml | 3 + .../templates/vpn-stack.j2 | 59 ++++++++++ vault_vars/qnap-vault.yml | 110 +++++++++--------- 5 files changed, 129 insertions(+), 60 deletions(-) diff --git a/group_vars/servers.yml b/group_vars/servers.yml index 7f78691..aab64dc 100644 --- a/group_vars/servers.yml +++ b/group_vars/servers.yml @@ -27,6 +27,8 @@ directories: backups_dir: /mnt/mergerfs/backups # path where photoprism photos are stored photoprism_dir: /mnt/mergerfs/photoprism + # path to youtube videos + youtube_dir: /mnt/mergerfs/media/youtube desired_docker_images: - ubuntu:latest diff --git a/host_vars/qnap.yml b/host_vars/qnap.yml index 6c4864f..bdf3a22 100644 --- a/host_vars/qnap.yml +++ b/host_vars/qnap.yml @@ -21,7 +21,7 @@ devices: path: /mnt/data/device1 - uuid: f3cff115-9adc-4761-b1e9-e81055f3e0af # /dev/sda1 path: /mnt/data/device2 - # SSD for downloads / transcoding + # SSD for downloads / transcoding - uuid: c528bf82-61ab-4f3d-87e0-d1e6e02ef7ec # /dev/sdf path: /mnt/ssd0/ @@ -43,6 +43,13 @@ portainer_required_files: portainer_endpoint: 2 services: + - name: vpn-stack + template_vars: + qbittorrent: true + radarr: true + sonarr: true + jackett: true + tubearchivist: true - name: gitea template_vars: image: gitea/gitea @@ -60,12 +67,6 @@ services: - name: nginx-proxy-manager - name: plex - name: uptime-kuma - - name: vpn-stack - template_vars: - qbittorrent: true - radarr: true - sonarr: true - jackett: true - name: mariadb template_vars: default_network: mariadb_net diff --git a/roles/setup_hosted_services/files/dashboards/dashy-config.yml b/roles/setup_hosted_services/files/dashboards/dashy-config.yml index 6d335a6..964286e 100644 --- a/roles/setup_hosted_services/files/dashboards/dashy-config.yml +++ b/roles/setup_hosted_services/files/dashboards/dashy-config.yml @@ -100,6 +100,9 @@ sections: - title: Qbittorrent icon: hl-qbittorrent url: http://qnap:15000 + - title: Tube Archivist + icon: hl-tubearchivist + url: http://qnap:8000 - name: QNAP widgets: - type: gl-disk-space diff --git a/roles/setup_hosted_services/templates/vpn-stack.j2 b/roles/setup_hosted_services/templates/vpn-stack.j2 index 5eb5938..c9632f5 100644 --- a/roles/setup_hosted_services/templates/vpn-stack.j2 +++ b/roles/setup_hosted_services/templates/vpn-stack.j2 @@ -25,6 +25,8 @@ services: - 8989:8989 # jackett - 9117:9117 + # tube + - 8000:8000 restart: unless-stopped dns: @@ -111,6 +113,57 @@ services: - {{ directories.downloads_dir }}:/downloads restart: unless-stopped {% endif %} +{% if template_vars.tubearchivist %} + tubearchivist: + container_name: tubearchivist + network_mode: service:surfshark + restart: unless-stopped + image: bbilly1/tubearchivist + volumes: + - {{ directories.youtube_dir }}:/youtube + - cache:/cache + environment: + - ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port + - REDIS_HOST=archivist-redis # don't add protocol + - HOST_UID=1000 + - HOST_GID=1000 + - TA_HOST=qnap # set your host name + - TA_USERNAME=tubearchivist # your initial TA credentials + - "TA_PASSWORD={{ ta_password }}" # your initial TA credentials + - "ELASTIC_PASSWORD={{ elastic_password }}" # set password for Elasticsearch + - TZ=Europe/London # set your time zone + depends_on: + - archivist-es + - archivist-redis + - surfshark + archivist-redis: + image: redislabs/rejson # for arm64 use bbilly1/rejson + container_name: archivist-redis + restart: unless-stopped + expose: + - "6379" + volumes: + - redis:/data + depends_on: + - archivist-es + archivist-es: + image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.4.3 + container_name: archivist-es + restart: unless-stopped + environment: + - "xpack.security.enabled=true" + - "ELASTIC_PASSWORD={{ elastic_password }}" # matching Elasticsearch password + - "discovery.type=single-node" + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + ulimits: + memlock: + soft: -1 + hard: -1 + volumes: + - es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme + expose: + - "9200" +{% endif %} volumes: {% if template_vars.jackett %} jackett_config: @@ -131,3 +184,9 @@ volumes: {% if template_vars.sonarr %} sonarr_config: {% endif %} +{% if template_vars.tubearchivist %} + cache: + redis: + es: +{% endif %} + diff --git a/vault_vars/qnap-vault.yml b/vault_vars/qnap-vault.yml index e588623..e04cb68 100644 --- a/vault_vars/qnap-vault.yml +++ b/vault_vars/qnap-vault.yml @@ -1,54 +1,58 @@ $ANSIBLE_VAULT;1.1;AES256 -66333730653465646636303364316565323435643936343638383337626333363838356636666261 -6632366364616461663463373635346633343830636130660a616534656536663433643164616434 -36623834323962633532333461363633653134366631623065626664643738656161626137663763 -3838666362363361350a363437366565363839326432623338663139323433346330343536616336 -39633961333833386361633466646430343730353863393835376639303335306265626135633030 -62626132633037306632306538373335633766616663336135656337386335336264386438373833 -34613730386135343362633261333436613935376237613938663862363766383033373734666165 -34323739386539363862633762333634363630663437343865313838303665663136373834623134 -32303466353830623237623036376637633130326561656337376434313136366662316332663863 -38653834333630636533636265643866613062356563396461626364623130383030656661613361 -64326132613162666137616539366262653965333033373336623633646534373030643039663231 -38363931313431353234346333386562643465383161636632646631353837313139333363356236 -31313562366462663635643730663062326634666438616261373135323865663238336461383038 -32306162663530376135366330306265383538326639636134623563303337396363336431363963 -66393838346232346362653131346233656433373365653735663934656138666565633833616539 -65343837313434323366363532333530663265363961373733363461653039363236346336313262 -62326561373638336231386463356335313635336439333764396231323231386362356363383237 -62383235343134663830373334383139633031356461666138613963643732356534313062373565 -31303539303931636463363931353938303162303462393963643064343062356532353131636466 -62336135393938366635343331643538303262613836313462626331666438666132353463373430 -35613864613738306630376465616662636134346635303636626332343531643434383865346435 -65333465633631343062633262656133323430626338333966666464623030653835313961653165 -31353532333232383032363761323637373830623931663834613862613138363836616236393438 -33353462346630306434306466343562666331393337363939623633366330636362306464346665 -62396634353066393666393230326663373162303062393136373431643335373165366632336138 -61353735646539396138306239363862383762663536663630393332633633386630386131386538 -34613332643539626132633531373239306237623461303837336566616461333266663639656535 -66373930383935613863623164353462323034393761646239393165376463356432626234323735 -61346361613937316636366165333738663437393435643636313231343464356337666366323664 -65656364343766303634373062343461653932373661333334353035346233333462653438363034 -35396362373061656365343832346630303966383034613061343638623861363537663862313939 -36343736333364663439343632396634356465656438316461636165393066376165633238643561 -31313036356538356231636336653737626530393439303764353965646663313065653038616330 -39623937633065633561613661636166326565336464393331313838323034623063336264663564 -32396539343339383637343561396431313130313133623439323232376232356437346436346236 -65396339343531356135343933353930306134363738303332613961316133636430613034343966 -63383664666364646265343230626464363332386264653664353831376162626533623161323231 -61613836646435383136613966386237366364313263616666376264613735386237613461343035 -30643034343233313931313562326433666666376564653230653238363837343535663165653064 -66633163663961653939666136366264313837353561616161373337643630326633366638323037 -38386165633739303438353032616264643461626663303337646436323832353861623562643064 -62346533336361636537366335666663393165633336656430363461626561373863366439613535 -39396438356466363238653563353664383331616235376138623064393331626637623663653837 -38613631663065366364643062306630656232396332643863373264373463363933323963383066 -39643462366162663263343739643862653965636430663533343731353538663930646664373633 -31383166336132373939373066303137343535633064633635613866666161643963313838666562 -64633166356134363664666363633861353762303263303233626537323965613666636433343861 -32306136373962393734376264353630613337343165373963653263653234616330633763393635 -64656232346262656439383364636234623130363635346633663432336638393638646435366266 -33303037646432646630326536333037643233323466623362393537386164393732336530623334 -64303036646331656233336137323963313964356136323533396564303166326333656534626433 -38623662643537356230353233646332333737336334333731343466346465343238643633653062 -37346463373232636332633239376431653464653261383461306433326665353866 +62656461643734666662633533643533333034343466373461346263346666353262313066663065 +3262386232666364333931303462356666326631623461390a306665656239616238626665633731 +61343262303561313730616164353065626635353161363564346236333531313335376237333032 +3664373430633537340a396637336535353862306463316262383936326662376338373662383232 +61373130623165643366643461613566656430336533306666643130643936363263353065623865 +64656535376535323533326334363966353839353838643066323662313937373865336565656439 +39393938356335303664376631356436353233383063323630623235306138376333373164353432 +61333565316262323863326631353563663936376635656632643461316465333034616137326166 +31303866643932613935623737373633383064653333383561663434316430313761616532383964 +65616462373066653462653361306338643738356663333163616130363034313034643535646631 +66623030393537633366396264623130373036643134356237303763303636393066356635353638 +32616438663134343439363764343633623637313363343931613231313731306537646335633132 +62373937323165336235636530646261343336613030326361363466316530343861396230366239 +31326334643766396563613162613662656163653833663638653333623163336630303430366334 +30616634343433383630613965646137333738386465353862366265383432353937353665616365 +37646335386661616466656461333365366336623064616639663530613536643138643339333761 +33376434356639626631626663383533303136643264653864623562366438653239643933666161 +62396461343666616130633562313739333966303936343637646335396233626435306137393530 +39643962653063356330353661393635363339653433323366646338376337656630323235636639 +31316437613264373764643939653434353234623634643234366532626339353530396536356164 +32373466393334643965616438653337666162313432316161313730653461376331373833343730 +33613332613566616161376465376463623064393464303731383736643638333862303562313531 +31373738393865613764353733303430373234343939386263303733383565316264363939343331 +63313938663732313061303166656337643062313131396161383239636136383961623466353538 +38383962613662643234393032306264393038306538333161323633396666383839663235303366 +34376638356135666634613561653161323037306363616161353663303535353836646633633463 +30343131636332626337633533396534616264626130333930623737316562313834316562373637 +65346233316230623830303833623537393134313965396666316434373065373562333138383635 +39323237383462333139626134393532666133643562336331613039616634313637623262353031 +39646539336636636432313138303837626261326437316362363739303637323965393138353034 +66636539343261343234323135316263326333633266386163373761383936373034306662373262 +61656433396139343436336633373261326135626233336432366234643666623935363566303061 +35653463636637373261373030383231633866666665346263393931623731366232646534633237 +39393139656165396630393135393736363735643533336663303632346362353032653432656538 +34343731643034633538376265383863343037616464313834353030633839383239386335313631 +65643834336465353431363338626664623436376238663434366130646539386230383935366539 +65306532616536653338303334306137326430373564333434633263323832643366393430303761 +31613534386438346437353539356336653133303066663964336235653334326633663562343538 +33303165373436323032653635363565333539666564333734656362363663373130313165303434 +64393264356665643963616161313831363165666539373631626530393561393234376562643764 +32343635663766313934656261356438663930306338343533373162306338303032346364363234 +34356461303737653638323335333862393535313762376233323033393262393632623262323633 +35626463313364303638353337643135656538633165663437613233656630633933633633376138 +36376333313537326630303861663231316264306563643262396635303437616664356465626363 +64343163353864393161633633303831343431313930653365333732363836363432623136316462 +32666262356235613262623564323764313330653538353263336561383331373932333338363963 +66316632643662356237643332313831353031663933313630373030383166663066383964646365 +62336462363035356538623935353161353666643066396561316239663137346135313732346465 +64326635633739363066346539333431333562653537386162613130303166366330633863623065 +64353861623931663830633230303332306632376331336430356163643536623864666335346464 +34636166613162616339313334353236386135653239656338393231663264636666616263656530 +31623330623333633237396366626663326662356539303637366664313130373231646233303233 +64653834663432316264653665313232663433653737303036386237326236356663333431306263 +38653635646134633537396263613634326566626533653862623763653061613565363564633236 +39343736663234623935663434316366633534626339643664323463613961313830663566336237 +34663332383662313535646361353262353866616134616162396538323437613362303534303761 +6662