mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 21:34:24 +00:00
Compare commits
3 commits
04ad8ca58e
...
8c69fd2c35
Author | SHA1 | Date | |
---|---|---|---|
8c69fd2c35 | |||
76f2d79904 | |||
4b315cd720 |
5 changed files with 83 additions and 3 deletions
BIN
.github/OTHER/ig_story_58m.png
vendored
Normal file
BIN
.github/OTHER/ig_story_58m.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 MiB |
|
@ -24,8 +24,8 @@ This code is absolutly NOT designed to be spinned up at Vercel or Netlify, it ha
|
|||
## Note for developing.
|
||||
The desktop enviroment is super unstable when even using a beefy computer, even so, the desktop will lag when opening the newsView, like it's just hates being in a dev env. Prod app works tho, so you can demo it using `bun run build && bun run preview` for demoing. Please don't file a issue request for this matter. If you have the fix, please contribute using Github PRs.
|
||||
|
||||
## news.yuanhau.com is now back up and running!
|
||||
Why? Tailscale is changing the dns server to 100.100.100.100 and it just won't find the thing ghcr.io dns correctly (although `ping ghcr.io` works?), so I just nuked it off my server :), since I don't even use it that much. It works now. (Also deploying to zeabur hurt my wallet (it's like 0.07 for a day for the memory), as my system that I built based on ram is too costly there). oof, so please just self host it.
|
||||
## news.yuanhau.com is now back up and running (again)!
|
||||
I fixed most issues of the server, including the nameserver stuff, if you want to know how I fixed it, you can view how I fixed it [here](/server_fixes.md) or on [My broken blog](https://4-1-2.yuanhau.com/posts/)
|
||||
|
||||
## Why?
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
// forgot to import t 💀
|
||||
const { t } = useI18n();
|
||||
|
||||
// Vars for translating stuff
|
||||
interface translateInterfaceText {
|
||||
translateText: string;
|
||||
|
@ -366,7 +369,11 @@ const translateFunction = () => {
|
|||
class="text-2xl text-bold"
|
||||
:class="getCheckResult(item.title) ? 'text-red-600' : ''"
|
||||
>
|
||||
{{ item.title }}
|
||||
{{
|
||||
displayTranslateContent
|
||||
? translateItem[item.title].translateText
|
||||
: item.title
|
||||
}}
|
||||
</h1>
|
||||
<p class="m-0 text-gray-600">
|
||||
<TooltipProvider>
|
||||
|
|
|
@ -130,5 +130,14 @@
|
|||
"contactEmailStarter": "Contact Email:"
|
||||
},
|
||||
"copyrightInfo": "Copyright Info"
|
||||
},
|
||||
"news": {
|
||||
"open": "View Article",
|
||||
"opennewwindow": "This will open a new window",
|
||||
"similararticles": "Similar Articles",
|
||||
"similarity": "Similarity",
|
||||
"nosimilararticles": "There isn't any similar articles.",
|
||||
"articleopenpart1": "This will open a open a new window about this new org",
|
||||
"articleopenpart2": ""
|
||||
}
|
||||
}
|
||||
|
|
64
server_fixes.md
Normal file
64
server_fixes.md
Normal file
|
@ -0,0 +1,64 @@
|
|||
# Server Fixed
|
||||
(This file is NOT related to neighbourhood, but it is some stuff I learned during the down time of the server)
|
||||
|
||||
## Timeline
|
||||
Aprox. 10 PM UTC+8 - I found out that the server is running an outdated version of the app and tried using `docker compose pull`, but saw 192.168.1.1:53 is not a Server, and tried to fix it, and broke off the connection to the internet.
|
||||
|
||||
11:40-ish PM UTC+8 Server is back online.
|
||||
|
||||
## So what is the issue?
|
||||
Well, My issue is one of my config files included a "on", which is why the PPPoE conenction does not work anymore.
|
||||
|
||||
Image:
|
||||

|
||||
|
||||
And also I wrote a super stupid cron fix, which is below.
|
||||
|
||||
## My stupid cron fix:
|
||||
Cron Job:
|
||||
```
|
||||
0 1 * * * "cd / && bun run hardpushrevolvconf.ts" > /dev/null
|
||||
```
|
||||
|
||||
Here is the script I used to force the change of my resolv.conf file:
|
||||
```typescript
|
||||
import { file, $ } from "bun";
|
||||
|
||||
function sendDataToSlack(text: string) {
|
||||
fetch("{slack_web_hook_to_one_of_my_channels_in_hackclub}", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application-json"
|
||||
},
|
||||
body: JSON.stringify({ text: text })
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
const resolvConfPath = "/etc/resolv.conf";
|
||||
const resolvConf = file(resolvConfPath);
|
||||
const resolvConfText = await resolvConf.text();
|
||||
|
||||
if (resolvConfText.includes("192.168.1.1")) {
|
||||
// Auto git config
|
||||
await $`git add .`
|
||||
await $`git commit -a -m "Auto Commit by the server ${Date().now}, before doing stuff into resolvConf"`
|
||||
try {
|
||||
await resolvConf.write("nameserver 8.8.8.8\n");
|
||||
sendDataToSlack(`${resolvConfPath} updated successfully.`);
|
||||
} catch (error) {
|
||||
sendDataToSlack(`Failed to write to ${resolvConfPath}:`, error);
|
||||
sendDataToSlack(
|
||||
"This likely happened because you didn't run the script with root privileges (e.g., 'sudo bun run script.ts')."
|
||||
);
|
||||
}
|
||||
await $`git add .`
|
||||
await $`git commit -a -m "Auto Commit by the server ${Date().now}, after doing stuff into resolvConf"`
|
||||
await $`git push`
|
||||
} else {
|
||||
sendDataToSlack(
|
||||
"Did not find '192.168.1.1'. No changes have been made."
|
||||
);
|
||||
}
|
||||
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue