From 8de9b5736527832c08353a136fab9c44fc061ab4 Mon Sep 17 00:00:00 2001 From: Chris King Date: Sun, 16 Feb 2025 01:20:53 -0800 Subject: [PATCH] Move Stash to Authentik Add bypass for bedroom ShieldTV Remove Stash port forwarding Set STASH_EXTERNAL_HOST to URL Add customized DupFileManager plugin to Stash Enable custom_served_folders in Stash Disable built-in Stash auth in favor of Authentik Add additional Stash plugins and plugin sources Add FansDB stash box configuration --- caddy/config/Caddyfile | 28 +- stashapp/config/config.yml | 686 +++--------------------------------- stashapp/docker-compose.yml | 6 +- 3 files changed, 89 insertions(+), 631 deletions(-) diff --git a/caddy/config/Caddyfile b/caddy/config/Caddyfile index 82e0c38..6c341fe 100644 --- a/caddy/config/Caddyfile +++ b/caddy/config/Caddyfile @@ -160,7 +160,7 @@ import ttt-app requestrr 4545 import ttt-app-alt budget actual-server-app-1 5006 import ttt-app-alt trilium triliumnext-notes-app-1 8080 import ttt-app-alt notes triliumnext-notes-app-1 8080 -import ttt-app-alt stash stashapp-app-1 9999 +#import ttt-app-alt stash stashapp-app-1 9999 import ttt-app-alt pihole1 192.168.1.116 80 # Authentik Configs @@ -172,3 +172,29 @@ import authentik code import authentik gitea import authentik dozzle import authentik tautulli +#import authentik-test stash + +stash.tremendousturtle.tools { + import ttt-log stash + import tls + @not_cf header !CF-Connecting-IP + @cf header CF-Connecting-IP * + + # Match the bedroom Nvidia Shield IP to skip Authentik + @shield client_ip 192.168.1.142 + reverse_proxy @shield stashapp-app-1:9999 { + header_up X-Real-IP {remote_host} + header_up X-Forwarded-Port {server_port} + } + + # When not from cloudflare just use the remote host as the real IP + reverse_proxy @not_cf authentik-app-1:9000 { + header_up X-Real-IP {remote_host} + header_up X-Forwarded-Port {server_port} + } + + # When from cloudflare tunnel use the CF-Connecting-IP as the real IP + reverse_proxy @cf authentik-app-1:9000 { + header_up X-Real-IP {http.request.header.CF-Connecting-IP} + header_up X-Forwarded-Port {server_port} + } diff --git a/stashapp/config/config.yml b/stashapp/config/config.yml index 34abde3..e84dfd8 100644 --- a/stashapp/config/config.yml +++ b/stashapp/config/config.yml @@ -5,7 +5,9 @@ calculate_md5: false continue_playlist_default: true create_image_clip_from_videos: false cssenabled: false -dangerous_allow_public_without_auth: "false" +custom_served_folders: + /: /custom_web +dangerous_allow_public_without_auth: true database: /db/stash-go.sqlite defaults: auto_tag_task: @@ -103,11 +105,13 @@ no_proxy: localhost,127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12 nobrowser: true notifications_enabled: false parallel_tasks: 0 -password: $2a$04$T8nN490lPHZw1rf6v1Q2ze/VAn3hhgiJ6l/SSV96gBMwhmDLk/dXq plugins: disabled: - VideoScrollWheel - TPDBMarkers + - filemonitor + - markerTagToScene + - visage package_sources: - localpath: community name: Community (stable) @@ -115,21 +119,64 @@ plugins: - localpath: stash-plugins name: Stash-Plugins url: https://7djx1qp.github.io/stash-plugins/main/index.yml + - localpath: tetrax + name: Tetrax + url: https://tetrax-10.github.io/stash-stuffs/index.yml + - localpath: valkyr + name: Valkyr + url: https://valkyr-js.github.io/stash-plugins/index.yml + - localpath: stgannon + name: STG Annon + url: https://stg-annon.github.io/StashScripts/stable/index.yml + - localpath: community + name: Axter-Stash + url: https://stash.axter.com/Dev/index.yml settings: + DupFileManager: + matchDupDistance: "1" + mergeDupFilename: true + zwGraylist: /data,/movies,/packs + zxBlacklist: "" + zySwapBetterBitRate: true + zySwapBetterFrameRate: true + zySwapCodec: true + zySwapHighRes: true + zySwapLongLength: true + zzDebug: true + zzObsoleteSettingsCheckVer2: true + zzTracing: true + zzdryRun: true + PerformerDetailsExtended: + additionalStyling: true + appearsMostWithGendered: true + scenesTimespanReverse: false + showWhenCollapsed: true + topTagsOn: true + totalPlayCountOn: true cjCardTweaks: addBannerDimension: true fileCount: true performerProfileCards: true + markerTagToScene: + allTags: false + stashStashIDInput: + performers: true + studios: true stashStashIdInput: performers: true studios: true tPdBmarkers: disableSceneMarkerHook: true + tagGraph: + options: true timestampTrade: - createMovieFromScene: false + addTimestampTradeUrl: true + addTsTradeTag: true + createMarkers: true + createMovieFromScene: true disableGalleryLookupHook: true - disableSceneMarkersHook: false - extraUrls: false + disableSceneMarkersHook: true + extraUrls: true mergeMarkers: true plugins_path: /plugins/ port: 9999 @@ -174,6 +221,9 @@ stash_boxes: - apikey: H04DEzLXkMqUBtNdS9CYOI4ek9KZb0EBSfNhTt1A87ee11b2 endpoint: https://theporndb.net/graphql name: ThePornDB + - apikey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiIwNWY4OTFiYy04MjVlLTQ1ZmQtYWFkYS0yYTc0OWE2NzgzMWQiLCJzdWIiOiJBUElLZXkiLCJpYXQiOjE3Mzk2MDkxOTF9.fMPLqqt2B3iw1qpOjMVMHmqMcorbw42Jy4WIBkyj7wo + endpoint: https://fansdb.cc/graphql + name: FansDB theme_color: '#202b33' ui: advancedMode: true @@ -298,628 +348,8 @@ ui: excludedStudioFields: - name fingerprintQueue: - https://stashdb.org/graphql: - - "14115" - - "13320" - - "13623" - - "17433" - - "14152" - - "14206" - - "14168" - - "17294" - - "13905" - - "13385" - - "13837" - - "16837" - - "16596" - - "16686" - - "13382" - - "15576" - - "16643" - - "12278" - - "16976" - - "16406" - - "14106" - - "12610" - - "17452" - - "17174" - - "12615" - - "13066" - - "12532" - - "17526" - - "17402" - - "17170" - - "17273" - - "16997" - - "17525" - - "12403" - - "15519" - - "17428" - - "16421" - - "14631" - - "17523" - - "17287" - - "17528" - - "15901" - - "17398" - - "16135" - - "13178" - - "17282" - - "17724" - - "17727" - - "17729" - - "17709" - - "17728" - - "17737" - - "17713" - - "17726" - - "17750" - - "17748" - - "17742" - - "17747" - - "17754" - - "17719" - - "17751" - - "17714" - - "17721" - - "17712" - - "17711" - - "17739" - - "17753" - - "17710" - - "17752" - - "17741" - - "17734" - - "17720" - - "17723" - - "17707" - - "17725" - - "17746" - - "17755" - - "17757" - - "17749" - - "17730" - - "17717" - - "17756" - - "17731" - - "17716" - - "17740" - - "17733" - - "17735" - - "17758" - - "17708" - - "17718" - - "17743" - - "17745" - - "17786" - - "17878" - - "17817" - - "17814" - - "17813" - - "17815" - - "17865" - - "17893" - - "17812" - - "17792" - - "17818" - - "17819" - - "17826" - - "17787" - - "17797" - - "17804" - - "17799" - - "17795" - - "17798" - - "17828" - - "17802" - - "17805" - - "17827" - - "17831" - - "17832" - - "17839" - - "17883" - - "17845" - - "17842" - - "17810" - - "17807" - - "17844" - - "17785" - - "17822" - - "17808" - - "17811" - - "17823" - - "17816" - - "17837" - - "17836" - - "17825" - - "17833" - - "17838" - - "17830" - - "17889" - - "17891" - - "17806" - - "17770" - - "17801" - - "17843" - - "17835" - - "17809" - - "17790" - - "17796" - - "17789" - - "17820" - - "17896" - - "17867" - - "17908" - - "17909" - - "17912" - - "17886" - - "17885" - - "17794" - - "17803" - - "17821" - - "17793" - - "17784" - - "17890" - - "17834" - - "17850" - - "17800" - - "17848" - - "17841" - - "17849" - - "17846" - - "17852" - - "17824" - - "17851" - - "17961" - - "17875" - - "17880" - - "17870" - - "17856" - - "17895" - - "17897" - - "17858" - - "17854" - - "17855" - - "17860" - - "17861" - - "17859" - - "17864" - - "17857" - - "17862" - - "17863" - - "17906" - - "17927" - - "17894" - - "17911" - - "17905" - - "17873" - - "17918" - - "17892" - - "17888" - - "17916" - - "17881" - - "17920" - - "17884" - - "17930" - - "17921" - - "17915" - - "17922" - - "17928" - - "17924" - - "17874" - - "17877" - - "17879" - - "17871" - - "17869" - - "17926" - - "17876" - - "17882" - - "17917" - - "17872" - - "17868" - - "17913" - - "17903" - - "17919" - - "17914" - - "17904" - - "17933" - - "17934" - - "17932" - - "17887" - - "17866" - - "17929" - - "17923" - - "17910" - - "17925" - - "17902" - - "17931" - - "17898" - - "17901" - - "17900" - - "17899" - - "17907" - - "17935" - - "17939" - - "17937" - - "17936" - - "17938" - - "17943" - - "17947" - - "17940" - - "17955" - - "17952" - - "17948" - - "17946" - - "17941" - - "17951" - - "17942" - - "17944" - - "17953" - - "17949" - - "17945" - - "17954" - - "17983" - - "17987" - - "17968" - - "17960" - - "17959" - - "17988" - - "17972" - - "17965" - - "17984" - - "17986" - - "17967" - - "17976" - - "17962" - - "17978" - - "17977" - - "17970" - - "17969" - - "17985" - - "17991" - - "17980" - - "17975" - - "17974" - - "17964" - - "17981" - - "17957" - - "17993" - - "17989" - - "17973" - - "17958" - - "17963" - - "17966" - - "17971" - - "17990" - - "17979" - - "18003" - - "18001" - - "17995" - - "18002" - - "17994" - - "18000" - - "17997" - - "17996" - - "17999" - - "17998" - - "18004" - - "18005" - - "18009" - - "18008" - - "18012" - - "18010" - - "18007" - - "18013" - - "18006" - - "18011" - - "18207" - - "18215" - - "18217" - - "18187" - - "18190" - - "18196" - - "18191" - - "18194" - - "18227" - - "18188" - - "18281" - - "18192" - - "18189" - - "18204" - - "18246" - - "18245" - - "18208" - - "18209" - - "18199" - - "18232" - - "18213" - - "18019" - - "18014" - - "18015" - - "18016" - - "18017" - - "18018" - - "18020" - - "18249" - - "18219" - - "18229" - - "18221" - - "18233" - - "18220" - - "18198" - - "18195" - - "18212" - - "18211" - - "18239" - - "18223" - - "18203" - - "18222" - - "18226" - - "18210" - - "18225" - - "18218" - - "18224" - - "18214" - - "18231" - - "18238" - - "18243" - - "18216" - - "18202" - - "18240" - - "18205" - - "18197" - - "18242" - - "18201" - - "18241" - - "18228" - - "18200" - - "18230" - - "18193" - - "18234" - - "18237" - - "18278" - - "18279" - - "18359" - - "18303" - - "18305" - - "18297" - - "18283" - - "18275" - - "18285" - - "18298" - - "18252" - - "18250" - - "18247" - - "18206" - - "18253" - - "18254" - - "18244" - - "18236" - - "18251" - - "18248" - - "18259" - - "18256" - - "18257" - - "18258" - - "18261" - - "18260" - - "18255" - - "18267" - - "18265" - - "18264" - - "18263" - - "18266" - - "18268" - - "18262" - - "18315" - - "18294" - - "18309" - - "18314" - - "18274" - - "18288" - - "18277" - - "18273" - - "18282" - - "18329" - - "18312" - - "18308" - - "18311" - - "18287" - - "18327" - - "18307" - - "18291" - - "18271" - - "18269" - - "18295" - - "18270" - - "18272" - - "18276" - - "18290" - - "18299" - - "18331" - - "18332" - - "18328" - - "18306" - - "18280" - - "18317" - - "18304" - - "18333" - - "18300" - - "18336" - - "18296" - - "18339" - - "18326" - - "18310" - - "18292" - - "18322" - - "18323" - - "18343" - - "18313" - - "18293" - - "18286" - - "18284" - - "18337" - - "18338" - - "18334" - - "18330" - - "18335" - - "18352" - - "18372" - - "18402" - - "18347" - - "18348" - - "18396" - - "18382" - - "18384" - - "18357" - - "18405" - - "18409" - - "18371" - - "18389" - - "18374" - - "18392" - - "18388" - - "18367" - - "18404" - - "18380" - - "18361" - - "18383" - - "18391" - - "18398" - - "18350" - - "18373" - - "18408" - - "18400" - - "18377" - - "18379" - - "18403" - - "18354" - - "18362" - - "18394" - - "18410" - - "18458" - - "18459" - - "18460" - - "18455" - - "18457" - - "18456" - - "18454" - - "18453" - - "18452" - - "18451" - - "18450" - - "18448" - - "18449" - - "18447" - - "18446" - - "18445" - - "18442" - - "18444" - - "18443" - - "18441" - - "18438" - - "18439" - - "18437" - - "18436" - - "18435" - - "18434" - - "18433" - - "18432" - - "18430" - - "18431" - - "18428" - - "18429" - - "18427" - - "18426" - - "18425" - - "18423" - - "18424" - - "18422" - - "18421" - - "18420" - - "18419" - - "18418" - - "18417" - - "18416" - - "18415" - - "18413" - - "18411" - - "18412" - - "18414" - - "18461" - - "18462" - - "18463" - - "18465" - - "18466" - - "18469" - - "18468" - - "18472" - - "18471" - - "18473" - - "18474" - - "18477" - - "18476" - - "18478" - - "18479" - - "18480" - - "18481" - - "18482" - - "18483" - - "18484" - - "18485" - - "18487" - - "18488" - - "18489" - - "18490" - - "18491" - - "18493" - - "18492" - - "18495" - - "18494" - - "18497" - - "18496" - - "18498" - - "18499" - - "18501" - - "18503" - - "18502" - - "18504" - - "18505" - - "18507" - - "18506" - - "18512" - - "18486" - - "18517" - - "18534" - - "18532" - - "18535" - - "18533" - - "18537" - - "18536" - - "18539" - - "18540" - - "18541" - - "18543" - - "18544" - - "18545" - - "18546" - - "18547" - - "18550" - - "18552" - - "18554" - - "18556" - - "18555" - - "18557" - - "18559" - - "18560" - - "18551" - - "18558" - https://theporndb.net/graphql: - - "18500" - - "18538" - - "18542" - - "18549" - - "18553" + https://stashdb.org/graphql: [] + https://theporndb.net/graphql: [] markSceneAsOrganizedOnSave: false mode: auto selectedEndpoint: https://stashdb.org/graphql @@ -931,7 +361,7 @@ ui: cleanGenerated: blobFiles: true dryRun: false - imageThumbnails: false + imageThumbnails: true markers: true screenshots: true sprites: true diff --git a/stashapp/docker-compose.yml b/stashapp/docker-compose.yml index 42c5895..d544847 100644 --- a/stashapp/docker-compose.yml +++ b/stashapp/docker-compose.yml @@ -8,8 +8,6 @@ services: ## the container's port must be the same with the STASH_PORT in the environment section networks: - proxy-net - ports: - - "9999:9999" expose: - "9999" ## If you intend to use stash's DLNA functionality uncomment the below network mode and comment out the above ports section @@ -24,6 +22,7 @@ services: - STASH_GENERATED=/generated/ - STASH_METADATA=/metadata/ - STASH_CACHE=/cache/ + - STASH_EXTERNAL_HOST=https://stash.tremendousturtle.tools ## Adjust below to change default port (9999) - STASH_PORT=9999 volumes: @@ -52,6 +51,9 @@ services: - ./data/scrapers:/scrapers ## Where to store database file - ./data/db:/db + ## Custom DupFileManager plugin + - /code/Axter-Stash/plugins/DupFileManager:/plugins/community/DupFileManager + - /code/Axter-Stash/plugins/DupFileManager/web:/custom_web ## Where to store generated content (screenshots,previews,transcodes,sprites) - /media/stashapp/generated:/generated