Total Pageviews

Sunday 21 April 2024

开源的视频文件与图像文件的管理程序-Stash



Stash是一款开源的视频与图像管理 Web 应用,基于 Go 编写,遵守AGPL开源协议。支持自部署,可将视频和图像按标签进行分类,以及信息提取与统计等功能。项目支持通过 Windows、macOS、Linux、Docker 等方式进行安装部署,并拥有多种 CSS 样式可供定制。

功能特色:
    Stash 从互联网上收集有关收藏的视频的信息,并且可以通过使用社区构建的插件为大量内容制作者和网站进行扩展。
    Stash 支持多种视频和图像格式。
    支持标记视频方便查找。
    Stash 提供有关表演者、标签、工作室等的统计数据。

源代码:https://github.com/stashapp/stash
-----------

An organizer for your porn, written in Go. Documentation: https://docs.stashapp.cc

stashapp.cc/ 

Stash

Build Docker pulls GitHub Sponsors Open Collective backers Go Report Card Matrix Discord GitHub release (latest by date) GitHub issues by-label

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

  • 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 consult the documentation or read the in-app manual.

Installing Stash

Windows macOS Linux Docker
Latest Release
Development Preview
Latest Release
Development Preview
Latest Release (amd64)
Development Preview (amd64)
More Architectures...
Instructions
Sample docker-compose.yml

Download links for other platforms and architectures are available on the Releases page.

First Run

Windows/macOS Users: Security Prompt

On Windows or macOS, running the app might present a security prompt since the binary isn't yet signed.

On Windows, bypass this by clicking "more info" and then the "run anyway" button. On macOS, Control+Click the app, click "Open", and then "Open" again.

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. Identifying an entire collection will typically require a mix of multiple sources:

  • The project maintains StashDB, a crowd-sourced repository of scene, studio, and performer information. Connecting it to Stash will allow you to automatically identify much of a typical media collection. It runs on our stash-box software and is primarily focused on mainstream digital scenes and studios. Instructions, invite codes, and more can be found in this guide to Accessing StashDB.
  • Several community-managed stash-box databases can also be connected to Stash in a similar manner. Each one serves a slightly different niche and follows their own methodology. A rundown of each stash-box, their differences, and the information you need to sign up can be found in this guide to Accessing Stash-Boxes.
  • Many community-maintained scrapers can also be downloaded, installed, and updated from within Stash, allowing you to pull data from a wide range of other websites and databases. They can be found by navigating to Settings -> Metadata Providers -> Available Scrapers -> Community (stable). These can be trickier to use than a stash-box because every scraper works a little differently. For more information, please visit the CommunityScrapers repository.
  • All of the above methods of scraping data into Stash are also covered in more detail in our Guide to Scraping.

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

Translation

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

Stash is available in 25 languages (so far!) and it could be in your language too. We use Weblate to coordinate community translations. If you want to help us translate Stash into your language, you can make an account at Stash's Weblate to get started contributing new languages or improving existing ones. Thanks!

Support (FAQ)

Check out our documentation on Stash-Docs for information about the software, questions, guides, add-ons and more.

For more help you can:

Customization

Themes and CSS Customization

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

You can also change the Stash interface to fit your desired style with various snippets from 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.

from https://github.com/stashapp/stash 

---------

Building from Source

Pre-requisites

Environment

Windows

  1. Download and install Go for Windows
  2. Download and extract MinGW64 (scroll down and select x86_64-posix-seh, don't use the autoinstaller, it doesn't work)
  3. Search for "Advanced System Settings" and open the System Properties dialog.
    1. Click the Environment Variables button
    2. Under System Variables find Path. Edit and add C:\MinGW\bin (replace with the correct path to where you extracted MingW64).

NOTE: The make command in Windows will be mingw32-make with MinGW. For example, make pre-ui will be mingw32-make pre-ui.

macOS

  1. If you don't have it already, install the Homebrew package manager.
  2. Install dependencies: brew install go git yarn gcc make node ffmpeg

Linux

Arch Linux

  1. Install dependencies: sudo pacman -S go git yarn gcc make nodejs ffmpeg --needed

Ubuntu

  1. Install dependencies: sudo apt-get install golang git yarnpkg gcc nodejs ffmpeg -y

OpenBSD

  1. Install dependencies doas pkg_add gmake go git yarn node cmake
  2. Compile a custom ffmpeg from ports. The default ffmpeg in OpenBSD's packages is not compiled with WebP support, which is required by Stash.
    • If you've already installed ffmpeg, uninstall it: doas pkg_delete ffmpeg
    • If you haven't already, fetch the ports tree and verify.
    • Find the ffmpeg port in /usr/ports/graphics/ffmpeg, and patch the Makefile to include libwebp
      • Add webp to WANTLIB
      • Add graphics/libwebp to the list in LIB_DEPENDS
      • Add -lwebp -lwebpdecoder -lwebpdemux -lwebpmux to LIBavcodec_EXTRALIBS
      • Add --enable-libweb to the list in CONFIGURE_ARGS
      • If you've already built ffmpeg from ports before, you may need to also increment REVISION
      • Run doas make install
    • Follow the instructions below to build a release, but replace the final step make build-release with gmake flags-release stash, to avoid the PIE buildmode.

NOTE: The make command in OpenBSD will be gmake. For example, make pre-ui will be gmake pre-ui.

Commands

  • make pre-ui - Installs the UI dependencies. This only needs to be run once after cloning the repository, or if the dependencies are updated.
  • make generate - Generates Go and UI GraphQL files. Requires make pre-ui to have been run.
  • make generate-stash-box-client - Generate Go files for the Stash-box client code.
  • make ui - Builds the UI. Requires make pre-ui to have been run.
  • make stash - Builds the stash binary (make sure to build the UI as well... see below)
  • make stash-macapp - Builds the Stash.app macOS app (only works when on macOS, for cross-compilation see below)
  • make phasher - Builds the phasher binary
  • make build - Builds both the stash and phasher binaries, alias for make stash phasher
  • make build-release - Builds release versions (debug information removed) of both the stash and phasher binaries, alias for make flags-release flags-pie build
  • make docker-build - Locally builds and tags a complete 'stash/build' docker image
  • make docker-cuda-build - Locally builds and tags a complete 'stash/cuda-build' docker image
  • make validate - Runs all of the tests and checks required to submit a PR
  • make lint - Runs golangci-lint on the backend
  • make it - Runs all unit and integration tests
  • make fmt - Formats the Go source code
  • make fmt-ui - Formats the UI source code
  • make server-start - Runs a development stash server in the .local directory
  • make server-clean - Removes the .local directory and all of its contents
  • make ui-start - Runs the UI in development mode. Requires a running Stash server to connect to - the server URL can be changed from the default of http://localhost:9999 using the environment variable VITE_APP_PLATFORM_URL, but keep in mind that authentication cannot be used since the session authorization cookie cannot be sent cross-origin. The UI runs on port 3000 or the next available port.

When building, you can optionally prepend flags-* targets to the target list in your make command to use different build flags:

  • flags-release (e.g. make flags-release stash) - Remove debug information from the binary.
  • flags-pie (e.g. make flags-pie build) - Build a PIE (Position Independent Executable) binary. This provides increased security, but it is unsupported on some systems (notably 32-bit ARM and OpenBSD).
  • flags-static (e.g. make flags-static phasher) - Build a statically linked binary (the default is a dynamically linked binary).
  • flags-static-pie (e.g. make flags-static-pie stash) - Build a statically linked PIE binary (using flags-static and flags-pie separately will not work).
  • flags-static-windows (e.g. make flags-static-windows build) - Identical to flags-static-pie, but does not enable the netgo build tag, which is not needed for static builds on Windows.

Local development quickstart

  1. Run make pre-ui to install UI dependencies
  2. Run make generate to create generated files
  3. In one terminal, run make server-start to run the server code
  4. In a separate terminal, run make ui-start to run the UI in development mode
  5. Open the UI in a browser: http://localhost:3000/

Changes to the UI code can be seen by reloading the browser page.

Changes to the backend code require a server restart (CTRL-C in the server terminal, followed by make server-start again) to be seen.

On first launch:

  1. On the "Stash Setup Wizard" screen, choose a directory with some files to test with
  2. Press "Next" to use the default locations for the database and generated content
  3. Press the "Confirm" and "Finish" buttons to get into the UI
  4. On the side menu, navigate to "Tasks -> Library -> Scan" and press the "Scan" button
  5. You're all set! Set any other configurations you'd like and test your code changes.

To start fresh with new configuration:

  1. Stop the server (CTRL-C in the server terminal)
  2. Run make server-clean to clear all config, database, and generated files (under .local)
  3. Run make server-start to restart the server
  4. Follow the "On first launch" steps above

Building a release

Simply run make or make release, or equivalently:

  1. Run make pre-ui to install UI dependencies
  2. Run make generate to create generated files
  3. Run make ui to build the frontend
  4. Run make build-release to build a release executable for your current platform

Cross-compiling

This project uses a modification of the CI-GoReleaser Docker container for cross-compilation, defined in docker/compiler/Dockerfile.

To cross-compile the app yourself:

  1. Run make pre-ui, make generate and make ui outside the container, to generate files and build the UI.
  2. Pull the latest compiler image from Docker Hub: docker pull stashapp/compiler
  3. Run docker run --rm --mount type=bind,source="$(pwd)",target=/stash -w /stash -it stashapp/compiler /bin/bash to open a shell inside the container.
  4. From inside the container, run make build-cc-all to build for all platforms, or run make build-cc-{platform} to build for a specific platform (have a look at the Makefile for the list of targets).
  5. You will find the compiled binaries in dist/.

NOTE: Since the container is run as UID 0 (root), the resulting binaries (and the dist/ folder itself, if it had to be created) will be owned by root.

Profiling

Stash can be profiled using the --cpuprofile <output profile filename> command line flag.

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

go tool pprof <path to binary> <path to profile filename>

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

go tool pprof -svg <path to binary> <path to profile filename> > <output svg file>

from https://github.com/stashapp/stash/blob/develop/docs/DEVELOPMENT.md

 

 

No comments:

Post a Comment