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 - LeoNeeson

Pages: [1] 2 3 ... 31
1
Programmers corner / Re: HTTP Header Size Problem
« on: September 02, 2018, 10:26:45 PM »
all the headers are not added in one block but at various stages of the execution, so it can happen that the one we want to withdraw at a given moment does not exist yet and that it appears at the end, the phenomenon is even more possible since some macros are not directly usable (especially in events)
That's right, I do understand, but from my point of view, I think [+request] is run first before anything (even before [+download]), so, perhaps the code to remove headers should be taken on consideration since the first initial request section. Correct me if I'm wrong.

You can try to reproduce the error using this or these 'HFS.Events'. More information about view HTTP Headers here.

2
HTML & templates / Some steps to reproduce the issue...
« on: September 02, 2018, 10:25:04 PM »
This, I tried for 3 hours with hfs 299-1/2 (the pre-release).  :) 
After upgrading to the official hfs 300, the remove headers command worked for cookies, not for etag.
That's why I've already reported this issue here. ;)

can you give some examples to reproduce in order to find a solution  ;)
You have several ways of view HTTP Headers:

1) The easiest way to reproduce this, is using Chrome. Open a new blank tab. Right click anywhere and select 'Inspect element' and then click on 'Network'. Close HFS and save the 'HFS.Events' file contained on the attached ZIP file in this post (or write in 'HFS.Events' any of these two filters described here). Open HFS, add some files (images or any other file), and go back to Chrome, paste the URL and watch the Network activity. To view the HTTP Header of any request, do right click on 'Copy response headers' on any element you want (and paste it on Notepad to view it). You will notice that any element generated by HFS on-the-fly will be fine, without the 'ETag', but if you request (click) on some file (to view it, or download it), then the 'ETag' is NOT removed (only Set-cookie is removed).

2) Another way is using FlаѕhGеt (being the version 1.65, the last adware-free version, which I'm currently using and you can download from here), or else using some HTTP Header view (online service), like this or this tool. If you use FlаѕhGеt, you need to configure it at the lowest possible speed (to being able to see the HTTP headers in the log), going to: Tools > Options > Connection > Traffic usage in manual mode (b/s): 400. And then go again to: Tools > Speed Limit Mode > Manual. And finally try to download (and quickly pausing it, to keep the logs at sight), a file that match some of those rules (as described on the point number one).

For example, a normal file listing request (it's working OK):

Quote
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1890
Accept-Ranges: bytes
Server: HFS 2.3m
Cache-Control: no-cache, no-store, must-revalidate, max-age=-1
Content-Encoding: gzip
Content-Length: 1890

But viewing a static HTML file (the same as if you download other file):

Quote
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 123
Accept-Ranges: bytes
Server: HFS 2.3m
ETag: 6ED8C82CA55F6D57FECD5F712EFFF8F1
Last-Modified: Fri, 20 Apr 2018 20:30:40 GMT
Content-Disposition: filename="SomeWebPage.html";

Viewing/downloading a image file:

Quote
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 123456
Accept-Ranges: bytes
Server: HFS 2.3m
ETag: F48480F7C42C4CF548855994DF1B5191
Last-Modified: Fri, 20 Apr 2018 20:10:00 GMT
Content-Disposition: filename="SomeImageFile.jpg";

Summarizing: if you remove a header on [+download] it works, but on [+request] it doesn't do it properly (only removes 'Set-cookie' but not the 'ETag'). I personally don't need this feature, but since danny and User21 wanted it, perhaps it's a easy fix.

Well, that's it, I hope this is useful...



> Off-topic: This gives an idea that it would be great to have a HFS template that shows the response HTTP Headers of a given URL (perhaps using part of the remote upload code?), among other useful information, like the client's User Agent, screen resolution, etc (something like THIS). I leave the idea here if someone wants to do it. ;)
 

3
Pусский / Re: Вопросы по HFS
« on: August 29, 2018, 06:58:15 PM »
@falcon1598: Mars дает вам два варианта (вам нужно выбрать только один из них):

1) Одним из вариантов является добавление этого текста на "hfs.events":
Code: [Select]
[quit]
{.set ini|
downloads-total=0
.}

2) Или другой вариант (достижение такого же эффекта), является оставьте это непроверенным.



Но вам нужно выбрать только один из них (что вам легче). Необходимо оставьте это проверено: «Auto-save options». Все остальное его объяснение касалось исходного кода (и некоторых технических деталей), только как ссылка.

4
HTML & templates / Re: No cookies for a certain folder?
« on: August 28, 2018, 06:12:45 PM »
I was wondering if it were possible, probably with hfs.events, to have no cookies issued or attempted for a certain folder? 
Perhaps it is a folder of support graphics, such as wallpapers; or, perhaps HFS is pulling dual duty also supporting a wholly different website in addition to its normal duties.  Or, in my case, I need to do that for markup speed testing.
Make a "HFS.Events" file with any of the following content...

Option 1) This removes the cookie header, only when someone access some picture/graphics/photo, perhaps useful when someone hotlink to a image on your server (you can remove the 'add to log' line, since it's there for testing purposes only):
Code: [Select]
[+request]
{.if |{.match|*.jpg;*.gif;*.png | %url%.}|{:
{.add to log|This file request was a photo!.}
{.remove header|Set-cookie.}
{.remove header|ETag.}
:}.}

Option 2) This removes the cookie header, when someone access a folder that contains the name "FolderWithPhotosOne" or "FolderWithPhotosTwo" (you can remove the 'add to log' line, since it's there for testing purposes only, and perhaps this can be further enhanced to search and check if there are picture files on that folder, but that's way beyond my knowledge at the moment):
Code: [Select]
[+request]
{.if |{.match|*FolderWithPhotosOne*;*FolderWithPhotosTwo*|%url%.}|{:
{.add to log|This folder request had cookie headers removed!.}
{.remove header|ETag.}
{.remove header|Set-cookie.}
:}.}

I think the second option was what you were looking for...
Please report here if this solution works correctly. :)

5
Programmers corner / Re: HTTP Header Size Problem
« on: August 28, 2018, 05:24:03 PM »
Possible bug?... ???

This works:
Quote
[+download]
{.remove header|ETag.}
{.remove header|Set-cookie.}

This partially work:
Quote
[+request]
{.remove header|ETag.}
{.remove header|Set-cookie.}

It seems the "remove header" works perfectly on [+download] but on [+request] only remove the header "Set-cookie" but NOT the ETag. I haven't tested using another "Events" (perhaps this is a small detail to fix on the build).

6
Pусский / Re: Вопросы по HFS
« on: August 28, 2018, 03:35:54 PM »
Следуйте за этим:

1) Скачать и разархивируйте этот файл и поместите его в то же расположение hfs.exe.
2) На мгновение закройте сервер и откройте файл "HFS.Events" с текстовым редактором.
3) Измените IP "192.168.0.135" на статический IP вашего посетителя.
4) Запустите сервер снова, и все готово.

Отныне ваш сервер будет реагировать ТОЛЬКО на статический IP вашего посетителя и будет ЗАПРЕЩАТЬ любой другой доступ с другого IP адреса. Пожалуйста, сообщите здесь, если это решение работает правильно.

7
HTML & templates / Re: new responsive template
« on: August 27, 2018, 05:30:03 PM »
Cool! That looks great! :)

8
Pусский / Re: Вопросы по HFS
« on: August 27, 2018, 05:28:14 PM »
Дайте мне несколько дней, чтобы спросить об этом на форуме...

9
Pусский / Re: Русская версия HFS 2.3k
« on: August 27, 2018, 05:24:44 PM »
Скоро буду переводить новую версию 2.3m
Начиная с версии 2.3 m, HFS можно легко перевести на любой язык, просто отредактировав текстовый файл. Вы можете начать перевод HFS на русский язык, загрузив сначала ЭТОТ английский файл и переведя каждое слово после символа "=". Для этого необходимо использовать текстовый редактор Unicode, например Notepad++.

Since version 2.3m, HFS can be easily translated into any language, by simply editing a text file. You could start translating HFS into Russian language, by downloading first THIS English file, and translating every word after the "=" symbol. To do it, you need to use a Unicode text editor, like Notepad++.

Например:
For example:

Английский (оригинал):
English (Original):
Quote
; Kryvich's Delphi Localizer Language File.
; Generated by K.D.L. Scanner, 02/11/2017 23:53:13

Humanize=1
HumanizedCR=\^
HumanizedCRLF=\+

[TdiffFrm]
Caption=Customized options

[TfilepropFrm]
Caption=filepropFrm
pages.permTab.Caption=Permissions
pages.permTab.actionTabs.newaccBtn.Caption=New account
pages.permTab.actionTabs.anyAccChk.Caption=Any account

Русский (Перевод):
Russian (Translated):
Quote
; Kryvich's Delphi Localizer Language File.
; Generated by K.D.L. Scanner, 02/11/2017 23:53:13

Humanize=1
HumanizedCR=\^
HumanizedCRLF=\+

[TdiffFrm]
Caption=Подгонянные варианты

[TfilepropFrm]
Caption=filepropFrm
pages.permTab.Caption=Разрешения
pages.permTab.actionTabs.newaccBtn.Caption=Новая учетная запись
pages.permTab.actionTabs.anyAccChk.Caption=Любой счет

Вы также должны иметь хорошее знание английского языка, чтобы сделать перевод. После завершения перевода hfs.lng файл, затем загрузите его на форум. И не стесняйтесь задавать мне любые вопросы (лучше на английском языке), если у вас есть какие-либо сомнения в том, как это перевести.

You will also need to have a good knowledge of English to do the translation. When you have completed the translation of the hfs.lng file, then upload it in the forum. And feel free to ask me any question (better in English) if you have any doubts on how to translate this.

10
HTML & templates / Re: Simple contact template
« on: August 27, 2018, 05:10:16 PM »
i don't think the eml is constructed correctly either:
https://github.com/ropensci/EML/blob/master/docs/articles/creating-EML.html
@bmartino1: Did you check the link you have posted?...

It's NOT that kind of EML format (Ecological Metadata Language).
It IS this kind of EML format (Electronic Mail, file name extension).

Quote
"EML is a file extension for an e-mail message saved to a file in the MIME RFC 822 standard format by Microsoft Outlook Express as well as some other email programs."

Also, the EML format does NOT start/end with this headers "-----[ BEGIN MESSAGE ]-----" and "-----[ END MESSAGE ]-----". Anyway, please read THIS and THIS page about the EML format before messing with it and making it worst... ::)

Don't worry, if you can't do it (because it's too complex), it's better you leave all as is, until I have enough free time to do a deep review of your code and find the errors. Don't take me wrong, you did a lot of effort and I appreciate it. :)

11
Pусский / Re: Вопросы по HFS
« on: August 25, 2018, 03:54:49 AM »
Приветствую.
 
1. Скачал программу, но интерфейс английский. Есть ли русская версия программы?
Русскую версию можно найти здесь.

2. Если вставить ссылку на файл в окно ввода сообщений в мессенджере ICQ, то происходит закачка этого файла на этот сервер. Ни о какой конфиденциальности не может быть и речи.
Как сделать, чтобы адресат получал только ссылку на файл и мог скачать его у меня, а мыло.ру не получали бы сам файл?
Вы можете защитить паролем доступ к файлам в HFS (щелкните правой кнопкой мыши на Свойства).

12
@bmartino1: I've tested your 'final code revision for form auth' on a desktop browser, and sadly it doesn't work. Although the login design looks nice, you are using a deprecated function (http://user:pass@host), so this also doesn't work on a mobile browser.

I can't find the target variables either.  But, it sure will be easy after we find that!  :D
Password in urls is being blocked by newer browsers, so can't do it that way.
For now, all Firefox, even the mobile, still have the deprecated built in login box.  So, just planning ahead.
I have good news for you: check out THIS new thread... ;)

Cheers,
Leo.-

13
HTML & templates / Alternative login form for modern browsers
« on: August 25, 2018, 03:05:25 AM »
Thanks to danny and his idea (in this post), and after spending several hours finding a solution and doing lot of tests, I think we finally have a working workaround solution for login from mobile browsers (that it even work on desktop browsers too).

1. In the "Virtual File System" box, right click on the first element (Home)
2. Properties
3. Diff template
4. Enter this text:
Code: [Select]
[unauthorized]
<h1>{.!Unauthorized.} {.!&#47; Please login&hellip;.}</h1>
{.!Either your user name and password do not match, or you are not permitted to access this resource..}<br>
{.!Please login to access to your account, and check if you have the correct permissions to continue..}<br>

<br>
<fieldset id='login'>
  <legend><img src="/~img27"> {.!Login.}</legend>
  <center>
    <input type='text' id='usr' size='15' placeholder=" Username" value=""><br>
    <input type='password' id='psw' size='15' placeholder=" Password" value=""><br>
    <input type='button' id='lognow' style="width:110px;" value="{.!Login.}" onclick="NewLogin();">
  </center>
</fieldset>
<br>

<script>
function NewLogin() {
  var xhr = new XMLHttpRequest();
  var ThisFolder = window.location;
  var ThisUser = document.getElementById("usr").value;
  var ThisPass = document.getElementById("psw").value;
  var LoginToken = ThisUser+':'+ThisPass;
  xhr.open("GET", "/~login", true);
  xhr.withCredentials = true;
  xhr.setRequestHeader("Authorization", 'Basic ' + btoa(LoginToken));
  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 && xhr.status == 200) {
      if (window.location.href.indexOf("~login") != -1) {
        window.location.replace('/?success');
        } else {
          window.location.replace(ThisFolder);
      };
    }
    if (xhr.readyState == 4 && xhr.status == 401) {
      alert("Invalid credentials! \(Wrong username or password\)");
    }
  }
  xhr.send();
}
</script>

Please test it and report the results (remember to create an account first on HFS). I've literally wasted all my free afternoon, but I'm happy with the results!. It may not be perfect, so, feel free to adapt/correct/enhance the code... ;)

Cheers,
Leo.-

14
HTML & templates / Re: Simple contact template
« on: August 25, 2018, 03:02:24 AM »
@bmartino1: thanks again for you collaboration. :) I would suggest you to make a 'clean up' on all your messages in this thread (editing them and leaving only one working version of each: one for Macro, another for XML and another for the EML method, to avoid confusion with non-working versions). Then, I will edit my first post and add a link to each of your 3 versions, so, if someone wants to have form validation, it could directly use any of your versions (because, at the moment, I don't see the point of releasing a new own revision, since yours are working mostly correctly and I also don't have the enough free time for doing a detailed code revision now).

@JavaScript Experts: in the EML version I use this unoptimized code:

Code: [Select]
var FullHeaders = Header0+Header1+Header2+Header3+Header4+Header5+Header6+Header7+Header8+Header9+Header10;
Is there a more efficient way of doing this in, using plain vanilla JavaScript? How we could make the variable 'FullHeaders' much shorter, concatenating the variables Header 0 to 10 (perhaps, using an loop array?). But how?... ???

Cheers,
Leo.-

15
HFS ~ HTTP File Server / Re: New version: 2.3m
« on: August 18, 2018, 09:58:24 AM »
Great!, we finally have the first stable version of 2018!... :)

Don't forget to upload the sources file (hfs2.3m.src.zip) in SourceForge.net (which is linked here, in the download section), or if it's easier for you, you can upload it directly, here on your server. The 'What's new' section needs also to be updated (since it's listing updates until version 2.3k) ;)

Cheers,
Leo.-

Pages: [1] 2 3 ... 31