mirror of
https://github.com/Damillora/phoebe.git
synced 2025-03-10 05:57:22 +00:00
feat: shioriko is now phoebe
This commit is contained in:
parent
1e1da493f2
commit
0854628c4e
6
.github/workflows/workflow.yml
vendored
6
.github/workflows/workflow.yml
vendored
@ -48,7 +48,7 @@ jobs:
|
|||||||
name: Upload Binaries
|
name: Upload Binaries
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: shioriko-${{ env.PLATFORM }}
|
name: phoebe-${{ env.PLATFORM }}
|
||||||
path: ./output
|
path: ./output
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
-
|
-
|
||||||
@ -59,7 +59,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
tags: damillora/shioriko:main
|
tags: damillora/phoebe:main
|
||||||
-
|
-
|
||||||
name: Build and push (Tagged)
|
name: Build and push (Tagged)
|
||||||
if: env.IS_LINUX == 'true' && env.IS_RELEASE == 'true'
|
if: env.IS_LINUX == 'true' && env.IS_RELEASE == 'true'
|
||||||
@ -68,7 +68,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
tags: damillora/shioriko:${{ env.GIT_TAG }}, damillora/shioriko:latest
|
tags: damillora/phoebe:${{ env.GIT_TAG }}, damillora/phoebe:latest
|
||||||
-
|
-
|
||||||
name: Image digest
|
name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
10
Dockerfile
10
Dockerfile
@ -7,14 +7,14 @@ RUN npm ci && npm run build
|
|||||||
|
|
||||||
# Go application
|
# Go application
|
||||||
FROM golang:1.23-alpine AS build
|
FROM golang:1.23-alpine AS build
|
||||||
WORKDIR /go/src/shioriko
|
WORKDIR /go/src/phoebe
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=node_build /src/pkg/web/build/ /go/src/shioriko/pkg/web/build/
|
COPY --from=node_build /src/pkg/web/build/ /go/src/phoebe/pkg/web/build/
|
||||||
RUN go get -d -v ./...
|
RUN go get -d -v ./...
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /shioriko -ldflags '-extldflags "-static"' -tags timetzdata
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /phoebe -ldflags '-extldflags "-static"' -tags timetzdata
|
||||||
|
|
||||||
FROM scratch AS runtime
|
FROM scratch AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /shioriko /app/
|
COPY --from=build /phoebe /app/
|
||||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
ENTRYPOINT ["/app/shioriko"]
|
ENTRYPOINT ["/app/phoebe"]
|
||||||
|
16
README.md
16
README.md
@ -1,8 +1,10 @@
|
|||||||
# shioriko
|
# phoebe
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
a booru-style image gallery and organizer.
|
a booru-style image gallery and organizer.
|
||||||
|
|
||||||
Built with the Go language and Svelte framework, shioriko is designed for personal image gathering.
|
Built with the Go language and Svelte framework, phoebe is designed for personal image gathering.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Upload and organize images
|
* Upload and organize images
|
||||||
@ -14,8 +16,8 @@ Built with the Go language and Svelte framework, shioriko is designed for person
|
|||||||
|
|
||||||
The easiest way to get started is to use Docker:
|
The easiest way to get started is to use Docker:
|
||||||
```bash
|
```bash
|
||||||
docker pull damillora/shioriko
|
docker pull damillora/phoebe
|
||||||
docker run -e POSTGRES_DATABASE=<PostgreSQL DSN> -e AUTH_SECRET=<secret> -e DATA_DIR=/data -e BASE_URL=http://localhost:8080 -p 8080:8080 -v "./data:/data" damillora/shioriko
|
docker run -e POSTGRES_DATABASE=<PostgreSQL DSN> -e AUTH_SECRET=<secret> -e DATA_DIR=/data -e BASE_URL=http://localhost:8080 -p 8080:8080 -v "./data:/data" damillora/phoebe
|
||||||
```
|
```
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -24,7 +26,7 @@ docker run -e POSTGRES_DATABASE=<PostgreSQL DSN> -e AUTH_SECRET=<secret> -e DATA
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Shioriko is configured using environment variables:
|
phoebe is configured using environment variables:
|
||||||
|
|
||||||
* `POSTGRES_DATABASE`: DSN string of Postgres Database, see [Gorm documentation](https://gorm.io/docs/connecting_to_the_database.html)
|
* `POSTGRES_DATABASE`: DSN string of Postgres Database, see [Gorm documentation](https://gorm.io/docs/connecting_to_the_database.html)
|
||||||
* `AUTH_SECRET`: Secret used to sign JWTs
|
* `AUTH_SECRET`: Secret used to sign JWTs
|
||||||
@ -33,7 +35,7 @@ Shioriko is configured using environment variables:
|
|||||||
* `DISABLE_REGISTRATION`: Optional, disable registration on the instance
|
* `DISABLE_REGISTRATION`: Optional, disable registration on the instance
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Shioriko is still in an early stage, but contributions are welcome!
|
phoebe is still in an early stage, but contributions are welcome!
|
||||||
|
|
||||||
## License
|
## License
|
||||||
shioriko is licensed under the [MIT license](https://choosealicense.com/licenses/mit/).
|
phoebe is licensed under the [MIT license](https://choosealicense.com/licenses/mit/).
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module github.com/Damillora/Shioriko
|
module github.com/Damillora/phoebe
|
||||||
|
|
||||||
go 1.21.0
|
go 1.21.0
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Damillora/Shioriko/pkg/app"
|
"github.com/Damillora/phoebe/pkg/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
33
phoebe-logo.svg
Normal file
33
phoebe-logo.svg
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?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)">
|
||||||
|
<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>
|
||||||
|
<g transform="matrix(-1.30841,0,0,1.30007,1102.19,-19.8909)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-8.01173e-17,-1.30841,-1.30007,7.96064e-17,1009.49,1123.36)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-8.01173e-17,1.30841,1.30007,7.96064e-17,-41.0588,-112.593)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1.30841,-1.60235e-16,-1.59213e-16,-1.30007,-133.76,1030.66)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.925189,-0.925189,-0.919289,-0.919289,418.667,1313.79)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-0.925189,0.925189,0.919289,0.919289,549.767,-303.017)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.846242,0.99791,0.991546,-0.840845,-316.092,373.794)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-0.925189,-0.925189,-0.919289,0.919289,1292.62,570.935)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
@ -5,9 +5,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/config"
|
"github.com/Damillora/phoebe/pkg/config"
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/web"
|
"github.com/Damillora/phoebe/pkg/web"
|
||||||
"github.com/gin-contrib/cors"
|
"github.com/gin-contrib/cors"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
@ -3,10 +3,10 @@ package app
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
)
|
)
|
||||||
|
@ -14,11 +14,11 @@ import (
|
|||||||
"golang.org/x/image/draw"
|
"golang.org/x/image/draw"
|
||||||
_ "golang.org/x/image/webp"
|
_ "golang.org/x/image/webp"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/config"
|
"github.com/Damillora/phoebe/pkg/config"
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/corona10/goimagehash"
|
"github.com/corona10/goimagehash"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
@ -5,10 +5,10 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
)
|
)
|
||||||
|
@ -3,9 +3,9 @@ package app
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
)
|
)
|
||||||
|
@ -3,11 +3,11 @@ package app
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/config"
|
"github.com/Damillora/phoebe/pkg/config"
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/middleware"
|
"github.com/Damillora/phoebe/pkg/middleware"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
)
|
)
|
||||||
|
@ -3,7 +3,7 @@ package database
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/config"
|
"github.com/Damillora/phoebe/pkg/config"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package middleware
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/Damillora/Shioriko/pkg/services"
|
"github.com/Damillora/phoebe/pkg/services"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/config"
|
"github.com/Damillora/phoebe/pkg/config"
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/dgrijalva/jwt-go"
|
"github.com/dgrijalva/jwt-go"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
@ -24,9 +24,9 @@ func CreateToken(user *database.User) string {
|
|||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||||
"email": user.Email,
|
"email": user.Email,
|
||||||
"name": user.Username,
|
"name": user.Username,
|
||||||
"iss": "shioriko-api",
|
"iss": "phoebe-api",
|
||||||
"sub": user.ID,
|
"sub": user.ID,
|
||||||
"aud": "shioriko",
|
"aud": "phoebe",
|
||||||
"exp": time.Now().Add(time.Hour * 24).Unix(),
|
"exp": time.Now().Add(time.Hour * 24).Unix(),
|
||||||
})
|
})
|
||||||
jwtToken, _ := token.SignedString([]byte(config.CurrentConfig.AuthSecret))
|
jwtToken, _ := token.SignedString([]byte(config.CurrentConfig.AuthSecret))
|
||||||
|
@ -3,8 +3,8 @@ package services
|
|||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/corona10/goimagehash"
|
"github.com/corona10/goimagehash"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetTagTypeAll() []database.TagType {
|
func GetTagTypeAll() []database.TagType {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Damillora/Shioriko/pkg/database"
|
"github.com/Damillora/phoebe/pkg/database"
|
||||||
"github.com/Damillora/Shioriko/pkg/models"
|
"github.com/Damillora/phoebe/pkg/models"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
@ -56,12 +56,10 @@ func UpdateUserProfile(id string, model models.UserUpdateModel) (*database.User,
|
|||||||
return &user, nil
|
return &user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func UpdateUserPassword(id string, model models.UserUpdatePasswordModel) (*database.User, error) {
|
func UpdateUserPassword(id string, model models.UserUpdatePasswordModel) (*database.User, error) {
|
||||||
var user database.User
|
var user database.User
|
||||||
result := database.DB.Where("id = ?", id).First(&user)
|
result := database.DB.Where("id = ?", id).First(&user)
|
||||||
|
|
||||||
|
|
||||||
if user.Password != "" {
|
if user.Password != "" {
|
||||||
verifyErr := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(model.OldPassword))
|
verifyErr := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(model.OldPassword))
|
||||||
if verifyErr != nil {
|
if verifyErr != nil {
|
||||||
|
15
pkg/web/package-lock.json
generated
15
pkg/web/package-lock.json
generated
@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "Shioriko",
|
"name": "phoebe",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "Shioriko",
|
"name": "phoebe",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"bulma": "^1.0.3",
|
"bulma": "^1.0.3",
|
||||||
|
"child_process": "^1.0.2",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"query-string": "^8.1.0"
|
"query-string": "^8.1.0"
|
||||||
},
|
},
|
||||||
@ -1744,6 +1745,12 @@
|
|||||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/child_process": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-Wmza/JzL0SiWz7kl6MhIKT5ceIlnFPJX+lwUGj7Clhy5MMldsSoJR0+uvRzOS5Kv45Mq7t1PoE8TsOA9bzvb6g==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Shioriko",
|
"name": "phoebe",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
@ -30,6 +30,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"bulma": "^1.0.3",
|
"bulma": "^1.0.3",
|
||||||
|
"child_process": "^1.0.2",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"query-string": "^8.1.0"
|
"query-string": "^8.1.0"
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// Path to Bulma's sass folder
|
// Path to Bulma's sass folder
|
||||||
@use "../node_modules/bulma/sass/" as * with (
|
@use "../node_modules/bulma/sass/" as * with (
|
||||||
$family-primary: '"Nunito", sans-serif',
|
$family-primary: '"Nunito", sans-serif',
|
||||||
$primary: #37b484,
|
$primary: #4c94e8,
|
||||||
);
|
);
|
||||||
// Import the Google Font
|
// Import the Google Font
|
||||||
@import "https://fonts.googleapis.com/css?family=Nunito:400,700";
|
@import "https://fonts.googleapis.com/css?family=Nunito:400,700";
|
||||||
|
33
pkg/web/src/lib/assets/phoebe-logo.svg
Normal file
33
pkg/web/src/lib/assets/phoebe-logo.svg
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?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)">
|
||||||
|
<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>
|
||||||
|
<g transform="matrix(-1.30841,0,0,1.30007,1102.19,-19.8909)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-8.01173e-17,-1.30841,-1.30007,7.96064e-17,1009.49,1123.36)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-8.01173e-17,1.30841,1.30007,7.96064e-17,-41.0588,-112.593)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(1.30841,-1.60235e-16,-1.59213e-16,-1.30007,-133.76,1030.66)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.925189,-0.925189,-0.919289,-0.919289,418.667,1313.79)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-0.925189,0.925189,0.919289,0.919289,549.767,-303.017)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.846242,0.99791,0.991546,-0.840845,-316.092,373.794)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(-0.925189,-0.925189,-0.919289,0.919289,1292.62,570.935)">
|
||||||
|
<path d="M497.447,61.6C497.447,54.619 491.815,48.951 484.879,48.951L459.742,48.951C452.805,48.951 447.173,54.619 447.173,61.6L447.173,184.477C447.173,191.459 452.805,197.127 459.742,197.127L484.879,197.127C491.815,197.127 497.447,191.459 497.447,184.477L497.447,61.6Z" style="fill:rgb(255,221,15);stroke:rgb(74,148,232);stroke-width:7.67px;"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
12
pkg/web/src/lib/components/ui/Footer.svelte
Normal file
12
pkg/web/src/lib/components/ui/Footer.svelte
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
import { version } from '$app/environment';
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="content has-text-centered">
|
||||||
|
<p>
|
||||||
|
<strong><a href="https://github.com/Damillora/phoebe">phoebe</a></strong>: a booru-style image gallery and organizer
|
||||||
|
</p>
|
||||||
|
<p>version {version}</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import logo from "$lib/assets/phoebe-logo.svg";
|
||||||
import { token } from "$lib/stores";
|
import { token } from "$lib/stores";
|
||||||
import { isTokenExpired, getUsernameFromToken } from "$lib/login-check";
|
import { isTokenExpired, getUsernameFromToken } from "$lib/login-check";
|
||||||
|
|
||||||
@ -19,7 +20,8 @@
|
|||||||
<nav class="navbar is-primary" aria-label="main navigation">
|
<nav class="navbar is-primary" aria-label="main navigation">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<a class="navbar-item" href="/">
|
<a class="navbar-item" href="/">
|
||||||
<strong>shioriko</strong>
|
<img class="image is-32x32" alt="phoebe logo" src={logo} />
|
||||||
|
<strong>phoebe</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import ShiorikoImage from "./ShiorikoImage.svelte";
|
import ImageView from "./ImageView.svelte";
|
||||||
|
|
||||||
let { posts = [] } = $props();
|
let { posts = [] } = $props();
|
||||||
</script>
|
</script>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<a href="/post/{post.id}">
|
<a href="/post/{post.id}">
|
||||||
<ShiorikoImage alt={post.id} src={post.thumbnail_path} />
|
<ImageView alt={post.id} src={post.thumbnail_path} />
|
||||||
</a>
|
</a>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import "../app.scss";
|
import "../app.scss";
|
||||||
import Navbar from "$lib/components/ui/Navbar.svelte";
|
import Navbar from "$lib/components/ui/Navbar.svelte";
|
||||||
|
import Footer from "$lib/components/ui/Footer.svelte";
|
||||||
interface Props {
|
interface Props {
|
||||||
children?: import('svelte').Snippet;
|
children?: import('svelte').Snippet;
|
||||||
}
|
}
|
||||||
@ -9,17 +10,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Shioriko</title>
|
<title>phoebe</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
|
|
||||||
<footer class="footer">
|
<Footer />
|
||||||
<div class="content has-text-centered">
|
|
||||||
<p>
|
|
||||||
<strong><a href="https://github.com/Damillora/Shioriko">shioriko</a></strong>: a booru-style image gallery and organizer
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Tags from "svelte-tags-input";
|
import Tags from "svelte-tags-input";
|
||||||
|
import logo from "$lib/assets/phoebe-logo.svg";
|
||||||
import { getPostCount, getPosts, getTagAutocomplete } from "$lib/api";
|
import { getPostCount, getPosts, getTagAutocomplete } from "$lib/api";
|
||||||
|
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
@ -43,8 +44,13 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="columns is-centered">
|
<div class="columns is-centered">
|
||||||
<div class="column is-12-tablet is-8-desktop is-8-widescreen">
|
<div class="column is-12-tablet is-8-desktop is-8-widescreen">
|
||||||
|
<div class="block is-flex is-justify-content-center">
|
||||||
|
<figure class="image is-128x128">
|
||||||
|
<img alt="phoebe logo" src={logo} />
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
<div class="block has-text-centered">
|
<div class="block has-text-centered">
|
||||||
<p class="title">shioriko</p>
|
<p class="title">phoebe</p>
|
||||||
<p class="subtitle">a booru-style image gallery and organizer</p>
|
<p class="subtitle">a booru-style image gallery and organizer</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="box has-text-centered">
|
<div class="box has-text-centered">
|
||||||
@ -71,9 +77,15 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{#if postCountLoaded}
|
{#if postCountLoaded}
|
||||||
<p class="block">serving <span class="is-primary"><strong>{postCount}</strong></span> images</p>
|
<p class="block">
|
||||||
|
serving <span class="is-primary"
|
||||||
|
><strong>{postCount}</strong></span
|
||||||
|
> images
|
||||||
|
</p>
|
||||||
{:else}
|
{:else}
|
||||||
<p class="block">serving <span class="is-primary"><strong>...</strong></span> images</p>
|
<p class="block">
|
||||||
|
serving <span class="is-primary"><strong>...</strong></span> images
|
||||||
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getTagAutocomplete, searchBlob } from "$lib/api";
|
import { getTagAutocomplete, searchBlob } from "$lib/api";
|
||||||
import PostGallery from "$lib/components/ui/PostGallery.svelte";
|
import PostGallery from "$lib/components/ui/PostGallery.svelte";
|
||||||
import ShiorikoImage from "$lib/components/ui/ShiorikoImage.svelte";
|
import ImageView from "$lib/components/ui/ImageView.svelte";
|
||||||
import { paginate } from "$lib/simple-pagination";
|
import { paginate } from "$lib/simple-pagination";
|
||||||
|
|
||||||
let currentProgress = $state(0);
|
let currentProgress = $state(0);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
import ViewPostPanel from "$lib/components/panels/ViewPostPanel.svelte";
|
import ViewPostPanel from "$lib/components/panels/ViewPostPanel.svelte";
|
||||||
|
|
||||||
import { page } from "$app/stores";
|
import { page } from "$app/stores";
|
||||||
import ShiorikoImage from "$lib/components/ui/ShiorikoImage.svelte";
|
import ImageView from "$lib/components/ui/ImageView.svelte";
|
||||||
import AuthCheck from "$lib/components/checks/AuthCheck.svelte";
|
import AuthCheck from "$lib/components/checks/AuthCheck.svelte";
|
||||||
import DeletePostPanel from "$lib/components/panels/DeletePostPanel.svelte";
|
import DeletePostPanel from "$lib/components/panels/DeletePostPanel.svelte";
|
||||||
const { id } = $page.params;
|
const { id } = $page.params;
|
||||||
@ -122,7 +122,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<ShiorikoImage
|
<ImageView
|
||||||
alt={post.id}
|
alt={post.id}
|
||||||
src={post.preview_path}
|
src={post.preview_path}
|
||||||
/>
|
/>
|
||||||
@ -134,7 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<ShiorikoImage
|
<ImageView
|
||||||
alt={post.id}
|
alt={post.id}
|
||||||
src={post.image_path}
|
src={post.image_path}
|
||||||
/>
|
/>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
import Tags from "svelte-tags-input";
|
import Tags from "svelte-tags-input";
|
||||||
import AuthRequired from "$lib/components/checks/AuthRequired.svelte";
|
import AuthRequired from "$lib/components/checks/AuthRequired.svelte";
|
||||||
import ShiorikoImage from "$lib/components/ui/ShiorikoImage.svelte";
|
import ImageView from "$lib/components/ui/ImageView.svelte";
|
||||||
|
|
||||||
let currentProgress = $state(0);
|
let currentProgress = $state(0);
|
||||||
|
|
||||||
@ -188,7 +188,7 @@
|
|||||||
{#if fileName}
|
{#if fileName}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<ShiorikoImage alt={fileName} src={previewUrl} />
|
<ImageView alt={fileName} src={previewUrl} />
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
{:else if loading && !(currentProgress > 0 && currentProgress < 100)}
|
{:else if loading && !(currentProgress > 0 && currentProgress < 100)}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import adapter from "@sveltejs/adapter-static";
|
import adapter from "@sveltejs/adapter-static";
|
||||||
|
import { execSync } from "child_process";
|
||||||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||||
|
|
||||||
|
const commit = execSync('git rev-parse HEAD').toString().trim().substring(0, 7);
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||||
@ -13,7 +16,12 @@ const config = {
|
|||||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
fallback: 'app.html', // may differ from host to host
|
fallback: 'app.html', // may differ from host to host
|
||||||
})
|
}),
|
||||||
|
version: {
|
||||||
|
|
||||||
|
name: `${process.env.npm_package_version}-${commit}`,
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user