SmallCoccinelle 401660e6a3 Hoist context, enable errchkjson (#2488)
* Make the script scraper context-aware

Connect the context to the command execution. This means command
execution can be aborted if the context is canceled. The context is
usually bound to user-interaction, i.e., a scraper operation issued
by the user. Hence, it seems correct to abort a command if the user
aborts.

* Enable errchkjson

Some json marshal calls are *safe* in that they can never fail. This is
conditional on the types of the the data being encoded. errchkjson finds
those calls which are unsafe, and also not checked for errors.

Add logging warnings to the place where unsafe encodings might happen.
This can help uncover usage bugs early in stash if they are tripped,
making debugging easier.

While here, keep the checker enabled in the linter to capture future
uses of json marshalling.

* Pass the context for zip file scanning.

* Pass the context in scanning

* Pass context, replace context.TODO()

Where applicable, pass the context down toward the lower functions in
the call stack. Replace uses of context.TODO() with the passed context.

This makes the code more context-aware, and you can rely on aborting
contexts to clean up subsystems to a far greater extent now.

I've left the cases where there is a context in a struct. My gut feeling
is that they have solutions that are nice, but they require more deep
thinking to unveil how to handle it.

* Remove context from task-structs

As a rule, contexts are better passed explicitly to functions than they
are passed implicitly via structs. In the case of tasks, we already
have a valid context in scope when creating the struct, so remove ctx
from the struct and use the scoped context instead.

With this change it is clear that the scanning functions are under a
context, and the task-starting caller has jurisdiction over the context
and its lifetime. A reader of the code don't have to figure out where
the context are coming from anymore.

While here, connect context.TODO() to the newly scoped context in most
of the scan code.

* Remove context from autotag struct too

* Make more context-passing explicit

In all of these cases, there is an applicable context which is close
in the call-tree. Hook up to this context.

* Simplify context passing in manager

The managers context handling generally wants to use an outer context
if applicable. However, the code doesn't pass it explicitly, but stores
it in a struct. Pull out the context from the struct and use it to
explicitly pass it.

At a later point in time, we probably want to handle this by handing
over the job to a different (program-lifetime) context for background
jobs, but this will do for a start.
2022-04-15 11:34:53 +10:00
2020-04-03 08:46:23 +11:00
2021-11-18 12:32:04 +11:00
2022-04-04 20:03:39 +10:00
2022-03-17 11:33:59 +11:00
2020-04-29 12:13:08 +10:00
2022-03-17 11:33:59 +11:00
2022-03-17 11:33:59 +11:00
2022-04-05 22:35:32 -07:00

Stash

https://stashapp.cc

Build Docker pulls Go Report Card Discord

Stash is a self-hosted webapp written in Go which organizes and serves your porn.

demo image

  • Stash gathers 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 and sites.
  • Stash supports a wide variety of both video and image formats.
  • You can tag videos and find them later.
  • Stash provides statistics about performers, tags, studios and more.

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

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

Installing Stash

Windows MacOS Linux Docker
Latest Release
Development Preview
Latest Release (Apple Silicon)
Development Preview (Apple Silicon)
Latest Release (Intel)
Development Preview (Intel)
Latest Release (amd64)
Development Preview (amd64)
More Architectures...
Instructions
Sample docker-compose.yml

First Run

Windows Users: Security Prompt

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

Stash requires ffmpeg. If you don't have it installed, Stash will download a copy for you. It is recommended that Linux users install ffmpeg from their distro's package manager.

Usage

Quickstart Guide

Stash is a web-based application. Once the application is running, the interface is available (by default) from http://localhost:9999.

On first run, Stash will prompt you for some configuration options and media directories to index, called "Scanning" in Stash. After scanning, your media will be available for browsing, curating, editing, and tagging.

Stash can pull metadata (performers, tags, descriptions, studios, and more) directly from many sites through the use of scrapers, which integrate directly into Stash.

Many community-maintained scrapers are available for download at the Community Scrapers Collection. The community also maintains StashDB, a crowd-sourced repository of scene, studio, and performer information, that can automatically identify much of a typical media collection. Inquire in the Discord for details. Identifying an entire collection will typically require a mix of multiple sources.

StashDB is the canonical instance of our open source metadata API, stash-box.

Translation

Translate 🇧🇷 🇨🇳 🇳🇱 🇬🇧 🇫🇮 🇫🇷 🇩🇪 🇮🇹 🇯🇵 🇪🇸 🇸🇪 🇹🇼 🇹🇷

Stash is available in 13 languages (so far!) and it could be in your language too. If you want to help us translate Stash into your language, you can make an account at translate.stashapp.cc to get started contributing new languages or improving existing ones. Thanks!

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, in the top right corner of the app (also available here
  • Join the Discord server, where the community can offer support.

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.

For Developers

Pull requests are welcome!

See Development and Contributing for information on working with the codebase, getting a local development setup, and contributing changes.

Description
Languages
Go 56.8%
TypeScript 40.1%
SCSS 2.5%
Makefile 0.2%
Dockerfile 0.1%