mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-10-15 03:58:14 +00:00
Compare commits
10 Commits
develop/ne
...
v1.11.0-rc
Author | SHA1 | Date | |
---|---|---|---|
|
7c97df98c7 | ||
|
b084c42aca | ||
|
fdfa2f3ea6 | ||
|
3323e7a0ed | ||
|
d4f9da34c6 | ||
|
10ed67c753 | ||
|
cf3cc4e638 | ||
|
46b9e41100 | ||
|
02adafbd4b | ||
|
f141d4719c |
Binary file not shown.
Before Width: | Height: | Size: 641 KiB After Width: | Height: | Size: 2.1 MiB |
36
.github/workflows/docker-build.yaml
vendored
36
.github/workflows/docker-build.yaml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- canary
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
@@ -43,6 +44,19 @@ jobs:
|
|||||||
-t itzcrazykns1337/${IMAGE_NAME}:amd64 \
|
-t itzcrazykns1337/${IMAGE_NAME}:amd64 \
|
||||||
--push .
|
--push .
|
||||||
|
|
||||||
|
- name: Build and push AMD64 Canary Docker image
|
||||||
|
if: github.ref == 'refs/heads/canary' && github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
DOCKERFILE=app.dockerfile
|
||||||
|
IMAGE_NAME=perplexica
|
||||||
|
docker buildx build --platform linux/amd64 \
|
||||||
|
--cache-from=type=registry,ref=itzcrazykns1337/${IMAGE_NAME}:canary-amd64 \
|
||||||
|
--cache-to=type=inline \
|
||||||
|
--provenance false \
|
||||||
|
-f $DOCKERFILE \
|
||||||
|
-t itzcrazykns1337/${IMAGE_NAME}:canary-amd64 \
|
||||||
|
--push .
|
||||||
|
|
||||||
- name: Build and push AMD64 release Docker image
|
- name: Build and push AMD64 release Docker image
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
@@ -91,6 +105,19 @@ jobs:
|
|||||||
-t itzcrazykns1337/${IMAGE_NAME}:arm64 \
|
-t itzcrazykns1337/${IMAGE_NAME}:arm64 \
|
||||||
--push .
|
--push .
|
||||||
|
|
||||||
|
- name: Build and push ARM64 Canary Docker image
|
||||||
|
if: github.ref == 'refs/heads/canary' && github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
DOCKERFILE=app.dockerfile
|
||||||
|
IMAGE_NAME=perplexica
|
||||||
|
docker buildx build --platform linux/arm64 \
|
||||||
|
--cache-from=type=registry,ref=itzcrazykns1337/${IMAGE_NAME}:canary-arm64 \
|
||||||
|
--cache-to=type=inline \
|
||||||
|
--provenance false \
|
||||||
|
-f $DOCKERFILE \
|
||||||
|
-t itzcrazykns1337/${IMAGE_NAME}:canary-arm64 \
|
||||||
|
--push .
|
||||||
|
|
||||||
- name: Build and push ARM64 release Docker image
|
- name: Build and push ARM64 release Docker image
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
@@ -128,6 +155,15 @@ jobs:
|
|||||||
--amend itzcrazykns1337/${IMAGE_NAME}:arm64
|
--amend itzcrazykns1337/${IMAGE_NAME}:arm64
|
||||||
docker manifest push itzcrazykns1337/${IMAGE_NAME}:main
|
docker manifest push itzcrazykns1337/${IMAGE_NAME}:main
|
||||||
|
|
||||||
|
- name: Create and push multi-arch manifest for canary
|
||||||
|
if: github.ref == 'refs/heads/canary' && github.event_name == 'push'
|
||||||
|
run: |
|
||||||
|
IMAGE_NAME=perplexica
|
||||||
|
docker manifest create itzcrazykns1337/${IMAGE_NAME}:canary \
|
||||||
|
--amend itzcrazykns1337/${IMAGE_NAME}:canary-amd64 \
|
||||||
|
--amend itzcrazykns1337/${IMAGE_NAME}:canary-arm64
|
||||||
|
docker manifest push itzcrazykns1337/${IMAGE_NAME}:canary
|
||||||
|
|
||||||
- name: Create and push multi-arch manifest for releases
|
- name: Create and push multi-arch manifest for releases
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "perplexica-frontend",
|
"name": "perplexica-frontend",
|
||||||
"version": "1.11.0-rc2",
|
"version": "1.11.0-rc3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "ItzCrazyKns",
|
"author": "ItzCrazyKns",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@@ -2,9 +2,12 @@ import Database from 'better-sqlite3';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
const db = new Database(path.join(process.cwd(), 'data', 'db.sqlite'));
|
const DATA_DIR = process.env.DATA_DIR || process.cwd();
|
||||||
|
const dbPath = path.join(DATA_DIR, './data/db.sqlite');
|
||||||
|
|
||||||
const migrationsFolder = path.join(process.cwd(), 'drizzle');
|
const db = new Database(dbPath);
|
||||||
|
|
||||||
|
const migrationsFolder = path.join(DATA_DIR, 'drizzle');
|
||||||
|
|
||||||
db.exec(`
|
db.exec(`
|
||||||
CREATE TABLE IF NOT EXISTS ran_migrations (
|
CREATE TABLE IF NOT EXISTS ran_migrations (
|
||||||
@@ -54,7 +57,7 @@ fs.readdirSync(migrationsFolder)
|
|||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
type TEXT NOT NULL,
|
type TEXT NOT NULL,
|
||||||
chatId TEXT NOT NULL,
|
chatId TEXT NOT NULL,
|
||||||
createdAt TEXT NOT NULL,
|
createdAt TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
messageId TEXT NOT NULL,
|
messageId TEXT NOT NULL,
|
||||||
content TEXT,
|
content TEXT,
|
||||||
sources TEXT DEFAULT '[]'
|
sources TEXT DEFAULT '[]'
|
||||||
@@ -67,8 +70,10 @@ fs.readdirSync(migrationsFolder)
|
|||||||
`);
|
`);
|
||||||
|
|
||||||
messages.forEach((msg: any) => {
|
messages.forEach((msg: any) => {
|
||||||
if (msg.type === 'user') {
|
while (typeof msg.metadata === 'string') {
|
||||||
msg.metadata = JSON.parse(msg.metadata || '{}');
|
msg.metadata = JSON.parse(msg.metadata || '{}');
|
||||||
|
}
|
||||||
|
if (msg.type === 'user') {
|
||||||
insertMessage.run(
|
insertMessage.run(
|
||||||
'user',
|
'user',
|
||||||
msg.chatId,
|
msg.chatId,
|
||||||
@@ -78,7 +83,6 @@ fs.readdirSync(migrationsFolder)
|
|||||||
'[]',
|
'[]',
|
||||||
);
|
);
|
||||||
} else if (msg.type === 'assistant') {
|
} else if (msg.type === 'assistant') {
|
||||||
msg.metadata = JSON.parse(msg.metadata || '{}');
|
|
||||||
insertMessage.run(
|
insertMessage.run(
|
||||||
'assistant',
|
'assistant',
|
||||||
msg.chatId,
|
msg.chatId,
|
||||||
|
@@ -2,17 +2,17 @@ import type { Config } from 'tailwindcss';
|
|||||||
import type { DefaultColors } from 'tailwindcss/types/generated/colors';
|
import type { DefaultColors } from 'tailwindcss/types/generated/colors';
|
||||||
|
|
||||||
const themeDark = (colors: DefaultColors) => ({
|
const themeDark = (colors: DefaultColors) => ({
|
||||||
50: '#111116',
|
50: '#0d1117',
|
||||||
100: '#1f202b',
|
100: '#161b22',
|
||||||
200: '#2d2f3f',
|
200: '#21262d',
|
||||||
300: '#3a3c4c',
|
300: '#30363d',
|
||||||
});
|
});
|
||||||
|
|
||||||
const themeLight = (colors: DefaultColors) => ({
|
const themeLight = (colors: DefaultColors) => ({
|
||||||
50: '#ffffff',
|
50: '#ffffff',
|
||||||
100: '#f1f5f9',
|
100: '#f6f8fa',
|
||||||
200: '#c4c7c5',
|
200: '#d0d7de',
|
||||||
300: '#9ca3af',
|
300: '#afb8c1',
|
||||||
});
|
});
|
||||||
|
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
|
Reference in New Issue
Block a user