diff --git a/.gitignore b/.gitignore index 66a7658..24fd4f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # Mico logs: log.txt -# Mby someday the WS-access logs -# Mby storage +node_modules/ +config/* +!config/config.example.yaml +storage/* +html/data/* diff --git a/config/admin.yaml b/config/admin.yaml index 3687410..2af9aa4 100644 --- a/config/admin.yaml +++ b/config/admin.yaml @@ -1 +1 @@ -passhash: zbTuKuppzGqDMxu+ltwsqpopnSEynvsDNvwCqC4YOag= +passhash: MFPgsnQ5GlRQI2Nr6h2uZDVsrLnpjrVQN8x1X1tW9dk= diff --git a/config/config.yaml b/config/config.yaml index 2d366a3..e9a511c 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -8,27 +8,30 @@ # especially not non strings into boolean entrys # (strings are the things with "quotes" and booleans are true / false) -logging: 1337 # adjust logging levels +logging: 0 # 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 +logfile: "log.txt" # logfile -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 +listening_port: 5501 +listening_addr: "127.0.0.1" + +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 cl: true # enable / disable interactive-ish shell # GET with "settoken" // (random by client) saves ip with that token # content config: -site_name: "a-blog" +site_name: "derzombiiie.com" search_enable: true # enable / disable search 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) +post_ranking_auto: 215100 # 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 (planned are: manual, rit (like reddits "hot")) diff --git a/config/config.yaml.example b/config/config.yaml.example new file mode 100644 index 0000000..fd8e63b --- /dev/null +++ b/config/config.yaml.example @@ -0,0 +1,41 @@ +# GENERAL ABOUT THIS CONFIG FILE: +# there are no "fallback" values, +# anything in here is required to be set to something +# a backup copy of the default file is recommended + +# the way some values in this file are treeted may be unsafe +# DONT copy suspicious looking config entrys from the interwebz +# especially not non strings into boolean entrys +# (strings are the things with "quotes" and booleans are true / false) + +# listening +listening_port: 5501 # port server listening on +listening_addr: 127.0.0.1 # ip server is listening on + +logging: 0 # 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: "log.txt" # logfile + +ipget_endpoint_set: "//example.com/set/${TOKEN}" # endpoint for setting token to ip ${TOKEN} beeing replaced with random char string which is send to server as "ip" +ipget_endpoint_get: "//example.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: "a-blog" + +search_enable: true # enable / disable search + +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 (planned are: manual, rit (like reddits "hot")) + +# file access config: +comment_sync_on_write: false # sync comments everytime a comment gets edited / created / deleted +comment_auto_sync: 360 # interval in seconds, comments are synced to disk | -1 for not at all diff --git a/html/impressum.html b/html/impressum.html index 7c85599..87b3c83 100644 --- a/html/impressum.html +++ b/html/impressum.html @@ -5,7 +5,7 @@ - derzombiiie.com - home + impressum @@ -27,12 +27,9 @@
Impressum

- No address here
- But im from germany im gonna tell you that much
- This is a PRIVATE website (atm)
-
contact:
Edzel at derz(at)elidragon(full-stop)com +
diff --git a/html/js/admin.js b/html/js/admin.js index 0bf61c2..f8dc7ad 100644 --- a/html/js/admin.js +++ b/html/js/admin.js @@ -69,7 +69,7 @@ function save() { } // dl it locally ( as .json ) - $(".dl").attr("href", "data:application/json;base64," + btoa( JSON.stringify(postjson) )) + $(".dl").attr("href", "data:text/plain;charset=utf-8," + encodeURIComponent( JSON.stringify(postjson) )) document.getElementsByClassName("dl")[0].click() } diff --git a/html/pp.html b/html/pp.html index 3a6a9ba..e09aca8 100644 --- a/html/pp.html +++ b/html/pp.html @@ -29,22 +29,23 @@
Here is a privacy policy placeholder
Basically:
- This site is not using any cookies by default possible cookies get added when
+ This site is not using any cookies by default, cookies get added when

Im NOT tracking your IP address outside the commenting field and voting
In commeting its used to get you county and ip as "author"
For voting its used to not make you able to vote multible times with the same ip
- its only transmitted/saved when commenting / voting not before
-
+ its only transmitted/processed when commenting / voting not before
+ only in commenting its persistent in voting its not saved to disk +
diff --git a/node/app.js b/node/app.js index 2a6de8a..9df1049 100644 --- a/node/app.js +++ b/node/app.js @@ -348,8 +348,10 @@ app.get("/search", (req, res) => { if ( req.query.api != undefined ) { res.type("application/json") res.end( JSON.stringify( {"type":"err","text":"NO SEARCH PARAMS"} ) ) + return } else { res.end("No search params") + return } } @@ -393,7 +395,7 @@ app.use("/admin/", (req, res, next) => admin.pre(req, res, next)) app.get("/admin", (req, res) => filestuff.readFS(req, res, "html/admin/index.html", "text/html")) app.post("/admin/post", (req, res) => admin.post(req, res)) -app.listen(port, () => { - console.log(`Server listening on http://0.0.0.0:${port}`) +app.listen(conf.listening_port, conf.listening_addr, () => { + console.log(`Server listening on http://${conf.listening_addr}:${conf.listening_port}`) if(conf.cl) con.init() }) diff --git a/node/posts.js b/node/posts.js index f81a196..d5abdb8 100644 --- a/node/posts.js +++ b/node/posts.js @@ -119,7 +119,10 @@ this.push = (post) => { "tags": post.tags, "title":post.title }) + // update len this.db.set("len", len+1) + this.len++ + this.index() return {"type":"s","text":"Success! postid: " + len,"content":len} } diff --git a/storage/comments.json b/storage/comments.json index 2c63c08..af643ed 100644 --- a/storage/comments.json +++ b/storage/comments.json @@ -1,2 +1,12 @@ { -} + "0-len": 1, + "0-0": { + "time": 1629909525274, + "author": "derz", + "authorinfo": { + "origin": "console" + }, + "body": "This is a testing comment just to show how this would look, if youl'd comment. The \"author\" / headline field would be your ip + corosponding location.", + "id": 0 + } +} \ No newline at end of file diff --git a/storage/posts.json b/storage/posts.json index 2c63c08..6bd0d7a 100644 --- a/storage/posts.json +++ b/storage/posts.json @@ -1,2 +1,20 @@ { + "0": { + "author": "derz-ed", + "content": "This site is a blog, it's probably gonna be about some coding / data-mining or other random stuff I'm interested in.\nIf you really like the style of this blog, you can get it on [github](//github.com/Eds-trash-can/a-blog).\nMost stuff is directly inspired by [unknown6656](//unknown6656.com) blog.\n\n### Some general information on how to use this site:\n* you can comment bellow posts in the \"your comment\" textarea\n* you can rate an article by clicking either the green/red on an /posts site not on / or /search\n* you can adjust the theme in the [cookie settings](//blog.derzombiiie.com/static/keks.html) also available the footer\n\nAlso please excuse any bad English as I'm not a native speaker.\n\nThis post was first posted: 18:20 - 25.08.2021", + "create": 1629909096761, + "desc": "very small description of what i think this blog is about.", + "id": 0, + "rating": { + "+": 0, + "-": 0 + }, + "tags": [ + "first-post", + ".info", + "meta" + ], + "title": "what this is about" + }, + "len": 1 }