Improved/fixed macOS support (#4153)

* Fix macOS notifications
* Change CFBundleIdentifier to match domain
* Distribute Stash.app
* Also build universal phasher binary
* Fix binary name in check_version.go
* Expose GOOS, working dir and home dir in systemStatus endpoint
* Disable setup in working directory when running Stash.app
* More Makefile improvements, remove unused scripts
* Improve READMEs and documentation
This commit is contained in:
DingDongSoLong4 2023-11-19 01:36:13 +02:00 committed by GitHub
parent 72779e618d
commit 4dd4c3c658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 345 additions and 381 deletions

View file

@ -84,13 +84,12 @@ jobs:
- name: Compile for all supported platforms - name: Compile for all supported platforms
run: | run: |
docker exec -t build /bin/bash -c "make cross-compile-windows" docker exec -t build /bin/bash -c "make build-cc-windows"
docker exec -t build /bin/bash -c "make cross-compile-macos-intel" docker exec -t build /bin/bash -c "make build-cc-macos"
docker exec -t build /bin/bash -c "make cross-compile-macos-applesilicon" docker exec -t build /bin/bash -c "make build-cc-linux"
docker exec -t build /bin/bash -c "make cross-compile-linux" docker exec -t build /bin/bash -c "make build-cc-linux-arm64v8"
docker exec -t build /bin/bash -c "make cross-compile-linux-arm64v8" docker exec -t build /bin/bash -c "make build-cc-linux-arm32v7"
docker exec -t build /bin/bash -c "make cross-compile-linux-arm32v7" docker exec -t build /bin/bash -c "make build-cc-linux-arm32v6"
docker exec -t build /bin/bash -c "make cross-compile-linux-arm32v6"
- name: Cleanup build container - name: Cleanup build container
run: docker rm -f -v build run: docker rm -f -v build
@ -98,7 +97,7 @@ jobs:
- name: Generate checksums - name: Generate checksums
run: | run: |
git describe --tags --exclude latest_develop | tee CHECKSUMS_SHA1 git describe --tags --exclude latest_develop | tee CHECKSUMS_SHA1
sha1sum dist/stash-* | sed 's/dist\///g' | tee -a CHECKSUMS_SHA1 sha1sum dist/Stash.app.zip dist/stash-* | sed 's/dist\///g' | tee -a CHECKSUMS_SHA1
echo "STASH_VERSION=$(git describe --tags --exclude latest_develop)" >> $GITHUB_ENV echo "STASH_VERSION=$(git describe --tags --exclude latest_develop)" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV echo "RELEASE_DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
@ -110,13 +109,13 @@ jobs:
name: stash-win.exe name: stash-win.exe
path: dist/stash-win.exe path: dist/stash-win.exe
- name: Upload OSX binary - name: Upload macOS binary
# only upload binaries for pull requests # only upload binaries for pull requests
if: ${{ github.event_name == 'pull_request' && github.base_ref != 'refs/heads/develop' && github.base_ref != 'refs/heads/master'}} if: ${{ github.event_name == 'pull_request' && github.base_ref != 'refs/heads/develop' && github.base_ref != 'refs/heads/master'}}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: stash-macos-intel name: stash-macos
path: dist/stash-macos-intel path: dist/stash-macos
- name: Upload Linux binary - name: Upload Linux binary
# only upload binaries for pull requests # only upload binaries for pull requests
@ -139,8 +138,8 @@ jobs:
automatic_release_tag: latest_develop automatic_release_tag: latest_develop
title: "${{ env.STASH_VERSION }}: Latest development build" title: "${{ env.STASH_VERSION }}: Latest development build"
files: | files: |
dist/stash-macos-intel dist/Stash.app.zip
dist/stash-macos-applesilicon dist/stash-macos
dist/stash-win.exe dist/stash-win.exe
dist/stash-linux dist/stash-linux
dist/stash-linux-arm64v8 dist/stash-linux-arm64v8
@ -157,8 +156,8 @@ jobs:
token: "${{ secrets.GITHUB_TOKEN }}" token: "${{ secrets.GITHUB_TOKEN }}"
allow_override: true allow_override: true
files: | files: |
dist/stash-macos-intel dist/Stash.app.zip
dist/stash-macos-applesilicon dist/stash-macos
dist/stash-win.exe dist/stash-win.exe
dist/stash-linux dist/stash-linux
dist/stash-linux-arm64v8 dist/stash-linux-arm64v8

1
.gitignore vendored
View file

@ -64,6 +64,7 @@ node_modules
*.db *.db
/stash /stash
/Stash.app
/phasher /phasher
dist dist
.DS_Store .DS_Store

276
Makefile
View file

@ -50,29 +50,42 @@ export CGO_ENABLED := 1
release: pre-ui generate ui build-release release: pre-ui generate ui build-release
# targets to set various build flags # targets to set various build flags
# use combinations on the make command-line to configure a build, e.g.:
# for a static-pie release build: `make flags-static-pie flags-release stash`
# for a static windows debug build: `make flags-static-windows stash`
# shell noop: prevents "nothing to be done" warnings
.PHONY: flags
flags:
ifdef IS_WIN_SHELL
@@
else
@:
endif
.PHONY: flags-release .PHONY: flags-release
flags-release: flags-release: flags
$(eval LDFLAGS += -s -w) $(eval LDFLAGS += -s -w)
$(eval GO_BUILD_FLAGS += -trimpath) $(eval GO_BUILD_FLAGS += -trimpath)
.PHONY: flags-pie .PHONY: flags-pie
flags-pie: flags-pie: flags
$(eval GO_BUILD_FLAGS += -buildmode=pie) $(eval GO_BUILD_FLAGS += -buildmode=pie)
.PHONY: flags-static .PHONY: flags-static
flags-static: flags-static: flags
$(eval LDFLAGS += -extldflags=-static) $(eval LDFLAGS += -extldflags=-static)
$(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo netgo) $(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo netgo)
.PHONY: flags-static-pie .PHONY: flags-static-pie
flags-static-pie: flags-static-pie: flags
$(eval LDFLAGS += -extldflags=-static-pie) $(eval LDFLAGS += -extldflags=-static-pie)
$(eval GO_BUILD_FLAGS += -buildmode=pie) $(eval GO_BUILD_FLAGS += -buildmode=pie)
$(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo netgo) $(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo netgo)
# identical to flags-static-pie, but excluding netgo, which is not needed on windows
.PHONY: flags-static-windows .PHONY: flags-static-windows
flags-static-windows: flags-static-windows: flags
$(eval LDFLAGS += -extldflags=-static-pie) $(eval LDFLAGS += -extldflags=-static-pie)
$(eval GO_BUILD_FLAGS += -buildmode=pie) $(eval GO_BUILD_FLAGS += -buildmode=pie)
$(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo) $(eval GO_BUILD_TAGS += sqlite_omit_load_extension osusergo)
@ -105,166 +118,141 @@ build-flags: build-info
stash: build-flags stash: build-flags
go build $(STASH_OUTPUT) $(BUILD_FLAGS) ./cmd/stash go build $(STASH_OUTPUT) $(BUILD_FLAGS) ./cmd/stash
.PHONY: stash-release
stash-release: flags-release
stash-release: flags-pie
stash-release: stash
.PHONY: stash-release-static
stash-release-static: flags-release
stash-release-static: flags-static-pie
stash-release-static: stash
.PHONY: stash-release-static-windows
stash-release-static-windows: flags-release
stash-release-static-windows: flags-static-windows
stash-release-static-windows: stash
.PHONY: phasher .PHONY: phasher
phasher: build-flags phasher: build-flags
go build $(PHASHER_OUTPUT) $(BUILD_FLAGS) ./cmd/phasher go build $(PHASHER_OUTPUT) $(BUILD_FLAGS) ./cmd/phasher
.PHONY: phasher-release
phasher-release: flags-release
phasher-release: flags-pie
phasher-release: phasher
.PHONY: phasher-release-static
phasher-release-static: flags-release
phasher-release-static: flags-static-pie
phasher-release-static: phasher
.PHONY: phasher-release-static-windows
phasher-release-static-windows: flags-release
phasher-release-static-windows: flags-static-windows
phasher-release-static-windows: phasher
# builds dynamically-linked debug binaries # builds dynamically-linked debug binaries
.PHONY: build .PHONY: build
build: stash phasher build: stash phasher
# builds dynamically-linked release binaries # builds dynamically-linked PIE release binaries
.PHONY: build-release .PHONY: build-release
build-release: stash-release phasher-release build-release: flags-release flags-pie build
# builds statically-linked release binaries # compile and bundle into Stash.app
.PHONY: build-release-static # for when on macOS itself
build-release-static: stash-release-static phasher-release-static .PHONY: stash-macapp
stash-macapp: STASH_OUTPUT := -o stash
stash-macapp: flags-release flags-pie stash
rm -rf Stash.app
cp -R scripts/macos-bundle Stash.app
mkdir Stash.app/Contents/MacOS
cp stash Stash.app/Contents/MacOS/stash
# build-release-static, but excluding netgo, which is not needed on windows # build-cc- targets should be run within the compiler docker container
.PHONY: build-release-static-windows
build-release-static-windows: stash-release-static-windows phasher-release-static-windows
# cross-compile- targets should be run within the compiler docker container build-cc-windows: export GOOS := windows
.PHONY: cross-compile-windows build-cc-windows: export GOARCH := amd64
cross-compile-windows: export GOOS := windows build-cc-windows: export CC := x86_64-w64-mingw32-gcc
cross-compile-windows: export GOARCH := amd64 build-cc-windows: export CXX := x86_64-w64-mingw32-g++
cross-compile-windows: export CC := x86_64-w64-mingw32-gcc build-cc-windows: STASH_OUTPUT := -o dist/stash-win.exe
cross-compile-windows: export CXX := x86_64-w64-mingw32-g++ build-cc-windows: PHASHER_OUTPUT :=-o dist/phasher-win.exe
cross-compile-windows: STASH_OUTPUT := -o dist/stash-win.exe build-cc-windows: flags-release
cross-compile-windows: PHASHER_OUTPUT := -o dist/phasher-win.exe build-cc-windows: flags-static-windows
cross-compile-windows: flags-release build-cc-windows: build
cross-compile-windows: flags-static-windows
cross-compile-windows: build
.PHONY: cross-compile-macos-intel .PHONY: build-cc-macos-intel
cross-compile-macos-intel: export GOOS := darwin build-cc-macos-intel: export GOOS := darwin
cross-compile-macos-intel: export GOARCH := amd64 build-cc-macos-intel: export GOARCH := amd64
cross-compile-macos-intel: export CC := o64-clang build-cc-macos-intel: export CC := o64-clang
cross-compile-macos-intel: export CXX := o64-clang++ build-cc-macos-intel: export CXX := o64-clang++
cross-compile-macos-intel: STASH_OUTPUT := -o dist/stash-macos-intel build-cc-macos-intel: STASH_OUTPUT := -o dist/stash-macos-intel
cross-compile-macos-intel: PHASHER_OUTPUT := -o dist/phasher-macos-intel build-cc-macos-intel: PHASHER_OUTPUT := -o dist/phasher-macos-intel
cross-compile-macos-intel: flags-release build-cc-macos-intel: flags-release
# can't use static build for OSX # can't use static build for macOS
cross-compile-macos-intel: flags-pie build-cc-macos-intel: flags-pie
cross-compile-macos-intel: build build-cc-macos-intel: build
.PHONY: cross-compile-macos-applesilicon .PHONY: build-cc-macos-arm
cross-compile-macos-applesilicon: export GOOS := darwin build-cc-macos-arm: export GOOS := darwin
cross-compile-macos-applesilicon: export GOARCH := arm64 build-cc-macos-arm: export GOARCH := arm64
cross-compile-macos-applesilicon: export CC := oa64e-clang build-cc-macos-arm: export CC := oa64e-clang
cross-compile-macos-applesilicon: export CXX := oa64e-clang++ build-cc-macos-arm: export CXX := oa64e-clang++
cross-compile-macos-applesilicon: STASH_OUTPUT := -o dist/stash-macos-applesilicon build-cc-macos-arm: STASH_OUTPUT := -o dist/stash-macos-arm
cross-compile-macos-applesilicon: PHASHER_OUTPUT := -o dist/phasher-macos-applesilicon build-cc-macos-arm: PHASHER_OUTPUT := -o dist/phasher-macos-arm
cross-compile-macos-applesilicon: flags-release build-cc-macos-arm: flags-release
# can't use static build for OSX # can't use static build for macOS
cross-compile-macos-applesilicon: flags-pie build-cc-macos-arm: flags-pie
cross-compile-macos-applesilicon: build build-cc-macos-arm: build
.PHONY: build-cc-macos
build-cc-macos:
make build-cc-macos-arm
make build-cc-macos-intel
# Combine into universal binaries
lipo -create -output dist/stash-macos dist/stash-macos-intel dist/stash-macos-arm
rm dist/stash-macos-intel dist/stash-macos-arm
lipo -create -output dist/phasher-macos dist/phasher-macos-intel dist/phasher-macos-arm
rm dist/phasher-macos-intel dist/phasher-macos-arm
.PHONY: cross-compile-macos
cross-compile-macos:
rm -rf dist/Stash.app dist/Stash-macos.zip
make cross-compile-macos-applesilicon
make cross-compile-macos-intel
# Combine into one universal binary
lipo -create -output dist/stash-macos-universal dist/stash-macos-intel dist/stash-macos-applesilicon
rm dist/stash-macos-intel dist/stash-macos-applesilicon
# Place into bundle and zip up # Place into bundle and zip up
rm -rf dist/Stash.app
cp -R scripts/macos-bundle dist/Stash.app cp -R scripts/macos-bundle dist/Stash.app
mkdir dist/Stash.app/Contents/MacOS mkdir dist/Stash.app/Contents/MacOS
mv dist/stash-macos-universal dist/Stash.app/Contents/MacOS/stash cp dist/stash-macos dist/Stash.app/Contents/MacOS/stash
cd dist && zip -r Stash-macos.zip Stash.app && cd .. cd dist && rm -f Stash.app.zip && zip -r Stash.app.zip Stash.app
rm -rf dist/Stash.app rm -rf dist/Stash.app
.PHONY: cross-compile-freebsd .PHONY: build-cc-freebsd
cross-compile-freebsd: export GOOS := freebsd build-cc-freebsd: export GOOS := freebsd
cross-compile-freebsd: export GOARCH := amd64 build-cc-freebsd: export GOARCH := amd64
cross-compile-freebsd: STASH_OUTPUT := -o dist/stash-freebsd build-cc-freebsd: STASH_OUTPUT := -o dist/stash-freebsd
cross-compile-freebsd: PHASHER_OUTPUT := -o dist/phasher-freebsd build-cc-freebsd: PHASHER_OUTPUT := -o dist/phasher-freebsd
cross-compile-freebsd: flags-release build-cc-freebsd: flags-release
cross-compile-freebsd: flags-static-pie build-cc-freebsd: flags-static-pie
cross-compile-freebsd: build build-cc-freebsd: build
.PHONY: cross-compile-linux .PHONY: build-cc-linux
cross-compile-linux: export GOOS := linux build-cc-linux: export GOOS := linux
cross-compile-linux: export GOARCH := amd64 build-cc-linux: export GOARCH := amd64
cross-compile-linux: STASH_OUTPUT := -o dist/stash-linux build-cc-linux: STASH_OUTPUT := -o dist/stash-linux
cross-compile-linux: PHASHER_OUTPUT := -o dist/phasher-linux build-cc-linux: PHASHER_OUTPUT := -o dist/phasher-linux
cross-compile-linux: flags-release build-cc-linux: flags-release
cross-compile-linux: flags-static-pie build-cc-linux: flags-static-pie
cross-compile-linux: build build-cc-linux: build
.PHONY: cross-compile-linux-arm64v8 .PHONY: build-cc-linux-arm64v8
cross-compile-linux-arm64v8: export GOOS := linux build-cc-linux-arm64v8: export GOOS := linux
cross-compile-linux-arm64v8: export GOARCH := arm64 build-cc-linux-arm64v8: export GOARCH := arm64
cross-compile-linux-arm64v8: export CC := aarch64-linux-gnu-gcc build-cc-linux-arm64v8: export CC := aarch64-linux-gnu-gcc
cross-compile-linux-arm64v8: STASH_OUTPUT := -o dist/stash-linux-arm64v8 build-cc-linux-arm64v8: STASH_OUTPUT := -o dist/stash-linux-arm64v8
cross-compile-linux-arm64v8: PHASHER_OUTPUT := -o dist/phasher-linux-arm64v8 build-cc-linux-arm64v8: PHASHER_OUTPUT := -o dist/phasher-linux-arm64v8
cross-compile-linux-arm64v8: flags-release build-cc-linux-arm64v8: flags-release
cross-compile-linux-arm64v8: flags-static-pie build-cc-linux-arm64v8: flags-static-pie
cross-compile-linux-arm64v8: build build-cc-linux-arm64v8: build
.PHONY: cross-compile-linux-arm32v7 .PHONY: build-cc-linux-arm32v7
cross-compile-linux-arm32v7: export GOOS := linux build-cc-linux-arm32v7: export GOOS := linux
cross-compile-linux-arm32v7: export GOARCH := arm build-cc-linux-arm32v7: export GOARCH := arm
cross-compile-linux-arm32v7: export GOARM := 7 build-cc-linux-arm32v7: export GOARM := 7
cross-compile-linux-arm32v7: export CC := arm-linux-gnueabi-gcc -march=armv7-a build-cc-linux-arm32v7: export CC := arm-linux-gnueabi-gcc -march=armv7-a
cross-compile-linux-arm32v7: STASH_OUTPUT := -o dist/stash-linux-arm32v7 build-cc-linux-arm32v7: STASH_OUTPUT := -o dist/stash-linux-arm32v7
cross-compile-linux-arm32v7: PHASHER_OUTPUT := -o dist/phasher-linux-arm32v7 build-cc-linux-arm32v7: PHASHER_OUTPUT := -o dist/phasher-linux-arm32v7
cross-compile-linux-arm32v7: flags-release build-cc-linux-arm32v7: flags-release
cross-compile-linux-arm32v7: flags-static build-cc-linux-arm32v7: flags-static
cross-compile-linux-arm32v7: build build-cc-linux-arm32v7: build
.PHONY: cross-compile-linux-arm32v6 .PHONY: build-cc-linux-arm32v6
cross-compile-linux-arm32v6: export GOOS := linux build-cc-linux-arm32v6: export GOOS := linux
cross-compile-linux-arm32v6: export GOARCH := arm build-cc-linux-arm32v6: export GOARCH := arm
cross-compile-linux-arm32v6: export GOARM := 6 build-cc-linux-arm32v6: export GOARM := 6
cross-compile-linux-arm32v6: export CC := arm-linux-gnueabi-gcc build-cc-linux-arm32v6: export CC := arm-linux-gnueabi-gcc
cross-compile-linux-arm32v6: STASH_OUTPUT := -o dist/stash-linux-arm32v6 build-cc-linux-arm32v6: STASH_OUTPUT := -o dist/stash-linux-arm32v6
cross-compile-linux-arm32v6: PHASHER_OUTPUT := -o dist/phasher-linux-arm32v6 build-cc-linux-arm32v6: PHASHER_OUTPUT := -o dist/phasher-linux-arm32v6
cross-compile-linux-arm32v6: flags-release build-cc-linux-arm32v6: flags-release
cross-compile-linux-arm32v6: flags-static build-cc-linux-arm32v6: flags-static
cross-compile-linux-arm32v6: build build-cc-linux-arm32v6: build
.PHONY: cross-compile-all .PHONY: build-cc-all
cross-compile-all: build-cc-all:
make cross-compile-windows make build-cc-windows
make cross-compile-macos-intel make build-cc-macos
make cross-compile-macos-applesilicon make build-cc-linux
make cross-compile-linux make build-cc-linux-arm64v8
make cross-compile-linux-arm64v8 make build-cc-linux-arm32v7
make cross-compile-linux-arm32v7 make build-cc-linux-arm32v6
make cross-compile-linux-arm32v6
.PHONY: touch-ui .PHONY: touch-ui
touch-ui: touch-ui:
@ -360,14 +348,6 @@ endif
ui: ui-env ui: ui-env
cd ui/v2.5 && yarn build cd ui/v2.5 && yarn build
.PHONY: ui-nolegacy
ui-nolegacy: STASH_NOLEGACY := true
ui-nolegacy: ui
.PHONY: ui-sourcemaps
ui-sourcemaps: STASH_SOURCEMAPS := true
ui-sourcemaps: ui
.PHONY: ui-start .PHONY: ui-start
ui-start: ui-env ui-start: ui-env
cd ui/v2.5 && yarn start --host cd ui/v2.5 && yarn start --host

View file

@ -29,8 +29,13 @@ For further information you can consult the [documentation](https://docs.stashap
[Latest Release](https://github.com/stashapp/stash/releases/latest/download/stash-win.exe) <br /> <sup><sub>[Development Preview](https://github.com/stashapp/stash/releases/download/latest_develop/stash-win.exe)</sub></sup> | [Latest Release (Apple Silicon)](https://github.com/stashapp/stash/releases/latest/download/stash-macos-applesilicon) <br /> <sup><sub>[Development Preview (Apple Silicon)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-macos-applesilicon)</sub></sup> <br />[Latest Release (Intel)](https://github.com/stashapp/stash/releases/latest/download/stash-macos-intel) <br /> <sup><sub>[Development Preview (Intel)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-macos-intel)</sub></sup> | [Latest Release (amd64)](https://github.com/stashapp/stash/releases/latest/download/stash-linux) <br /> <sup><sub>[Development Preview (amd64)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-linux)</sub></sup> <br /> [More Architectures...](https://github.com/stashapp/stash/releases/latest) | [Instructions](docker/production/README.md) <br /> <sup><sub> [Sample docker-compose.yml](docker/production/docker-compose.yml)</sub></sup> [Latest Release](https://github.com/stashapp/stash/releases/latest/download/stash-win.exe) <br /> <sup><sub>[Development Preview](https://github.com/stashapp/stash/releases/download/latest_develop/stash-win.exe)</sub></sup> | [Latest Release (Apple Silicon)](https://github.com/stashapp/stash/releases/latest/download/stash-macos-applesilicon) <br /> <sup><sub>[Development Preview (Apple Silicon)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-macos-applesilicon)</sub></sup> <br />[Latest Release (Intel)](https://github.com/stashapp/stash/releases/latest/download/stash-macos-intel) <br /> <sup><sub>[Development Preview (Intel)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-macos-intel)</sub></sup> | [Latest Release (amd64)](https://github.com/stashapp/stash/releases/latest/download/stash-linux) <br /> <sup><sub>[Development Preview (amd64)](https://github.com/stashapp/stash/releases/download/latest_develop/stash-linux)</sub></sup> <br /> [More Architectures...](https://github.com/stashapp/stash/releases/latest) | [Instructions](docker/production/README.md) <br /> <sup><sub> [Sample docker-compose.yml](docker/production/docker-compose.yml)</sub></sup>
## First Run ## 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. #### 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 #### 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. 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.

View file

@ -1 +1 @@
This dockerfile is used by travis to build the stash image. It must be run after cross-compiling - that is, `stash-linux` must exist in the `dist` directory. This image must be built from the `dist` directory. This Dockerfile is used by CI to build the `stashapp/stash` Docker image. It must be run after cross-compiling - that is, `stash-linux` must exist in the `dist` directory. This image must be built from the `dist` directory.

View file

@ -1,3 +1,3 @@
Modified from https://github.com/bep/dockerfiles/tree/master/ci-goreleaser Modified from https://github.com/bep/dockerfiles/tree/master/ci-goreleaser
When the dockerfile is changed, the version number should be incremented in the Makefile and the new version tag should be pushed to docker hub. The `scripts/cross-compile.sh` script should also be updated to use the new version number tag, and the github workflow files need to be updated to pull the correct image tag. When the Dockerfile is changed, the version number should be incremented in the Makefile and the new version tag should be pushed to Docker Hub. The GitHub workflow files also need to be updated to pull the correct image tag.

View file

@ -60,11 +60,10 @@ NOTE: The `make` command in OpenBSD will be `gmake`. For example, `make pre-ui`
* `make generate-stash-box-client` - Generate Go files for the Stash-box client code. * `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 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` - Builds the `stash` binary (make sure to build the UI as well... see below)
* `make stash-release` - Builds a release version the `stash` binary, with debug information removed * `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 phasher` - Builds the `phasher` binary
* `make phasher-release` - Builds a release version the `phasher` binary, with debug information removed * `make build` - Builds both the `stash` and `phasher` binaries, alias for `make stash phasher`
* `make build` - Builds both the `stash` and `phasher` binaries * `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 build-release` - Builds release versions of both the `stash` and `phasher` binaries
* `make docker-build` - Locally builds and tags a complete 'stash/build' docker image * `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 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 validate` - Runs all of the tests and checks required to submit a PR
@ -76,6 +75,14 @@ NOTE: The `make` command in OpenBSD will be `gmake`. For example, `make pre-ui`
* `make server-clean` - Removes the `.local` directory and all of its contents * `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. * `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 ## Local development quickstart
1. Run `make pre-ui` to install UI dependencies 1. Run `make pre-ui` to install UI dependencies
@ -112,13 +119,19 @@ Simply run `make` or `make release`, or equivalently:
3. Run `make ui` to build the frontend 3. Run `make ui` to build the frontend
4. Run `make build-release` to build a release executable for your current platform 4. Run `make build-release` to build a release executable for your current platform
## Cross compiling ## Cross-compiling
This project uses a modification of the [CI-GoReleaser](https://github.com/bep/dockerfiles/tree/master/ci-goreleaser) docker container to create an environment This project uses a modification of the [CI-GoReleaser](https://github.com/bep/dockerfiles/tree/master/ci-goreleaser) Docker container for cross-compilation, defined in `docker/compiler/Dockerfile`.
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 stashapp/compiler:latest /bin/bash` 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 ## Profiling

2
go.mod
View file

@ -28,7 +28,7 @@ require (
github.com/jinzhu/copier v0.4.0 github.com/jinzhu/copier v0.4.0
github.com/jmoiron/sqlx v1.3.5 github.com/jmoiron/sqlx v1.3.5
github.com/json-iterator/go v1.1.12 github.com/json-iterator/go v1.1.12
github.com/kermieisinthehouse/gosx-notifier v0.1.1 github.com/kermieisinthehouse/gosx-notifier v0.1.2
github.com/kermieisinthehouse/systray v1.2.4 github.com/kermieisinthehouse/systray v1.2.4
github.com/lucasb-eyer/go-colorful v1.2.0 github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mattn/go-sqlite3 v1.14.17 github.com/mattn/go-sqlite3 v1.14.17

4
go.sum
View file

@ -358,8 +358,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kermieisinthehouse/gosx-notifier v0.1.1 h1:lVXyKsa1c1RUkckp3KayloNLoI//fUwVYye3RPSPtEw= github.com/kermieisinthehouse/gosx-notifier v0.1.2 h1:KV0KBeKK2B24kIHY7iK0jgS64Q05f4oB+hUZmsPodxQ=
github.com/kermieisinthehouse/gosx-notifier v0.1.1/go.mod h1:xyWT07azFtUOcHl96qMVvKhvKzsMcS7rKTHQyv8WTho= github.com/kermieisinthehouse/gosx-notifier v0.1.2/go.mod h1:xyWT07azFtUOcHl96qMVvKhvKzsMcS7rKTHQyv8WTho=
github.com/kermieisinthehouse/systray v1.2.4 h1:pdH5vnl+KKjRrVCRU4g/2W1/0HVzuuJ6WXHlPPHYY6s= github.com/kermieisinthehouse/systray v1.2.4 h1:pdH5vnl+KKjRrVCRU4g/2W1/0HVzuuJ6WXHlPPHYY6s=
github.com/kermieisinthehouse/systray v1.2.4/go.mod h1:axh6C/jNuSyC0QGtidZJURc9h+h41HNoMySoLVrhVR4= github.com/kermieisinthehouse/systray v1.2.4/go.mod h1:axh6C/jNuSyC0QGtidZJURc9h+h41HNoMySoLVrhVR4=
github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM=

View file

@ -5,5 +5,8 @@ query SystemStatus {
appSchema appSchema
status status
configPath configPath
os
workingDir
homeDir
} }
} }

View file

@ -303,6 +303,9 @@ type SystemStatus {
configPath: String configPath: String
appSchema: Int! appSchema: Int!
status: SystemStatusEnum! status: SystemStatusEnum!
os: String!
workingDir: String!
homeDir: String!
} }
input MigrateInput { input MigrateInput {

View file

@ -26,8 +26,8 @@ const defaultSHLength int = 8 // default length of SHA short hash returned by <g
var stashReleases = func() map[string]string { var stashReleases = func() map[string]string {
return map[string]string{ return map[string]string{
"darwin/amd64": "stash-osx", "darwin/amd64": "stash-macos",
"darwin/arm64": "stash-osx-applesilicon", "darwin/arm64": "stash-macos",
"linux/amd64": "stash-linux", "linux/amd64": "stash-linux",
"windows/amd64": "stash-win.exe", "windows/amd64": "stash-win.exe",
"linux/arm": "stash-linux-arm32v6", "linux/arm": "stash-linux-arm32v6",

View file

@ -23,7 +23,8 @@ func sendNotification(notificationTitle string, notificationText string) {
notification := gosxnotifier.NewNotification(notificationText) notification := gosxnotifier.NewNotification(notificationText)
notification.Title = notificationTitle notification.Title = notificationTitle
notification.AppIcon = getIconPath() notification.AppIcon = getIconPath()
notification.Link = getServerURL("") notification.Open = getServerURL("")
notification.Sender = "cc.stashapp.stash"
err := notification.Push() err := notification.Push()
if err != nil { if err != nil {

View file

@ -7,6 +7,7 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"runtime/pprof" "runtime/pprof"
"strconv" "strconv"
"strings" "strings"
@ -46,6 +47,9 @@ type SystemStatus struct {
ConfigPath *string `json:"configPath"` ConfigPath *string `json:"configPath"`
AppSchema int `json:"appSchema"` AppSchema int `json:"appSchema"`
Status SystemStatusEnum `json:"status"` Status SystemStatusEnum `json:"status"`
Os string `json:"os"`
WorkingDir string `json:"working_dir"`
HomeDir string `json:"home_dir"`
} }
type SystemStatusEnum string type SystemStatusEnum string
@ -740,20 +744,27 @@ func (s *Manager) Migrate(ctx context.Context, input MigrateInput) error {
} }
func (s *Manager) GetSystemStatus() *SystemStatus { func (s *Manager) GetSystemStatus() *SystemStatus {
workingDir := fsutil.GetWorkingDirectory()
homeDir := fsutil.GetHomeDirectory()
database := s.Database database := s.Database
status := SystemStatusEnumOk
dbSchema := int(database.Version()) dbSchema := int(database.Version())
dbPath := database.DatabasePath() dbPath := database.DatabasePath()
appSchema := int(database.AppSchemaVersion()) appSchema := int(database.AppSchemaVersion())
configFile := s.Config.GetConfigFile()
status := SystemStatusEnumOk
if s.Config.IsNewSystem() { if s.Config.IsNewSystem() {
status = SystemStatusEnumSetup status = SystemStatusEnumSetup
} else if dbSchema < appSchema { } else if dbSchema < appSchema {
status = SystemStatusEnumNeedsMigration status = SystemStatusEnumNeedsMigration
} }
configFile := s.Config.GetConfigFile()
return &SystemStatus{ return &SystemStatus{
Os: runtime.GOOS,
WorkingDir: workingDir,
HomeDir: homeDir,
DatabaseSchema: &dbSchema, DatabaseSchema: &dbSchema,
DatabasePath: &dbPath, DatabasePath: &dbPath,
AppSchema: appSchema, AppSchema: appSchema,

View file

@ -45,6 +45,16 @@ func IsPathInDirs(dirs []string, pathToCheck string) bool {
return false return false
} }
// GetWorkingDirectory returns the current working directory.
func GetWorkingDirectory() string {
ret, err := os.Getwd()
if err != nil {
// if we can't get cwd for whatever reason, just return "."
ret = "."
}
return ret
}
// GetHomeDirectory returns the path of the user's home directory. ~ on Unix and C:\Users\UserName on Windows // GetHomeDirectory returns the path of the user's home directory. ~ on Unix and C:\Users\UserName on Windows
func GetHomeDirectory() string { func GetHomeDirectory() string {
currentUser, err := user.Current() currentUser, err := user.Current()

View file

@ -1,55 +0,0 @@
#!/bin/bash
COMPILER_CONTAINER="stashapp/compiler:7"
BUILD_DATE=`go run scripts/getDate.go`
GITHASH=`git rev-parse --short HEAD`
STASH_VERSION=`git describe --tags --exclude latest_develop`
SETENV="BUILD_DATE=\"$BUILD_DATE\" GITHASH=$GITHASH STASH_VERSION=\"$STASH_VERSION\""
SETUP="export CGO_ENABLED=1;"
WINDOWS="echo '=== Building Windows binary ==='; $SETENV make cross-compile-windows;"
DARWIN="echo '=== Building OSX binary ==='; $SETENV make cross-compile-macos-intel;"
DARWIN_ARM64="echo '=== Building OSX (arm64) binary ==='; $SETENV make cross-compile-macos-applesilicon;"
LINUX_AMD64="echo '=== Building Linux (amd64) binary ==='; $SETENV make cross-compile-linux;"
LINUX_ARM64v8="echo '=== Building Linux (armv8/arm64) binary ==='; $SETENV make cross-compile-linux-arm64v8;"
LINUX_ARM32v7="echo '=== Building Linux (armv7/armhf) binary ==='; $SETENV make cross-compile-linux-arm32v7;"
LINUX_ARM32v6="echo '=== Building Linux (armv6 | Raspberry Pi 1) binary ==='; $SETENV make cross-compile-pi;"
BUILD_COMPLETE="echo '=== Build complete ==='"
BUILD=`echo "$1" | cut -d - -f 1`
if [ "$BUILD" == "windows" ]
then
echo "Building Windows"
COMMAND="$SETUP $WINDOWS $BUILD_COMPLETE"
elif [ "$BUILD" == "darwin" ]
then
echo "Building Darwin(MacOSX)"
COMMAND="$SETUP $DARWIN $BUILD_COMPLETE"
elif [ "$BUILD" == "amd64" ]
then
echo "Building Linux AMD64"
COMMAND="$SETUP $LINUX_AMD64 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm64v8" ]
then
echo "Building Linux ARM64v8"
COMMAND="$SETUP $LINUX_ARM64v8 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm32v6" ]
then
echo "Building Linux ARM32v6"
COMMAND="$SETUP $LINUX_ARM32v6 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm32v7" ]
then
echo "Building Linux ARM32v7"
COMMAND="$SETUP $LINUX_ARM32v7 $BUILD_COMPLETE"
else
echo "Building All"
COMMAND="$SETUP $WINDOWS $DARWIN $DARWIN_ARM64 $LINUX_AMD64 $LINUX_ARM64v8 $LINUX_ARM32v7 $LINUX_ARM32v6 $BUILD_COMPLETE"
fi
# Pull Latest Image
docker pull $COMPILER_CONTAINER
# Changed consistency to delegated since this is being used as a build tool. The binded volume shouldn't be changing during its run.
docker run --rm --mount type=bind,source="$(pwd)",target=/stash,consistency=delegated -w /stash $COMPILER_CONTAINER /bin/bash -c "$COMMAND"

View file

@ -9,7 +9,7 @@
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>icon.icns</string> <string>icon.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.stashapp.stash</string> <string>cc.stashapp.stash</string>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>
<string>True</string> <string>True</string>
<key>LSUIElement</key> <key>LSUIElement</key>

View file

@ -1,38 +0,0 @@
#!/bin/sh
# assumes cross-compile.sh has already been run successfully
uploadFile()
{
FILE=$1
BASENAME="$(basename "${FILE}")"
# get available server from gofile api
serverApi=$(curl -m 15 https://apiv2.gofile.io/getServer)
resp=$(echo "$serverApi" | cut -d "\"" -f 4)
# if no server is available abort
if [ $resp != "ok" ] ; then
echo "Upload of $BASENAME failed! Server not available."
echo
return
fi
server=$(echo "$serverApi" | cut -d "," -f 2 | cut -d "\"" -f 6)
# abort if it takes more than two minutes to upload
uploadedTo=$(curl -m 120 -F "email=stash@stashapp.cc" -F "file=@$FILE" "https://$server.gofile.io/uploadFile")
resp=$(echo "$uploadedTo" | cut -d "\"" -f 4)
if [ $resp = "ok" ] ; then
URL=$(echo "$uploadedTo"|cut -d "," -f 2 | cut -d "\"" -f 6)
echo "$BASENAME uploaded to url: \"https://gofile.io/d/$URL\""
fi
# print an extra newline
echo
}
uploadFile "dist/stash-osx"
uploadFile "dist/stash-win.exe"
uploadFile "dist/stash-linux"
echo "SHA1 Checksums"
cat CHECKSUMS_SHA1 | grep -v '\-pi\|\-arm'

View file

@ -54,12 +54,32 @@ export const Setup: React.FC = () => {
const [showBlobsDialog, setShowBlobsDialog] = useState(false); const [showBlobsDialog, setShowBlobsDialog] = useState(false);
const { data: systemStatus, loading: statusLoading } = useSystemStatus(); const { data: systemStatus, loading: statusLoading } = useSystemStatus();
const status = systemStatus?.systemStatus;
const windows = status?.os === "windows";
const pathSep = windows ? "\\" : "/";
const homeDir = windows ? "%USERPROFILE%" : "$HOME";
const pwd = windows ? "%CD%" : "$PWD";
function pathJoin(...paths: string[]) {
return paths.join(pathSep);
}
const workingDir = status?.workingDir ?? ".";
// When running Stash.app, the working directory is (usually) set to /.
// Assume that the user doesn't want to set up in / (it's usually mounted read-only anyway),
// so in this situation disallow setting up in the working directory.
const macApp = status?.os === "darwin" && workingDir === "/";
const fallbackStashDir = pathJoin(homeDir, ".stash");
const fallbackConfigPath = pathJoin(fallbackStashDir, "config.yml");
useEffect(() => { useEffect(() => {
if (systemStatus?.systemStatus.configPath) { if (status?.configPath) {
setConfigLocation(systemStatus.systemStatus.configPath); setConfigLocation(status.configPath);
} }
}, [systemStatus]); }, [status?.configPath]);
useEffect(() => { useEffect(() => {
if (configuration) { if (configuration) {
@ -181,6 +201,8 @@ export const Setup: React.FC = () => {
} }
function renderWelcome() { function renderWelcome() {
const homeDirPath = pathJoin(status?.homeDir ?? homeDir, ".stash");
return ( return (
<> <>
<section> <section>
@ -195,6 +217,7 @@ export const Setup: React.FC = () => {
id="setup.welcome.config_path_logic_explained" id="setup.welcome.config_path_logic_explained"
values={{ values={{
code: (chunks: string) => <code>{chunks}</code>, code: (chunks: string) => <code>{chunks}</code>,
fallback_path: fallbackConfigPath,
}} }}
/> />
</p> </p>
@ -225,14 +248,50 @@ export const Setup: React.FC = () => {
id="setup.welcome.in_current_stash_directory" id="setup.welcome.in_current_stash_directory"
values={{ values={{
code: (chunks: string) => <code>{chunks}</code>, code: (chunks: string) => <code>{chunks}</code>,
path: fallbackStashDir,
}} }}
/> />
<br />
<code>{homeDirPath}</code>
</Button> </Button>
<Button <Button
variant="secondary mx-2 p-5" variant="secondary mx-2 p-5"
onClick={() => onConfigLocationChosen("config.yml")} onClick={() => onConfigLocationChosen("config.yml")}
disabled={macApp}
> >
<FormattedMessage id="setup.welcome.in_the_current_working_directory" /> {macApp ? (
<>
<FormattedMessage
id="setup.welcome.in_the_current_working_directory_disabled"
values={{
code: (chunks: string) => <code>{chunks}</code>,
path: pwd,
}}
/>
<br />
<b>
<FormattedMessage
id="setup.welcome.in_the_current_working_directory_disabled_macos"
values={{
code: (chunks: string) => <code>{chunks}</code>,
br: () => <br />,
}}
/>
</b>
</>
) : (
<>
<FormattedMessage
id="setup.welcome.in_the_current_working_directory"
values={{
code: (chunks: string) => <code>{chunks}</code>,
path: pwd,
}}
/>
<br />
<code>{workingDir}</code>
</>
)}
</Button> </Button>
</div> </div>
</section> </section>
@ -511,18 +570,6 @@ export const Setup: React.FC = () => {
); );
} }
function renderConfigLocation() {
if (configLocation === "config.yml") {
return <code>&lt;current working directory&gt;/config.yml</code>;
}
if (configLocation === "") {
return <code>$HOME/.stash/config.yml</code>;
}
return <code>{configLocation}</code>;
}
function maybeRenderExclusions(s: GQL.StashConfig) { function maybeRenderExclusions(s: GQL.StashConfig) {
if (!s.excludeImage && !s.excludeVideo) { if (!s.excludeImage && !s.excludeVideo) {
return; return;
@ -539,19 +586,6 @@ export const Setup: React.FC = () => {
return `(excludes ${excludes.join(" and ")})`; return `(excludes ${excludes.join(" and ")})`;
} }
function renderStashLibraries() {
return (
<ul>
{stashes.map((s) => (
<li key={s.path}>
<code>{s.path} </code>
{maybeRenderExclusions(s)}
</li>
))}
</ul>
);
}
async function onSave() { async function onSave() {
try { try {
setLoading(true); setLoading(true);
@ -582,6 +616,42 @@ export const Setup: React.FC = () => {
} }
function renderConfirm() { function renderConfirm() {
let cfgPath = "";
let config = configLocation;
if (configLocation === "config.yml") {
cfgPath = pwd;
config = pathJoin(cfgPath, "config.yml");
} else if (configLocation === "") {
cfgPath = fallbackStashDir;
config = pathJoin(cfgPath, "config.yml");
}
let database = databaseFile;
if (database === "") {
database = pathJoin(cfgPath, "stash-go.sqlite");
}
let generated = generatedLocation;
if (generated === "") {
generated = pathJoin(cfgPath, "generated");
}
let cache = cacheLocation;
if (cache === "") {
cache = pathJoin(cfgPath, "cache");
}
let blobs;
if (storeBlobsInDatabase) {
blobs = intl.formatMessage({
id: "setup.confirm.blobs_use_database",
});
} else if (blobsLocation !== "") {
blobs = blobsLocation;
} else {
blobs = pathJoin(cfgPath, "blobs");
}
return ( return (
<> <>
<section> <section>
@ -595,26 +665,31 @@ export const Setup: React.FC = () => {
<dt> <dt>
<FormattedMessage id="setup.confirm.configuration_file_location" /> <FormattedMessage id="setup.confirm.configuration_file_location" />
</dt> </dt>
<dd>{renderConfigLocation()}</dd> <dd>
<code>{config}</code>
</dd>
</dl> </dl>
<dl> <dl>
<dt> <dt>
<FormattedMessage id="setup.confirm.stash_library_directories" /> <FormattedMessage id="setup.confirm.stash_library_directories" />
</dt> </dt>
<dd>{renderStashLibraries()}</dd> <dd>
<ul>
{stashes.map((s) => (
<li key={s.path}>
<code>{s.path} </code>
{maybeRenderExclusions(s)}
</li>
))}
</ul>
</dd>
</dl> </dl>
<dl> <dl>
<dt> <dt>
<FormattedMessage id="setup.confirm.database_file_path" /> <FormattedMessage id="setup.confirm.database_file_path" />
</dt> </dt>
<dd> <dd>
<code> <code>{database}</code>
{databaseFile !== ""
? databaseFile
: intl.formatMessage({
id: "setup.confirm.default_db_location",
})}
</code>
</dd> </dd>
</dl> </dl>
<dl> <dl>
@ -622,13 +697,7 @@ export const Setup: React.FC = () => {
<FormattedMessage id="setup.confirm.generated_directory" /> <FormattedMessage id="setup.confirm.generated_directory" />
</dt> </dt>
<dd> <dd>
<code> <code>{generated}</code>
{generatedLocation !== ""
? generatedLocation
: intl.formatMessage({
id: "setup.confirm.default_generated_content_location",
})}
</code>
</dd> </dd>
</dl> </dl>
<dl> <dl>
@ -636,29 +705,15 @@ export const Setup: React.FC = () => {
<FormattedMessage id="setup.confirm.cache_directory" /> <FormattedMessage id="setup.confirm.cache_directory" />
</dt> </dt>
<dd> <dd>
<code> <code>{cache}</code>
{cacheLocation !== ""
? cacheLocation
: intl.formatMessage({
id: "setup.confirm.default_cache_location",
})}
</code>
</dd> </dd>
</dl>
<dl>
<dt> <dt>
<FormattedMessage id="setup.confirm.blobs_directory" /> <FormattedMessage id="setup.confirm.blobs_directory" />
</dt> </dt>
<dd> <dd>
<code> <code>{blobs}</code>
{storeBlobsInDatabase
? intl.formatMessage({
id: "setup.confirm.blobs_use_database",
})
: blobsLocation !== ""
? blobsLocation
: intl.formatMessage({
id: "setup.confirm.default_blobs_location",
})}
</code>
</dd> </dd>
</dl> </dl>
</section> </section>
@ -803,18 +858,14 @@ export const Setup: React.FC = () => {
return <LoadingIndicator />; return <LoadingIndicator />;
} }
if ( if (step === 0 && status && status.status !== GQL.SystemStatusEnum.Setup) {
step === 0 &&
systemStatus &&
systemStatus.systemStatus.status !== GQL.SystemStatusEnum.Setup
) {
// redirect to main page // redirect to main page
history.push("/"); history.push("/");
return <LoadingIndicator />; return <LoadingIndicator />;
} }
const welcomeStep = const welcomeStep =
systemStatus && systemStatus.systemStatus.configPath !== "" status && status.configPath !== ""
? renderWelcomeSpecificConfig ? renderWelcomeSpecificConfig
: renderWelcome; : renderWelcome;
const steps = [welcomeStep, renderSetPaths, renderConfirm, renderFinish]; const steps = [welcomeStep, renderSetPaths, renderConfirm, renderFinish];

View file

@ -6,41 +6,23 @@ Financial contributions are welcomed and are accepted using [Open Collective](ht
## Development-related ## Development-related
The Stash backend is written in golang with a sqlite database. The UI is written in react. Bug fixes, improvements and new features are welcomed. Please see the [README.md](https://github.com/stashapp/stash/blob/develop/docs/DEVELOPMENT.md) file for details on how to get started. Assistance can be provided via our [Discord](https://discord.gg/2TsNFKt). The Stash backend is written in Go, using a SQLite database. The UI is written in Typescript, using React. Bug fixes, improvements and new features are welcomed. Please see the [DEVELOPMENT.md](https://github.com/stashapp/stash/blob/develop/docs/DEVELOPMENT.md) file for details on how to get started. Assistance is available via our [Discord](https://discord.gg/2TsNFKt).
## Documentation ## Documentation
Efforts to improve documentation in stash helps new users and reduces the amount of questions we have to field in Discord. Contributions to documentation are welcomed. While submitting documentation changes via git pull requests is ideal, we will gladly accept submissions via [github issues](https://github.com/stashapp/stash/issues) or on [Discord](https://discord.gg/2TsNFKt). Efforts to improve documentation in Stash helps new users and reduces the number of questions we have to field in Discord. Contributions to documentation are welcomed. While submitting documentation changes via GitHub pull requests is ideal, we will gladly accept submissions via [GitHub issues](https://github.com/stashapp/stash/issues) or on [Discord](https://discord.gg/2TsNFKt).
For those with web page experience, we also welcome contributions to our [website](https://stashapp.cc/) (which as of writing is very undeveloped). For those with web page experience, we also welcome contributions to our [website](https://stashapp.cc/) (which as of writing is very undeveloped).
## Testing features, improvements and bug fixes ## Testing features, improvements and bug fixes
Testing is currently covered by a very small group, so new testers are welcomed. Being able to build stash locally is ideal, but custom binaries for pull requests are available by navigating to the `continuous-integration/travis-ci/pr` travis check details. Testing is currently covered by a very small group, so new testers are welcomed. Being able to build Stash locally is ideal, but binaries for pull requests are also available.
The link to the custom binary for each platform can be found at the end of the build log, and looks like the following: First, you will need to be signed in to GitHub. Find and open the relevant pull request, and then click on the `Checks` tab. On the right, there should be a button titled `Artifacts` - click that, and you should get a dropdown with links to download binaries built from that pull request for Linux, Windows and macOS.
```
$ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./scripts/upload-pull-request.sh; fi
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 43.1M 100 35 100 43.1M 3 3812k 0:00:11 0:00:11 --:--:-- 5576k
stash-osx uploaded to url: https://transfer.sh/.../stash-osx
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 60.7M 100 39 100 60.7M 3 5391k 0:00:13 0:00:11 0:00:02 7350k
stash-win.exe uploaded to url: https://transfer.sh/.../stash-win.exe
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 44.6M 100 37 100 44.6M 2 3648k 0:00:18 0:00:12 0:00:06 7504k
stash-linux uploaded to url: https://transfer.sh/.../stash-linux
```
The `if` line will need to be expanded to see the details.
## Submitting and contributing to bug reports, improvements and new features ## Submitting and contributing to bug reports, improvements and new features
We welcome contributions for future improvements and features, and bug reports help everyone. These can all be found in the [github issues](https://github.com/stashapp/stash/issues). We welcome ideas for future improvements and features, and bug reports help everyone. These can all be found on [GitHub](https://github.com/stashapp/stash/issues).
## Providing support ## Providing support

View file

@ -1162,14 +1162,10 @@
"confirm": { "confirm": {
"almost_ready": "We're almost ready to complete the configuration. Please confirm the following settings. You can click back to change anything incorrect. If everything looks good, click Confirm to create your system.", "almost_ready": "We're almost ready to complete the configuration. Please confirm the following settings. You can click back to change anything incorrect. If everything looks good, click Confirm to create your system.",
"blobs_directory": "Binary data directory", "blobs_directory": "Binary data directory",
"blobs_use_database": "<use database>", "blobs_use_database": "<using database>",
"cache_directory": "Cache directory", "cache_directory": "Cache directory",
"configuration_file_location": "Configuration file location:", "configuration_file_location": "Configuration file location:",
"database_file_path": "Database file path", "database_file_path": "Database file path",
"default_blobs_location": "<path containing configuration file>/blobs",
"default_cache_location": "<path containing configuration file>/cache",
"default_db_location": "<path containing configuration file>/stash-go.sqlite",
"default_generated_content_location": "<path containing configuration file>/generated",
"generated_directory": "Generated directory", "generated_directory": "Generated directory",
"nearly_there": "Nearly there!", "nearly_there": "Nearly there!",
"stash_library_directories": "Stash library directories" "stash_library_directories": "Stash library directories"
@ -1237,10 +1233,12 @@
"your_system_has_been_created": "Success! Your system has been created!" "your_system_has_been_created": "Success! Your system has been created!"
}, },
"welcome": { "welcome": {
"config_path_logic_explained": "Stash tries to find its configuration file (<code>config.yml</code>) from the current working directory first, and if it does not find it there, it falls back to <code>$HOME/.stash/config.yml</code> (on Windows, this will be <code>%USERPROFILE%\\.stash\\config.yml</code>). You can also make Stash read from a specific configuration file by running it with the <code>-c '<path to config file>'</code> or <code>--config '<path to config file>'</code> options.", "config_path_logic_explained": "Stash tries to find its configuration file (<code>config.yml</code>) from the current working directory first, and if it does not find it there, it falls back to <code>{fallback_path}</code>. You can also make Stash read from a specific configuration file by running it with the <code>-c '<path to config file>'</code> or <code>--config '<path to config file>'</code> options.",
"in_current_stash_directory": "In the <code>$HOME/.stash</code> directory", "in_current_stash_directory": "In the <code>{path}</code> directory:",
"in_the_current_working_directory": "In the current working directory", "in_the_current_working_directory": "In <code>{path}</code>, the working directory, currently:",
"next_step": "With all of that out of the way, if you're ready to proceed with setting up a new system, choose where you'd like to store your configuration file and click Next.", "in_the_current_working_directory_disabled": "In <code>{path}</code>, the working directory:",
"in_the_current_working_directory_disabled_macos": "Unsupported when running <code>Stash.app</code>,<br></br>run <code>stash-macos</code> to set up in the working directory",
"next_step": "With all of that out of the way, if you're ready to proceed with setting up a new system, please choose where you'd like to store your configuration file.",
"store_stash_config": "Where do you want to store your Stash configuration?", "store_stash_config": "Where do you want to store your Stash configuration?",
"unable_to_locate_config": "If you're reading this, then Stash couldn't find an existing configuration. This wizard will guide you through the process of setting up a new configuration.", "unable_to_locate_config": "If you're reading this, then Stash couldn't find an existing configuration. This wizard will guide you through the process of setting up a new configuration.",
"unexpected_explained": "If you're getting this screen unexpectedly, please try restarting Stash in the correct working directory or with the <code>-c</code> flag." "unexpected_explained": "If you're getting this screen unexpectedly, please try restarting Stash in the correct working directory or with the <code>-c</code> flag."