1
0
mirror of https://github.com/Damillora/phoebe.git synced 2025-04-16 03:33:13 +00:00

Compare commits

...

22 Commits

Author SHA1 Message Date
Damillora
5327abaf46
Merge pull request from Damillora/dependabot/go_modules/github.com/go-playground/validator/v10-10.25.0
chore(deps): bump github.com/go-playground/validator/v10 from 10.24.0 to 10.25.0
2025-02-25 03:03:38 +07:00
Damillora
f517750d53
Merge pull request from Damillora/dependabot/go_modules/golang.org/x/crypto-0.35.0
chore(deps): bump golang.org/x/crypto from 0.32.0 to 0.35.0
2025-02-25 03:03:18 +07:00
b0f4f18c64 chore(deps-dev): bump @typescript-eslint/parser from 5.62.0 to 8.25.0 in /pkg/web 2025-02-24 20:01:55 +00:00
Damillora
97635a0a2b
Merge pull request from Damillora/dependabot/npm_and_yarn/pkg/web/eslint-9.21.0
chore(deps-dev): bump eslint from 8.57.1 to 9.21.0 in /pkg/web
2025-02-25 02:57:37 +07:00
Damillora
acfa8a12f9
Merge pull request from Damillora/dependabot/npm_and_yarn/pkg/web/sveltejs/kit-2.17.2
chore(deps-dev): bump @sveltejs/kit from 2.17.1 to 2.17.2 in /pkg/web
2025-02-25 02:57:18 +07:00
dependabot[bot]
cde0c55e08
chore(deps-dev): bump eslint from 8.57.1 to 9.21.0 in /pkg/web
Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.57.1...v9.21.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:57:00 +00:00
Damillora
98ab1b9902
Merge pull request from Damillora/dependabot/npm_and_yarn/pkg/web/vite-6.1.1
chore(deps-dev): bump vite from 5.4.14 to 6.1.1 in /pkg/web
2025-02-25 02:55:41 +07:00
03582e0b36 chore: [skip ci[ adjust PR workflow again 2025-02-24 19:54:58 +00:00
bbaa78b2d9 chore: [skip ci] adjust changelog in goreleaser config 2025-02-24 19:54:58 +00:00
dependabot[bot]
f778393e9b
chore(deps-dev): bump vite from 5.4.14 to 6.1.1 in /pkg/web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 6.1.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.1.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:50:57 +00:00
dependabot[bot]
40a79bb7b7
chore(deps-dev): bump @sveltejs/kit from 2.17.1 to 2.17.2 in /pkg/web
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.17.1 to 2.17.2.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.17.2/packages/kit)

---
updated-dependencies:
- dependency-name: "@sveltejs/kit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:50:52 +00:00
Damillora
e830d0fec3
Merge pull request from Damillora/dependabot/npm_and_yarn/pkg/web/sveltejs/vite-plugin-svelte-5.0.3
chore(deps-dev): bump @sveltejs/vite-plugin-svelte from 4.0.4 to 5.0.3 in /pkg/web
2025-02-25 02:49:30 +07:00
d78132ee8b chore: [skip ci] update dependabot again 2025-02-24 19:45:23 +00:00
f3db0e4785 chore [skip ci]: update workflow and release workflow a bit 2025-02-24 19:41:40 +00:00
dependabot[bot]
c24c7cb257
chore(deps-dev): bump @sveltejs/vite-plugin-svelte in /pkg/web
Bumps [@sveltejs/vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte/tree/HEAD/packages/vite-plugin-svelte) from 4.0.4 to 5.0.3.
- [Release notes](https://github.com/sveltejs/vite-plugin-svelte/releases)
- [Changelog](https://github.com/sveltejs/vite-plugin-svelte/blob/main/packages/vite-plugin-svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/vite-plugin-svelte/commits/@sveltejs/vite-plugin-svelte@5.0.3/packages/vite-plugin-svelte)

---
updated-dependencies:
- dependency-name: "@sveltejs/vite-plugin-svelte"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:15:58 +00:00
dependabot[bot]
dc7717d7b1
chore(deps): bump github.com/go-playground/validator/v10
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.24.0 to 10.25.0.
- [Release notes](https://github.com/go-playground/validator/releases)
- [Commits](https://github.com/go-playground/validator/compare/v10.24.0...v10.25.0)

---
updated-dependencies:
- dependency-name: github.com/go-playground/validator/v10
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:15:57 +00:00
dependabot[bot]
4d0a10ea66
chore(deps): bump golang.org/x/crypto from 0.32.0 to 0.35.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.32.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.32.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 19:15:52 +00:00
fbd3ebcb24 chore: [skip ci] setup dependabot 2025-02-24 19:14:47 +00:00
4cbd0bf3c4 chore: [skip ci] update README 2025-02-24 18:22:12 +00:00
363933011a chore: [skip ci] update actions name 2025-02-24 17:38:26 +00:00
cb80f5922b chore: version 0.1.1 2025-02-24 17:24:06 +00:00
af30246132 fix: incorrect resize logic when generating preview and thumbnails 2025-02-24 17:17:25 +00:00
13 changed files with 650 additions and 678 deletions

18
.github/dependabot.yml vendored Normal file

@ -0,0 +1,18 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `pkg/web` directory
directory: "/pkg/web"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "weekly"
day: "saturday"
time: "20:00"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
time: "20:00"

@ -1,4 +1,4 @@
name: CI
name: nightly - docker image
on:
push:
branches:

29
.github/workflows/pull-request.yml vendored Normal file

@ -0,0 +1,29 @@
name: pull requests - build check
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --snapshot --clean
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: phoebe
path: dist/*

@ -1,4 +1,4 @@
name: CI
name: releases - docker image
on:
push:
tags:
@ -9,9 +9,6 @@ jobs:
strategy:
matrix:
platform: [linux/amd64,linux/arm64]
env:
IS_LINUX: ${{ startsWith(matrix.platform, 'linux/') && 'true' || 'false' }}
GIT_TAG: ${{ needs.git-version.outputs.git_tag }}
steps:
-
name: Set up QEMU

@ -1,4 +1,4 @@
name: CI
name: releases - other platforms
on:
push:
tags:

@ -48,6 +48,9 @@ changelog:
exclude:
- "^docs:"
- "^test:"
- "^Merge pull request"
- "^Merge remote-tracking branch"
- "^Merge branch"
release:
header: >-

@ -1,6 +1,10 @@
# phoebe
![project logo](./phoebe-logo.svg)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Damillora/phoebe/dev.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/Damillora/phoebe)](https://goreportcard.com/report/github.com/Damillora/phoebe)
![GitHub License](https://img.shields.io/github/license/Damillora/phoebe)
<img src="./phoebe-logo.svg " alt="project logo" width="300" height="200">
a booru-style image gallery and organizer.

5
go.mod

@ -1,7 +1,6 @@
module github.com/Damillora/phoebe
go 1.21.0
toolchain go1.23.6
require (
@ -9,9 +8,9 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-contrib/cors v1.7.3
github.com/gin-gonic/gin v1.10.0
github.com/go-playground/validator/v10 v10.24.0
github.com/go-playground/validator/v10 v10.25.0
github.com/google/uuid v1.6.0
golang.org/x/crypto v0.32.0
golang.org/x/crypto v0.35.0
golang.org/x/image v0.24.0
gorm.io/driver/postgres v1.5.11
gorm.io/gorm v1.25.12

8
go.sum

@ -28,8 +28,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.24.0 h1:KHQckvo8G6hlWnrPX4NJJ+aBfWNAE/HH+qdL2cBpCmg=
github.com/go-playground/validator/v10 v10.24.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8=
github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@ -94,8 +94,8 @@ github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65E
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4=
golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ=
golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<g transform="matrix(1,0,0,1,27.7829,6.61499)">
<svg width="100%" height="100%" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<g transform="matrix(0.25,0,0,0.25,6.94573,1.65375)">
<g transform="matrix(0.929615,0,0,0.929615,31.3145,2.05741)">
<circle cx="487.194" cy="541.437" r="249.054" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:10.76px;"/>
</g>

Before

(image error) Size: 4.3 KiB

After

(image error) Size: 4.3 KiB

@ -119,12 +119,14 @@ func uploadBlob(c *gin.Context) {
previewFactor := float32(previewWidth) / float32(width)
previewHeight := int(float32(height) * previewFactor)
if width <= previewWidth {
previewWidth = width
previewHeight = height
}
thumbnailWidth := 300
thumbnailFactor := float32(thumbnailWidth) / float32(width)
thumbnailHeight := int(float32(height) * thumbnailFactor)
if width <= thumbnailWidth {
thumbnailWidth = width
thumbnailHeight = height
}

1230
pkg/web/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "phoebe",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"scripts": {
"dev": "vite dev",
@ -12,11 +12,11 @@
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.5.27",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"@sveltejs/kit": "^2.17.2",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"eslint": "^9.21.0",
"eslint-plugin-svelte": "^2.45.1",
"sass-embedded": "^1.85.0",
"svelte": "^5.0.0",
@ -24,7 +24,7 @@
"svelte-tags-input": "^6.0.2",
"tslib": "^2.4.1",
"typescript": "^5.5.0",
"vite": "^5.4.4"
"vite": "^6.1.1"
},
"type": "module",
"dependencies": {