Compare commits
7 Commits
97f85fef34
...
390482f494
Author | SHA1 | Date |
---|---|---|
Linca | 390482f494 | |
naskya | 82c98ae72f | |
naskya | 5b3f93457b | |
naskya | 4d9c0f8e7b | |
naskya | bf2b624bc9 | |
naskya | 5261eb24b6 | |
Lhcfl | bfa8bc5f7d |
|
@ -6,6 +6,14 @@ services:
|
|||
- name: docker.io/redis:7-alpine
|
||||
alias: redis
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_PROJECT_PATH == 'firefish/firefish'
|
||||
when: always
|
||||
- if: $CI_MERGE_REQUEST_PROJECT_PATH == 'firefish/firefish'
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- node_modules
|
||||
|
@ -16,6 +24,8 @@ cache:
|
|||
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
- dependency
|
||||
|
||||
variables:
|
||||
POSTGRES_DB: 'firefish_db'
|
||||
|
@ -29,7 +39,6 @@ variables:
|
|||
|
||||
default:
|
||||
before_script:
|
||||
- mkdir -p "${CARGO_HOME}"
|
||||
- apt-get update && apt-get -y upgrade
|
||||
- apt-get -y --no-install-recommends install curl
|
||||
- curl -fsSL 'https://deb.nodesource.com/setup_18.x' | bash -
|
||||
|
@ -48,7 +57,21 @@ build_test:
|
|||
- pnpm run build:debug
|
||||
- pnpm run migrate
|
||||
|
||||
build_and_cargo_unit_test:
|
||||
container_image_build:
|
||||
stage: build
|
||||
image: docker.io/debian:bookworm-slim
|
||||
services: []
|
||||
before_script: []
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'develop'
|
||||
script:
|
||||
- apt-get update && apt-get -y upgrade
|
||||
- apt-get install -y --no-install-recommends buildah ca-certificates
|
||||
- buildah login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
||||
- buildah build --security-opt seccomp=unconfined --cap-add all --tag "${CI_REGISTRY}/${CI_PROJECT_PATH}/develop:not-for-production" --platform linux/amd64 .
|
||||
- buildah push "${CI_REGISTRY}/${CI_PROJECT_PATH}/develop:not-for-production" "docker://${CI_REGISTRY}/${CI_PROJECT_PATH}/develop:not-for-production"
|
||||
|
||||
cargo_unit_test:
|
||||
stage: test
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
|
@ -69,7 +92,7 @@ build_and_cargo_unit_test:
|
|||
- pnpm --filter='!backend-rs' run build:debug
|
||||
- cargo test
|
||||
|
||||
clippy:
|
||||
cargo_clippy:
|
||||
stage: test
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
|
@ -83,3 +106,15 @@ clippy:
|
|||
when: never
|
||||
script:
|
||||
- cargo clippy -- -D warnings
|
||||
|
||||
renovate:
|
||||
stage: dependency
|
||||
image:
|
||||
name: docker.io/renovate/renovate:37-slim
|
||||
entrypoint: [""]
|
||||
rules:
|
||||
- if: $RENOVATE && $CI_PIPELINE_SOURCE == 'schedule'
|
||||
services: []
|
||||
before_script: []
|
||||
script:
|
||||
- renovate --platform gitlab --token "${API_TOKEN}" --endpoint "${CI_SERVER_URL}/api/v4" "${CI_PROJECT_PATH}"
|
||||
|
|
|
@ -3,19 +3,71 @@ import { fetchMeta } from "backend-rs";
|
|||
import { config } from "@/config.js";
|
||||
import manifest from "./manifest.json" assert { type: "json" };
|
||||
|
||||
interface Manifest {
|
||||
short_name: string;
|
||||
name: string;
|
||||
description: string;
|
||||
start_url: string;
|
||||
scope: string;
|
||||
display: string;
|
||||
background_color: string;
|
||||
theme_color: string;
|
||||
orientation: string;
|
||||
icons: {
|
||||
src: string;
|
||||
sizes?: string;
|
||||
type?: string;
|
||||
purpose?: "any" | "maskable" | "monochrome";
|
||||
}[];
|
||||
share_target: {
|
||||
action: "/share/";
|
||||
params: {
|
||||
title: "title";
|
||||
text: "text";
|
||||
url: "url";
|
||||
};
|
||||
};
|
||||
screenshots: {
|
||||
src: string;
|
||||
sizes: string;
|
||||
type: string;
|
||||
platform: string;
|
||||
label: string;
|
||||
}[];
|
||||
shortcuts: {
|
||||
name: string;
|
||||
short_name?: string;
|
||||
url: string;
|
||||
}[];
|
||||
categories: string[];
|
||||
}
|
||||
|
||||
export const manifestHandler = async (ctx: Koa.Context) => {
|
||||
// TODO
|
||||
//const res = structuredClone(manifest);
|
||||
const res = JSON.parse(JSON.stringify(manifest));
|
||||
const res: Manifest = JSON.parse(JSON.stringify(manifest));
|
||||
|
||||
const instance = await fetchMeta(false);
|
||||
|
||||
res.short_name = instance.name || "Firefish";
|
||||
res.name = instance.name || "Firefish";
|
||||
if (instance.themeColor) res.theme_color = instance.themeColor;
|
||||
for (const icon of res.icons) {
|
||||
icon.src = `${icon.src}?v=${config.version.replace(/[^0-9]/g, "")}`;
|
||||
|
||||
if (instance.iconUrl) {
|
||||
res.icons = [
|
||||
{
|
||||
src: instance.iconUrl,
|
||||
sizes: "48x48 72x72 96x96 128x128 192x192 256x256",
|
||||
purpose: "any",
|
||||
},
|
||||
];
|
||||
} else {
|
||||
for (const icon of res.icons) {
|
||||
icon.src = `${icon.src}?v=${config.version.replace(/[^0-9]/g, "")}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (instance.themeColor) res.theme_color = instance.themeColor;
|
||||
|
||||
for (const screenshot of res.screenshots) {
|
||||
screenshot.src = `${screenshot.src}?v=${config.version.replace(
|
||||
/[^0-9]/g,
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["config:base"],
|
||||
"rangeStrategy": "bump",
|
||||
"branchConcurrentLimit": 5,
|
||||
"enabledManagers": ["npm", "cargo"],
|
||||
"baseBranches": ["develop"],
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true,
|
||||
"recreateWhen": "always",
|
||||
"rebaseStalePrs": true,
|
||||
"branchTopic": "lock-file-maintenance",
|
||||
"commitMessageAction": "Lock file maintenance"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue