Stash is a locally hosted web-based app written in Go which organizes and serves your porn.

Stash

Build Status Go Report Card Discord

https://stashapp.cc

Stash is a locally hosted web-based app written in Go which organizes and serves your porn.

  • It can gather information about videos in your collection from the internet, and is extensible through the use of community-built plugins for a large number of content producers.
  • It supports a wide variety of both video and image formats.
  • You can tag videos and find them later.
  • It provides statistics about performers, tags, studios and other things.

You can watch a SFW demo video to see it in action.

For further information you can read the in-app manual.

Installing stash

via Docker

Follow this README.md in the docker directory.

Pre-Compiled Binaries

The Stash server runs on macOS, Windows, and Linux. Download the latest release here.

Run the executable (double click the exe on windows or run ./stash-osx / ./stash-linux from the terminal on macOS / Linux) and navigate to either https://localhost:9999 or http://localhost:9999 to get started.

Note for Windows users: Running the app might present a security prompt since the binary isn't yet signed. Bypass this by clicking "more info" and then the "run anyway" button.

FFMPEG

If stash is unable to find or download FFMPEG then download it yourself from the link for your platform:

The ffmpeg(.exe) and ffprobe(.exe) files should be placed in ~/.stash on macOS / Linux or C:\Users\YourUsername\.stash on Windows.

Usage

Quickstart Guide

  1. Download and install Stash and its dependencies
  2. Run Stash. It will prompt you for some configuration options and a directory to index (you can also do this step afterward)
  3. After configuration, launch your web browser and navigate to the URL shown within the Stash app.

Note that Stash does not currently retrieve and organize information about your entire library automatically. You will need to help it along through the use of scrapers. The Stash community has developed scrapers for many popular data sources which can be downloaded and installed from this repository.

The simplest way to tag a large number of files is by using the Tagger which uses filename keywords to help identify the file and pull in scene and performer information from our stash-box database. Note that this data source is not comprehensive and you may need to use the scrapers to identify some of your media.

CLI

Stash runs as a command-line app and local web server. There are some command-line options available, which you can see by running stash --help.

For example, to run stash locally on port 80 run it like this (OSX / Linux) stash --host 127.0.0.1 --port 80

SSL (HTTPS)

Stash can run over HTTPS with some additional work. First you must generate a SSL certificate and key combo. Here is an example using openssl:

openssl req -x509 -newkey rsa:4096 -sha256 -days 7300 -nodes -keyout stash.key -out stash.crt -extensions san -config <(echo "[req]"; echo distinguished_name=req; echo "[san]"; echo subjectAltName=DNS:stash.server,IP:127.0.0.1) -subj /CN=stash.server

This command would need customizing for your environment. This link might be useful.

Once you have a certificate and key file name them stash.crt and stash.key and place them in the same directory as the config.yml file, or the ~/.stash directory. Stash detects these and starts up using HTTPS rather than HTTP.

Customization

Themes and CSS Customization

There is a directory of community-created themes on our Wiki, along with instructions on how to install them.

You can also make Stash interface fit your desired style with Custom CSS snippets and CSS Tweaks.

Support (FAQ)

Answers to other Frequently Asked Questions can be found on our Wiki

For issues not addressed there, there are a few options.

  • Read the Wiki
  • Check the in-app documentation (also available here
  • Join the Discord server, where the community can offer support.

Compiling From Source Code

Pre-requisites

  • Go
  • Revive - Configurable linter
    • Go Install: go get github.com/mgechev/revive
  • Packr2 - Static asset bundler
  • Yarn - Yarn package manager
    • Run yarn install --frozen-lockfile in the stash/ui/v2.5 folder (before running make generate for first time).

NOTE: You may need to run the go get commands outside the project directory to avoid modifying the projects module file.

Environment

macOS

TODO

Windows

  1. Download and install Go for Windows
  2. Download and install MingW
  3. Search for "advanced system settings" and open the system properties dialog.
    1. Click the Environment Variables button
    2. Under system variables find the Path. Edit and add C:\Program Files\mingw-w64\*\mingw64\bin (replace * with the correct path).

NOTE: The make command in Windows will be mingw32-make with MingW.

Commands

  • make generate - Generate Go and UI GraphQL files
  • make build - Builds the binary (make sure to build the UI as well... see below)
  • make docker-build - Locally builds and tags a complete 'stash/build' docker image
  • make pre-ui - Installs the UI dependencies. Only needs to be run once before building the UI for the first time, or if the dependencies are updated
  • make fmt-ui - Formats the UI source code.
  • make ui - Builds the frontend and the packr2 files
  • make packr - Generate packr2 files (sub-target of ui. Use to regenerate packr2 files without rebuilding UI)
  • make vet - Run go vet
  • make lint - Run the linter
  • make fmt - Run go fmt
  • make fmt-check - Ensure changed files are formatted correctly
  • make it - Run the unit and integration tests
  • make validate - Run all of the tests and checks required to submit a PR
  • make ui-start - Runs the UI in development mode. Requires a running stash server to connect to. Stash port can be changed from the default of 9999 with environment variable REACT_APP_PLATFORM_PORT.

Building a release

  1. Run make generate to create generated files
  2. Run make ui to compile the frontend
  3. Run make build to build the executable for your current platform

Cross compiling

This project uses a modification of the CI-GoReleaser docker container to create an environment where the app can be cross-compiled. This process is kicked off by CI via the scripts/cross-compile.sh script. Run the following command to open a bash shell to the container to poke around:

docker run --rm --mount type=bind,source="$(pwd)",target=/stash -w /stash -i -t stashappdev/compiler:latest /bin/bash

Profiling

Stash can be profiled using the --cpuprofile command line flag.

The resulting file can then be used with pprof as follows:

go tool pprof

With graphviz installed and in the path, a call graph can be generated with:

go tool pprof -svg >

Comments
  • Tag hierarchy

    Tag hierarchy

    I'm currently working on adding support for a hierarchy to tags where one tag could have multiple children and/or parents. This feature seems to have been requested a couple of times before, and with 0.8 adding support for tag aliases I might just as well try to add this as well and I guess tags would then have most of the desired features, or at least from management purposes.

    As stated this branch is a work-in-progress, so I will list the things which I already implemented:

    • [X] DB migration
    • [x] Management
      • [x] Adding parent(s) / child(ren)
        • [x] Validation that no loops are created (i.e.: A => B, B => A should fail, and A => B, B => C, C => A should fail as well etc)
      • [X] Listing parent(s) / child(ren)
      • [x] Merging parents/childs when merging tags
    • [X] Filters
      • [X] Scenes.Tags
      • [X] Scenes.PerformerTags
      • [x] SceneMarkers.Tags
      • [x] SceneMarkers.SceneTags
      • [X] Images.Tags
      • [X] Images.PerformerTags
      • [X] Galleries.Tags
      • [X] Galleries.PerformerTags
      • [X] Performers.Tags

    For the management part (adding parent or child tags) I'm open to suggestions to how to add this to the UI. This applies to both the actual management, as listing the parents and children

  • Files refactor bug reports

    Files refactor bug reports

    This is intended as a catch-all issue to report bugs with the files-refactor alpha branch.

    Known issues are as follows:

    • ~~import/export functionality is currently disabled. Needs further design.~~
    • missing covers are not currently regenerated. Need to consider further, especially around scene cover redesign.
    • ~~deleting galleries is currently slow.~~
    • ~~Don't include file extension as part of the title scan flag is not supported.~~
    • ~~Set name, date, details from embedded file metadata scan flag is not supported.~~
    • ~~Draft submissions to stash-box currently give an already in transaction error.~~

    Other notable changes:

    • Object titles are now displayed as the file basename if the title is not explicitly set. The Don't include file extension as part of the title scan flag is no longer supported.
    • Set name, date, details from embedded file metadata scan flag is no longer supported. This functionality may be implemented as a built-in scraper in the future.

    Please report issues with the files-refactor build here.

  • Caption support

    Caption support

    Fixes #495

    This pull request adds caption support for DE, EN, ES, FR, IT, NL, and PT VTT files. As far as I'm aware those are the only languages that are captioned in adult content. This pull request only adds support for VTT files since video.js only supports VTT files but we could support SRT files later by converting the files to VTT on the fly, see https://github.com/videojs/video.js/issues/5923.

    Caption

  • [RFC] Proposal For Configuration Section Refactor

    [RFC] Proposal For Configuration Section Refactor

    ### Scope Rework the config page for better organization.

    Long Form

    As #1548 is moving scrapers to its own page, I think it would be good to take a look at the configuration section overall.

    My suggestions are as follows:

    Separate pages into collapsible sections, expanded by default

    (like this: https://www.codehim.com/bootstrap/bootstrap-vertical-menu-with-submenu-on-click/ ) Screenshot 2021-07-02 16 57 22

    Move stuff around

    (in no particular order)

    Content Section

    The purpose of the Library section is to show configuration settings related to WHICH CONTENT IS INDEXED OR NOT INDEXED

    Library

    • Video Extensions
    • Image Extensions
    • Gallery Zip Extensions
    • Excluded Video Patterns
    • Excluded Image/Gallery Patterns

    Tasks

    • Auto Tag (Rename "Detect Tags From Filenames")
    • Scan (Rename "Add To Library...."). Also rename "Scan" and "Scan Selected" to "Scan All" and "Scan Folders..."
    • Generated Content (Rename "Generate Interface Files....")

    System Section

    The purpose of the System section is to show configuation options and settings related to BACK-END SETTINGS

    Paths Menu

    • Database Path
    • Generated Path
    • Cache Path

    Logs Menu

    • Log File
    • Log Level
    • Current contents of "Log" page

    Maintenance Menu

    • Clean Database
    • Backup
    • Metadata Export

    Indexing Section

    The purpose of the System section is to show configuation options and settings related to THE INGESTION OF CONTENT

    • Hashing
    • Parallel Scan/Generation
    • Preview Generation

    Playback Section

    The purpose of the Playback section is to show configuration options and settings related to VIDEO PLAYBACK

    Playback Menu

    • Auto-Start Video
    • Maximum Loop Duration

    Conversions Menu

    • Transcoding options

    DLNA Menu

    • Existing DLNA Menu (Possible future additions: Global playback speed, video player selection, etc)

    Users Section

    The purpose of the Users section is to show configuration options and settings related to USER LOGIN

    • (contents of Authentication section)
    • Handy Connection Key

    Appearance Section

    The purpose of the APPEARANCE section is to show configuration options and settings related to USER INTERFACE

    Interface Menu

    • Language
    • Menu Items (Rename "Enable/Disable sections")
    • Wall Settings
    • Slideshow Delay

    Theme Menu

    • Page showing "Currently Active Theme" with source and link to themes index on wiki (or native display of that page)

    Extensions Section

    Plugins Manu

    The purpose of the Plugins section is to show configuration options and settings generated by PLUGINS

    • "Installed Plugins", current "plugin" page but refactored as a table with Name, Description, Version, Link.
    • "Refresh Plugin List" to replace "Reload Plugins" (at some point in the future, an "Add plugins" page)

    Scrapers Menu

    (as described in #1548 )

    Tools Menu

    • Existing "Tools" section
  • Settings UI refactor

    Settings UI refactor

    • makes all settings pages auto-save when changing options
    • made settings menu fixed to the left edge of the screen and centred content panel
    • restructured and reordered pages based on discussion in #1549
    • change checkboxes to switches

    image

    Still to be done:

    • [x] add a saving/saved indicator instead of using Toast notification
    • [x] restructure and restyle Tasks page
    • [x] readd some missing help links
  • Transcode stream refactor

    Transcode stream refactor

    This is a significant refactor of the transcode streaming code.

    The forceMKV and forceHEVC flags have been removed, and is_streamable has been removed from the scene graphql type. Instead, there is a new IsSceneStreamable graphql query that accepts a list of supported video codecs. Similarly, the stream.mp4 route has been changed to accept a list of codecs as well. The supported video codecs are obtained using a custom Modernizr build that only tests for video support. There is an additional test for mkv support, but it is hard-coded to check if the client browser is Chromium-based.

    On the backend, the transcode code is changed so that it chooses the codec to use based on the supported codecs sent to the request. It is currently hard-coded to prefer VP9, VP8, HEVC then H264. This should probably be further refined to accept the supported codecs in order of preference.

    ~~This doesn't fix the Safari bug referenced in #600 but is a decent first step.~~ This obsoletes a lot of the changes in #522 which will need to be reworked if we go ahead with this.

    Fixes #600

  • Add indexes for path and checksum to images

    Add indexes for path and checksum to images

    The scenes table has unique indexes/constraints on path and checksum colums. The images table doesn't, which doesn't really make sense, as scanning uses these colums extensively which warrents an index, and both should be unique as well.

    Adding these indexes thus heavily improves the scanning tasks performance. On a database containing 4700 images a (re)scan of those 4700 files, which thus shouldn't do anything, took 1.2 seconds, with the indexes added this only takes 0.4 seconds. Taking the same test on a generated database containing 4M images + the actual 4700 images took 26 minutes for a rescan, and with the index existing also only takes 0.4 seconds.

  • [RFC] Refactor main navbar

    [RFC] Refactor main navbar

    This is the current navbar.

    image

    This is as narrow as I can get the Window before it has to collapse to a menu button. With Audio and Text items in the roadmap, plus Playlists and such, we're going to run out of room in the navbar. We need to think about reworking it.

    Some design considerations:

    • we need to maintain single-click navigation for at least the most used buttons. I know that I will be bothered if I suddenly need to do two clicks to go to Scenes, Performers and Studios.
    • the navitems fit into categorical groups. Scenes, Markers and Movies would fall under a Video group, and Images and Galleries would fall under an Image group, and the rest could go under Metadata.
    • saved queries are in the roadmap and should ideally be accessible from the navbar.
    • we should consider that on desktops, there is a lot more horizontal real estate than there is vertical
    • we should ensure consistency between desktop and mobile views

    Possible designs:

    • on desktops, group navitems into the groups mentioned above (Metadata probably wouldn't need to grouped). The groups would be implemented as a hover dropdown button. Pornhub does something like this, as does xhamster: image
    • we could potentially save some horizontal realestate by increasing the height of the navbar and placing the icons above the text, with a squarer button - like how Sonarr/Radarr do it: image

    This would mean a loss of vertical real estate which I'm loathe to lose.

    • move the items into a clickable menu like how the mobile view is currently. I'd rather not do this since it adds an extra click to all those top-level objects.
    • move the items into a sidebar. Plex has this, for example: image

    Said sidebar is collapsible to it's icons, with the More > button only accessible when not collapsed. On most widescreens, we'd probably be losing less proportional real estate horizontally than vertically, and definitely less when collapsed. It would mean that some of our screens would need to be redesigned (the scene detail page for example).

    • show only the first x items that will fit and put the rest into a More... menu button. Menu item configuration would then be order as well as inclusion.
  • ffmpeg error when generating sprites and previews

    ffmpeg error when generating sprites and previews

    When I generate previews and spites, I get this kind of error on some vids:

    ERRO[3587] ffmpeg error when running command </usr/bin/ffmpeg -v quiet -ss 1180 -t 0.75 -i /home/user/Desktop/sort/Goga-Huxley ++.wmv -y -c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.2 -preset veryslow -crf 21 -threads 4 -vf scale=640:-2 -c:a aac -b:a 128k -strict -2 /home/ziggy/stash/generated/tmp/preview010.mp4>

    I ran the command manually from bash, and it does work if I add the option "-max_muxing_queue_size 400" to ffmpeg.

  • Add support for the Handy APIv2

    Add support for the Handy APIv2

    Docs: https://staging.handyfeeling.com/api/handy/v2/docs/ Ref: https://github.com/defucilis/thehandy

    Update axios to 0.24.0 due to a security update

    Progress on https://github.com/stashapp/stash/issues/1376

    I've updated https://github.com/defucilis/thehandy with the change https://github.com/defucilis/thehandy/pull/2 because the class HandyUtils wasn't exported, which is why this is a Draft PR. In order to test/verify the change you will need to use my branch until it is merged upstream

    Also I added support for the following funscript features:

    • inverted flag
    • range argument
  • [Feature] Add a

    [Feature] Add a "play all" button for performers or tags that play a mix of images, scenes and movies from them.

    It would be good to have a "play all" feature in the performer profile or tags cloud so we can start playing a mix of both, videos and images. Nowadays you have to go over one of the topics but they can't be mixed in a playlist.

    imagen

    Describe the solution you'd like A solution to this would be to add a "play all content" button that appears in the performer profile page and tag cloud pages.

  • [Feature] Show folder path and file name in scene info

    [Feature] Show folder path and file name in scene info

    Right now stash forces me to have every file and folder formatted with underscores instead of spaces even though I don't want to, otherwise when I copy a scene path from the info tab I get an unusable path with many %20 that I have to substitute for spaces.

    The path should be formatted so that I can just copy and paste it into the file manager and go to the folder containing the file. And there should also be a file name so that I can copy and search for it in the folder. That's the only way to open mkv files right now since they are too slow in stash.

  • Handle file rescan

    Handle file rescan

    • fixes issue where scene/image/gallery would not be created if it there was none associated with a file that had been subsequently moved
    • scene/image/gallery post-update hooks are now called when the underlying file was updated
    • scene generated files are now migrated when the underlying file hash has changed
    • creates galleries when necessary instead of upfront when detecting a zip file. This fixes the issue where galleries would be created for zip files containing no valid image files
    • clean now deletes empty galleries again
    • fixes issue in clean where zip file folders would fail to be cleaned when its path is no longer valid because the zip file was moved
    • fixes issue where duplicate images would not be associated with galleries - fixes #2939
  • MacOS scan does not work, and cleaning attempts to remove entire filesystem

    MacOS scan does not work, and cleaning attempts to remove entire filesystem

    Describe the bug Recent development versions do not scan folders correctly. Logs show an error about dotfiles (even if those are excluded) and the scan does not find any new items. The Clean utility also now attempts to remove the entire root directory.

    To Reproduce Steps to reproduce the behavior:

    1. Go to Tasks and select Scan

    2. New items are not found and the scan shows errors.

    3. Go to Tasks and select Clean

    4. The entire filesystem root "/" is marked for cleaning.

    Screenshots Screenshot 2022-09-25 at 11 27 31 PM

    Screenshot 2022-09-25 at 11 32 13 PM

    Stash Version: (from Settings -> About): v0.16.1-67-g00820a87

    Desktop (please complete the following information):

    • OS: MacOS 13.0
    • Browser [all]

    Additional context Add any other context about the problem here.

  • Add default thumbnails for scenes and images

    Add default thumbnails for scenes and images

    Adds default thumbnails for scenes and images for when the thumbnail fails to load:

    image image

    Doing this for galleries is a more difficult process so is not included in this PR.

  • [Feature] Show file path on list view

    [Feature] Show file path on list view

    As I've increased the number of files I have, stash has been getting slower and slower. Right now it takes 34 seconds on average for it to open a scene. I would like to be able to copy the path from the list view and open the file in a file manager.

  • [Feature] Add a move command

    [Feature] Add a move command

    Is your feature request related to a problem? Please describe. Whenever a file is moved into a different folder on the computer, all its markers, tags, and other data get reset. One has to manually edit the database in order to keep them.

    Describe the solution you'd like Add a menu option to move a scene (or multiple selected scenes) to a new location, which will show a list of stash folders (like the scan option does), and when a folder is selected, the file (or all selected files) will be moved to the new location, and all its stash data will be changed to reflect the move.

This service provides authenticated access to a static website hosted in an s3 bucket.
This service provides authenticated access to a static website hosted in an s3 bucket.

website-openid-proxy This service provides OpenID authenticated access to a static website hosted in an s3 bucket. It is designed to be a simple way t

Jan 19, 2022
Go middleware for monetizing your API on a per-request basis with Bitcoin and Lightning ⚡️

ln-paywall Go middleware for monetizing your API on a per-request basis with Bitcoin and Lightning ⚡️ Middlewares for: net/http HandlerFunc net/http H

Jul 24, 2022
A simple and lightweight encrypted password manager written in Go.
A simple and lightweight encrypted password manager written in Go.

A simple and lightweight encrypted password manager written in Go.

Jun 16, 2022
Go (golang) library for creating and consuming HTTP Server-Timing headers
Go (golang) library for creating and consuming HTTP Server-Timing headers

HTTP Server-Timing for Go This is a library including middleware for using HTTP Server-Timing with Go. This header allows a server to send timing info

Aug 21, 2022
Redcon is a custom Redis server framework for Go that is fast and simple to use.
Redcon is a custom Redis server framework for Go that is fast and simple to use.

Redcon is a custom Redis server framework for Go that is fast and simple to use. The reason for this library it to give an efficient server front-end for the BuntDB and Tile38 projects.

Sep 13, 2022
👄 The most accurate natural language detection library in the Go ecosystem, suitable for long and short text alike
👄 The most accurate natural language detection library in the Go ecosystem, suitable for long and short text alike

Its task is simple: It tells you which language some provided textual data is written in. This is very useful as a preprocessing step for linguistic data in natural language processing applications such as text classification and spell checking. Other use cases, for instance, might include routing e-mails to the right geographically located customer service department, based on the e-mails' languages.

Sep 25, 2022
GoatCounter is an open source web analytics platform available as a hosted service or self-hosted app

GoatCounter is an open source web analytics platform available as a hosted service (free for non-commercial use) or self-hosted app. It aims to offer easy to use and meaningful privacy-friendly web analytics as an alternative to Google Analytics or Matomo.

Sep 24, 2022
A dead simple cli utility to help you manage your git stash
A dead simple cli utility to help you manage your git stash

A dead simple cli utility to help you manage your git stash.

Aug 2, 2022
Chat backend which serves REST APIs

Chat backend which serves REST APIs

Nov 24, 2021
Stash large datasets on GitHub for free, quick, and easy download 🐿

squirrel Stash large datasets on GitHub for free, quick, and easy download ?? Install To install squirrel, run the following: curl ... Usage Create a

Dec 31, 2021
Go-ipfs-pinner - The pinner system is responsible for keeping track of which objects a user wants to keep stored locally

go-ipfs-pinner Background The pinner system is responsible for keeping track of

Jan 18, 2022
A Simple Application written in go-lang that serves the index.html

go-web server A Simple Application written in go-lang that serves the index.html Running the Application, Well, make sure you have go installed to con

Nov 24, 2021
Test your API gateway routed lambdas locally and in CI
Test your API gateway routed lambdas locally and in CI

Lambo Test API Gateway wrapped lambda functions locally. Lambo can also be used to test API GW lambdas in CI without needing docker-in-docker. It will

Jun 22, 2022
EggContractor is a self-hosted contract monitoring web app + CLI client for Egg

EggContractor is a self-hosted contract monitoring web app + CLI client for Egg, Inc.. It allows you to easily monitor all your contract progress, as well as peeking into prospective coops you may want to join.

Sep 10, 2022
Self-hosted web app for encoding files to a target format using distributed computing.
Self-hosted web app for encoding files to a target format using distributed computing.

What is Encodarr? Encodarr is a self-hosted web application that encodes video files to a target format using distributed computing to spread the work

Aug 19, 2022
A basic file server automatically generates self certificates and serves the given folder.

A basic file server automatically generates self certificates and serves the given folder.

Jul 20, 2022
The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat
The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

Jul 2, 2022
A net.http.Handler similar to FileServer that serves gzipped content

net.http.handler.gzip: a FileServer that serves gzipped content. Usage: import "net/http/handler/gzip" base := "/path/to/website/static/files" http

Mar 14, 2022
Statigz serves pre-compressed embedded files with http in Go

statigz statigz serves pre-compressed embedded files with http in Go 1.16 and later. Why? Since version 1.16 Go provides standard way to embed static

Sep 15, 2022
The plugin serves as a starting point for writing a Mattermost plugin

Plugin Starter Template This plugin serves as a starting point for writing a Mattermost plugin. Feel free to base your own plugin off this repository.

Dec 10, 2021