Compare commits

...

10 Commits

Author SHA1 Message Date
Pihkaal
49854a661d github -> gitea
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m6s
2025-12-21 00:01:20 +01:00
Pihkaal
3827176093 feat: drop bunnycdn 2025-10-11 17:37:36 +02:00
Pihkaal
d07eddc502 chore: docker restart always 2025-03-16 20:15:02 +01:00
Pihkaal
e822a74c60 fix(docker): missing environment variable 2024-11-12 16:22:48 +01:00
Pihkaal
57bbf9f091 feat(docker): build go project 2024-11-12 16:17:32 +01:00
Pihkaal
85eac55045 refactor: rewrite in Go
NOTE: docker not working anymore
2024-11-12 16:02:02 +01:00
Pihkaal
55c43df2a7 feat: add more images 2024-10-18 11:25:29 +02:00
Pihkaal
f9a3f48858 fix: set body background color 2024-10-18 00:58:32 +02:00
Pihkaal
947634a27e fix: use svh instead of vh 2024-10-17 23:49:51 +02:00
Pihkaal
98c3d92c7e feat: bigger sparkles 2024-10-17 23:46:54 +02:00
103 changed files with 279 additions and 11802 deletions

View File

@@ -1,3 +0,0 @@
node_modules
.nuxt
.output

View File

@@ -0,0 +1,29 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.pihkaal.xyz
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t git.pihkaal.xyz/pihkaal/lilou-cat:latest .
docker push git.pihkaal.xyz/pihkaal/lilou-cat:latest

View File

@@ -1,28 +0,0 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t pihkaal/lilou-cat:latest .
docker push pihkaal/lilou-cat:latest

28
.gitignore vendored
View File

@@ -1,27 +1 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example
# ESLint
.eslintcache
lilou

View File

@@ -1,23 +1,13 @@
FROM node:20-slim AS base
FROM golang:1.23.2
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
COPY go.mod ./
RUN go mod download
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM base
COPY --from=build /app/.output /app/.output
COPY *.go ./
COPY public ./public
RUN go build -o ./server
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
CMD ["./server"]

14
app.vue
View File

@@ -1,14 +0,0 @@
<script setup lang="ts">
useSeoMeta({
title: "Lilou Chat",
description: "Just ✨ Lilou ✨",
themeColor: "#fa86c4",
});
</script>
<template>
<div class="h-screen">
<AppBody />
<StarshineGlitter />
</div>
</template>

View File

@@ -1,26 +0,0 @@
<template>
<main
class="h-full items-center relative p-5 justify-center flex flex-col space-y-4 bg-[#fa86c4] z-10"
>
<NuxtRouteAnnouncer />
<h1
class="text-4xl md:text-5xl lg:text-6xl font-serif text-white dark:text-white"
>
Lilou
</h1>
<img
class="w-full max-w-[50vh] rotate-90"
src="https://lilou.cat/api"
alt="Lilou"
/>
<h1
class="text-4xl md:text-5xl lg:text-6xl font-serif text-white dark:text-white"
>
Lilou
</h1>
<div class="absolute inset-0">
<StarshineGlitter />
</div>
</main>
</template>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
services:
lilou-cat:
image: pihkaal/lilou-cat:latest
image: git.pihkaal.xyz/pihkaal/lilou-cat:latest
networks:
- web
labels:
@@ -10,6 +10,7 @@ services:
- "traefik.http.services.lilou-cat.loadbalancer.server.port=3000"
- "traefik.http.routers.lilou-cat.tls=true"
- "traefik.http.routers.lilou-cat.tls.certResolver=myresolver"
restart: always
networks:
web:

View File

@@ -1,4 +0,0 @@
// @ts-check
import withNuxt from "./.nuxt/eslint.config.mjs";
export default withNuxt();

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module lilou
go 1.23.2

77
main.go Normal file
View File

@@ -0,0 +1,77 @@
package main
import (
_ "embed"
"errors"
"fmt"
"io"
"math/rand"
"net/http"
"os"
"strings"
)
//go:embed public/index.html
var indexSrc string
const PORT = 3000
const IMAGES_DIR = "images"
var cachedImages []string
func loadImages() error {
imagesDir := fmt.Sprintf("public/%s", IMAGES_DIR)
entries, err := os.ReadDir(imagesDir)
if err != nil {
return fmt.Errorf("ERROR: Failed to read public/%s directory: %w", IMAGES_DIR, err)
}
cachedImages = []string{}
for _, entry := range entries {
if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".webp") {
cachedImages = append(cachedImages, entry.Name())
}
}
fmt.Printf("OK: Loaded %d images\n", len(cachedImages))
return nil
}
func getPage(w http.ResponseWriter, r *http.Request) {
imageName := cachedImages[rand.Intn(len(cachedImages))]
imageURL := fmt.Sprintf("/%s/%s", IMAGES_DIR, imageName)
src := strings.Replace(indexSrc, "{{ IMAGE_URL }}", imageURL, 1)
io.WriteString(w, src)
}
func getFavicon(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "public/favicon.ico")
}
func main() {
if err := loadImages(); err != nil {
fmt.Printf("ERROR: Error loading images: %s\n", err)
os.Exit(1)
}
if len(cachedImages) == 0 {
fmt.Printf("ERROR: no images found in public/%s\n", IMAGES_DIR)
os.Exit(1)
}
http.HandleFunc("/", getPage)
http.HandleFunc("/favicon.ico", getFavicon)
http.Handle(fmt.Sprintf("/%s/", IMAGES_DIR), http.StripPrefix(fmt.Sprintf("/%s/", IMAGES_DIR), http.FileServer(http.Dir(fmt.Sprintf("public/%s", IMAGES_DIR)))))
fmt.Printf("OK: Listening on port %d\n", PORT)
err := http.ListenAndServe(fmt.Sprintf(":%d", PORT), nil)
if errors.Is(err, http.ErrServerClosed) {
fmt.Printf("OK: Server closed\n")
} else if err != nil {
fmt.Printf("ERROR: error starting server: %s\n", err)
os.Exit(1)
}
}

View File

@@ -6,8 +6,9 @@
IMG_SZ=1024
for file in public/lilou/*.jpg; do
hash=$(md5sum "$file" | awk '{print $1}')
cwebp "$file" -resize $IMG_SZ $IMG_SZ -o "./public/lilou/${hash}.webp"
rm "$file"
hash=$(md5sum "$file" | awk '{print $1}')
out="./public/lilou/${hash}.webp"
cwebp "$file" -resize $IMG_SZ $IMG_SZ -o "$out"
magick "$out" -rotate 90 "$out"
rm "$file"
done

View File

@@ -1,6 +0,0 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-04-03",
devtools: { enabled: true },
modules: ["@nuxt/eslint", "@nuxtjs/tailwindcss"],
});

View File

@@ -1,25 +0,0 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint": "eslint . --cache --fix",
"format": "pnpx prettier --cache --write ."
},
"dependencies": {
"@nuxt/eslint": "^0.6.0",
"@nuxtjs/tailwindcss": "^6.12.2",
"nuxt": "^3.13.0",
"vue": "latest",
"vue-router": "latest"
},
"packageManager": "pnpm@9.11.0",
"devDependencies": {
"typescript": "5.5.4"
}
}

11550
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

155
public/index.html Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@

Some files were not shown because too many files have changed in this diff Show More