general clean up

logs + posts + config + comments etc
master
derzombiiie 2021-08-23 23:02:02 +02:00
parent 1e96a62fc9
commit 5749c553c2
11 changed files with 8 additions and 2215 deletions

15
TODO.md
View File

@ -1,15 +0,0 @@
# TODO
- Actual post view site thingy
<DONE> markdown interpreter thing
* voting
* idk comments
- Admin interface
- create posts in MD
- mby with upload (pics + text)
- Put up!
- random blog articles

View File

@ -1 +1 @@
passhash: JAvlGPq9JyTdtvBO6x2llnRI1+gxwIyPqCKAn3THIKk=
passhash: zbTuKuppzGqDMxu+ltwsqpopnSEynvsDNvwCqC4YOag=

View File

@ -8,21 +8,20 @@
# especially not non strings into boolean entrys
# (strings are the things with "quotes" and booleans are true / false)
debug: false # enable / disable debug mode
logging: 1337 # WIP - adjust logging levels
logging: 1337 # adjust logging levels
# -1 - none
# 0 - basic (Logs new comments)
# 10 - datahorder (Logs everything (all requests with ip + timestamp))
# 1337 - haxxer (JUST FOR DEBUGGING (and cool looks)) (takes everything from datahorder and just prints it out)
logfile: "logs/log.log" # logfile
ipget_endpoint_set: "//derzombiiie.com/getip.php?settoken=${TOKEN}" # endpoint for setting token to ip ${TOKEN} beeing replaced with random char string which is send to server as "ip"
ipget_endpoint_get: "//derzombiiie.com/getip.php?token=${TOKEN}" # ${TOKEN} beeing replaced with token from client
ipget_endpoint_set: "//ipget.com?setto=${TOKEN}" # endpoint for setting token to ip ${TOKEN} beeing replaced with random char string which is send to server as "ip"
ipget_endpoint_get: "//ipget.com?get=${TOKEN}" # ${TOKEN} beeing replaced with token from client
cl: true # enable / disable interactive-ish shell
# GET with "settoken" // (random by client) saves ip with that token
# content config:
site_name: "blog.derzombiiie.com"
site_name: "a-blog"
search_enable: true # enable / disable search
@ -31,7 +30,7 @@ commenting_enabled: true # enable / disable ability to comment bellow articles
# post ranking config:
post_ranking_auto: 43200 # time in seconds, posts are autoranked | -1 for not at all (default is 12h aka. 43200)
index_post_sort: "new" # sorting used for index page
# new | hot (WIP are: manual, rit (like reddits "hot"))
# new | hot (planned are: manual, rit (like reddits "hot"))
# file access config:
comment_sync_on_write: false # sync comments everytime a comment gets edited / created / deleted

View File

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>derzombiiie.com - home</title>
<link rel="stylesheet" href="/static/style/fonts.css">
<link rel="stylesheet" href="/static/style/main.css">
<link rel="stylesheet" href="editormd/css/editormd.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="/static/js/jq.js"></script>
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
<script src="/config.js"></script>
<script src="/static/js/themes.js"></script>
<script src="/static/js/menubar.js"></script>
<script src="/static/js/entry.js"></script>
<script src="/static/js/share.js"></script>
<script src="/static/js/admin.js"></script>
</head>
<body>
</body>
</html>

File diff suppressed because it is too large Load Diff

BIN
master

Binary file not shown.

View File

@ -379,20 +379,6 @@ app.get("/search", (req, res) => {
app.get("/search", (req, res) => filestuff.readFS(req,res,"html/search/disabled.html","text/html"))
}
// debug stuff:
if( conf.debug )
app.get("/debug/:action", (req, res) => {
switch ( req.params.action ) {
case "ip":
res.end(req.ip)
break
case "ips":
res.end(JSON.stringify( req.ips ))
break
}
})
// admin stuff:
admin.init(comments, posts, log)
con.registercmd( "passwd", (arg) => {

37
sort.js
View File

@ -1,37 +0,0 @@
posts = [
{"id":4,
"rating":{"+":50,"-":30}},
{"id":3,
"rating":{"+":50,"-":990}},
{"id":1,
"rating":{"+":50,"-":10}},
{"id":2,
"rating":{"+":50,"-":20}},
]
let filterMap = {};
posts.forEach((item, index) => {
if (!filterMap[item.id] || filterMap[item.id].rating < ( posts.rating["+"] - posts.rating["-"]) ) {
// calc item rating:
let newitem = item
newitem.rating = item.rating["+"] - item.rating["-"]
filterMap[item.id] = newitem;
}
})
let result = [];
for (let id in filterMap) {
result.push(filterMap[id]);
}
result.sort((a , b) => {
return b.rating - a.rating;
});
let sorted = []
result.forEach((elem, i) => {
sorted.push(elem.id)
})
console.log(sorted)

View File

@ -1,46 +1,2 @@
{
"0-0": {
"time": 1628548565347,
"author": "87.123.198.124",
"body": "fist comment to be send! (using the \"complete\" system that is!)\neven support for\nNEWLINES\n(no MD though)",
"id": 0
},
"0-1": {
"time": 1628633229656,
"author": "DerZombiiie",
"authorinfo": {
"origin": "console"
},
"body": "this, as this is a testing blog post\nalso Newlines **no** markdown though :(\nmaybe later!",
"id": 1
},
"0-2": {
"time": 1628710062750,
"author": "Edzel",
"authorinfo": {
"origin": "console"
},
"body": "Hi, me here!\nthis is from\nconsole",
"id": 2
},
"0-3": {
"time": 1629302893284,
"author": "82.207.236.224",
"authorinfo": {
"country": "DE",
"origin": "web"
},
"body": "This is a test to test\nif the authorinfo works correctly!",
"id": 3
},
"0-len": 5,
"0-4": {
"time": 1629373943454,
"author": "94.134.179.144",
"authorinfo": {
"country": "DE",
"origin": "web"
},
"body": "fgaW "
}
}
}

View File

@ -1,311 +1,2 @@
{
"0": {
"title": "Im trying MD post",
"author": "derzombiiie",
"desc": "HERE PRESS THIS THIS NOT CONTENT THIS DESC!",
"content": "# Article!\nwelcome\n*bold***italic** ***bold+italic***\n- point1\n- point2- \n me not more md from the brain :(",
"href": "#",
"tags": [
"$$$",
"testing"
],
"dummy": {
"1": 2
},
"rating": {
"+": 999,
"-": 1
},
"create": 2,
"id": 0
},
"1": {
"author": "deinz mudda",
"content": "\thier könnte ihre werbung stehen",
"create": 1629562159432,
"desc": "hier nicht",
"id": 1,
"rating": {
"+": 1,
"-": 0
},
"tags": [
"$$$",
"othertag"
],
"title": "testing for tagz"
},
"2": {
"author": "deinz mudda",
"content": "\thier könnte ihre werbung stehen",
"create": 1629562186156,
"desc": "hier nicht",
"id": 2,
"rating": {
"+": 0,
"-": 1
},
"tags": [
"$$$",
"othertag",
"othertag0"
],
"title": "testing for tagz1"
},
"3": {
"author": "Author",
"content": "# Your post (NO HEADLINE HERE)",
"create": 1629720057137,
"desc": "This is a post about *",
"id": 3,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$$",
"othertag1",
"tag1"
],
"title": "me try 2 other creator"
},
"4": {
"author": "Author",
"content": "# Your post (NO HEADLINE HERE)",
"create": 1629720067537,
"desc": "This is a post about *",
"id": 4,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$$",
"othertag1",
"tag1"
],
"title": "me try 2 other creator"
},
"5": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727628418,
"desc": "desc",
"id": 5,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "0das hier ist einz title"
},
"6": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727642467,
"desc": "desc",
"id": 6,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "2das hier ist einz title"
},
"7": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727647823,
"desc": "desc",
"id": 7,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "3das hier ist einz title"
},
"8": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727652358,
"desc": "desc",
"id": 8,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "4das hier ist einz title"
},
"9": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727676048,
"desc": "desc",
"id": 9,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "5das hier ist einz title"
},
"10": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727681549,
"desc": "desc",
"id": 10,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "6das hier ist einz title"
},
"11": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727686171,
"desc": "desc",
"id": 11,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "7das hier ist einz title"
},
"12": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727692876,
"desc": "desc",
"id": 12,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "8das hier ist einz title"
},
"13": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727698662,
"desc": "desc",
"id": 13,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "9das hier ist einz title"
},
"14": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727706950,
"desc": "desc",
"id": 14,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "10das hier ist einz title"
},
"15": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727717296,
"desc": "desc",
"id": 15,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "11das hier ist einz title"
},
"16": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727721726,
"desc": "desc",
"id": 16,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"$$$",
"othertag",
"tag0"
],
"title": "12das hier ist einz title"
},
"len": 17,
"preview": {
"author": "author",
"content": "# Your post (NO HEADLINE HERE)\nyou post ",
"create": 1629727689858,
"desc": "desc",
"id": -1,
"rating": {
"+": 0,
"-": 0
},
"tags": [
"tag0",
"othertag",
"$$$"
],
"title": "8das hier ist einz title"
}
}
}

View File

@ -1,4 +0,0 @@
undefined--- SEPERATOR ---
test1234
test1234
test1234