Compare commits

..

No commits in common. "master" and "v1.0.0" have entirely different histories.

6 changed files with 44 additions and 44 deletions

View File

@ -3,19 +3,20 @@ name: CI
on: on:
push: push:
branches: branches:
- 'master' - master
tags:
- 'v*'
pull_request:
branches:
- master
env: env:
# Use docker.io for Docker Hub if empty # Use docker.io for Docker Hub if empty
REGISTRY: git.thehrz.net REGISTRY: git.thehrz.net
# github.repository as <account>/<repo> # github.repository as <account>/<repo>
IMAGE_NAME: H8-Network/TinySkin IMAGE_NAME: tinyskin
jobs: jobs:
release-image: deploy:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -28,7 +29,7 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Log into registry - name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@ -36,18 +37,12 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.TOKEN }} password: ${{ secrets.TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v6 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha cache-from: type=gha
# cache-to: type=gha,mode=max cache-to: type=gha,mode=max

View File

@ -11,7 +11,7 @@ COPY frontend .
RUN pnpm build RUN pnpm build
FROM golang:1.23-alpine AS build-stage FROM golang:1.23 AS build-stage
WORKDIR /app WORKDIR /app
ENV GOPROXY https://goproxy.cn,direct ENV GOPROXY https://goproxy.cn,direct

23
docker-compose.yml Normal file
View File

@ -0,0 +1,23 @@
version: "3.9"
networks:
traefik:
name: traefik
external: true
services:
tinyskin:
build: .
container_name: tinyskin
volumes:
- /srv/server/tinyskin:/app/config
restart: always
labels:
- traefik.enable=true
- traefik.http.routers.tinyskin.rule=Host(`auth.hfbz.net`)
- traefik.http.routers.tinyskin.entrypoints=web,websecure
- traefik.http.routers.tinyskin.middlewares=CORS@file
- traefik.http.services.tinyskin.loadbalancer.server.port=8080
networks:
- traefik

View File

@ -1,24 +0,0 @@
import Button from "@mui/material/Button"
import { useCallback } from "react"
export default function QuickSetter() {
const url = "https://auth.hfbz.net/api/yggdrasil"
const handleDragStart = useCallback(
(event: React.DragEvent<HTMLButtonElement>) => {
const uri = "authlib-injector:yggdrasil-server:" + encodeURIComponent(url)
if (event.dataTransfer) {
event.dataTransfer.setData("text/plain", uri)
event.dataTransfer.dropEffect = "copy"
}
},
[url]
)
return (
<Button variant="contained" draggable onDragStart={handleDragStart}>
</Button>
)
}

View File

@ -166,7 +166,7 @@ export default function SignUp() {
checkList={[ checkList={[
{ {
errMsg: "长度在 3-16 之间由数字、大小写字母、_构成", errMsg: "长度在 3-16 之间由数字、大小写字母、_构成",
reg: /^[0-9a-zA-Z_]{3,16}$/ reg: /[0-9a-zA-Z_]{3,16}/
} }
]} ]}
required required

View File

@ -11,7 +11,6 @@ import Box from '@mui/material/Box';
import useTitle from '@/hooks/useTitle'; import useTitle from '@/hooks/useTitle';
import SkinViewUUID from '@/components/SkinViewUUID'; import SkinViewUUID from '@/components/SkinViewUUID';
import root from '@/utils/root'; import root from '@/utils/root';
import YggdrasilSetter from '@/components/YggdrasilSetter';
const Profile = function Profile() { const Profile = function Profile() {
const navigate = useNavigate(); const navigate = useNavigate();
@ -55,7 +54,14 @@ const Profile = function Profile() {
<Typography> Yggdrasil </Typography> <Typography> Yggdrasil </Typography>
<code style={{ wordBreak: "break-all" }}>{getYggRoot()}</code> <code style={{ wordBreak: "break-all" }}>{getYggRoot()}</code>
<Typography> API </Typography> <Typography> API </Typography>
<YggdrasilSetter /> <Button
variant="contained"
href="https://auth.hfbz.net/api/yggdrasil"
draggable='true'
data-clipboard-text="https://auth.hfbz.net/api/yggdrasil"
>
</Button>
</CardContent> </CardContent>
</Card> </Card>
<Box sx={{ gridArea: "d" }}></Box> <Box sx={{ gridArea: "d" }}></Box>