Updated
This commit is contained in:
parent
bcb83dfea5
commit
4430d24a3e
14 changed files with 99 additions and 106 deletions
|
|
@ -1,10 +1,8 @@
|
||||||
/** biome-ignore-all lint/suspicious/noExplicitAny: <_> */
|
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
import { ofetch } from "ofetch";
|
import { ofetch } from "ofetch";
|
||||||
import * as toml from "toml";
|
import * as toml from "toml";
|
||||||
import { encryptRsa } from "../../scripts/index.ts";
|
import { encryptRsa } from "../../scripts/index";
|
||||||
|
|
||||||
const apiConfig = toml.parse(
|
const apiConfig = toml.parse(
|
||||||
fs.readFileSync("configs/config.api.toml", "utf-8"),
|
fs.readFileSync("configs/config.api.toml", "utf-8"),
|
||||||
|
|
@ -13,11 +11,11 @@ const securityConfig = toml.parse(
|
||||||
fs.readFileSync("configs/config.security.toml", "utf-8"),
|
fs.readFileSync("configs/config.security.toml", "utf-8"),
|
||||||
);
|
);
|
||||||
|
|
||||||
const TOKEN_NAME = securityConfig.token.token_name;
|
const TOKEN_NAME = securityConfig.token.name;
|
||||||
const TOKEN_EXPIRATION = securityConfig.token.token_expiration;
|
const TOKEN_EXPIRATION = securityConfig.token.expiration;
|
||||||
const URL = apiConfig.backend.backend_url;
|
const URL = apiConfig.backend.url;
|
||||||
const RETRY = apiConfig.request.request_retries;
|
const RETRY = apiConfig.request.retries;
|
||||||
const CODES = apiConfig.request.request_retry_codes;
|
const CODES = apiConfig.request.retry_codes;
|
||||||
|
|
||||||
export default async (api: string, body: { [key: string]: unknown }) => {
|
export default async (api: string, body: { [key: string]: unknown }) => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
import { JSEncrypt } from "jsencrypt";
|
import { JSEncrypt } from "jsencrypt";
|
||||||
import { $rsaPublicKey } from "../../../configs/config.security.ts";
|
import * as fs from "node:fs";
|
||||||
|
import * as toml from "toml";
|
||||||
|
|
||||||
|
const config = toml.parse(
|
||||||
|
fs.readFileSync("configs/config.security.toml", "utf-8"),
|
||||||
|
);
|
||||||
const enc = new JSEncrypt();
|
const enc = new JSEncrypt();
|
||||||
const PUBLIC_KEY = $rsaPublicKey.get();
|
const PUBLIC_KEY = config.rsa.public_key;
|
||||||
|
|
||||||
export default (message: string) => {
|
export default (message: string) => {
|
||||||
enc.setPublicKey(PUBLIC_KEY);
|
enc.setPublicKey(PUBLIC_KEY);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,12 @@
|
||||||
FROM denoland/deno:alpine AS build
|
FROM oven/bun:canary-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json deno.lock ./
|
COPY package*.json bun.lock ./
|
||||||
RUN deno install && deno install --allow-scripts=npm:sharp,npm:@parcel/watcher
|
RUN bun install && bun pm trust --all
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN deno task build
|
RUN bun run build
|
||||||
|
|
||||||
# FROM nginx:alpine AS runtime
|
FROM nginx:alpine AS runtime
|
||||||
# COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
# COPY --from=build /app/.output/public /usr/share/nginx/html
|
COPY --from=build /app/.output/public /usr/share/nginx/html
|
||||||
# EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
FROM denoland/deno:alpine
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=build /app .
|
|
||||||
CMD ["deno", "run", "--allow-env", "--allow-net", "--allow-read", ".output/server/index.mjs"]
|
|
||||||
|
|
@ -19,11 +19,11 @@ podman:
|
||||||
podman-compose up -d
|
podman-compose up -d
|
||||||
|
|
||||||
favicon:
|
favicon:
|
||||||
deno --allow-env --allow-read --allow-ffi ./@dasig/scripts/node/generateFavicon.ts
|
bun ./@dasig/scripts/node/generateFavicon.ts
|
||||||
|
|
||||||
logo:
|
logo:
|
||||||
deno --allow-env --allow-read --allow-ffi ./@dasig/scripts/node/optimizeLogo.ts --size $(size)
|
bun ./@dasig/scripts/node/optimizeLogo.ts --size $(size)
|
||||||
|
|
||||||
image:
|
image:
|
||||||
deno --allow-env --allow-read --allow-ffi ./@dasig/scripts/node/optimizeImage.ts --name $(name) --size $(size)
|
bun ./@dasig/scripts/node/optimizeImage.ts --name $(name) --size $(size)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { defineConfig } from '@solidjs/start/config'
|
import { defineConfig } from "@solidjs/start/config";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
ssr: true,
|
ssr: false,
|
||||||
// server: {
|
server: {
|
||||||
// static: true,
|
static: true,
|
||||||
// prerender: {
|
prerender: {
|
||||||
// crawlLinks: true,
|
crawlLinks: true,
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
{
|
|
||||||
"formatter": {
|
|
||||||
"enabled": true,
|
|
||||||
"formatWithErrors": false,
|
|
||||||
"indentStyle": "space",
|
|
||||||
"indentWidth": 2,
|
|
||||||
"lineEnding": "lf",
|
|
||||||
"lineWidth": 320,
|
|
||||||
"attributePosition": "auto",
|
|
||||||
"bracketSameLine": false,
|
|
||||||
"bracketSpacing": true,
|
|
||||||
"expand": "auto",
|
|
||||||
"useEditorconfig": true
|
|
||||||
},
|
|
||||||
"javascript": {
|
|
||||||
"formatter": {
|
|
||||||
"jsxQuoteStyle": "double",
|
|
||||||
"quoteProperties": "asNeeded",
|
|
||||||
"trailingCommas": "es5",
|
|
||||||
"semicolons": "asNeeded",
|
|
||||||
"arrowParentheses": "always",
|
|
||||||
"bracketSameLine": false,
|
|
||||||
"quoteStyle": "single",
|
|
||||||
"attributePosition": "auto",
|
|
||||||
"bracketSpacing": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"json": { "formatter": { "enabled": false } },
|
|
||||||
"html": {
|
|
||||||
"formatter": {
|
|
||||||
"indentScriptAndStyle": false,
|
|
||||||
"selfCloseVoidElements": "always"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"linter": {
|
|
||||||
"rules": {
|
|
||||||
"style": {
|
|
||||||
"noNonNullAssertion": "off"
|
|
||||||
},
|
|
||||||
"a11y": {
|
|
||||||
"useKeyWithClickEvents": "off",
|
|
||||||
"noStaticElementInteractions": "off"
|
|
||||||
},
|
|
||||||
"complexity": {
|
|
||||||
"noUselessFragments": "off"
|
|
||||||
},
|
|
||||||
"suspicious": {
|
|
||||||
"noImplicitAnyLet": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
52
frontend/biome.jsonc
Normal file
52
frontend/biome.jsonc
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"formatter": {
|
||||||
|
"enabled": true,
|
||||||
|
"formatWithErrors": false,
|
||||||
|
"indentStyle": "space",
|
||||||
|
"indentWidth": 2,
|
||||||
|
"lineEnding": "lf",
|
||||||
|
"lineWidth": 320,
|
||||||
|
"attributePosition": "auto",
|
||||||
|
"bracketSameLine": false,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"expand": "auto",
|
||||||
|
"useEditorconfig": true
|
||||||
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"jsxQuoteStyle": "double",
|
||||||
|
"quoteProperties": "asNeeded",
|
||||||
|
"trailingCommas": "es5",
|
||||||
|
"semicolons": "asNeeded",
|
||||||
|
"arrowParentheses": "always",
|
||||||
|
"bracketSameLine": false,
|
||||||
|
"quoteStyle": "single",
|
||||||
|
"attributePosition": "auto",
|
||||||
|
"bracketSpacing": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"json": { "formatter": { "enabled": false } },
|
||||||
|
"html": {
|
||||||
|
"formatter": {
|
||||||
|
"indentScriptAndStyle": false,
|
||||||
|
"selfCloseVoidElements": "always"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"style": {
|
||||||
|
"noNonNullAssertion": "off"
|
||||||
|
},
|
||||||
|
"a11y": {
|
||||||
|
"useKeyWithClickEvents": "off",
|
||||||
|
"noStaticElementInteractions": "off"
|
||||||
|
},
|
||||||
|
"complexity": {
|
||||||
|
"noUselessFragments": "off"
|
||||||
|
},
|
||||||
|
"suspicious": {
|
||||||
|
"noImplicitAnyLet": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[backend]
|
[backend]
|
||||||
backend_url = "http://localhost:8080"
|
url = "http://localhost:8080"
|
||||||
|
|
||||||
[request]
|
[request]
|
||||||
request_retries = 3
|
retries = 3
|
||||||
request_retry_codes = [400, 404, 405, 500, 502]
|
retry_codes = [400, 404, 405, 500, 502]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
[token]
|
[token]
|
||||||
token_name = "dasig" # output: dasig-token
|
name = "dasig" # output: dasig-token
|
||||||
token_encryption = "rsa"
|
encryption = "rsa"
|
||||||
token_expiration = 9 # seconds
|
expiration = 9 # seconds
|
||||||
|
|
||||||
[rsa]
|
[rsa]
|
||||||
rsa_public_key = '''-----BEGIN PUBLIC KEY-----
|
public_key = '''-----BEGIN PUBLIC KEY-----
|
||||||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9Aw5Zasdanf2biS69qoQ
|
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9Aw5Zasdanf2biS69qoQ
|
||||||
/YZbyIM+LS7LOLNN3ot6nZH1FiTqTNy61ffUA2Y/s3hGz9L0+k6gRu7uGBza6XPU
|
/YZbyIM+LS7LOLNN3ot6nZH1FiTqTNy61ffUA2Y/s3hGz9L0+k6gRu7uGBza6XPU
|
||||||
+iuGdXxZd2mc3lrnPfR6SSllMwGlAVkYpQhmkB19igd8aLUbFiJ3pPKkNocv/yQa
|
+iuGdXxZd2mc3lrnPfR6SSllMwGlAVkYpQhmkB19igd8aLUbFiJ3pPKkNocv/yQa
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
$lightBackground: #e2e7f2
|
$light-background: #e2e7f2
|
||||||
$darkBackground: #0a152a
|
$dark-background: #0a152a
|
||||||
|
|
||||||
$mobile: 575.98px
|
$mobile: 575.98px
|
||||||
$tablet: 768px
|
$tablet: 768px
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,4 @@ services:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- ${PORT}:8080
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// @refresh reload
|
// @refresh reload
|
||||||
/** biome-ignore-all lint/style/noNonNullAssertion: <biome exception> */
|
|
||||||
import { mount, StartClient } from "@solidjs/start/client";
|
import { mount, StartClient } from "@solidjs/start/client";
|
||||||
|
|
||||||
mount(() => <StartClient />, document.getElementById("app")!);
|
mount(() => <StartClient />, document.getElementById("app")!);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
// deno-lint-ignore-file jsx-no-children-prop
|
|
||||||
|
|
||||||
import * as fs from "node:fs";
|
|
||||||
// import { $companyName, $font, $websiteDescription, $websiteName } from '../configs/config.site.ts';
|
|
||||||
import { createHandler, StartServer } from "@solidjs/start/server";
|
import { createHandler, StartServer } from "@solidjs/start/server";
|
||||||
|
import * as fs from "node:fs";
|
||||||
import * as toml from "toml";
|
import * as toml from "toml";
|
||||||
import { HTML } from "../@dasig/index.ts";
|
import { HTML } from "../@dasig/index";
|
||||||
|
|
||||||
const config = toml.parse(fs.readFileSync("configs/config.site.toml", "utf8"));
|
const config = toml.parse(fs.readFileSync("configs/config.site.toml", "utf8"));
|
||||||
const websiteName = config.website.name;
|
const websiteName = config.website.name;
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
:root
|
:root
|
||||||
color-scheme: light dark
|
color-scheme: light dark
|
||||||
background-color: light-dark(design.$lightBackground, design.$darkBackground)
|
background-color: light-dark(design.$light-background, design.$dark-background)
|
||||||
transition: background-color 0.6s ease-out
|
transition: background-color 0.6s ease-out
|
||||||
|
|
||||||
body
|
body
|
||||||
color: light-dark(color.adjust(design.$lightBackground, $blackness: 95%), color.adjust(design.$darkBackground, $lightness: 95%))
|
color: light-dark(color.adjust(design.$light-background, $blackness: 95%), color.adjust(design.$dark-background, $lightness: 95%))
|
||||||
transition: background-color 0.6s ease-out
|
transition: color 0.6s ease-out
|
||||||
|
|
||||||
a
|
a
|
||||||
margin-right: 1rem
|
margin-right: 1rem
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue