Added passwd protection to /admin/
+ post creator + preview + posting + save local + load local + fixed commenting from browser + deleted old testing comments + report page --- + admin config (the pass) + "passwd <pass>" in cl to change pass --- TODO: /posts?new /posts?hot /posts?rit /posts?featured fix cl comment command helpmaster
parent
3f933910bc
commit
b7cd6cfee5
|
@ -1,9 +1,19 @@
|
|||
# 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)
|
||||
|
||||
debug: false # enable / disable debug mode
|
||||
logging: 1337 # WIP - adjust logging levels
|
||||
# -1 - none
|
||||
# 0 - basic (Logs new comments)
|
||||
# 10 - datahorder (Logs everything (all requests with ip + timestamp))
|
||||
# 1337 - haxxer (takes everything from datahorder and just prints it out)
|
||||
# 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"
|
||||
|
@ -15,11 +25,14 @@ cl: true # enable / disable interactive-ish shell
|
|||
site_name: "blog.derzombiiie.com"
|
||||
|
||||
search_enable: false # enable / disable search WIP
|
||||
search_only_tags: true # enable / disable search only searching tags WIP
|
||||
|
||||
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)
|
||||
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, featured)
|
||||
# new | hot (WIP are: manual, rit (like reddits "hot"))
|
||||
|
||||
# file access config:
|
||||
comment_sync_on_write: false # sync comments everytime a comment gets edited / created / deleted
|
||||
|
|
421
editor.css
421
editor.css
|
@ -1,421 +0,0 @@
|
|||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src:url('fonts/icomoon.eot');
|
||||
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.woff') format('woff'),
|
||||
url('fonts/icomoon.ttf') format('truetype'),
|
||||
url('fonts/icomoon.svg#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* Use the following CSS code if you want to use data attributes for inserting your icons */
|
||||
[data-icon]:before {
|
||||
font-family: 'icomoon';
|
||||
content: attr(data-icon);
|
||||
speak: none;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* Use the following CSS code if you want to have a class per icon */
|
||||
/*
|
||||
Instead of a list of all class selectors,
|
||||
you can use the generic selector below, but it's slower:
|
||||
[class*="icon-"] {
|
||||
*/
|
||||
.icon-bold, .icon-italic, .icon-quote, .icon-unordered-list, .icon-ordered-list, .icon-link, .icon-image, .icon-play, .icon-music, .icon-contract, .icon-fullscreen, .icon-question, .icon-info, .icon-undo, .icon-redo, .icon-code, .icon-preview {
|
||||
font-family: 'icomoon';
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
.icon-bold:before {
|
||||
content: "\e000";
|
||||
}
|
||||
.icon-italic:before {
|
||||
content: "\e001";
|
||||
}
|
||||
.icon-quote:before {
|
||||
content: "\e003";
|
||||
}
|
||||
.icon-unordered-list:before {
|
||||
content: "\e004";
|
||||
}
|
||||
.icon-ordered-list:before {
|
||||
content: "\e005";
|
||||
}
|
||||
.icon-link:before {
|
||||
content: "\e006";
|
||||
}
|
||||
.icon-image:before {
|
||||
content: "\e007";
|
||||
}
|
||||
.icon-play:before {
|
||||
content: "\e008";
|
||||
}
|
||||
.icon-music:before {
|
||||
content: "\e009";
|
||||
}
|
||||
.icon-contract:before {
|
||||
content: "\e00a";
|
||||
}
|
||||
.icon-fullscreen:before {
|
||||
content: "\e00b";
|
||||
}
|
||||
.icon-question:before {
|
||||
content: "\e00c";
|
||||
}
|
||||
.icon-info:before {
|
||||
content: "\e00d";
|
||||
}
|
||||
.icon-undo:before {
|
||||
content: "\e00e";
|
||||
}
|
||||
.icon-redo:before {
|
||||
content: "\e00f";
|
||||
}
|
||||
.icon-code:before {
|
||||
content: "\e011";
|
||||
}
|
||||
.icon-preview:before {
|
||||
content: "\e002";
|
||||
}
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
height: 300px;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
/* Set scrolling behaviour here */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
z-index: 3;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
z-index: 1;
|
||||
}
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-paper .cm-keyword {color: #555;}
|
||||
.cm-s-paper .cm-atom {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-number {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-def {color: #00f;}
|
||||
.cm-s-paper .cm-variable {color: black;}
|
||||
.cm-s-paper .cm-variable-2 {color: #555;}
|
||||
.cm-s-paper .cm-variable-3 {color: #085;}
|
||||
.cm-s-paper .cm-property {color: black;}
|
||||
.cm-s-paper .cm-operator {color: black;}
|
||||
.cm-s-paper .cm-comment {color: #959595;}
|
||||
.cm-s-paper .cm-string {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-string-2 {color: #f50;}
|
||||
.cm-s-paper .cm-meta {color: #555;}
|
||||
.cm-s-paper .cm-error {color: #f00;}
|
||||
.cm-s-paper .cm-qualifier {color: #555;}
|
||||
.cm-s-paper .cm-builtin {color: #555;}
|
||||
.cm-s-paper .cm-bracket {color: #997;}
|
||||
.cm-s-paper .cm-tag {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-attribute {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-header {color: #000;}
|
||||
.cm-s-paper .cm-quote {color: #888;}
|
||||
.cm-s-paper .cm-hr {color: #999;}
|
||||
.cm-s-paper .cm-link {color: #7f8c8d;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px; padding-right: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%; height: 0px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #BDC3C7; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.CodeMirror {
|
||||
height: 450px;
|
||||
}
|
||||
:-webkit-full-screen {
|
||||
background: #f9f9f5;
|
||||
padding: 0.5em 1em;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
:-moz-full-screen {
|
||||
padding: 0.5em 1em;
|
||||
background: #f9f9f5;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.editor-wrapper {
|
||||
font: 16px/1.62 "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
|
||||
color: #2c3e50;
|
||||
}
|
||||
/* this is the title */
|
||||
.editor-wrapper input.title {
|
||||
font: 18px "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
|
||||
background: transparent;
|
||||
padding: 4px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
outline: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.editor-toolbar {
|
||||
position: relative;
|
||||
opacity: 0.6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.editor-toolbar:before, .editor-toolbar:after {
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
background-color: #bdc3c7;
|
||||
background: -moz-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: -webkit-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: -ms-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
}
|
||||
.editor-toolbar:before {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.editor-toolbar:after {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.editor-wrapper input.title:hover, .editor-wrapper input.title:focus, .editor-toolbar:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.editor-toolbar a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none !important;
|
||||
color: #2c3e50 !important;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.editor-toolbar a:hover, .editor-toolbar a.active {
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
}
|
||||
.editor-toolbar a:before {
|
||||
line-height: 24px;
|
||||
}
|
||||
.editor-toolbar i.separator {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid white;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
}
|
||||
.editor-toolbar a.icon-fullscreen {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
.editor-statusbar {
|
||||
border-top: 1px solid #ece9e9;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
}
|
||||
.editor-statusbar span {
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
.editor-statusbar .lines:before {
|
||||
content: 'lines: ';
|
||||
}
|
||||
.editor-statusbar .words:before {
|
||||
content: 'words: ';
|
||||
}
|
||||
.editor-preview {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
background: #f9f9f5;
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
-webkit-transition: left 0.2s ease;
|
||||
-moz-transition: left 0.2s ease;
|
||||
-ms-transition: left 0.2s ease;
|
||||
transition: left 0.2s ease;
|
||||
}
|
||||
.editor-preview-active {
|
||||
left: 0;
|
||||
}
|
||||
.editor-preview > p {
|
||||
margin-top: 0;
|
||||
}
|
421
editor.css.1
421
editor.css.1
|
@ -1,421 +0,0 @@
|
|||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src:url('fonts/icomoon.eot');
|
||||
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.woff') format('woff'),
|
||||
url('fonts/icomoon.ttf') format('truetype'),
|
||||
url('fonts/icomoon.svg#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* Use the following CSS code if you want to use data attributes for inserting your icons */
|
||||
[data-icon]:before {
|
||||
font-family: 'icomoon';
|
||||
content: attr(data-icon);
|
||||
speak: none;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* Use the following CSS code if you want to have a class per icon */
|
||||
/*
|
||||
Instead of a list of all class selectors,
|
||||
you can use the generic selector below, but it's slower:
|
||||
[class*="icon-"] {
|
||||
*/
|
||||
.icon-bold, .icon-italic, .icon-quote, .icon-unordered-list, .icon-ordered-list, .icon-link, .icon-image, .icon-play, .icon-music, .icon-contract, .icon-fullscreen, .icon-question, .icon-info, .icon-undo, .icon-redo, .icon-code, .icon-preview {
|
||||
font-family: 'icomoon';
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
.icon-bold:before {
|
||||
content: "\e000";
|
||||
}
|
||||
.icon-italic:before {
|
||||
content: "\e001";
|
||||
}
|
||||
.icon-quote:before {
|
||||
content: "\e003";
|
||||
}
|
||||
.icon-unordered-list:before {
|
||||
content: "\e004";
|
||||
}
|
||||
.icon-ordered-list:before {
|
||||
content: "\e005";
|
||||
}
|
||||
.icon-link:before {
|
||||
content: "\e006";
|
||||
}
|
||||
.icon-image:before {
|
||||
content: "\e007";
|
||||
}
|
||||
.icon-play:before {
|
||||
content: "\e008";
|
||||
}
|
||||
.icon-music:before {
|
||||
content: "\e009";
|
||||
}
|
||||
.icon-contract:before {
|
||||
content: "\e00a";
|
||||
}
|
||||
.icon-fullscreen:before {
|
||||
content: "\e00b";
|
||||
}
|
||||
.icon-question:before {
|
||||
content: "\e00c";
|
||||
}
|
||||
.icon-info:before {
|
||||
content: "\e00d";
|
||||
}
|
||||
.icon-undo:before {
|
||||
content: "\e00e";
|
||||
}
|
||||
.icon-redo:before {
|
||||
content: "\e00f";
|
||||
}
|
||||
.icon-code:before {
|
||||
content: "\e011";
|
||||
}
|
||||
.icon-preview:before {
|
||||
content: "\e002";
|
||||
}
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
height: 300px;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
/* Set scrolling behaviour here */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
z-index: 3;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
z-index: 1;
|
||||
}
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-paper .cm-keyword {color: #555;}
|
||||
.cm-s-paper .cm-atom {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-number {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-def {color: #00f;}
|
||||
.cm-s-paper .cm-variable {color: black;}
|
||||
.cm-s-paper .cm-variable-2 {color: #555;}
|
||||
.cm-s-paper .cm-variable-3 {color: #085;}
|
||||
.cm-s-paper .cm-property {color: black;}
|
||||
.cm-s-paper .cm-operator {color: black;}
|
||||
.cm-s-paper .cm-comment {color: #959595;}
|
||||
.cm-s-paper .cm-string {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-string-2 {color: #f50;}
|
||||
.cm-s-paper .cm-meta {color: #555;}
|
||||
.cm-s-paper .cm-error {color: #f00;}
|
||||
.cm-s-paper .cm-qualifier {color: #555;}
|
||||
.cm-s-paper .cm-builtin {color: #555;}
|
||||
.cm-s-paper .cm-bracket {color: #997;}
|
||||
.cm-s-paper .cm-tag {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-attribute {color: #7f8c8d;}
|
||||
.cm-s-paper .cm-header {color: #000;}
|
||||
.cm-s-paper .cm-quote {color: #888;}
|
||||
.cm-s-paper .cm-hr {color: #999;}
|
||||
.cm-s-paper .cm-link {color: #7f8c8d;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px; padding-right: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%; height: 0px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #BDC3C7; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.CodeMirror {
|
||||
height: 450px;
|
||||
}
|
||||
:-webkit-full-screen {
|
||||
background: #f9f9f5;
|
||||
padding: 0.5em 1em;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
:-moz-full-screen {
|
||||
padding: 0.5em 1em;
|
||||
background: #f9f9f5;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.editor-wrapper {
|
||||
font: 16px/1.62 "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
|
||||
color: #2c3e50;
|
||||
}
|
||||
/* this is the title */
|
||||
.editor-wrapper input.title {
|
||||
font: 18px "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
|
||||
background: transparent;
|
||||
padding: 4px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
outline: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.editor-toolbar {
|
||||
position: relative;
|
||||
opacity: 0.6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.editor-toolbar:before, .editor-toolbar:after {
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
background-color: #bdc3c7;
|
||||
background: -moz-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: -webkit-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: -ms-linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
background: linear-gradient(45deg, #f9f9f9, #bdc3c7, #f9f9f9);
|
||||
}
|
||||
.editor-toolbar:before {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.editor-toolbar:after {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.editor-wrapper input.title:hover, .editor-wrapper input.title:focus, .editor-toolbar:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.editor-toolbar a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none !important;
|
||||
color: #2c3e50 !important;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.editor-toolbar a:hover, .editor-toolbar a.active {
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
}
|
||||
.editor-toolbar a:before {
|
||||
line-height: 24px;
|
||||
}
|
||||
.editor-toolbar i.separator {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid white;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
}
|
||||
.editor-toolbar a.icon-fullscreen {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
.editor-statusbar {
|
||||
border-top: 1px solid #ece9e9;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
}
|
||||
.editor-statusbar span {
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
.editor-statusbar .lines:before {
|
||||
content: 'lines: ';
|
||||
}
|
||||
.editor-statusbar .words:before {
|
||||
content: 'words: ';
|
||||
}
|
||||
.editor-preview {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
background: #f9f9f5;
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
-webkit-transition: left 0.2s ease;
|
||||
-moz-transition: left 0.2s ease;
|
||||
-ms-transition: left 0.2s ease;
|
||||
transition: left 0.2s ease;
|
||||
}
|
||||
.editor-preview-active {
|
||||
left: 0;
|
||||
}
|
||||
.editor-preview > p {
|
||||
margin-top: 0;
|
||||
}
|
|
@ -8,8 +8,8 @@
|
|||
<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="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/style/simplemde.min.css">
|
||||
<script src="/static/js/simplemde.min.js"></script>
|
||||
<script src="/static/js/jq.js"></script>
|
||||
<script src="/config.js"></script>
|
||||
<script src="/static/js/themes.js"></script>
|
||||
|
@ -30,15 +30,22 @@
|
|||
<hr class="seperator">
|
||||
<div class="preview">
|
||||
<div class="editor">
|
||||
<input class="editor title" type="text">
|
||||
<input class="editor title" placeholder="title" type="text">
|
||||
<textarea class="editor mde" id="mde"># Your post (NO HEADLINE HERE)</textarea>
|
||||
<input class="editor tags" placeholder="TAGS HERE, comma (and or space) seperated">
|
||||
<textarea class="editor desc">description</textarea>
|
||||
</div>
|
||||
<input class="editor author" placeholder="Author">
|
||||
<button onclick="previewpost()">preview</button>
|
||||
<button onclick="post()">post</button>
|
||||
<button onclick="save()">save localy</button>
|
||||
<input class="editor load" type="file" onchange="load()">
|
||||
<a class="dl" download="export.post.json"></a>
|
||||
<a class="link" target="_blank" on></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<!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>
|
|
@ -1,4 +1,4 @@
|
|||
$(document).ready(()=>{
|
||||
$(document).ready(() => {
|
||||
mde = new SimpleMDE({
|
||||
element: document.getElementById("mde")
|
||||
})
|
||||
|
@ -14,10 +14,13 @@ function previewpost() {
|
|||
"title": $(".editor.title").val(),
|
||||
"body": mde.value(),
|
||||
"tags": tags,
|
||||
"time": "auto"
|
||||
}).then(r => r.json()).then(res=>{
|
||||
"time": "auto",
|
||||
"author": $(".editor.author").val(),
|
||||
"desc": $(".editor.desc").val()
|
||||
}).then(res=>{
|
||||
if( res.type == "s" ) {
|
||||
window.open("/posts?post=preview")
|
||||
$(".link").attr("href", "/posts?post=preview")
|
||||
document.getElementsByClassName("link")[0].click()
|
||||
} else {
|
||||
alert( "Err! " + res.text )
|
||||
}
|
||||
|
@ -42,8 +45,10 @@ function post() {
|
|||
"title": $(".editor.title").val(),
|
||||
"body": mde.value(),
|
||||
"tags": tags,
|
||||
"time": "auto"
|
||||
}).then(r => r.json()).then(res=>{
|
||||
"time": "auto",
|
||||
"author": $(".editor.author").val(),
|
||||
"desc": $(".editor.desc").val()
|
||||
}).then(res=>{
|
||||
if( res.type == "s" ) {
|
||||
alert( "Post live!" )
|
||||
} else {
|
||||
|
@ -51,3 +56,37 @@ function post() {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
function save() {
|
||||
let tags = $(".editor.tags").val().split(/[\,\ ]/).filter(i=> i!="" )
|
||||
|
||||
let postjson = {
|
||||
"title": $(".editor.title").val(),
|
||||
"body": mde.value(),
|
||||
"tags": tags,
|
||||
"author": $(".editor.author").val(),
|
||||
"desc": $(".editor.desc").val()
|
||||
}
|
||||
|
||||
// dl it locally ( as .json )
|
||||
$(".dl").attr("href", "data:application/json;base64," + btoa( JSON.stringify(postjson) ))
|
||||
document.getElementsByClassName("dl")[0].click()
|
||||
|
||||
}
|
||||
|
||||
function load() {
|
||||
let file = document.getElementsByClassName("load")[0].files[0]
|
||||
let read = new FileReader()
|
||||
read.readAsText(file, "UTF-8")
|
||||
read.onload = (e) => {
|
||||
let p = JSON.parse( e.target.result )
|
||||
|
||||
$(".editor.title").val (p.title)
|
||||
mde.value (p.body)
|
||||
$(".editor.tags").val (p.tags.join(", "))
|
||||
$(".editor.author").val(p.author)
|
||||
$(".editor.desc").val (p.desc)
|
||||
|
||||
console.log(p)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,21 +46,21 @@ class comment {
|
|||
}
|
||||
|
||||
function displaycomments() {
|
||||
if( conf.commenting_enabled )
|
||||
commenting = new metaentry(undefined, "comment:", ".content",{"content":
|
||||
`Your comment: (no MD)<br>
|
||||
<textarea class="comment commtext"></textarea>
|
||||
<input class="comment" onclick="sendcomment($('.commtext').val())" type="submit" value="Submit!" \\>`})
|
||||
|
||||
comments = []
|
||||
comments.push( new metaentry(undefined, "comments:", ".content", {"content":
|
||||
`These comments are user generated! they are <strong>NOT</strong> (actively) moderated!`, "class":"comments"}))
|
||||
comments.push( new metaentry(undefined, "comments:", ".content",{"content":"", "class":"comments"}))
|
||||
|
||||
// load comments:
|
||||
reloadcommenting()
|
||||
}
|
||||
|
||||
function reloadcommenting() {
|
||||
$(".comments").html("")
|
||||
$(".comments").html("These comments are user generated! they are <strong>NOT</strong> (actively) moderated! To report one please click <a href=\"/static/reporting.html\" style=\"color:blue\">here</a>!")
|
||||
fetch("/comments?post=" + postDATA.id).then(d=>d.json()).then(data=>{
|
||||
for (i in data.content) {
|
||||
comments.push( new comment( data.content[i] ) )
|
||||
|
|
|
@ -3,11 +3,11 @@ let shareurl = encodeURI(this.location.toString().split("//")[1])
|
|||
|
||||
function displayshare() {
|
||||
sharemenu = new metaentry(undefined,"Share",".content",{"content":
|
||||
`Don't know why you would, but here you can find me elsewhere on the Net:<br \\>
|
||||
`Don't know why you would, but here you can find me elsewhere on the interwebz:<br \\>
|
||||
<a href="//github.com/derzombiiie"><img class="socialicon" title="pls click tiktok icon!" src="/static/icon/github.png" \\></a>
|
||||
<a href="//www.youtube.com/watch?v=dQw4w9WgXcQ"><img title="100% legit" class="socialicon" src="/static/icon/tiktok.png" \\></a>
|
||||
<small>(yea thats it)</small><br \\><br \\>
|
||||
oh yea the title of this box: go share my page:
|
||||
<small>(yea thats it lol)</small><br \\><br \\>
|
||||
oh yea the title of this box: go share this page with...
|
||||
<a class="share" href="mailto:?subject=DerZombiiies%20totally%20cool%20website!&body=Hi%2C%0AI%20just%20found%20this%20on%20the%20interwebz%3A%20${shareurl}">Email</a>,
|
||||
<a class="share" href="whatsapp://send?text=Hi%2C%0AI%20just%20found%20this%20on%20the%20interwebz%3A%20${shareurl}">WhatsApp</a>,
|
||||
<a class="share" href="https://twitter.com/intent/tweet?text==Check%20derzombiiies%20website!%0A%40%20${shareurl}">Twitter</a>,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,49 @@
|
|||
<!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">
|
||||
<script src="/static/js/jq.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>
|
||||
$(document).ready(() => { // yes this is extra for sharing the reporting site lol
|
||||
console.log(this)
|
||||
displayshare()
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="menubox"></div>
|
||||
|
||||
<div class="content">
|
||||
<div class="entrybox">
|
||||
<div class="entry metaentry">
|
||||
<div class="title">how to report?</div>
|
||||
<hr class="seperator">
|
||||
<div class="preview">
|
||||
If you found a post or a comment you'd like to be removed please message me at derz<span>(at)</span>elidragon<span>(dot)</span>com<br>
|
||||
Please just keep in mind i'll <strong>NOT</strong> remove a comment just because it says something "wrong" or "bad"<br>
|
||||
I'll only remove it, if you can reason with logical argument!<br>
|
||||
Also, if you message me please use the subject "report of post / comment X"</br>
|
||||
for posts that "X" just is the ID shown in the top URL bar, for comments send the ID of the post its on and the posting time (completely!)</br>
|
||||
<br>
|
||||
The removal process is probably going to take a fair while as i dont check my mails every day!<br>
|
||||
Please send the email in English or German, as i dont know any other languages!<br>
|
||||
If the comment is any other language, please send me a translation of yours (if you speek the language of course) as the google translator isnt the best, thanks!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -142,4 +142,13 @@ textarea.comment {
|
|||
top: -2em;
|
||||
width: 40em;
|
||||
max-width: calc( 60% );
|
||||
font-family: slkscr;
|
||||
}
|
||||
.entrybox > .entry.metaentry > .preview > .editor > textarea.editor.desc {
|
||||
width: calc( 100% - 0.5em );
|
||||
resize: none;
|
||||
height: 5em;
|
||||
}
|
||||
.entrybox > .entry.metaentry > .preview > .editor.author {
|
||||
font-family: slkscr;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
188
logs/log.log
188
logs/log.log
|
@ -195,3 +195,191 @@
|
|||
1628685250861 | Reading posts sorted by "new" with a length of 10
|
||||
1628702052113 | Reading post 9
|
||||
1628702054939 | Reading post testing
|
||||
1628703478089 | Reading posts sorted by "new" with a length of 10
|
||||
1628703480878 | Reading post 2
|
||||
--- SEPERATOR ---
|
||||
1628709584252 | Dumping config:
|
||||
1628709584258 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628709594440 | Reading posts sorted by "new" with a length of 10
|
||||
1628709609369 | Reading post 1
|
||||
1628709609674 | Reading comments from post "1", with length: undefined
|
||||
1628709631779 | Reading comments from post "1", with length: undefined
|
||||
1628709637563 | Reading post 1
|
||||
1628709637846 | Reading comments from post "1", with length: undefined
|
||||
1628709644951 | Reading comments from post "1", with length: undefined
|
||||
1628709644987 | Reading comments from post "1", with length: undefined
|
||||
1628709645038 | Trying to comment to post "1", from ip "6024480993258485" (tkn: 6024480993258485) with content: "1234"
|
||||
1628709645044 | Trying to comment to post "1", from ip "1540852939102905" (tkn: 1540852939102905) with content: "1234"
|
||||
1628709721623 | Reading post 1
|
||||
1628709721938 | Reading comments from post "1", with length: undefined
|
||||
1628709789948 | Reading post 1
|
||||
1628709790243 | Reading comments from post "1", with length: undefined
|
||||
1628709838398 | Reading post 1
|
||||
1628709838698 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
1628710025189 | Dumping config:
|
||||
1628710025195 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628710068519 | Reading post 1
|
||||
1628710068792 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628710123480 | Dumping config:
|
||||
1628710123486 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628710124087 | Reading post 1
|
||||
1628710124378 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628710264632 | Dumping config:
|
||||
1628710264638 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628710270354 | Reading posts sorted by "new" with a length of 10
|
||||
1628710272695 | Reading post 1
|
||||
1628710272937 | Reading comments from post "1", with length: undefined
|
||||
1628710276015 | Reading comments from post "1", with length: undefined
|
||||
1628710276110 | Trying to comment to post "1", from ip "4101118344740699" (tkn: 4101118344740699) with content: "test"
|
||||
1628710278314 | Reading post 1
|
||||
1628710278616 | Reading comments from post "1", with length: undefined
|
||||
1628710341988 | Reading comments from post "1", with length: undefined
|
||||
1628710342000 | Trying to comment to post "1", from ip "2186730507190057" (tkn: 2186730507190057) with content: "test"
|
||||
--- SEPERATOR ---
|
||||
1628710390388 | Dumping config:
|
||||
1628710390395 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628710391676 | Reading post 1
|
||||
1628710391999 | Reading comments from post "1", with length: undefined
|
||||
1628710403333 | Reading comments from post "1", with length: undefined
|
||||
1628710403367 | Reading comments from post "1", with length: undefined
|
||||
1628710403424 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 1770902532489613) with content: "Test here"
|
||||
1628710403431 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 9417441799779184) with content: "Test here"
|
||||
1628710404918 | Reading post 1
|
||||
1628710405174 | Reading comments from post "1", with length: undefined
|
||||
1628710406219 | Reading post 1
|
||||
1628710406447 | Reading comments from post "1", with length: undefined
|
||||
1628710480816 | Reading post 1
|
||||
1628710481102 | Reading comments from post "1", with length: undefined
|
||||
1628710634498 | Reading comments from post "1", with length: undefined
|
||||
1628710634503 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 9139611832112006) with content: "LEUTE,
|
||||
LEUDE
|
||||
LEUDE!"
|
||||
1628710638683 | Reading post 1
|
||||
1628710638972 | Reading comments from post "1", with length: undefined
|
||||
1628710831969 | Reading posts sorted by "new" with a length of 10
|
||||
1628710838001 | Reading post 1
|
||||
1628710838268 | Reading comments from post "1", with length: undefined
|
||||
1628710871139 | Reading comments from post "1", with length: undefined
|
||||
1628710871157 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 8923528146744258) with content: "test"
|
||||
err, crashed!"
|
||||
--- SEPERATOR ---
|
||||
1628711113109 | Dumping config:
|
||||
1628711113115 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628711123929 | Reading comments from post "1", with length: undefined
|
||||
1628711124018 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 8661334420801312) with content: "test" | err, crashed!"
|
||||
--- SEPERATOR ---
|
||||
1628711165307 | Dumping config:
|
||||
1628711165313 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628711166495 | Reading comments from post "1", with length: undefined
|
||||
1628711166595 | Trying to comment to post "1", from ip "94.134.179.7" (tkn: 9862165061574262) with content: "test"
|
||||
| err, crashed!"
|
||||
--- SEPERATOR ---
|
||||
1628711862233 | Dumping config:
|
||||
1628711862239 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":false,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628711866368 | Reading post 1
|
||||
1628711866646 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628711895024 | Dumping config:
|
||||
1628711895030 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628711895826 | Reading post 1
|
||||
1628711896115 | Reading comments from post "1", with length: undefined
|
||||
1628712095024 | Reading post 1
|
||||
1628712095275 | Reading comments from post "1", with length: undefined
|
||||
1628712107167 | Reading post 1
|
||||
1628712107415 | Reading comments from post "1", with length: undefined
|
||||
1628712125731 | Reading post 1
|
||||
1628712125996 | Reading comments from post "1", with length: undefined
|
||||
1628712142512 | Reading post 1
|
||||
1628712142793 | Reading comments from post "1", with length: undefined
|
||||
1628712188981 | Reading post 1
|
||||
1628712189247 | Reading comments from post "1", with length: undefined
|
||||
1628712264556 | Reading post 1
|
||||
1628712275546 | Reading post 1
|
||||
1628712280076 | Reading post 1
|
||||
1628712307721 | Reading post 1
|
||||
1628712308114 | Reading comments from post "1", with length: undefined
|
||||
1628712371918 | Reading post 1
|
||||
1628712372188 | Reading comments from post "1", with length: undefined
|
||||
1628712401870 | Reading post 1
|
||||
1628712402119 | Reading comments from post "1", with length: undefined
|
||||
1628712445326 | Reading posts sorted by "new" with a length of 10
|
||||
1628712921280 | Reading posts sorted by "new" with a length of 10
|
||||
1628713286088 | Reading posts sorted by "new" with a length of 10
|
||||
1628713288712 | Reading post 0
|
||||
1628713291576 | Reading post 1
|
||||
1628713291773 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628714371225 | Dumping config:
|
||||
1628714371231 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628714802953 | Reading post 9
|
||||
1628714805466 | Reading post 1
|
||||
1628714805703 | Reading comments from post "1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628715469014 | Dumping config:
|
||||
1628715469020 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628715729239 | Reading posts sorted by "new" with a length of 10
|
||||
1628715828234 | Reading post preview
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
1628716276487 | Dumping config:
|
||||
1628716276493 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628716288557 | Reading post preview
|
||||
1628716288901 | Reading comments from post "-1", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
--- SEPERATOR ---
|
||||
1628718146406 | Dumping config:
|
||||
1628718146412 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628718386500 | Reading posts sorted by "new" with a length of 10
|
||||
1628718443445 | Reading posts sorted by "new" with a length of 10
|
||||
1628718449833 | Reading posts sorted by "new" with a length of 10
|
||||
1628718457514 | Reading post 4
|
||||
1628718457798 | Reading comments from post "4", with length: undefined
|
||||
--- SEPERATOR ---
|
||||
1628718892995 | Dumping config:
|
||||
1628718893001 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628718901219 | Trying to set post "preview", as name "The first post with the MD editor!!11!!!"
|
||||
1628718901220 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628718901219,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"The first post with the MD editor!!11!!!"}
|
||||
1628718908597 | Reading post preview
|
||||
1628718908879 | Reading comments from post "-1", with length: undefined
|
||||
1628718931174 | Reading posts sorted by "new" with a length of 10
|
||||
1628718935393 | Reading posts sorted by "new" with a length of 10
|
||||
1628722176581 | Reading posts sorted by "new" with a length of 10
|
||||
1628722185764 | Trying to set post "undefined", as name "this is an error right?!"
|
||||
1628722185765 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722185764,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722188053 | Reading posts sorted by "new" with a length of 10
|
||||
1628722189440 | Reading posts sorted by "new" with a length of 10
|
||||
1628722208425 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722208426 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722208425,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722223709 | Reading post preview
|
||||
1628722223973 | Reading comments from post "-1", with length: undefined
|
||||
1628722248784 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722248784 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722248784,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722259731 | Trying to set post "undefined", as name "this is an error right?!"
|
||||
--- SEPERATOR ---
|
||||
1628722393671 | Dumping config:
|
||||
1628722393677 | {"debug":false,"logging":1337,"logfile":"logs/log.log","ipget_endpoint_set":"//derzombiiie.com/getip.php?settoken=${TOKEN}","ipget_endpoint_get":"//derzombiiie.com/getip.php?token=${TOKEN}","cl":true,"site_name":"blog.derzombiiie.com","search_enable":false,"search_only_tags":true,"commenting_enabled":true,"post_ranking_auto":43200,"index_post_sort":"new","comment_sync_on_write":false,"comment_auto_sync":360}
|
||||
1628722402990 | Trying to set post "undefined", as name "this is an error right?!"
|
||||
1628722402990 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722402990,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722406894 | Reading post preview
|
||||
1628722410445 | Reading posts sorted by "new" with a length of 10
|
||||
1628722737781 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722737782 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722737781,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722747718 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722747719 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722747717,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722829316 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722829316 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722829316,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722859565 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722859566 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722859565,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722904701 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722904702 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722904701,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722990943 | Trying to set post "preview", as name "this is an error right?!"
|
||||
1628722990943 | Contents: {"author":"Derz","content":"# Your post (NO HEADLINE HERE)","create":1628722990942,"desc":"Hi i'm a desecription plz open this article!!1!","id":-1,"rating":{"+":0,"-":0},"tags":["testing","space_Ballz","fuck_drump","MONEY","$$$"],"title":"this is an error right?!"}
|
||||
1628722991028 | Reading post preview
|
||||
1628722991303 | Reading comments from post "-1", with length: undefined
|
||||
|
|
|
@ -18,16 +18,19 @@ this.setpass = ( p ) => {
|
|||
this.saveconf()
|
||||
}
|
||||
|
||||
// save conf (just pwd)
|
||||
this.saveconf = () => {
|
||||
fs.writeFile("config/admin.yaml", yaml.dump(this.config), "utf8", ()=>{})
|
||||
}
|
||||
|
||||
// check password
|
||||
this.pass = ( pass ) => {
|
||||
if ( this.config.passhash == crypto.createHash( "sha256" ).update( pass ).digest( "base64" ) ) return true
|
||||
return false
|
||||
}
|
||||
|
||||
this.indexuse = (req, res, next) => {
|
||||
// does the auth stuff
|
||||
this.pre = (req, res, next) => {
|
||||
const auth = ( req.headers.authorization || "" ).split(" ")[1] || ""
|
||||
const [user, pass] = Buffer.from(auth, "base64").toString().split(":")
|
||||
|
||||
|
@ -41,13 +44,76 @@ this.indexuse = (req, res, next) => {
|
|||
next()
|
||||
}
|
||||
|
||||
this.index = (req, res) => {
|
||||
console.log("authenticated!")
|
||||
// POST: /admin/post api endpoint handler
|
||||
this.post = (req, res) => {
|
||||
res.type("application/json")
|
||||
let ret
|
||||
let post
|
||||
switch ( req.body.action ) {
|
||||
case "set":
|
||||
if( !req.body.id || !req.body.title || !req.body.body || !req.body.tags || !req.body.time || !req.body.author || !req.body.desc ) {
|
||||
res.status( 400 )
|
||||
res.end( JSON.stringify( {"type":"err","text":"Non complete request!"} ) )
|
||||
return
|
||||
}
|
||||
if ( req.body.time == "auto" ) {
|
||||
req.body.time = new Date().getTime()
|
||||
}
|
||||
|
||||
this.log.log(`Trying to set post "${req.body.id}", as name "${req.body.title}"`, this.log.d.basic)
|
||||
post = {
|
||||
"author": req.body.author,
|
||||
"content": req.body.body,
|
||||
"create": req.body.time,
|
||||
"desc": req.body.desc,
|
||||
"id": typeof(req.body.id) == "number" ? req.body.id : -1,
|
||||
"rating": {"+":0,"-":0},
|
||||
"tags": req.body.tags,
|
||||
"title": req.body.title
|
||||
}
|
||||
this.log.log(`Contents: ${JSON.stringify( post )}`, this.log.d.datahorder)
|
||||
|
||||
ret = this.posts.set( req.body.id, post )
|
||||
|
||||
if ( ret.type != "s" ) res.status( 400 )
|
||||
res.end( JSON.stringify( ret ) )
|
||||
break
|
||||
|
||||
case "push":
|
||||
if( !req.body.title || !req.body.body || !req.body.tags || !req.body.time || !req.body.author || !req.body.desc ) {
|
||||
res.status( 400 )
|
||||
res.end( JSON.stringify( {"type":"err","text":"Non complete request!"} ) )
|
||||
return
|
||||
}
|
||||
if ( req.body.time == "auto" ) {
|
||||
req.body.time = new Date().getTime()
|
||||
}
|
||||
|
||||
this.log.log(`Trying to set post "${req.body.id}", as name "${req.body.title}"`, this.log.d.basic)
|
||||
|
||||
post = {
|
||||
"author": req.body.author,
|
||||
"content": req.body.body,
|
||||
"create": req.body.time,
|
||||
"desc": req.body.desc,
|
||||
"id": -1,
|
||||
"rating": {"+":0,"-":0},
|
||||
"tags": req.body.tags,
|
||||
"title": req.body.title
|
||||
}
|
||||
|
||||
this.log.log(`Contents: ${ JSON.stringify(post) }`, this.log.d.datahorder)
|
||||
|
||||
ret = this.posts.push( post )
|
||||
if ( ret.type != "s" ) res.status( 400 )
|
||||
res.end( JSON.stringify( ret ) )
|
||||
break
|
||||
default:
|
||||
res.status( 501 )
|
||||
res.end( JSON.stringify( {"type":"err","text":"Not implemented!"} ) )
|
||||
break
|
||||
}
|
||||
|
||||
fs.readFile("html/admin/index.html", (data) => {
|
||||
res.type("text/html")
|
||||
res.end(data)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
11
node/app.js
11
node/app.js
|
@ -40,7 +40,7 @@ conf.ipget_endpoint_set = "${conf.ipget_endpoint_set}"
|
|||
conf.site_name = "${conf.site_name}"
|
||||
conf.search_enable = ${conf.search_enable}
|
||||
conf.index_post_sort = "${conf.index_post_sort}"
|
||||
conf.comments_enabled = ${conf.comments_enabled}\n`)
|
||||
conf.commenting_enabled = ${conf.commenting_enabled}\n`)
|
||||
})
|
||||
log.log("Dumping config:", log.d.datahorder)
|
||||
log.log(JSON.stringify(conf), log.d.datahorder)
|
||||
|
@ -78,7 +78,6 @@ con.registercmd( "comment", (arg => {
|
|||
body.shift()
|
||||
body.shift()
|
||||
body.shift()
|
||||
body.shift()
|
||||
|
||||
let time = arg[2]
|
||||
if (arg[2] == "auto") {
|
||||
|
@ -244,11 +243,11 @@ app.all("/comments", (req, res) => {
|
|||
res.type("application/json")
|
||||
let ret
|
||||
let waiting
|
||||
if ( req.body.body && req.body.ip && req.body.post ) {
|
||||
if ( req.body.body && req.body.ip && req.body.post && conf.commenting_enabled ) {
|
||||
console.log("commentetded!")
|
||||
// get ip from tkn
|
||||
waiting = true
|
||||
fetch("https:" + conf.ipget_endpoint_set.replace("${TOKEN}", req.body.ip)).then(
|
||||
fetch("https:" + conf.ipget_endpoint_get.replace("${TOKEN}", req.body.ip)).then(
|
||||
d => d.text()).then(data=>{
|
||||
log.log(`Trying to comment to post "${req.body.post}", from ip "${data}" (tkn: ${req.body.ip}) with content: "${req.body.body}"`, log.d.datahorder)
|
||||
if (data == "") {
|
||||
|
@ -304,9 +303,9 @@ con.registercmd( "testpass", (arg) => {
|
|||
if ( !arg[0] ) return console.log("Usage: \"testpass <pass>\"")
|
||||
console.log( admin.pass( arg[0] ) )
|
||||
})
|
||||
app.use("/admin/", (req, res, next) => admin.indexuse(req, res, next))
|
||||
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://localhost:${port}`)
|
||||
|
|
|
@ -16,6 +16,8 @@ this.d = {
|
|||
|
||||
this.log = ( msg, ll ) => {
|
||||
if(ll => this.ll) {
|
||||
// prep msg for logging:
|
||||
msg = msg.replace(/\n/g, "\n" + " ".repeat(14) + "| ")
|
||||
this.writelog( new Date().getTime() + " | " + msg + "\n" )
|
||||
}
|
||||
if(this.ll == this.d.haxxer) {
|
||||
|
|
|
@ -75,7 +75,6 @@ this.rank = (c) => {
|
|||
|
||||
this.read = (count, sort) => {
|
||||
let ret = []
|
||||
debugger
|
||||
switch (sort) {
|
||||
case "hot":
|
||||
this.ranking.hot.length
|
||||
|
@ -97,4 +96,33 @@ this.read = (count, sort) => {
|
|||
return ret
|
||||
}
|
||||
|
||||
this.push = (post) => {
|
||||
if ( !post ) return {"type":"err","text":"no post"}
|
||||
if ( !post.title || !post.content || !post.create ) return {"type":"err","text":"wrong contents"}
|
||||
|
||||
if ( post.time == "auto" ) {
|
||||
post.time = new Date().getTime()
|
||||
}
|
||||
|
||||
let len = this.db.get("len")
|
||||
this.db.set(len, {
|
||||
"autor": post.author,
|
||||
"content": post.content,
|
||||
"create": post.create,
|
||||
"desc": post.desc,
|
||||
"id": len,
|
||||
"rating": {"+":0,"-":0},
|
||||
"tags": post.tags,
|
||||
"title":post.title
|
||||
})
|
||||
this.db.set("len", len+1)
|
||||
return {"type":"s","text":"Success! postid: " + len,"content":len}
|
||||
}
|
||||
|
||||
this.set = (postID, post) => {
|
||||
if ( !post ) return {"type":"err","text":"no post"}
|
||||
if ( !post.title || !post.content || !post.create ) return {"type":"err","text":"wrong contents"}
|
||||
|
||||
this.db.set(postID, post)
|
||||
return {"type":"s", "text":"Success, set post \"" + postID + "\"","content":postID}
|
||||
}
|
||||
|
|
|
@ -2,58 +2,79 @@
|
|||
"1-0": {
|
||||
"time": 1628529664467,
|
||||
"author": "87.123.198.124",
|
||||
"body": "test"
|
||||
"body": "test",
|
||||
"id": 0,
|
||||
"deleted": true
|
||||
},
|
||||
"1-len": 13,
|
||||
"1-len": 16,
|
||||
"1-1": {
|
||||
"time": 1628532147370,
|
||||
"author": "87.123.198.124",
|
||||
"body": "test"
|
||||
"body": "test",
|
||||
"id": 1,
|
||||
"deleted": true
|
||||
},
|
||||
"1-2": {
|
||||
"time": 1628532164173,
|
||||
"author": "87.123.198.124",
|
||||
"body": "test"
|
||||
"body": "test",
|
||||
"id": 2,
|
||||
"deleted": true
|
||||
},
|
||||
"1-3": {
|
||||
"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)"
|
||||
"body": "fist comment to be send! (using the \"complete\" system that is!)\neven support for\nNEWLINES\n(no MD though)",
|
||||
"id": 3,
|
||||
"deleted": true
|
||||
},
|
||||
"1-4": {
|
||||
"time": 1628548924474,
|
||||
"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)"
|
||||
"body": "fist comment to be send! (using the \"complete\" system that is!)\neven support for\nNEWLINES\n(no MD though)",
|
||||
"id": 4
|
||||
},
|
||||
"1-5": {
|
||||
"time": 1628549275764,
|
||||
"author": "87.123.198.124",
|
||||
"body": "test"
|
||||
"body": "test",
|
||||
"id": 5,
|
||||
"deleted": true
|
||||
},
|
||||
"1-6": {
|
||||
"time": 1628549378060,
|
||||
"author": "87.123.198.124",
|
||||
"body": "sneT"
|
||||
"body": "sneT",
|
||||
"id": 6,
|
||||
"deleted": true
|
||||
},
|
||||
"1-7": {
|
||||
"time": 1628549409275,
|
||||
"author": "87.123.198.124",
|
||||
"body": "sneT"
|
||||
"body": "sneT",
|
||||
"id": 7,
|
||||
"deleted": true
|
||||
},
|
||||
"1-8": {
|
||||
"time": 1628549488473,
|
||||
"author": "87.123.198.124",
|
||||
"body": "zu"
|
||||
"body": "zu",
|
||||
"id": 8,
|
||||
"deleted": true
|
||||
},
|
||||
"1-9": {
|
||||
"time": 1628549502520,
|
||||
"author": "87.123.198.124",
|
||||
"body": "AEjkzshgbnxmk"
|
||||
"body": "AEjkzshgbnxmk",
|
||||
"id": 9,
|
||||
"deleted": true
|
||||
},
|
||||
"1-10": {
|
||||
"time": 1628549536356,
|
||||
"author": "87.123.198.124",
|
||||
"body": "AWJYTGHSAK"
|
||||
"body": "AWJYTGHSAK",
|
||||
"id": 10,
|
||||
"deleted": true
|
||||
},
|
||||
"1-11": {
|
||||
"time": 1628552668304,
|
||||
|
@ -70,6 +91,38 @@
|
|||
"authorinfo": {
|
||||
"origin": "console"
|
||||
},
|
||||
"body": "this, as this is a testing blog post\nalso Newlines **no** markdown though :(\nmaybe later!"
|
||||
"body": "this, as this is a testing blog post\nalso Newlines **no** markdown though :(\nmaybe later!",
|
||||
"id": 12
|
||||
},
|
||||
"1-13": {
|
||||
"time": 1628710062750,
|
||||
"author": "josh",
|
||||
"authorinfo": {
|
||||
"origin": "console"
|
||||
},
|
||||
"body": "Hi, me here!",
|
||||
"id": 13
|
||||
},
|
||||
"1-14": {
|
||||
"time": 1628710403425,
|
||||
"author": "94.134.179.7",
|
||||
"authorinfo": {
|
||||
"country": "DE",
|
||||
"origin": "web"
|
||||
},
|
||||
"body": "Test here",
|
||||
"id": 14,
|
||||
"deleted": true
|
||||
},
|
||||
"1-15": {
|
||||
"time": 1628710403431,
|
||||
"author": "94.134.179.7",
|
||||
"authorinfo": {
|
||||
"country": "DE",
|
||||
"origin": "web"
|
||||
},
|
||||
"body": "Test here",
|
||||
"id": 15,
|
||||
"deleted": true
|
||||
}
|
||||
}
|
|
@ -24,32 +24,33 @@
|
|||
"tags": [
|
||||
"testing",
|
||||
"$$$"
|
||||
],
|
||||
"dummy": {
|
||||
"1": 2
|
||||
},
|
||||
"rating": {
|
||||
],
|
||||
"dummy": {
|
||||
"1": 2
|
||||
},
|
||||
"rating": {
|
||||
"+": 999,
|
||||
"-": 0
|
||||
},
|
||||
"create": 2,
|
||||
"id": 1
|
||||
},
|
||||
"2": {
|
||||
"title": "Warum sind k.rum und was ist k.?",
|
||||
"author": "olli",
|
||||
"desc": "Warum nicht! hier text Lorem ipsum dolor sit!",
|
||||
"href": "#",
|
||||
"tags": [
|
||||
"karotte",
|
||||
"dumm",
|
||||
"garten"
|
||||
],
|
||||
"rating": {
|
||||
"+": 395,
|
||||
"-": 14
|
||||
},
|
||||
"create": 1628252855774,
|
||||
"id": 2
|
||||
}
|
||||
"-": 0
|
||||
},
|
||||
"create": 2,
|
||||
"id": 1
|
||||
},
|
||||
"2": {
|
||||
"title": "Warum sind k.rum und was ist k.?",
|
||||
"author": "olli",
|
||||
"desc": "Warum nicht! hier text Lorem ipsum dolor sit!",
|
||||
"href": "#",
|
||||
"tags": [
|
||||
"karotte",
|
||||
"dumm",
|
||||
"garten"
|
||||
],
|
||||
"rating": {
|
||||
"+": 395,
|
||||
"-": 14
|
||||
},
|
||||
"create": 1628252855774,
|
||||
"id": 2
|
||||
},
|
||||
"len": 3
|
||||
}
|
Loading…
Reference in New Issue