mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 15:51:01 +08:00
Add documentation about why is the service down for like an hour
stright.
This commit is contained in:
parent
4b315cd720
commit
76f2d79904
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.0 MiB |
@ -12,9 +12,6 @@ Reverse engineering documentation: [about](/about/)
|
|||||||
|
|
||||||
Deploy: [via docker compose](/deploy.md)
|
Deploy: [via docker compose](/deploy.md)
|
||||||
|
|
||||||
## Updates again:
|
|
||||||
My main production server, news.yuanhau.com, is currently NOT serving any requests, as the server failed to deploy new versions of my app, and I tried to debug the server's DNS, as it turns out, my ISP 中華電信 actively changes my DNS to 192.168.1.1 which cannot get the IP from ghcr.io, and me trying to update the config & restarting the server killed it. :(
|
|
||||||
|
|
||||||
## Demo:
|
## Demo:
|
||||||
You can try out the app RIGHT NOW via this link: https://yhw.tw/news?goto=desktop
|
You can try out the app RIGHT NOW via this link: https://yhw.tw/news?goto=desktop
|
||||||
|
|
||||||
@ -27,8 +24,8 @@ This code is absolutly NOT designed to be spinned up at Vercel or Netlify, it ha
|
|||||||
## Note for developing.
|
## 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.
|
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!
|
## news.yuanhau.com is now back up and running (again)!
|
||||||
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.-->
|
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?
|
## Why?
|
||||||
|
|
||||||
|
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…
x
Reference in New Issue
Block a user