Today, I had an unexpected downtime of roughly 2 hours 2023.11.28 3-4 UTC. I had a Russian visiter Sunday (?) the 25th who commented essentially an ad about their website SEO skills onto the comment board. This is unfortunately the internet, and even more so a comment board where anyone can say and do anything (within the rules).
Normally I would have no real issues with what they have done, as it is not commit a crime, nor is it necessarilly disruptive. But they did happen to comment three times, each time the same thing without any kind of variation. This was cause for concern…. (im joking). But as a webadmin, I can do whatever the hell I want and censor whatever kind of things I want to censor, so why not exercise my webadmin rights and change the visibility of the excess comments and then leave a curdious note to the user about why I had to mark their notes as hidden? Naturally, you have to hide the comment on production right?
Heres where everything starts going down hill
I decided to begin by running the command sqlite3 comments.db
. That is where i messed up first. I should have made a backup of the database. Its prone to human error (me, its prone to me, absolutely fucking it up, im the problem).
I then, was sitting in the console and it has been so long since ive worked on this project, I have no idea what the hell kind of comannds I need to run to view the database scheema, I know I could look at the source code, but curiosity got me and what if i didnt have access to the source code? well you can run
|
|
and it spits out the schema used to create the database. Cool, ive got my column variable types, and ive got the id from the comment board. So i need to just set the visibility to 0.
Boom, I do that with the following command, UPDATE comments SET visible = 0 WHERE id = "<id_goes_here>";
it works. I do it for the other post i want to get rid of. And I update the poorly named slqite-commands.md
file with the command i used. Boom bam bow, whenever this happens again, i’m a prepared web admin.
I type my relatively polite message up:
Hello MikhailRS, thank you for visting the site. This is by far the internet, you are welcome to do whatever you want to my site. I can simply destroy this website and start it up again. But please, in the future, do not repeat your post as it is breaking the rules (no spam) as listed in the above headers.
Although I appreciate your feed back as you have made a few things apparent to me, One the rules should be numbered in an ordered list so i can refer to them as numbers and not by “the rules”. Two, when I hide a comment, it still rederns in the html as a comment_ div. I will need to fix that sometime soon, its looking like a bug that will get resolved in probably 5 weeks as finals is coming up.
Thank you my friend :)
Google Translate, do your thang:
Здравствуйте, МихаилРС, спасибо, что посетили сайт. Это, безусловно, Интернет, вы можете делать на моем сайте все, что захотите. Я могу просто уничтожить этот сайт и запустить его заново. Но, пожалуйста, в будущем не повторяйте свой пост, поскольку он нарушает правила (без спама), перечисленные в заголовках выше.
Хотя я ценю вашу обратную связь, поскольку вы объяснили мне некоторые вещи, во-первых, правила должны быть пронумерованы в упорядоченном списке, чтобы я мог называть их числами, а не «правилами». Во-вторых, когда я скрываю комментарий, он все равно отображается в HTML как div comment_. Мне нужно будет это исправить в ближайшее время, это похоже на ошибку, которая будет исправлена, вероятно, через 5 недель, когда приближается финал.
Спасибо, мой друг :)
And post it to the comment board.
I then try to push the changes to the git repository and run into an authentication error. Why is that? maybe its because I don’t have my ssh keys on the server. Why is that? because its publicly accessible and prone to Russian dudes poking my server. And why don’t i want my ssh keys on the server? because they are used to authenticate to my GitHub. I at some point used my brain in this convoluted process.
No biggie, let me just git pull origin and uncommit all of these stupid changes. LOL. it overwrote the database. All comments lost, Im not back at the tracked testing version of comments.db
. About 6 months worth of commenting gold lost in the wind. Only to be held in my memory. This can never happen again.
So I go on a bug fixing protocol making rampage, I resolve the bug causing empty divs to show when i hide a comment and fix a number of spelling errors along the way. I also create a backup solution to never do this again. And with that, I hopefully never make changes on prod again.
To over view heres a list of ways that I fucked up:
- Make changes on prod.
- Commit changes on prod.
- Roll back changes on prod.
- Don’t back changes up on prod.
- Keep your database in the same folder as your source (shhh we didn’t talk about this).
Other than that, the kind stranger MikhailRS taught me a few things though. List your rules as numbers so you can refer to them as Rule #4 instead of Rulez. You also pointed out a bug in the templating that I had. Finally, you also reminded me that I need to create a admin panel of sorts to hide comments lol.
Overall, there is my report on what the went wrong, November 28th, 2023.