Merge pull request #31 from renzynx/dev

Dev
This commit is contained in:
renzynx 2022-12-25 23:39:34 +07:00 committed by GitHub
commit da1b3ae7d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 15 deletions

View File

@ -31,6 +31,8 @@ wget https://cdn.amog-us.club/docker-compose.yml
```
Fill in the `docker-compose.yml` environment with the appropriate values.
<br>
For arm64 CPUs like the Raspberry Pi 4 change the image to `ghcr.io/renzynx/bliss:latest-arm64` and `ghcr.io/renzynx/web:latest-arm64`.
```bash
docker compose up -d

View File

@ -3,7 +3,7 @@ name: Build and push Docker images
on:
push:
branches:
- main
- dev
paths:
- 'api/src/**'
- 'api/prisma/**'
@ -14,7 +14,7 @@ on:
workflow_dispatch:
jobs:
build:
api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -30,10 +30,7 @@ jobs:
api/prisma/**
api/Dockerfile
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Buildx
- name: Set up BuildX
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
@ -49,12 +46,48 @@ jobs:
with:
context: ./api
file: ./api/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/renzynx/bliss:latest
cache-from: type=gha
cache-to: type=gha,mode=max
api-arm64:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
files: |
api/src/**
api/prisma/**
api/Dockerfile
- name: Set up BuildX
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: docker/build-push-action@v3
with:
context: ./api
file: ./api/Dockerfile
push: true
tags: ghcr.io/renzynx/bliss:latest-arm64
cache-from: type=gha
cache-to: type=gha,mode=max
web:
runs-on: ubuntu-latest
steps:
@ -69,9 +102,6 @@ jobs:
web/public/**
web/Dockerfile
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Buildx
uses: docker/setup-buildx-action@v2
@ -88,8 +118,42 @@ jobs:
with:
context: ./web
file: ./web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/renzynx/web:latest
cache-from: type=gha
cache-to: type=gha,mode=max
web-arm64:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
files: |
web/src/**
web/public/**
web/Dockerfile
- name: Set up BuildX
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: docker/build-push-action@v3
with:
context: ./web
file: ./web/Dockerfile
push: true
tags: ghcr.io/renzynx/web:latest-arm64
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -9,7 +9,7 @@ import client from "./lib/redis";
import ConnectStore from "connect-redis";
import session from "express-session";
import helmet from "helmet";
import bp from "body-parser";
import bodyparser from "body-parser";
import "./lib/setup";
import "./lib/clean";
import { NextFunction, Request, Response } from "express";
@ -29,7 +29,7 @@ async function bootstrap() {
}
next();
});
app.use(bp.raw({ type: "application/octet-stream", limit: "100mb" }));
app.use(bodyparser.raw({ type: "application/octet-stream", limit: "100mb" }));
app.use(
helmet({
crossOriginEmbedderPolicy: false,

View File

@ -216,7 +216,7 @@ export class UsersService implements IUserService {
}
try {
const avatarHash = md5(generateRandomString(32) + Date.now().toString());
const avatarHash = md5(generateRandomString(16) + Date.now().toString());
const hashedPassword = await argon.hash(password);
const user = await this.prisma.user.create({
data: {

View File

@ -1,8 +1,16 @@
import { NotFoundTitle } from '@pages/404Page';
import Head from 'next/head';
import React from 'react';
const NotFound = () => {
return <NotFoundTitle />;
return (
<>
<Head>
<title>404 - Page Not Found</title>
</Head>
<NotFoundTitle />
</>
);
};
export default NotFound;