Delete funding.yml as the Lawsnotes thingy & Update README & Wipedev
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled

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:
yuanhau 2025-07-02 22:46:39 +08:00
parent fe9cb6e588
commit 0c904fd5bd
15 changed files with 276 additions and 248 deletions

BIN
.github/README/error1.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

1
.github/funding.yml vendored
View file

@ -1 +0,0 @@
ko_fi: howard00

1
.gitignore vendored
View file

@ -37,3 +37,4 @@ _dt_*.py
# Testing files
test.vue
100106_lt_test.html
dump.txt

View file

@ -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.
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
![](/.github/README/error1.png)
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?
We'll use this news article from May 7th 2025 as an example:

438
bun.lock

File diff suppressed because it is too large Load diff

View file

@ -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
```
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
# Chahnge your_dir to your dir in your server!
mkdir ./your_dir

View 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

View file

@ -2,32 +2,28 @@ services:
reverse-proxy:
image: traefik:v3.1
command:
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- --providers.docker
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
ports:
- 127.0.0.1:36694:80
- 127.0.0.1:36695:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- web
newsanalyze-service:
- n3abetaweb
service:
image: ghcr.io/hpware/news-analyze:beta
networks:
- web
- n3abetaweb
labels:
- "traefik.enable=true"
- "traefik.http.routers.newsanalyze.rule=Host(`news.yuanhau.com`)"
- "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
- "com.centurylinklabs.watchtower.enable=true"
- traefik.enable=true
- traefik.http.routers.newsanalyzebeat.rule=Host(`YOUR_HOSTNAME_HERE`) # YOUR HOSTNAME HERE
- traefik.http.services.newsanalyzebeta.loadbalancer.server.port=3000
- com.centurylinklabs.watchtower.enable=true
restart: unless-stopped
# Use only one node to ease development, as this is not for prod use.
env_file:
- path: ./.env
required: true
deploy:
mode: replicated
replicas: 2
networks:
web:
n3abetaweb: null

14
docker-compose-no-traefik.yml Executable file
View 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:

View file

@ -18,7 +18,7 @@ services:
- web
labels:
- "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"
- "com.centurylinklabs.watchtower.enable=true"
restart: unless-stopped

View file

@ -14,7 +14,7 @@
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"wipedev": "./clean-dev-env.sh",
"wipedev": "./wipedev.sh",
"generateVersionTag": "bun run versionTagGenerate.ts"
},
"dependencies": {

View file

@ -500,7 +500,7 @@ const toggleMinWindow = (windowUUId: string) => {
component: activeWindow.component,
name: activeWindow.name,
title: activeWindow.title,
width: activeWindow.width,
width: activeWindow.width, // HUH THIS IS CAUSING THE ERROR????
height: activeWindow.height,
black: activeWindow.black || false,
translatable: activeWindow.translatable || false,

View file

@ -2,10 +2,6 @@ import { Groq } from "groq-sdk";
import sql from "~/server/components/postgres";
import { checkIfUserHasCustomGroqKey } from "~/server/components/customgroqsystem";
const groq = new Groq({
apiKey: process.env.GROQ_API_KEY,
});
export default defineEventHandler(async (event) => {
const host = getRequestHost(event);
const protocol = getRequestProtocol(event);
@ -14,13 +10,12 @@ export default defineEventHandler(async (event) => {
console.log("Token: ", userToken);
const doesTheUserHasACustomGroqApiAndWhatIsIt =
await checkIfUserHasCustomGroqKey(userToken);
let groqClient = groq;
let groqClient;
if (doesTheUserHasACustomGroqApiAndWhatIsIt.status === true) {
groqClient = new Groq({
apiKey: doesTheUserHasACustomGroqApiAndWhatIsIt.customApi,
});
} else {
console.log(process.env.GROQ_API_KEY); // DEBUGGING ONLY!!! THIS ONLY CONTAINS THE .ENV KEYS NOT THE USER ONES
groqClient = new Groq({
apiKey: process.env.GROQ_API_KEY,
});

6
wipedev.bat Normal file
View 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