Compare commits
32 Commits
67edfe17bb
...
main
Author | SHA1 | Date | |
---|---|---|---|
77c8c099ae | |||
b1b895b9c1 | |||
0fbfee706c
|
|||
0474c2dcb6
|
|||
50784a6ab5
|
|||
a01a4febf5
|
|||
1c8cd6ed32
|
|||
d40dce624b | |||
6db6680a16 | |||
527fa8c13d | |||
9270fa919f | |||
77cdfa0e96 | |||
70ec918a10 | |||
2a10f8bc2f
|
|||
a551ba326c
|
|||
1beb629811
|
|||
6f1cad19ac
|
|||
04fca77aec
|
|||
939b7cc1e9
|
|||
20eed09f38
|
|||
e9dfb890dc
|
|||
7cea387f02
|
|||
9e307b7da4 | |||
2de4b7aeaf | |||
c1ff537d35 | |||
91b374af35 | |||
f2447f8219 | |||
85433f9620 | |||
dc9fe2319b | |||
6e98118720 | |||
c438ec8434 | |||
57a3b4b5b4 |
34
.gitea/workflows/docker.yml
Normal file
34
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,34 @@
|
||||
name: docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- "LICENSE.txt"
|
||||
- "docker-compose.example.yml"
|
||||
- "ups.json"
|
||||
|
||||
env:
|
||||
REGISTRY: git.ngn.tf
|
||||
IMAGE: ${{gitea.repository}}
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to container repo
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ${{env.REGISTRY}}
|
||||
username: ${{gitea.actor}}
|
||||
password: ${{secrets.PACKAGES_TOKEN}}
|
||||
|
||||
- name: Build docker image
|
||||
run: |
|
||||
docker build . --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
||||
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
25
.gitea/workflows/ups.yml
Normal file
25
.gitea/workflows/ups.yml
Normal file
@ -0,0 +1,25 @@
|
||||
name: ups
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "@weekly"
|
||||
|
||||
jobs:
|
||||
ups:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update -y
|
||||
sudo apt install -y python3 python3-build python3-requests make
|
||||
|
||||
- name: Install ups
|
||||
run: |
|
||||
git clone https://git.ngn.tf/ngn/ups && cd ups
|
||||
make && make install
|
||||
|
||||
- name: Run ups
|
||||
run: PATH=~/.local/bin:$PATH ups-check
|
21
.github/dependabot.yml
vendored
21
.github/dependabot.yml
vendored
@ -1,21 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
all:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
# Maintain dependencies for Golang
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
all:
|
||||
patterns:
|
||||
- "*"
|
86
.github/workflows/image.yml
vendored
86
.github/workflows/image.yml
vendored
@ -1,86 +0,0 @@
|
||||
name: Build and publish container images
|
||||
|
||||
on:
|
||||
push: { branches: [ main ] }
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ startsWith(github.event.head_commit.message, 'feat:') || startsWith(github.event.head_commit.message, 'fix:') }}
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
commit: ${{ steps.metadata.outputs.commit }}
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [ amd64, arm64v8 ]
|
||||
include:
|
||||
- architecture: amd64
|
||||
platform: linux/amd64
|
||||
- architecture: arm64v8
|
||||
platform: linux/arm64
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Obtain project metadata
|
||||
id: metadata
|
||||
run: echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate image metadata
|
||||
uses: docker/metadata-action@v5
|
||||
id: image-metadata
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=raw,value=${{ matrix.architecture }}-${{ steps.metadata.outputs.commit }},enable={{is_default_branch}}
|
||||
type=raw,value=${{ matrix.architecture }},enable={{is_default_branch}}
|
||||
|
||||
- name: Build and push platform specific images
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: ${{ steps.image-metadata.outputs.tags }}
|
||||
build-args: |
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [ build ]
|
||||
env:
|
||||
IMAGE: ghcr.io/${{ github.repository }}
|
||||
COMMIT: ${{ needs.build.outputs.commit }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate manifest for multi-arch images from source manifests
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
--tag ${IMAGE}:${COMMIT} ${IMAGE}:{amd64,arm64v8}-${COMMIT}
|
||||
docker buildx imagetools create \
|
||||
--tag ${IMAGE}:latest ${IMAGE}:{amd64,arm64v8}
|
26
.github/workflows/linter.yml
vendored
26
.github/workflows/linter.yml
vendored
@ -1,26 +0,0 @@
|
||||
name: linter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
golangci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go install github.com/a-h/templ/cmd/templ@latest
|
||||
- run: make build
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6.1.0
|
||||
with:
|
||||
version: latest
|
||||
only-new-issues: true
|
17
.github/workflows/test.yml
vendored
17
.github/workflows/test.yml
vendored
@ -1,17 +0,0 @@
|
||||
name: Test and Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go install github.com/a-h/templ/cmd/templ@latest
|
||||
- run: make build
|
||||
#- run: make test
|
24
Dockerfile
24
Dockerfile
@ -1,29 +1,17 @@
|
||||
FROM docker.io/golang:1.22.2-alpine3.19 AS build
|
||||
|
||||
RUN apk add make git curl
|
||||
FROM golang:1.24.2 AS build
|
||||
|
||||
WORKDIR /code
|
||||
RUN go install github.com/a-h/templ/cmd/templ@latest
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
COPY go.mod ./
|
||||
COPY go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
COPY .git .
|
||||
RUN make build
|
||||
RUN make CGO_ENABLED=0
|
||||
|
||||
###############################################################
|
||||
|
||||
FROM scratch
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/rramiachraf/dumb"
|
||||
LABEL org.opencontainers.image.url="https://github.com/rramiachraf/dumb"
|
||||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
LABEL org.opencontainers.image.description="Private alternative front-end for Genius."
|
||||
FROM alpine:3.22
|
||||
|
||||
COPY --from=build /code/dumb .
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
EXPOSE 5555/tcp
|
||||
|
||||
CMD ["./dumb"]
|
||||
|
||||
|
19
Makefile
19
Makefile
@ -1,14 +1,15 @@
|
||||
VERSION=`git rev-parse --short HEAD`
|
||||
CGO_ENABLED=1
|
||||
|
||||
gentempl:
|
||||
command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest
|
||||
esbuild:
|
||||
[ ! -f ./esbuild ] && curl -fsSL https://esbuild.github.io/dl/latest | sh
|
||||
build:gentempl esbuild
|
||||
all:
|
||||
templ generate
|
||||
cat ./style/*.css | ./esbuild --loader=css --minify > ./static/style.css
|
||||
go build -ldflags="-X 'github.com/rramiachraf/dumb/data.Version=$(VERSION)' -s -w"
|
||||
cat ./style/*.css > ./static/style.css
|
||||
CGO_ENABLED=$(CGO_ENABLED) go build
|
||||
|
||||
test:
|
||||
go test ./... -v
|
||||
fmt:
|
||||
|
||||
format:
|
||||
gofmt -s -w .
|
||||
templ fmt .
|
||||
|
||||
.PHONY: test format
|
||||
|
54
README.md
54
README.md
@ -1,51 +1,7 @@
|
||||
# dumb
|
||||
With the massive daily increase of useless scripts on Genius's web frontend, and having to download megabytes of clutter, [dumb](https://github.com/rramiachraf/dumb) tries to make reading lyrics from Genius a pleasant experience, and as lightweight as possible.
|
||||
# dumb - frontend for Genius
|
||||
|
||||
<a href="https://codeberg.org/rramiachraf/dumb"><img src="https://img.shields.io/badge/Codeberg-%232185d0" /></a>
|
||||
|
||||

|
||||
|
||||
## Installation & Usage
|
||||
### Docker
|
||||
```bash
|
||||
docker run -p 8080:5555 --name dumb ghcr.io/rramiachraf/dumb:latest
|
||||
```
|
||||
|
||||
### Build from source
|
||||
[Go 1.22+](https://go.dev/dl) is required.
|
||||
```bash
|
||||
git clone https://github.com/rramiachraf/dumb
|
||||
cd dumb
|
||||
make build
|
||||
./dumb
|
||||
```
|
||||
|
||||
#### Notes:
|
||||
- The default port is 5555, you can use other ports by setting the `PORT` environment variable.
|
||||
- Genius servers are behind a Cloudflare reverse proxy, which means certain IPs won't be able to send requests, to partially mitigate this, you can specify a proxy by setting the `PROXY` variable (must be a valid URI).
|
||||
|
||||
## Public Instances
|
||||
| URL | Tor | I2P | Region | CDN? | Operator |
|
||||
| --- | :----: | :----: | :----: | :----: | --- |
|
||||
| <https://dumb.ducks.party> | No | No | NL | No | https://ducks.party |
|
||||
| <https://dumb.privacydev.net> | [Yes](http://dumb.g4c3eya4clenolymqbpgwz3q3tawoxw56yhzk4vugqrl6dtu3ejvhjid.onion) | No | FR | No | https://privacydev.net |
|
||||
| <https://dumb.hyperreal.coffee> | No | No | US | No | https://hyperreal.coffee |
|
||||
| <https://dm.vern.cc> | [Yes](http://dm.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion) | [Yes](http://vernxpcpqi2y4uhu7to4rnjmyjjgzh3x3qxyzpmkhykefchkmleq.b32.i2p) | US | No | https://vern.cc |
|
||||
| <https://dumb.lunar.icu> | No | No | DE | Yes | @MaximilianGT500 |
|
||||
| <https://dumb.privacyfucking.rocks> | No | No | DE | - | https://privacyfucking.rocks |
|
||||
| <https://sing.whatever.social> | No | No | US/DE | Yes | Whatever Social |
|
||||
| <https://dumb.bloat.cat> | No | No | DE | No | https://bloat.cat |
|
||||
| <https://dumb.gitro.xyz> | No | No | DE | No | https://gitro.xyz |
|
||||
|
||||
[Status Page](https://github.com/rramiachraf/dumb-instances)
|
||||
|
||||
#### Notes:
|
||||
- Instances list in JSON format can be found in [instances.json](instances.json) file.
|
||||
- For people who might be capable and interested in hosting a public instance feel free to do so, and don't forget to open a pull request, so your instance can be included here.
|
||||
|
||||
## Contributing
|
||||
Contributions are welcome.
|
||||
|
||||
## License
|
||||
[MIT](https://github.com/rramiachraf/dumb/blob/main/LICENCE)
|
||||

|
||||

|
||||
|
||||
A fork of the [dumb](https://github.com/rramiachraf/dumb) project, with my
|
||||
personal changes.
|
||||
|
@ -1,3 +0,0 @@
|
||||
package data
|
||||
|
||||
var Version = "DEVELOPMENT"
|
@ -58,6 +58,8 @@ type customPerformance struct {
|
||||
func (s *Song) parseLyrics(doc *goquery.Document) error {
|
||||
var htmlError error
|
||||
|
||||
doc.Find("[class^=LyricsHeader]").Remove()
|
||||
|
||||
doc.Find("[data-lyrics-container='true']").Each(func(i int, ss *goquery.Selection) {
|
||||
h, err := ss.Html()
|
||||
if err != nil {
|
||||
|
@ -13,4 +13,3 @@ func ExtractImageURL(image string) string {
|
||||
|
||||
return fmt.Sprintf("/images%s", u.Path)
|
||||
}
|
||||
|
||||
|
12
go.mod
12
go.mod
@ -1,17 +1,19 @@
|
||||
module github.com/rramiachraf/dumb
|
||||
|
||||
go 1.22.2
|
||||
go 1.23
|
||||
|
||||
toolchain go1.23.4
|
||||
|
||||
require (
|
||||
github.com/PuerkitoBio/goquery v1.9.2
|
||||
github.com/a-h/templ v0.2.747
|
||||
github.com/PuerkitoBio/goquery v1.10.1
|
||||
github.com/a-h/templ v0.3.819
|
||||
github.com/allegro/bigcache/v3 v3.1.0
|
||||
github.com/gorilla/handlers v1.5.2
|
||||
github.com/gorilla/mux v1.8.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
golang.org/x/net v0.24.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
)
|
||||
|
41
go.sum
41
go.sum
@ -1,11 +1,17 @@
|
||||
github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
|
||||
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
|
||||
github.com/PuerkitoBio/goquery v1.10.1 h1:Y8JGYUkXWTGRB6Ars3+j3kN0xg1YqqlwvdTV8WTFQcU=
|
||||
github.com/PuerkitoBio/goquery v1.10.1/go.mod h1:IYiHrOMps66ag56LEH7QYDDupKXyo5A8qrjIx3ZtujY=
|
||||
github.com/a-h/templ v0.2.747 h1:D0dQ2lxC3W7Dxl6fxQ/1zZHBQslSkTSvl5FxP/CfdKg=
|
||||
github.com/a-h/templ v0.2.747/go.mod h1:69ObQIbrcuwPCU32ohNaWce3Cb7qM5GMiqN1K+2yop4=
|
||||
github.com/a-h/templ v0.3.819 h1:KDJ5jTFN15FyJnmSmo2gNirIqt7hfvBD2VXVDTySckM=
|
||||
github.com/a-h/templ v0.3.819/go.mod h1:iDJKJktpttVKdWoTkRNNLcllRI+BlpopJc+8au3gOUo=
|
||||
github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=
|
||||
github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
|
||||
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
|
||||
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
||||
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
@ -17,18 +23,36 @@ github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWS
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@ -36,17 +60,34 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
@ -47,7 +47,7 @@ func annotations(l *utils.Logger) http.HandlerFunc {
|
||||
buf := new(bytes.Buffer)
|
||||
_, err = buf.ReadFrom(resp.Body)
|
||||
if err != nil {
|
||||
l.Error("Error paring genius api response: %s", err.Error())
|
||||
l.Errorf("Error paring genius api response: %s", err.Error())
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
utils.RenderTemplate(w, views.ErrorPage(500, "something went wrong"), l)
|
||||
return
|
||||
@ -56,7 +56,7 @@ func annotations(l *utils.Logger) http.HandlerFunc {
|
||||
var data data.AnnotationsResponse
|
||||
err = json.Unmarshal(buf.Bytes(), &data)
|
||||
if err != nil {
|
||||
l.Error("could not unmarshal json: %s\n", err)
|
||||
l.Errorf("could not unmarshal json: %s\n", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
utils.RenderTemplate(w, views.ErrorPage(500, "something went wrong"), l)
|
||||
return
|
||||
@ -69,7 +69,7 @@ func annotations(l *utils.Logger) http.HandlerFunc {
|
||||
encoder := json.NewEncoder(w)
|
||||
|
||||
if err = encoder.Encode(&annotation); err != nil {
|
||||
l.Error("Error sending response: %s", err.Error())
|
||||
l.Errorf("Error sending response: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
@ -25,6 +26,7 @@ func TestLyrics(t *testing.T) {
|
||||
func testLyrics(t *testing.T, url string) {
|
||||
title := "The Silver Seas"
|
||||
artist := "Catch Yer Own Train"
|
||||
firstLyricLine := "[Verse 1]"
|
||||
|
||||
r, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
@ -46,6 +48,7 @@ func testLyrics(t *testing.T, url string) {
|
||||
|
||||
docArtist := doc.Find("#metadata-info h1").Text()
|
||||
docTitle := doc.Find("#metadata-info h2").Text()
|
||||
docLyrics := doc.Find("#lyrics").Text()
|
||||
|
||||
if docTitle != title {
|
||||
t.Fatalf("expected %q, got %q\n", title, docTitle)
|
||||
@ -54,4 +57,8 @@ func testLyrics(t *testing.T, url string) {
|
||||
if docArtist != artist {
|
||||
t.Fatalf("expected %q, got %q\n", artist, docArtist)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(docLyrics, firstLyricLine) {
|
||||
t.Fatalf("expected lyrics to start with %q, got %q\n", firstLyricLine, docLyrics)
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func imageProxy(l *utils.Logger) http.HandlerFunc {
|
||||
w.Header().Set("Content-type", mime.TypeByExtension("."+ext))
|
||||
w.Header().Add("Cache-Control", "max-age=1296000")
|
||||
if _, err = io.Copy(w, res.Body); err != nil {
|
||||
l.Error("unable to write image, %s", err.Error())
|
||||
l.Errorf("unable to write image, %s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
[
|
||||
{
|
||||
"clearnet": "https://dm.vern.cc/",
|
||||
"tor": "http://dm.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/",
|
||||
"i2p": "http://vernxpcpqi2y4uhu7to4rnjmyjjgzh3x3qxyzpmkhykefchkmleq.b32.i2p/",
|
||||
"country": "US",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://sing.whatever.social/",
|
||||
"country": "US/DE",
|
||||
"cdn": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.lunar.icu/",
|
||||
"country": "DE",
|
||||
"cdn": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.privacydev.net/",
|
||||
"tor": "http://dumb.g4c3eya4clenolymqbpgwz3q3tawoxw56yhzk4vugqrl6dtu3ejvhjid.onion/",
|
||||
"country": "FR",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.ducks.party/",
|
||||
"country": "NL",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.privacyfucking.rocks/",
|
||||
"country": "DE",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.hyperreal.coffee/",
|
||||
"country": "DE",
|
||||
"cdn": true
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.bloat.cat/",
|
||||
"country": "DE",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.gitro.xyz/",
|
||||
"country": "DE",
|
||||
"cdn": false
|
||||
},
|
||||
{
|
||||
"clearnet": "https://dumb.jeikobu.net/",
|
||||
"country": "DE",
|
||||
"cdn": false
|
||||
}
|
||||
]
|
4
main.go
4
main.go
@ -39,7 +39,7 @@ func main() {
|
||||
|
||||
if port == 0 {
|
||||
port = 5555
|
||||
logger.Info("using default port %d", port)
|
||||
logger.Infof("using default port %d", port)
|
||||
}
|
||||
|
||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
|
||||
@ -47,7 +47,7 @@ func main() {
|
||||
logger.Fatal(err.Error())
|
||||
}
|
||||
|
||||
logger.Info("server is listening on port %d", port)
|
||||
logger.Infof("server is listening on port %d", port)
|
||||
|
||||
if err := server.Serve(l); err != nil {
|
||||
logger.Fatal(err.Error())
|
||||
|
4
renovate.json
Normal file
4
renovate.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": ["config:recommended"],
|
||||
"prHourlyLimit": 20
|
||||
}
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 402 KiB |
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.2 KiB |
@ -12,11 +12,6 @@ description &&
|
||||
);
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
const geniusURL =
|
||||
"https://genius.com" +
|
||||
document.location.pathname +
|
||||
document.location.search;
|
||||
document.getElementById("goto-genius").setAttribute("href", geniusURL);
|
||||
document.querySelectorAll("#lyrics a").forEach((item) => {
|
||||
item.addEventListener("click", getAnnotation);
|
||||
});
|
||||
@ -75,35 +70,3 @@ function getAnnotation(e) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
window._currentTheme = localStorage.getItem("_theme") || "light";
|
||||
setTheme(window._currentTheme);
|
||||
|
||||
const themeChooser = document.getElementById("choose-theme");
|
||||
themeChooser.addEventListener("click", function () {
|
||||
if (window._currentTheme === "dark") {
|
||||
setTheme("light");
|
||||
} else {
|
||||
setTheme("dark");
|
||||
}
|
||||
});
|
||||
|
||||
function setTheme(theme) {
|
||||
const toggler = document.getElementById(
|
||||
"ic_fluent_dark_theme_24_regular"
|
||||
);
|
||||
switch (theme) {
|
||||
case "dark":
|
||||
toggler.setAttribute("fill", "#fff");
|
||||
localStorage.setItem("_theme", "dark");
|
||||
document.body.classList.add("dark");
|
||||
window._currentTheme = "dark";
|
||||
return;
|
||||
case "light":
|
||||
toggler.setAttribute("fill", "#181d31");
|
||||
localStorage.setItem("_theme", "light");
|
||||
document.body.classList.remove("dark");
|
||||
window._currentTheme = "light";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -22,20 +22,12 @@
|
||||
}
|
||||
|
||||
#album-single-track p {
|
||||
color: #181d31;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dark #album-single-track p {
|
||||
color: #ddd;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#album-single-track small {
|
||||
font-size: 1.5rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.dark #album-single-track small {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
blockquote {
|
||||
padding: 1rem;
|
||||
border-radius: 4px;
|
||||
background: #eee;
|
||||
background-color: #272d44;
|
||||
color: inherit;
|
||||
border: 1px solid #ddd;
|
||||
color: #222;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
@ -37,9 +37,3 @@ blockquote ul {
|
||||
color: #be3144;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.dark .annotation,
|
||||
.dark blockquote {
|
||||
background-color: #272d44;
|
||||
color: inherit;
|
||||
}
|
||||
|
@ -8,7 +8,11 @@
|
||||
|
||||
#article-body {
|
||||
line-height: 1.75;
|
||||
color: #171717;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#article-title {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#article-subtitle {
|
||||
@ -22,39 +26,19 @@
|
||||
border-radius: 5px;
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #e4e4e4;
|
||||
}
|
||||
|
||||
#metadata,
|
||||
#article-subtitle,
|
||||
#article-date {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
#article-authors {
|
||||
color: #1e1e1e;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.dark #article-image {
|
||||
background-color: #151515;
|
||||
border: 1px solid #2f2f2f;
|
||||
}
|
||||
|
||||
.dark #metadata,
|
||||
.dark #article-subtitle,
|
||||
.dark #article-date,
|
||||
.dark #article-authors {
|
||||
#metadata,
|
||||
#article-subtitle,
|
||||
#article-date,
|
||||
#article-authors {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.dark #article-title {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.dark #article-body {
|
||||
color: #eee;
|
||||
#article-authors {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dark #artist-albumlist p {
|
||||
#artist-albumlist p {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
@ -39,15 +39,11 @@
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.dark #artist-albumlist small {
|
||||
#artist-albumlist small {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#metadata p {
|
||||
color: #171717;
|
||||
}
|
||||
|
||||
.dark #metadata p {
|
||||
.#metadata p {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
@ -64,9 +60,5 @@
|
||||
}
|
||||
|
||||
#artist-section h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.dark #artist-section h2 {
|
||||
color: #ddd;
|
||||
}
|
||||
|
@ -10,20 +10,12 @@
|
||||
|
||||
#error h1 {
|
||||
font-size: 5rem;
|
||||
color: #111;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#error p {
|
||||
text-transform: uppercase;
|
||||
font-size: 1.6rem;
|
||||
color: #222;
|
||||
color: #ddd;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dark #error h1 {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.dark #error p {
|
||||
color: #ddd;
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
footer {
|
||||
background-color: #ffcd38;
|
||||
background: #000;
|
||||
border-top: solid 1px #fff;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
color: #1b1a17;
|
||||
transition: 0.3s ease text-decoration;
|
||||
font-size: 1.4rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
footer a:hover {
|
||||
@ -18,19 +18,15 @@ footer a:hover {
|
||||
#footer-container {
|
||||
width: 1024px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#footer-links {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
#version {
|
||||
font-size: 1.3rem;
|
||||
color: #1b1b1b;
|
||||
#footer-container span {
|
||||
color: #fff;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1080px) {
|
||||
@ -40,7 +36,3 @@ footer a:hover {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.dark footer {
|
||||
background-color: #fec260;
|
||||
}
|
||||
|
@ -14,11 +14,11 @@
|
||||
#home h1 {
|
||||
font-weight: 600;
|
||||
font-size: 2.2rem;
|
||||
color: #222;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#home p {
|
||||
color: #333;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
#home code {
|
||||
@ -34,17 +34,6 @@
|
||||
box-sizing: border-box;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #ddd;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.dark #home h1 {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.dark #home p {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.dark #search-input {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
#lyrics {
|
||||
color: #171717;
|
||||
line-height: 2.5rem;
|
||||
flex-basis: 0;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 1;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#lyrics a {
|
||||
color: inherit;
|
||||
background-color: #ddd;
|
||||
background-color: #272d44;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#lyrics a:hover {
|
||||
background-color: #ccc;
|
||||
background-color: #32384f;
|
||||
}
|
||||
|
||||
#metadata {
|
||||
@ -25,13 +25,13 @@
|
||||
|
||||
#metadata h1 {
|
||||
font-size: 2rem;
|
||||
color: #171717;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
#metadata h2 {
|
||||
font-size: 1.4rem;
|
||||
color: #1e1e1e;
|
||||
font-weight: 500;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#metadata-info {
|
||||
@ -55,9 +55,9 @@
|
||||
|
||||
#description p {
|
||||
font-size: 1.4rem;
|
||||
color: #171717;
|
||||
line-height: 1.8rem;
|
||||
cursor: pointer;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#title {
|
||||
@ -78,54 +78,27 @@
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
|
||||
#credits summary {
|
||||
font-weight: 900;
|
||||
font-size: 1.4rem;
|
||||
cursor: pointer;
|
||||
color: #1e1e1e;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#credits p {
|
||||
font-size: 1.3rem;
|
||||
padding: 0.5rem;
|
||||
color: #171717;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dark #lyrics {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.dark #lyrics a {
|
||||
background-color: #272d44;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.dark #lyrics a:hover {
|
||||
background-color: #32384f;
|
||||
}
|
||||
|
||||
.dark #metadata h1 {
|
||||
#title {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.dark #metadata h2,
|
||||
.dark #credits p {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.dark #title {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.dark #description p,
|
||||
.dark #credits summary {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1080px) {
|
||||
#metadata {
|
||||
align-items: center;
|
||||
|
@ -49,7 +49,7 @@ html {
|
||||
body {
|
||||
font-size: 1.5rem;
|
||||
font-family: inter;
|
||||
background-color: #f9f9f9;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,3 @@ a {
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
body.dark {
|
||||
background-color: #181d31;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
nav {
|
||||
background-color: #ffcd38;
|
||||
background: #000;
|
||||
border-bottom: solid 1px #fff;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
@ -7,7 +8,7 @@ nav {
|
||||
width: 1024px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@ -19,26 +20,6 @@ nav {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nav img {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#nav-icons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dark nav {
|
||||
background-color: #fec260;
|
||||
}
|
||||
|
@ -19,35 +19,35 @@
|
||||
}
|
||||
|
||||
#search-results h2 {
|
||||
color: #222;
|
||||
font-size: 1.8rem;
|
||||
font-weight: 500;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
#search-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
#search-item {
|
||||
display: flex;
|
||||
height: 8rem;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 1px 1px #ddd;
|
||||
border: 1px solid #888;
|
||||
}
|
||||
|
||||
#search-item h3 {
|
||||
font-size: 1.8rem;
|
||||
color: #333;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
#search-item span {
|
||||
font-size: 1.3rem;
|
||||
color: #333;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
#search-item img {
|
||||
@ -63,19 +63,3 @@
|
||||
border: 1px solid #ddd;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.dark #search-page h2 {
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.dark #search-item {
|
||||
border: 1px solid #888;
|
||||
}
|
||||
|
||||
.dark #search-item h3 {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.dark #search-item span {
|
||||
color: #bbb;
|
||||
}
|
||||
|
5
ups.json
Normal file
5
ups.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"upstream": "https://github.com/rramiachraf/dumb",
|
||||
"provider": "github",
|
||||
"commit": "f5df91fffe50283295f82488e4ec63a4be23f04e"
|
||||
}
|
@ -18,15 +18,27 @@ func NewLogger(w io.WriteCloser) *Logger {
|
||||
return &Logger{slog: sl}
|
||||
}
|
||||
|
||||
func (l *Logger) Error(f string, args ...any) {
|
||||
func (l *Logger) Errorf(f string, args ...any) {
|
||||
l.slog.Error(fmt.Sprintf(f, args...))
|
||||
}
|
||||
|
||||
func (l *Logger) Info(f string, args ...any) {
|
||||
func (l *Logger) Error(e string) {
|
||||
l.Errorf("%s", e)
|
||||
}
|
||||
|
||||
func (l *Logger) Infof(f string, args ...any) {
|
||||
l.slog.Info(fmt.Sprintf(f, args...))
|
||||
}
|
||||
|
||||
func (l *Logger) Fatal(f string, args ...any) {
|
||||
l.Error(f, args...)
|
||||
func (l *Logger) Info(m string) {
|
||||
l.Infof("%s", m)
|
||||
}
|
||||
|
||||
func (l *Logger) Fatalf(f string, args ...any) {
|
||||
l.Errorf(f, args...)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func (l *Logger) Fatal(e string) {
|
||||
l.Fatalf("%s", e)
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
func RenderTemplate(w http.ResponseWriter, t templ.Component, l *Logger) {
|
||||
if err := t.Render(context.Background(), w); err != nil {
|
||||
l.Error("unable to render template %s", err)
|
||||
l.Errorf("unable to render template %s", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
_, err := w.Write([]byte{})
|
||||
if err != nil {
|
||||
|
@ -1,15 +1,11 @@
|
||||
package views
|
||||
|
||||
import "github.com/rramiachraf/dumb/data"
|
||||
|
||||
templ footer() {
|
||||
<footer>
|
||||
<div id="footer-container">
|
||||
<div id="footer-links">
|
||||
<a rel="noopener noreferrer" target="_blank" href="https://github.com/rramiachraf/dumb">Source Code</a>
|
||||
<a rel="noopener noreferrer" target="_blank" href="/instances.json">Instances</a>
|
||||
</div>
|
||||
<p id="version">v.{ data.Version }</p>
|
||||
<a rel="noopener noreferrer" target="_blank" href="https://github.com/rramiachraf/dumb">Source</a>
|
||||
<span> | </span>
|
||||
<a rel="noopener noreferrer" target="_blank" href="https://git.ngn.tf/ngn/dumb">Modified Source</a>
|
||||
</div>
|
||||
</footer>
|
||||
}
|
||||
|
@ -4,38 +4,6 @@ templ navbar() {
|
||||
<nav>
|
||||
<div id="nav-container">
|
||||
<a href="/"><img src="/static/logo.png" alt="Logo"/></a>
|
||||
<div id="nav-icons">
|
||||
<a
|
||||
title="Go to Genius.com"
|
||||
alt="Go to Genius.com"
|
||||
class="nav-icon"
|
||||
id="goto-genius"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="25px" height="25px" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="#181d31" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 14v4.833A1.166 1.166 0 0 1 16.833 20H5.167A1.167 1.167 0 0 1 4 18.833V7.167A1.166 1.166 0 0 1 5.167 6h4.618m4.447-2H20v5.768m-7.889 2.121 7.778-7.778"></path>
|
||||
</svg>
|
||||
</a>
|
||||
<button id="choose-theme" class="nav-icon" type="button" aria-label="Change theme">
|
||||
<svg
|
||||
width="25px"
|
||||
height="25px"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
>
|
||||
<g id="🔍-Product-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="ic_fluent_dark_theme_24_regular" fill="#181d31" fill-rule="nonzero">
|
||||
<path
|
||||
d="M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,20.5 L12,3.5 C16.6944204,3.5 20.5,7.30557963 20.5,12 C20.5,16.6944204 16.6944204,20.5 12,20.5 Z"
|
||||
></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
}
|
||||
|
Reference in New Issue
Block a user