mirror of
https://github.com/hpware/news-analyze.git
synced 2025-07-17 03:29:29 +08:00
Delete funding.yml as the Lawsnotes thingy & Update README & Wipedev
scripts to give windows ppl a script to use & add MORE docker-compose files :D also updated deploy.md & gitignore, but the groq api thing is still broken tho.
This commit is contained in:
parent
fe9cb6e588
commit
0c904fd5bd
BIN
.github/README/error1.png
vendored
Normal file
BIN
.github/README/error1.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
1
.github/funding.yml
vendored
1
.github/funding.yml
vendored
@ -1 +0,0 @@
|
|||||||
ko_fi: howard00
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -37,3 +37,4 @@ _dt_*.py
|
|||||||
# Testing files
|
# Testing files
|
||||||
test.vue
|
test.vue
|
||||||
100106_lt_test.html
|
100106_lt_test.html
|
||||||
|
dump.txt
|
||||||
|
@ -62,6 +62,11 @@ Here is the GitHub Issue: https://github.com/hpware/news-analyze/issues/2
|
|||||||
### Groq API not loading to .env for some reasons.
|
### Groq API not loading to .env for some reasons.
|
||||||
If the user did not load a GROQ api, the summerizing system will just fail outright. Fixing this rn.
|
If the user did not load a GROQ api, the summerizing system will just fail outright. Fixing this rn.
|
||||||
|
|
||||||
|
### When using the desktop in the dev env it pops up an error
|
||||||
|

|
||||||
|
|
||||||
|
For some reasons, Nuxt's dev env prev does not display this error, but with the newer ones, it started displaying this error, please run `./wipedev.sh` or `./wipedev.bat` and restart the dev server. (And this is only a temp fix, I have no idea how can I fix this, if you have a fix, please submit a PR thx.)
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
We'll use this news article from May 7th 2025 as an example:
|
We'll use this news article from May 7th 2025 as an example:
|
||||||
|
@ -21,6 +21,8 @@ sudo apt-get update
|
|||||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
```
|
```
|
||||||
4. Download the docker-compose.yml and .env.example file to an dir & change the .env.example file to .env:
|
4. Download the docker-compose.yml and .env.example file to an dir & change the .env.example file to .env:
|
||||||
|
|
||||||
|
psst: You can change the docker-compose file to different systems, these are available: `docker-compose.yml`, `docker-compose-no-traefik.yml`, `docker-compose-beta.yml`, `docker-compose-beta-no-traefik.yml`
|
||||||
```bash
|
```bash
|
||||||
# Chahnge your_dir to your dir in your server!
|
# Chahnge your_dir to your dir in your server!
|
||||||
mkdir ./your_dir
|
mkdir ./your_dir
|
||||||
|
14
docker-compose-beta-no-traefik.yml
Executable file
14
docker-compose-beta-no-traefik.yml
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
service:
|
||||||
|
image: ghcr.io/hpware/news-analyze:beta
|
||||||
|
ports:
|
||||||
|
- 36695:3000 # CHANGE YOUR PORT HERE
|
||||||
|
restart: unless-stopped
|
||||||
|
# Use only one node to ease development, as this is not for prod use.
|
||||||
|
env_file:
|
||||||
|
- path: ./.env
|
||||||
|
required: true
|
||||||
|
networks:
|
||||||
|
- n3abetaweb
|
||||||
|
networks:
|
||||||
|
n3abetaweb: null
|
@ -2,32 +2,28 @@ services:
|
|||||||
reverse-proxy:
|
reverse-proxy:
|
||||||
image: traefik:v3.1
|
image: traefik:v3.1
|
||||||
command:
|
command:
|
||||||
- "--providers.docker"
|
- --providers.docker
|
||||||
- "--providers.docker.exposedbydefault=false"
|
- --providers.docker.exposedbydefault=false
|
||||||
- "--entrypoints.web.address=:80"
|
- --entrypoints.web.address=:80
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:36694:80
|
- 127.0.0.1:36695:80
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
networks:
|
networks:
|
||||||
- web
|
- n3abetaweb
|
||||||
|
service:
|
||||||
newsanalyze-service:
|
|
||||||
image: ghcr.io/hpware/news-analyze:beta
|
image: ghcr.io/hpware/news-analyze:beta
|
||||||
networks:
|
networks:
|
||||||
- web
|
- n3abetaweb
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- traefik.enable=true
|
||||||
- "traefik.http.routers.newsanalyze.rule=Host(`news.yuanhau.com`)"
|
- traefik.http.routers.newsanalyzebeat.rule=Host(`YOUR_HOSTNAME_HERE`) # YOUR HOSTNAME HERE
|
||||||
- "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
|
- traefik.http.services.newsanalyzebeta.loadbalancer.server.port=3000
|
||||||
- "com.centurylinklabs.watchtower.enable=true"
|
- com.centurylinklabs.watchtower.enable=true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
# Use only one node to ease development, as this is not for prod use.
|
||||||
env_file:
|
env_file:
|
||||||
- path: ./.env
|
- path: ./.env
|
||||||
required: true
|
required: true
|
||||||
deploy:
|
|
||||||
mode: replicated
|
|
||||||
replicas: 2
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
web:
|
n3abetaweb: null
|
||||||
|
14
docker-compose-no-traefik.yml
Executable file
14
docker-compose-no-traefik.yml
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
newsanalyze-service:
|
||||||
|
image: ghcr.io/hpware/news-analyze:latest
|
||||||
|
ports:
|
||||||
|
- 36694:80 # CHANGE YOUR PORT HERE
|
||||||
|
networks:
|
||||||
|
- web
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- path: ./.env
|
||||||
|
required: true
|
||||||
|
|
||||||
|
networks:
|
||||||
|
web:
|
@ -18,7 +18,7 @@ services:
|
|||||||
- web
|
- web
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.newsanalyze.rule=Host(`news.yuanhau.com`)"
|
- "traefik.http.routers.newsanalyze.rule=Host(`YOUR_HOSTNAME_HERE`)" # CHANGE TO YOUR HOSTNAME
|
||||||
- "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
|
- "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
|
||||||
- "com.centurylinklabs.watchtower.enable=true"
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"docs:dev": "vitepress dev docs",
|
"docs:dev": "vitepress dev docs",
|
||||||
"docs:build": "vitepress build docs",
|
"docs:build": "vitepress build docs",
|
||||||
"docs:preview": "vitepress preview docs",
|
"docs:preview": "vitepress preview docs",
|
||||||
"wipedev": "./clean-dev-env.sh",
|
"wipedev": "./wipedev.sh",
|
||||||
"generateVersionTag": "bun run versionTagGenerate.ts"
|
"generateVersionTag": "bun run versionTagGenerate.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -500,7 +500,7 @@ const toggleMinWindow = (windowUUId: string) => {
|
|||||||
component: activeWindow.component,
|
component: activeWindow.component,
|
||||||
name: activeWindow.name,
|
name: activeWindow.name,
|
||||||
title: activeWindow.title,
|
title: activeWindow.title,
|
||||||
width: activeWindow.width,
|
width: activeWindow.width, // HUH THIS IS CAUSING THE ERROR????
|
||||||
height: activeWindow.height,
|
height: activeWindow.height,
|
||||||
black: activeWindow.black || false,
|
black: activeWindow.black || false,
|
||||||
translatable: activeWindow.translatable || false,
|
translatable: activeWindow.translatable || false,
|
||||||
|
@ -2,10 +2,6 @@ import { Groq } from "groq-sdk";
|
|||||||
import sql from "~/server/components/postgres";
|
import sql from "~/server/components/postgres";
|
||||||
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
|
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
|
||||||
|
|
||||||
const groq = new Groq({
|
|
||||||
apiKey: process.env.GROQ_API_KEY,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const host = getRequestHost(event);
|
const host = getRequestHost(event);
|
||||||
const protocol = getRequestProtocol(event);
|
const protocol = getRequestProtocol(event);
|
||||||
@ -14,13 +10,12 @@ export default defineEventHandler(async (event) => {
|
|||||||
console.log("Token: ", userToken);
|
console.log("Token: ", userToken);
|
||||||
const doesTheUserHasACustomGroqApiAndWhatIsIt =
|
const doesTheUserHasACustomGroqApiAndWhatIsIt =
|
||||||
await checkIfUserHasCustomGroqKey(userToken);
|
await checkIfUserHasCustomGroqKey(userToken);
|
||||||
let groqClient = groq;
|
let groqClient;
|
||||||
if (doesTheUserHasACustomGroqApiAndWhatIsIt.status === true) {
|
if (doesTheUserHasACustomGroqApiAndWhatIsIt.status === true) {
|
||||||
groqClient = new Groq({
|
groqClient = new Groq({
|
||||||
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
|
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(process.env.GROQ_API_KEY); // DEBUGGING ONLY!!! THIS ONLY CONTAINS THE .ENV KEYS NOT THE USER ONES
|
|
||||||
groqClient = new Groq({
|
groqClient = new Groq({
|
||||||
apiKey: process.env.GROQ_API_KEY,
|
apiKey: process.env.GROQ_API_KEY,
|
||||||
});
|
});
|
||||||
|
6
wipedev.bat
Normal file
6
wipedev.bat
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@REM THis file is AI generated
|
||||||
|
rmdir /s /q node_modules
|
||||||
|
del /f /q bun.lock
|
||||||
|
rmdir /s /q .nuxt
|
||||||
|
rmdir /s /q .output
|
||||||
|
bun install
|
Loading…
x
Reference in New Issue
Block a user