new file: s/contact.tpl.html

new file:   s/favicon.gif
	new file:   s/how.tpl.html
	modified:   s/index.tpl.html
	modified:   s/item.tpl.html
	modified:   s/style.css
	modified:   src/main.js
	deleted:    s/irccat.gif
This commit is contained in:
Flummi 2016-08-16 15:48:37 +02:00
parent 244fa1053f
commit ade9d27c18
8 changed files with 72 additions and 23 deletions

0
s/contact.tpl.html Normal file
View File

BIN
s/favicon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

32
s/how.tpl.html Normal file
View File

@ -0,0 +1,32 @@
<html>
<head>
<title>f0ck me! but how?</title>
<link rel="stylesheet" type="text/css" href="./s/style.css" />
<link rel="icon" type="image/gif" href="./s/favicon.gif" />
</head>
<body>
<div class="irc">
<h4>irc.n0xy.net +6697 (ssl only) #f0ck</h4>
<p><code>SHA256 Fingerprint=10:2F:90:45:53:B9:1E:F8:7A:B4:7B:AE:03:70:4C:84:70:7A:A9:EE:11:49:2B:79:A0:7A:2D:01:B2:E6:0F:41</code></p>
<p>Don't have a desktop client? Why not join our Network via webirc? <a href="https://webirc.n0xy.net/#f0ck" target="about_blank">>>webirc.n0xy.net</a></p>
<div class="page-header">
<h4>IRC Rules</h4>
</div>
<ol>
<li>Do not spread CP of any kind at this server (loli included!).</li>
<li>Do not attack against users or infrastructure of this server.</li>
<li>Do not attack against any systems throught this server.</li>
<li>Do not spread worms, viruses or any other kind of malware at this server.</li>
<li>Do not try to sell, buy, or spread credit-card, banking etc info at this server!</li>
<li>Do not spread content, that is at the moment illegal at the hosting country, or your country.</li>
<li>Don't be an asshole, no butthurt allowed beyond this line ^-^</li>
</ol>
<h4>how to f0ck you ask?</h4>
<p>f0ck will f0ck any media link posted in the channel ending with: jpg|gif|png|webm|mp3|mp4</p>
<p>If you don't want f0ck to f0ck it put !ignore behind your link. Example: https://retard-journal.com/stupidshit.png !ignore</a>
<p>f0ck will only f0ck media links with the maximum size of 30MB</p>
<p>Don't let f0ck f0ck childporn :( ... please</p>
<a href="/">return to main</a>
</div>
</body>
</html>

View File

@ -3,11 +3,11 @@
<head> <head>
<title>f0ck me!</title> <title>f0ck me!</title>
<link rel="stylesheet" type="text/css" href="./s/style.css"> <link rel="stylesheet" type="text/css" href="./s/style.css">
<link rel="favicon" type="image/png" href="./s/faviconf0ck.png" /> <link rel="icon" type="image/gif" href="./s/favicon.gif" />
</head> </head>
<body> <body>
{% for item in items %} <div class="navbar"><a href="/">f0ck.me</a> | <a href="/how" target="_blank">how to</a> | <a href="/contact" target="_blank">Contact</a></div><br />
<div class="mrhankyisteinneger"><a href="./{{ item }}"><img src="./t/{{ item }}.png" /></a></div> {% for item in items %}<div class="mrhankyisteinneger"><a href="./{{ item }}"><img src="./t/{{ item }}.png" /></a></div>
{% endfor %} {% endfor %}
</html> </html>
</body> </body>

BIN
s/irccat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -3,11 +3,11 @@
<head> <head>
<title>{{ id }} - f0ck.me</title> <title>{{ id }} - f0ck.me</title>
<link rel="stylesheet" type="text/css" href="./s/style.css"> <link rel="stylesheet" type="text/css" href="./s/style.css">
<link rel="favicon" type="image/png" href="./s/faviconf0ck.png" /> <link rel="icon" type="image/gif" href="./s/favicon.gif" />
</head> </head>
<body> <body>
<h4><a href="/">f0ck.me</a></h4>
<div class="id">[ID: {{ id }} | by: {{ username }}]</div> <div class="id">[ID: {{ id }} | by: {{ username }}]</div>
<div class="return"><a href="/" title="return to main">f0ck.me</a></div><br />
<div class="medium"> <div class="medium">
{% if item == "video" %} {% if item == "video" %}
<video src="{{ dest }}" style="max-width: 1024px" autoplay controls loop></video> <video src="{{ dest }}" style="max-width: 1024px" autoplay controls loop></video>
@ -19,7 +19,7 @@
<img src="{{ dest }}" style="max-width: 1024px" /> <img src="{{ dest }}" style="max-width: 1024px" />
{% endif %} {% endif %}
</div> </div>
<div class="controls">controls f&uuml;r vor und zur&uuml;ck :^)</div> <div class="controls">controls f&uuml;r vor und zur&uuml;ck :^)</div><br />
<div class="info"> <div class="info">
<span class="src">src: <a href="{{ src }}" target="_blank">{{ src }}</a></span><br /> <span class="src">src: <a href="{{ src }}" target="_blank">{{ src }}</a></span><br />
<span class="dest">dest: {{ dest }}</span><br /> <span class="dest">dest: {{ dest }}</span><br />

View File

@ -9,40 +9,43 @@ a > img {
border: 2px solid #4c4a4a; border: 2px solid #4c4a4a;
margin: 0; margin: 0;
} }
a { a {
color: #9f0; color: #9f0;
} }
a:hover { a:hover {
color: #74c100; color: #74c100;
} }
.medium { .medium {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.info { .info {
text-align: center; text-align: center;
} }
.id { .id {
text-align: center; text-align: center;
padding-bottom: 10px; padding-bottom: 10px;
} }
.mrhankyisteinneger { .mrhankyisteinneger {
padding: 0; padding: 0;
display: block; display: block;
margin: 0 0 4px 5px; margin: 0 0 4px 5px;
float: left; float: left;
} }
.mrhankyisteinneger:hover { .mrhankyisteinneger:hover {
opacity: 0.7; opacity: 0.7;
} }
.controls { .controls {
text-align: center; text-align: center;
display: none;
}
.navbar {
text-align: center;
}
.return {
text-align: center;
}
.irc {
margin: 20px;
} }

View File

@ -47,7 +47,7 @@ bot.on('motd', (e) => {
bot.on('message', (e) => { bot.on('message', (e) => {
var orig = e.message; var orig = e.message;
if(orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi) && e.channel.getName() == "#f0ck") { // shitpostcatcher if(orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)/* && e.channel.getName() == "#f0ck"*/) { // shitpostcatcher
if(!orig.match(/\!ignore$/)) { if(!orig.match(/\!ignore$/)) {
var tmp = orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links var tmp = orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links
tmp.forEach((entry,i,a) => { tmp.forEach((entry,i,a) => {
@ -95,6 +95,10 @@ bot.on('message', (e) => {
var tmp = getUser(e.user.getNick(), e.network); var tmp = getUser(e.user.getNick(), e.network);
setTimeout(()=>{ e.reply(tmp); }, 1500); setTimeout(()=>{ e.reply(tmp); }, 1500);
} }
else if(orig.match(/^\!reload tpl$/)) {
getTpls();
e.reply("templates reloaded");
}
}); });
var getUser = (u, n) => { var getUser = (u, n) => {
@ -172,7 +176,6 @@ http.createServer((req, res) => {
var url = req.url.split("/")[1]; var url = req.url.split("/")[1];
if(filePath == './') if(filePath == './')
filePath = './index.html'; filePath = './index.html';
var extname = String(path.extname(filePath)).toLowerCase(); var extname = String(path.extname(filePath)).toLowerCase();
var contentType = 'text/html'; var contentType = 'text/html';
var mimeTypes = { var mimeTypes = {
@ -240,8 +243,18 @@ http.createServer((req, res) => {
res.end(tpl(data), 'utf-8'); res.end(tpl(data), 'utf-8');
}); });
} }
else if(filePath == "./how") {
var tpl = swig.compile(templates.how);
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(tpl(), 'utf-8');
}
else if(filePath == "./contact") {
var tpl = swig.compile(templates.contact);
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(tpl(), 'utf-8');
}
else if(filePath.match(/^\.\/(b|s|t)\/.*/)) { // file else if(filePath.match(/^\.\/(b|s|t)\/.*/)) { // file
contentType = mimeTypes[extname] || 'application/octect-stream'; contentType = mimeTypes[extname];
switch(contentType) { switch(contentType) {
case "video/webm": case "video/webm":
case "video/mp4": case "video/mp4":
@ -280,7 +293,7 @@ http.createServer((req, res) => {
} }
} }
else { else {
res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length }); res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length, 'Cache-Control': 'max-age=2592000, public' });
res.end(content, 'utf-8'); res.end(content, 'utf-8');
} }
}); });
@ -290,7 +303,7 @@ http.createServer((req, res) => {
if(error) { if(error) {
if(error.code == 'ENOENT') { if(error.code == 'ENOENT') {
res.writeHead(200, { 'Content-Type': contentType }); res.writeHead(200, { 'Content-Type': contentType });
res.end('404 - file not found', 'utf-8'); res.end('404 - f0ck you', 'utf-8');
} }
else { else {
res.writeHead(500); res.writeHead(500);
@ -305,14 +318,16 @@ http.createServer((req, res) => {
} }
else { // errorpage else { // errorpage
res.writeHead(404); res.writeHead(404);
res.end('404 - not found', 'utf-8'); res.end('404 - f0ck you', 'utf-8');
} }
}).listen(cfg.webserver.port); }).listen(cfg.webserver.port);
var getTpls = () => { var getTpls = () => {
templates = { templates = {
"index": fs.readFileSync("./s/index.tpl.html", "utf-8"), "index": fs.readFileSync("./s/index.tpl.html", "utf-8"),
"item": fs.readFileSync("./s/item.tpl.html", "utf-8") "item": fs.readFileSync("./s/item.tpl.html", "utf-8"),
"how": fs.readFileSync("./s/how.tpl.html", "utf-8"),
"contact": fs.readFileSync("./s/contact.tpl.html", "utf-8")
}; };
}; };
getTpls(); getTpls();
@ -330,9 +345,8 @@ var generateThumbs = () => {
exec('ffmpegthumbnailer -i'+e.dest+' -o'+outdir+e.id+'.png -a', (error) => { exec('ffmpegthumbnailer -i'+e.dest+' -o'+outdir+e.id+'.png -a', (error) => {
if(error) { if(error) {
bot.send("#f0ck", "failed thumbnail for "+e.id+" ("+e.mime+")", 'n0xy'); bot.send("#f0ck", "failed thumbnail for "+e.id+" ("+e.mime+")", 'n0xy');
fs.unlink(outdir+e.id+'.png'); fs.unlink(outdir+e.id+'.png'); //
fs.copySync('./s/mp3.png', outdir+e.id+'.png'); fs.copySync('./s/mp3.png', outdir+e.id+'.png'); // copy standardthumbnail
// Standardthumb reinkopieren
} }
else { else {
bot.send("#f0ck", "generated thumbnail for "+e.id+" ("+e.mime+")", 'n0xy'); bot.send("#f0ck", "generated thumbnail for "+e.id+" ("+e.mime+")", 'n0xy');