Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - XCanG

Pages: [1] 2 3
1
HFS ~ HTTP File Server / Re: Text Font
« on: April 26, 2017, 07:37:02 AM »
Hello. Txt files are simple and they contain only information and have no information about styles. So it always will be that font, that setted in your browser! E.g. this is in Firefox:

Chrome have also their own settings.

If you want to use formatted text (that will similar on every device) you have 3 options here: 1) If you want to use it on your PC (not in browser), you may save it as .rtf (Rich Text Format) via WordPad (have in any windows), what support changing fonts, and use it on your server.
But I don't recommend it (it just a simpler solution).
2) The more correct way is using .html files (HyperText Markup Language), what is not hard to do, but first time working in it will be hard. But I will help you.
For that what you want you need in any text editor (Notepad also fine) write that code, where in span you need to paste infromation from your txt. And font: 14pt "Times New Roman"; define your font. For more instructions about that, please read documentation: https://developer.mozilla.org/en-US/docs/Web/CSS/font?v=example
Code: [Select]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
html { min-width: 100%; }
body { font: 14pt "Times New Roman"; width: 100%; }
span { display: block; word-break: normal; word-wrap: break-word; white-space: pre; width: 100%; }
</style>
</head>
<body>
<span>23 Brooke Candy - Living Out Loud
21 Shaun Frank - No Future feat. DYSON
____________your text here____________
3 DJ Katch feat. Hayley - Lights Out (Too Drunk)
1 Scissor Sisters - Comfortably Numb
1 Sam Sparro - The Shallow End (MBS+C3K Remix)
1 Groove Armada - History


From these calculations, Jazler also found out that the first song was logged at 04/19/2017 00:59:18 and last song at 04/25/2017 21:06:09
Jazler RadioStar Export @ 04/25/2017 21:09:16</span>
</body>
</html>
3) If somehow that file is generated by external program, then you need load it into page, so that page need to change a bit:
Code: [Select]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
html { min-width: 100%; }
body { font: 14pt "Times New Roman"; width: 100%; }
span { display: block; word-break: normal; word-wrap: break-word; white-space: pre; width: 100%; }
</style>
</head>
<body>
<span id="text"></span>
<script>
window.onload = function() {
var t = document.getElementById("text");
var xhr = new XMLHttpRequest();
xhr.open("GET", "topsongs.txt", true);
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.onreadystatechange = function() {
if (this.readyState != 4) return;
//console.log(this.status, this.responseText);
t.innerHTML = this.responseText;
}
xhr.send(null);
}
</script>
</body>
</html>
Post-notes: Be sure that your .html file will be placed in same folder, because I use relative path to load it "topsongs.txt". E.g. if you place it in "http://88.88.209.56:12/topsongs/topsongs.html" then "topsongs.txt" will be loaded from "http://88.88.209.56:12/topsongs/topsongs.txt"
You may change path to "/topsongs.txt" and that always will be looking for "http://88.88.209.56:12/topsongs.txt" because "/" at first character mean root.

Also if you not using server for hosting anything else I recommend to you rename file as "index.html" because after that when you open "http://88.88.209.56:12/" you will see that file, instead of HFS interface. This is following by that setting:

2
HFS ~ HTTP File Server / Re: Question: vulnerability or not?
« on: November 30, 2016, 07:01:47 PM »
Sorry, but I don't understand what you mean.

Who getting this errors? Where you get it or how to come to this conclusion? (I know about this errors, but don't get point it mention here)

About url... You think here is requested control characters? Such as NUL/BS/else?
...

3
HFS ~ HTTP File Server / Re: Question: vulnerability or not?
« on: November 28, 2016, 05:26:30 PM »
Oh no, damn, why? I not mean google bot, I know about it. Just ignore it. I mean about that character in search, that i don't see, this is more looks like as a hacer, so why I ask. Bot is just bot, but when people come to my server I may see what they searching, but this 121 IP is strange and ever search request I see that, looks like he try to hack server, but can't and try again. You see, that this 121 IP not go to any url on a page (not navigate), just search in root, so why I say this strange.

And more strange that i may say it that is not regilar web browser. Every user when open my server, include me, my friengs, guys from internet connection like that:

Lines 2, 3, 4, 5, 6 is impotant! At least if user use something like NoScript, they will not download JS file, but still download favicon.
And that with every user mobile or desktop, don't matter. Exceptons if: 1) user already download it and have in cache, 2) bot and bot not setup for downloading external things like that, 3) hacker, that may be just get page html, then generate get request with search parameter and send it to server.

So why I ask. Again Ignore bot, just think what may wrong with this user.

4
HFS ~ HTTP File Server / Re: Question: vulnerability or not?
« on: November 27, 2016, 08:52:57 PM »
Also I may say, that i restrict to bot using sorting, search, get list or e.t.c. (because it same information and take additional load to the server).

5
HFS ~ HTTP File Server / Re: Question: vulnerability or not?
« on: November 27, 2016, 08:48:46 PM »
IP started from 66 is a google bot, what IP you mean? 121 or 66?

I never see before that this IP connect to my server and I can't see at headers right now, so I don't know who is that

6
HFS ~ HTTP File Server / Question: vulnerability or not?
« on: November 25, 2016, 10:22:18 PM »
I check my logs today and see that one preson trying multiple times searching some strange requests, in log I don't see what he try to search, but that is very strange, that new line in log deleted... If I, for example, try to search something I see it as normal line. I remind that some old build of HFS have vulerability and some scripts may send on page, may be user try to cause it? Or not? If not why this thing happen with newline character?

Log:

7
OK, but no need translation. Better is see right english, than bad russian, because bad translating crush meaning.

So in my situation useful is only /sync/ folder with 3 scripts. External html file may be on different server, so, don't matter what code it will content, it just use tis 3 scripts and read many times saved files. Most frequency is time.json. All commands double check it. And only some commands read watch.json. It read only if command not accept time value (-1 (not set) or time in file later than current time (error) or time is obsolete (normal situation, when time need to update)).

8
@XCanG: It would be better if you ZIP all your HFS folder and upload it here, so we can analyse your current configuration. You don't need to share your current VFS file or any of your private files, only make a different separate folder, and configure everything exactly the same way as you have in your current HFS folder. Recreate all the settings you have in your actual HFS folder, and then share it here, please. ;)
I already send all what need to rejetto mail, if they think about share — ok, but currenly I don't like this idea, because some code I make will public. Scripts I already shered here, .vfs just struct html file and sync folder, what's it.

9
bmartino1, currently I tested all on local machine, so it only local time. I don't think that problem appear there, as it appear some next days later after PC rebooting many times (at least to July 12).

10
1) Hm, may be I may give you html file, that call it and .vfs file to test it 1 in 1. I also recieve you mail, may send it to mail. EDIT reply to mail, check it.
2) watch.json and time.json, both files bugged.
3) Ok, will try random and add results later. EDIT Ugh, I don't know how long, but bug is fixed (I do nothing than wait). When I post at July 12 it still bugged, but now (July 22) it unbugged and I don't know will help random to fix it or not. May be if I can call bug again.
4) I don't add any libraries and do page simple as possible.

11
So, how I can fix it? Or you need fix it in code?

12
So, 3 days of testing work fine, but at 4th day after my mistake in JS logic it bugged (I request too many GET/POST on the same files)

If you want to reproduce it you may just call code or function inside setInterval(code/function, delay_in_ms);

P.S. Also my file list bugged again. Private folder for users of specific group. Why it bugged again if I don't touch it after it setuped and work? Cause now only 3 solutions: give file to you again, create new file list or still do nothing with folder cause it crash HFS. // Look at old thread: http://www.rejetto.com/forum/bug-reports/bug-with-folder-(hfs-2-3-282)/ here is same problem again. Now I just want add one new group to permission for this folder, but can't.

13
Ok, step by step:
1) in HDD create sync folder and add as real folder at HFS root with hidden parameter (site.com/sync/)
2) add at HDD set, unset, posturl folder
3) create in folders hfs.diff.tpl with content I post above
4) create new .html file and add it in HFS (don't matter where it will be, may be not on this server)
5) edit html-file, this file have property requests on JS. GET to set / unset / watch.json / time.json
Example:
Code: [Select]
var timevalue = ...;
let xhr = new XMLHttpRequest();
xhr.open("GET", "/sync/set/?t=" + timevalue, true);
xhr.send();
xhr.onreadystatechange = function() {
if (this.readyState != 4) return;
if (this.status == 200 || this.status == 304) {
console.log("async ended");
}
}
POST for posturl
Example:
Code: [Select]
function addurl(url) {
url = encodeURI(url);
let data = {
url: url // will be more complex later
};
let boundary = String(Math.random()).slice(2);
let boundaryMiddle = '--' + boundary + '\r\n';
let boundaryLast = '--' + boundary + '--\r\n';
let body = ['\r\n'];
for (let key in data) {
body.push('Content-Disposition: form-data; name="' + key + '"\r\n\r\n' + data[key] + '\r\n\r\n'); // add extra newline at end
}
body = body.join(boundaryMiddle) + boundaryLast;
let xhr = new XMLHttpRequest();
xhr.open('POST', '/sync/posturl/', true);
xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
xhr.onreadystatechange = function() {
if (this.readyState != 4) return;
if (this.status == 200 || this.status == 304) {
console.log("addurl(): %s", this.responseText);
// ...
}
}
xhr.send(body);
}
6) open page and call functions (some of it semiautomatically, like time checked every 4 second (P.S. want to set update at 1 second, but after calculations found some bug that it not ideal correctly and have delay about 300ms))

14
Hello! I write some page, that iteract with hidden (real) folder on my server. This folder have 3 subfolders with macros actions, this macros save info into file.
One subfolder called set write GET variable ?t=value into "../time.json", second is unset, just set time to -1 (clear-like).
Another folder is posturl, it not compleated, but it add url that it get in POST request "url=" and write into watch.json new url + url it already content, also not implemented: deleting url by POST request, but I not finish this part of macros now.
Code is:
set
Code: [Select]
{.save|../time.json|{.urlvar|t.}.}unset
Code: [Select]
{.save|../time.json|-1.}posturl
Code: [Select]
{.set|url|{.postvar|url.}.}{.load|/sync/watch.json|var=w.}{.if|{.>|{.length|{.^w.}.}|1.}|{:{.if|{.>|{.length|{.^url.}.}|1.}|{:Server: Added to playlist{.set|playlist|{.^w.}{.^url.}.}{.save|../watch.json|var=playlist.}:}|{:Server: Remove currently playing video{.save|../watch.json|/.}:}.}:}|{:{.if|{.>|{.length|{.^url.}.}|1.}|{:Server: Create new playlist with requested entrie{.save|../watch.json|{.^url.}.}:}|{:Server: Nothing to remove, playlist is clear:}.}:}.}
Server: Current playlist entrie(s): {.^w.}{.^url.}

So, this work clearly some time ago, BUT it bugged.
In my real files writed on hard disk I have some values but if I download it directly from server now it return older value! and it not changed. I try to remove this folder from template and add again, BUT it still send older value, that different in real file content.

As I make iteactable page I also make some mistakes, that produce ton of request. And it return at that time to my browser 200 OK or 304 Unchanged. Now I fixed it, but I don't know why it bugged in HFS, HFS now remove some older value (in time.json and watch.json) on that it freezed.

P.S. this thing happen 2 days ago. And I, of course, restarting PC, HFS, folder readd in template.
P.S.S. HFS 2.3i Build 297

15
HFS ~ HTTP File Server / Add to log range (starting and ending byte)
« on: June 12, 2016, 07:09:17 PM »
You know this parameter:
Code: [Select]
Range: bytes=a-bwhere a - start byte, b - end byte (may be empty).
So, now about logs, look at this:
Code: [Select]
12.06.2016 15:14:28 92.*.*.141:51746 Requested GET /file1.mkv
12.06.2016 15:14:28 92.*.*.141:51749 Requested GET /file1.mkv
12.06.2016 15:14:28 92.*.*.141:51748 Requested GET /file1.mkv
12.06.2016 15:14:28 92.*.*.141:51748 Fully downloaded - 1.1 K @ 93.3 KB/s - /file1.mkv
12.06.2016 15:14:28 92.*.*.141:51748 Requested GET /file1.mkv
12.06.2016 15:14:33 92.*.*.141:51750 Requested GET /file1.mkv
12.06.2016 15:14:51 92.*.*.141:51752 Requested GET /file1.mkv
12.06.2016 15:15:06 92.*.*.141:51753 Requested GET /file2.mkv
12.06.2016 15:15:06 92.*.*.141:51755 Requested GET /file2.mkv
12.06.2016 15:15:07 92.*.*.141:51756 Requested GET /file2.mkv
12.06.2016 15:15:07 92.*.*.141:51756 Fully downloaded - 1.1 K @ 111.9 KB/s - /file2.mkv
12.06.2016 15:15:07 92.*.*.141:51756 Requested GET /file2.mkv
12.06.2016 15:15:11 92.*.*.141:51754 Requested GET /file2.mkv
12.06.2016 15:15:20 92.*.*.141:51758 Requested GET /file3.mkv
12.06.2016 15:15:20 92.*.*.141:51759 Requested GET /file3.mkv
12.06.2016 15:15:21 92.*.*.141:51760 Requested GET /file3.mkv
12.06.2016 15:15:21 92.*.*.141:51760 Fully downloaded - 1.1 K @ 93.3 KB/s - /file3.mkv
12.06.2016 15:15:22 92.*.*.141:51760 Requested GET /file3.mkv
12.06.2016 15:15:27 92.*.*.141:51761 Requested GET /file3.mkv
12.06.2016 15:15:34 92.*.*.141:51762 Requested GET /file4.mkv
12.06.2016 15:15:35 92.*.*.141:51763 Requested GET /file4.mkv
12.06.2016 15:15:35 92.*.*.141:51764 Requested GET /file4.mkv
12.06.2016 15:15:35 92.*.*.141:51764 Fully downloaded - 1.1 K @ 79.9 KB/s - /file4.mkv
12.06.2016 15:15:35 92.*.*.141:51764 Requested GET /file4.mkv
12.06.2016 15:15:40 92.*.*.141:51765 Requested GET /file4.mkv
12.06.2016 15:15:49 92.*.*.141:51766 Requested GET /file5.mkv
12.06.2016 15:15:50 92.*.*.141:51767 Requested GET /file5.mkv
12.06.2016 15:15:52 92.*.*.141:51769 Requested GET /file5.mkv
12.06.2016 15:15:52 92.*.*.141:51769 Fully downloaded - 1.1 K @ 124.3 KB/s - /file5.mkv
12.06.2016 15:15:52 92.*.*.141:51769 Requested GET /file5.mkv
12.06.2016 15:15:59 92.*.*.141:51770 Requested GET /file5.mkv
12.06.2016 15:22:34 92.*.*.141:51752 Fully downloaded - 547.0 M @ 1.2 MB/s - /file1.mkv
12.06.2016 15:23:42 92.*.*.141:51754 Fully downloaded - 546.5 M @ 1.1 MB/s - /file2.mkv
12.06.2016 15:23:57 92.*.*.141:51761 Fully downloaded - 547.5 M @ 1.1 MB/s - /file3.mkv
12.06.2016 15:24:19 92.*.*.141:51770 Fully downloaded - 546.4 M @ 1.1 MB/s - /file5.mkv
12.06.2016 15:24:29 92.*.*.141:51765 Fully downloaded - 546.7 M @ 1.0 MB/s - /file4.mkv
This is very unconvinient to read and understand what happen, why files download twice, why this order of get. To understand this will be very helpfull add in log line this Range parameter, if it not empty. So it will help to see and understand what heppen here, because right now this situation in log looks useless.

Pages: [1] 2 3