rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: rejetto on May 02, 2020, 05:15:30 PM

Title: delphi 10
Post by: rejetto on May 02, 2020, 05:15:30 PM
hi guys,
this days i had some spare time, so first i reinitialized my Windows system after 5 years. Much better now!
Then i decided to try to go for Delphi 10.3.3, that is the latest free version (it's callled "community edition").
https://www.embarcadero.com/products/delphi/starter/free-download

After many hours I also found Rapid's topic (http://rejetto.com/forum/index.php?topic=11924.0), but too late.
Anyway, i'm probably not finished but it's somewhat working.

https://github.com/rejetto/hfs2/releases

Let me know if you find things not working please.
Title: Re: delphi 10
Post by: SilentPliz on May 02, 2020, 06:08:53 PM
Hi Boss !

thanks for the link for delphi 10. ;)

It's good that you found some free time to post a RC with the source code.

I imagine the 'head' of your Windows after 5 years of bad treatment. :D

Many thanks.
Title: Re: delphi 10
Post by: Mars on May 02, 2020, 06:43:14 PM
this version of delphi can't working on Windows XP  :'(

license is limited to 1 year

Some patches  https://developpeur-pascal.fr/p/___00c-les-patchs-a-installer-sur-la-version-rio-1033-de-delphi-c-builder-et-rad-studio.html (https://developpeur-pascal.fr/p/___00c-les-patchs-a-installer-sur-la-version-rio-1033-de-delphi-c-builder-et-rad-studio.html)
Title: Re: delphi 10
Post by: LeoNeeson on May 02, 2020, 09:53:06 PM
Then i decided to try to go for Delphi 10.3.3, that is the latest free version (it's callled "community edition").
Happy to have some news from you! :)

this version of delphi can't working on Windows XP  :'(
Sadly, I can confirm this... :(

I also use Windows XP daily (on machines that can't get an OS upgrade), so, I support Mars petition of keeping XP support (remember that being XP compatible, is also being ReactOS compatible).

I've tried to compile the latest sources with Delphi 2006 (http://rejetto.com/forum/index.php?topic=13088.0) (to get a XP compatible executable), and it fails, with this error:

Code: [Select]
[Pascal Error] hslib.pas(302): E2004 Identifier redeclared: 'chop'
[Pascal Error] hslib.pas(307): E2004 Identifier redeclared: 'chop'
[Pascal Error] hslib.pas(317): E2003 Undeclared identifier: 'Tbytes'
[Pascal Error] hslib.pas(361): E2004 Identifier redeclared: 'includeTrailingString'
[Pascal Error] hslib.pas(501): E2008 Incompatible types
[Pascal Error] hslib.pas(514): E2008 Incompatible types
[Pascal Error] hslib.pas(536): E2003 Undeclared identifier: 'utf8ToString'
[Pascal Error] hslib.pas(562): E2003 Undeclared identifier: 'charInSet'
[Pascal Error] hslib.pas(611): E2004 Identifier redeclared: 'chop'
[Pascal Error] hslib.pas(626): E2004 Identifier redeclared: 'chop'
[Pascal Error] hslib.pas(639): E2004 Identifier redeclared: 'chopLine'
[Pascal Fatal Error] hfs.dpr(51): F2063 Could not compile used unit 'hslib.pas'

Besides that, your Delphi 10 executable is twice the size of hfs24rc4 (50% bigger), but this is not something as important as keeping backwards compatibility. The drapid's (http://rejetto.com/forum/index.php?topic=11924.0) HFS compilation (https://github.com/drapid/HFS/releases) also has 'draw' (graphical) issues on XP (only the menu is working, but the rest of the GUI interface is not usable), but at least using his (https://github.com/drapid/HFS/releases/download/2.3m/HFS300_RD.exe) version the server runs fine (I have not thoroughly tested).



Let me know if you find things not working please.
Warning: using latest HFS 2.4rc5 (302), if you are upgrading, your old VFS file could get corrupted! This is the error I've got once, when HFS starts:

(https://i.imgur.com/N5gFFay.png)

Then, this is how the GUI looks like on XP:

(https://i.imgur.com/Z5Tq9nEm.png) (https://i.imgur.com/Z5Tq9nE.png)

And the server doesn't work, if you try to open: http://localhost/ (http://localhost/)



license is limited to 1 year
Summarizing (and take this only as suggestion, not a request), if I were Rejetto, I would give the 'jump' to Lazarus v2.0.6 (https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%202.0.6/) which is the latest version being XP compatible, and is much modern than using the old Delphi 2006 (Lazarus has unicode support (https://wiki.lazarus.freepascal.org/Unicode_Support_in_Lazarus) available since Lazarus v1.6.0). Lazarus uses FPC (Free Pascal Compiler), and it's mature enough to be as good as any other commercial compiler. So, besides getting unicode support, I don't see why upgrading to Delphi 10 would be beneficial (well, anyway is Rejetto's choice, he is the boss, and he has the fiinal word on this, and I respect it).

Anyway, I truly appreciate your effort of keeping HFS updated, and thanks for releasing the complete sources of 2.4. As last resource, I think I could compile the source by myself, but only if you keep the sources compatible with Delphi 2006 (I would be happy if you do this).

Well, I hope this can be somewhat sorted, or v2.4 will be the end for some of us... :(

Cheers,
Leo.-
Title: Re: delphi 10
Post by: SilentPliz on May 02, 2020, 09:57:33 PM
Probable answers to the choice of rejetto:

http://docwiki.embarcadero.com/RADStudio/Rio/en/10.3_Rio_-_Release_3 (http://docwiki.embarcadero.com/RADStudio/Rio/en/10.3_Rio_-_Release_3)

The evolution of hfs will be more convincing with a more 'modern' delphi...
We can always continue as much as possible the 'forks' of hfs with delphi 2006.

Not all the libraries necessary to compile hfs are available with Lazarus ... this is the case for the release I am publishing... too many transpositions would be required currently.
Title: Re: delphi 10
Post by: LeoNeeson on May 03, 2020, 01:04:35 AM
The evolution of hfs will be more convincing with a more 'modern' delphi...
We can always continue as much as possible the 'forks' of hfs with delphi 2006.
I totally agree. I always had in my mind that sooner or later a 'fork' would be needed for legacy systems (like Windows XP). It's OK for me having a fork (or compiling my own version, in case it's required). But currently, for legacy systems we still have your own version (http://rejetto.com/forum/index.php?topic=10242.0), so, for as long you keep compiling it with the old Delphi, there is an alternative for those with old systems (like Mars and myself) :)

On a second thought, after all, I hope this modern evolution of HFS would bring (somewhere in the future) the long-awaited native SSL support for all the users. I'm not against the normal evolution of HFS (if I've said 'I would choose Lazarus', that was only my personal preference, but I'm OK with whatever decision Rejetto takes).

Well, anyone tested HFS v2.4 RC5 on Windows 7? I guess that would be the new absolute minimum required operating system of HFS 2.4, right? It would be nice to get confirmation if the VFS gets corrupted (or not) in Windows 7, or if it only happens on XP (to make sure and discard that this is not a new bug introduced on this build).

Leaving that issue with XP behind, I'm happy to see HFS v2.4 is getting closer to have a stable release. Anther good thing, is that the new HFS v2.4 RC5 had zero false positives, so the antivirus now are happy with HFS (see here (https://www.virustotal.com/file/be914f9f6ab8ae75f638fcace463834b5fbbd425056dff0e87cda3e3ee83e0f3/analysis/)). :)

Cheers,
Leo.-
Title: RC4 sources?...
Post by: LeoNeeson on May 03, 2020, 03:52:36 AM
@Rejetto: Do you have RC4 sources? :) so we can see what changed on RC5. If you please can share it with us here, we could compile it with the old Delphi. That way, we could add ourselves the RC5 changes (because RC5 sources can't be compiled with old Delphi). Since RC4 was the last version working on XP, it will be extremely useful to keep track of new changes you could include on successive versions. (Thanks!)
Title: Re: delphi 10
Post by: rejetto on May 03, 2020, 08:55:36 AM
find attached the changes of rc4
Title: Re: delphi 10
Post by: rejetto on May 03, 2020, 09:39:54 AM
this porting to delphi 10 was made mainly because of the unicode and to use something more modern.
There was also no other free delphi versions for like 10 years, so i had not much choice because i don't want to use a non-free version.
In the past I already tried to move to a modern delphi, but I could never see the light at the end of the tunnel, too long, so i gave up.
It took me several days this time, and it was possible because at this very moment I have a stop with my job. It may happen again in 10 years. :)

Unicode support is still not working, didn't work on it yet, i had first to make the rest work. I gave a look anyway and expect it to be not far.

The delphi 10 IDE is quite disappointing in features and bugs.

I didn't think it could break XP compatibility for HFS. I wonder if that cannot be fixed somehow, but I cannot make this attempt myself.
Since my time for HFS is so insufficient i cannot split it on 2 forks, because that would ditch the project. So, if in the end an XP fork is to be, someone else should.
This is all an experiment now, but i hope to not have to go back unless i find something better.

I'm now downloading lazarus and maybe will give it a try, but i cannot spend another week in porting, so i hope that will be smooth.
Title: Re: delphi 10
Post by: rejetto on May 03, 2020, 11:19:14 AM
i had to disable the translation system, the one we added recently, as it was not compatible
Title: Re: delphi 10
Post by: SilentPliz on May 03, 2020, 11:37:20 AM
@rejetto

Your release seems to work on Windows 7 full edition (all menus are present)...
but, I did not manage to login (locally) with FF & Chrome...
and the password field in hfs Others Options > users account is inaccessible (invisible).
We cannot therefore create accounts with password.
            :-\
For the password field, this does not to be serious, it is enough not to hide it any more
when there is no account selected.

@all

Also remember that: 'Windows 7 support ended on January 14, 2020'
Does this hold any unpleasant surprises for us ... Who knows?

Edit: rejetto wrote:
Quote
i had to disable the translation system, the one we added recently, as it was not compatible

Not very good news ... the feature was recently there in your release.  :-\
Title: Re: delphi 10
Post by: rejetto on May 03, 2020, 01:37:50 PM
i made an attempt with lazarus, but i'm stuck trying to compile ICS with fpc.
if anyone is willing to make this other porting i will see what i can do, at the moment my spirit is already worn out by delphi10.

If/when i have more time i would like to try to see if i can use delphi's socket lib instead of ics, and have less dependencies.

i'm going to see if i can fix the unicode now
Title: Re: delphi 10
Post by: bmartino1 on May 03, 2020, 01:44:26 PM
this version of delphi can't working on Windows XP  :'(

license is limited to 1 year

Some patches  https://developpeur-pascal.fr/p/___00c-les-patchs-a-installer-sur-la-version-rio-1033-de-delphi-c-builder-et-rad-studio.html (https://developpeur-pascal.fr/p/___00c-les-patchs-a-installer-sur-la-version-rio-1033-de-delphi-c-builder-et-rad-studio.html)

https://www.componentsource.com/search/product/Windows%20Xp?f%5B0%5D=pt%3A910966
Release Notes: XP compatibility (even though the platform is not officially supported).
looks like a missing dll file
https://stackoverflow.com/questions/48096527/delphi-tokyo-10-2-2-packages-do-not-load-at-runtime-in-win-xp
https://github.com/ccy/WS2_32_XP
Title: Re: delphi 10
Post by: SilentPliz on May 03, 2020, 01:58:21 PM
@rejetto

Are you used ICS-V8.58 (Nov, 2018)... it's the good build for Delphi Rio.

Edit for bmartino1:
Unofficial support for xp is valable for Tokyo relelease, not for Rio release it seem.
The changes are more profound with this release.
Title: Re: delphi 10
Post by: rejetto on May 03, 2020, 04:01:22 PM
i already got presenting and downloading of unicode files working. Now i'll work on saving in VFS files.
https://github.com/rejetto/hfs2/commit/384d2d10f437d2cd34f88888a39a98b77e382b1c

@bmartino1: leo is having not an error message but all screwed, i think it's a different problem

@silentpliz: i'm already using 8.58

Title: Re: delphi 10
Post by: LeoNeeson on May 03, 2020, 07:28:25 PM
find attached the changes of rc4
Thank you! :) (I'll check it later)

i had to disable the translation system, the one we added recently, as it was not compatible
Don't worry, perhaps you will find another alternative in the future.

i made an attempt with lazarus, but i'm stuck trying to compile ICS with fpc.
if anyone is willing to make this other porting i will see what i can do, at the moment my spirit is already worn out but delphi10.
Yes, it seems latest ICS-V8.58 is not compatible with FPC. In case you or someone else is interested on compiling it with Lazarus, the last compatible version, is ICS-V5 (http://www.overbyte.eu/arch/OverbyteIcsV5.zip), according to THIS (http://lists.elists.org/pipermail/twsocket/2016-February/046568.html) message: "It compiles with version 5 (2005-07 (https://web.archive.org/web/20051230164717if_/www.overbyte.be/arch/ics.zip)) and only if you include the units and create objects and events manually."

If/when i have more time i would like to try to see if i can use delphi's socket lib instead of ics, and have less dependencies.
Perhaps that could help to make sources being easily compilable on Lazarus (since latest ICS is not compatible with Lazarus/FPC). We look forward to new changes that you could bring on the future using Delphi 10 (my best wishes on that). ;)  8)

Cheers,
Leo.-
Title: Re: delphi 10
Post by: rejetto on May 05, 2020, 02:27:59 PM
Don't worry, perhaps you will find another alternative in the future.

that, or maybe fixing this library is not hard, but i will have to focus on the basics for now.

but, I did not manage to login (locally) with FF & Chrome...

confirmed, the old build didn't work, but next one will

Quote
and the password field in hfs Others Options > users account is inaccessible (invisible).

that was just the 'group' enabled by default, causing the password to disappear. Fixed in next release, thanks.


I had to revert to zlib included in ICS, as the other one had problems. I'll reconsider this in the future.

New release: please give a look https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha02
Title: Re: delphi 10
Post by: Rapid on May 06, 2020, 01:49:00 PM
Hi Rejetto! This is a great news that you start using github.
I'm not sure what you mean by too late to founding my post?
3 years - it's not too much :)

But as I see you are only at the beginning of rewriting hfs to full Unicode support.
As per my understanding, all AnsiString should be divided into String ot RawByteString.
Because AnsiString is not the same as was String in pre-unicode Delphi.
AnsiString is a codepaged string and it can be even MultiByteString. And that makes it very dangerous to use for unknown incoming bytes.

Code: [Select]
move(idxS[1], result[p], length(idxS));I think this should be as
Code: [Select]
MoveChars(idxS[1], result[p], length(idxS));
It would be great if you could compare your code with mine.
I had to make a big changes because of TreeView unpredictable self-reorganization (all nodes are recreated when monitor is disconnected).

ps.
As you made your work as public, it would be great if you added your coding-standards.
So what merge-requests are you willing to merge.
For example:


Regards,
Rapid D
Title: Re: delphi 10
Post by: rejetto on May 07, 2020, 11:09:57 AM
Hi Rejetto! This is a great news that you start using github.

nice to see you :) and thanks for commenting this

Quote
I'm not sure what you mean by too late to founding my post? 3 years - it's not too much :)

:) i meant i could have started from your base, but i  started from scratch.
Anyway, i'm sometimes taking inspiration from yours, so...thank you ;)

Quote
But as I see you are only at the beginning of rewriting hfs to full Unicode support.

you think? i hoped to be almost finished with the unicode thing  :-\
but i still have to check all 'data loss' compiler warnings, if not all of them.

Quote
As per my understanding, all AnsiString should be divided into String ot RawByteString.
Because AnsiString is not the same as was String in pre-unicode Delphi.
AnsiString is a codepaged string and it can be even MultiByteString. And that makes it very dangerous to use for unknown incoming bytes.

This is an interesting topic.
I like the name rawByteString more, as it expresses what i'm using it for.
First thing i did was to check its definition
> type RawByteString =AnsiString;
I deduced it was just a matter of taste, but I was undecided on what to do as I already had many ansistrings around.
I tried to introduce the rawBS in a few places but I had some compilation issues. IIRC it was on 'var' parameters, it required the exact type. Then considering it as unnecessary I skipped it, as there was much else to do.

I saw the multibyte reference in the doc you are talking about. The only thing i can suppose is that some function may behave differently (through overload) on systems with some codepages. It's not easy for me to test, and maybe some asian user may help.
Anyway, I know I have many asians users and I would expect the problem to have happened even with the previous versions.
The only reports i have received were about unicode filenames.

Quote
Code: [Select]
move(idxS[1], result[p], length(idxS));I think this should be as
Code: [Select]
MoveChars(idxS[1], result[p], length(idxS));

right, i should verify every usage of 'move' against the type of string.
But for ansistring i should still use 'move', as the docs say to use moveChars only for unicode.

Quote
It would be great if you could compare your code with mine.

i should, and i was, but stopped to give priority to more 'apparent' issues.

Quote
I had to make a big changes because of TreeView unpredictable self-reorganization (all nodes are recreated when monitor is disconnected).

what kind of changes? all about strings in main.pas ?
was you using Delphi 10.3 ?
i detached the monitor and all was well, then reattached and the whole program was stuck (CPU 100%). I will investigate. Thanks

Quote
As you made your work as public, it would be great if you added your coding-standards.

i should consider that, even if i'm not very concerned about it. But i'm willing to consider merge-requests.
This project for me is a "survivor", and I hate working with delphi. Yet HFS makes still sense and a lot of people using it.
Title: Re: delphi 10
Post by: SilentPliz on May 07, 2020, 03:17:09 PM

Hi!

I tested 'unicode' with Chinese words:
Treeview (files, folders) ... OK
Accounts name ... OK

But I did not manage to connect with an user account written in Chinese.

The 'Locale of WIN 2007' for the test is in French.
Title: Re: delphi 10
Post by: rejetto on May 08, 2020, 10:41:13 PM
thanks SP, i just fixed a number of unicode problems, including the one you reported
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha03
Title: Re: delphi 10
Post by: NaitLee on May 09, 2020, 12:21:40 AM
Hey, I did a simple test with 2.4 rc5 (alpha 3) for the Unicode problem with my takeback template (http://index.php), but still found something worked wrongly:


With problems above users may feel more uncomfortable than using old version... :( Sorry that I know nothing about Pascal and can do no help to the source code... :-[
Wish these problems can be dealt successfully...
Title: Re: delphi 10
Post by: LeoNeeson on May 09, 2020, 07:26:46 AM
...but GUI (built-in) texts got mad. Setting the meta charset of the template/webpage is useless to the problem.
With problems above users may feel more uncomfortable than using old version... :(
Could you please post a screenshot of how it looks on v2.3m, v2.4 RC4 and v2.4 RC5? (to easily spot the problem). I'm sure some screenshots could give a better picture of the problem (you can upload them on Imgur or as forum attachments).

  • Though the usernames in HFS now saved as Unicode, when I attempting to login as a Chinese username, with takeback template (comes with the alternative login form ver2 by Leo (http://rejetto.com/forum/index.php?topic=13054.msg1065523#msg1065523)) I got "this user does not exist" again as the same as in 2.3m, and with the default template I got a "400 - bad request" then no page on my site can be accessed with that error code...
I wish this could be solved. I hope Rejetto could entirely review the login and logout (internal) functions, specially the logout, as it's being discussed here (http://rejetto.com/forum/index.php?topic=13286.0). Perhaps if he do some changes, your problem could be also solved.

@Rejetto: :-[ :'( Ti prego, per favore, guarda questo messaggio (http://rejetto.com/forum/index.php?topic=13286.msg1065529#msg1065529) e lascia un commento. Grazie...

Cheers,
Leo.-
Title: Re: delphi 10
Post by: dj on May 09, 2020, 08:40:47 AM
but GUI (built-in) texts got mad
save your tpl as "UTF8 with BOM" helps (working example (http://rejetto.com/forum/index.php?topic=11754.msg1065605#msg1065605) of my tpl)
Title: Re: delphi 10
Post by: NaitLee on May 09, 2020, 01:23:02 PM
save your tpl as "UTF8 with BOM" helps (working example (http://rejetto.com/forum/index.php?topic=11754.msg1065605#msg1065605) of my tpl)

Yes it really helps...
It's a pity that I have not know something about BOM before this. But here (https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom) in Stack Overflow says utf-8 with BOM is not recommended...
Should these tough encode problems solved by keeping the compatibility to HFS or following the national standard (http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf) (a pdf, something is in section 2.6 and 2.13)?
Title: Re: delphi 10
Post by: SilentPliz on May 09, 2020, 02:14:47 PM
@NaitLee, dj, all, :) :)

It seems that currently the work of rejetto on hfs 2.5 is directed on the rewriting of the basic functions, in order to (re)find the good functioning of hfs not only in unicode, but also it aims to adapt it to the new 'compiler' requirements.

It's good to point out what is dysfunctioning.

But do not tire yourself too much to adapt your work on your templates day by day, from these alpha versions.

I think it is wiser to wait for a 'stabilization' of the rewriting of the program ... otherwise, you will look like Sisyphus. ;)
Title: Re: delphi 10
Post by: NaitLee on May 09, 2020, 02:38:11 PM
It seems that currently the work of rejetto on hfs 2.5 is access on the rewriting of the basic functions, in order to find the good functioning of hfs not only in unicode, but also it aims to adapt it to the new 'compiler' requirements.

Yes, with several tricks these problems can be avoided. It's a wise choice to adapt the application itself to a stable environment first, then go ahead for these tough but not-so-necessary things.

If this is really hard-as-rock, the Unicode username problem can be put off, since a person with a wide-enough knowledge and technical skill will always try to adapt to a thing rather than always require the thing to change.
But be aware at the login/logout problem, it seems unadaptable to most ones...
Title: Re: delphi 10
Post by: rejetto on May 09, 2020, 05:21:50 PM
Hey, I did a simple test with 2.4 rc5 (alpha 3) for the Unicode problem with my takeback template (http://index.php), but still found something worked wrongly:

thanks for your time! your link was not working, so i just downloaded version 0.13b from your signature.

Quote
The takeback template with Chinese language set even works well in rc4, but get a mess-code problem in rc5: File names are still well, even Korean file names are shown because of the Unicode update, but GUI (built-in) texts got mad.

what are these texts you are talking about? i don't understand.
I tried to install your tpl and saw nothing bad with unicode chars.

Quote
I got "this user does not exist" again as the same as in 2.3m, and with the default template I got a "400 - bad request" then no page on my site can be accessed with that error code...

i tried, with your template, to have an account 會 and could log in successfully.
Let me know if you find exactly how to reproduce the problem.
Title: Re: delphi 10
Post by: rejetto on May 09, 2020, 05:22:22 PM
please use this version for your tests, thanks
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha04
Title: Re: delphi 10
Post by: rejetto on May 09, 2020, 05:24:09 PM
If this is really hard-as-rock, the Unicode username problem can be put off, since a person with a wide-enough knowledge and technical skill will always try to adapt to a thing rather than always require the thing to change.

silentpliz is right, the goal is to have a tool working well LIKE and BETTER than before, all problems must be solved.
I need to know all the problems, but i need to be able to reproduce them.
Title: Re: delphi 10
Post by: Mars on May 09, 2020, 05:25:05 PM

I have very very good news to announce

working as a rebutto from the start with turbo delphi 2006, until then everything was going well, then for some time I had to work on another project which required at least a delphi XE, but despite unsuccessful tests the compilation of hfs did not pass not a few minor modifications still made it possible to obtain an exe but with a display of the huge buttons as I no longer know who made us a capture

I tried the delphi rio on a loaned pc but which only accepts windows 8 at least to work, but it was rather frustrating.

I managed to find the origin of the problem, you have to go into the design of the main.not and modify all the font sizes by increasing them by 2 pixels each, compile the project then return to the normal size of all fonts

So the latest sources can be compiled on a delphi XE2 running under Windows XP


(https://i27.servimg.com/u/f27/16/40/25/39/nibble10.png)

I now need to check the overbyte update and the jcl suite like on delphi rio to complete compatibility with rejetto
Title: Re: delphi 10
Post by: rejetto on May 09, 2020, 05:32:26 PM
save your tpl as "UTF8 with BOM" helps (working example (http://rejetto.com/forum/index.php?topic=11754.msg1065605#msg1065605) of my tpl)

this BOM thing surprises me: templates are going to always be loaded in UTF8.
If you find the latest version to not work like this, please tell me.
I also switched the Takeback tpl to chinese, and everything seemed good.
Title: Re: delphi 10
Post by: rejetto on May 09, 2020, 05:34:43 PM
997/5000
I have very very good news to announce

cool, thanks. Maybe the best solution is to totally remove the font settings from the DFM files ? can you try that way?
Title: Re: delphi 10
Post by: Mars on May 09, 2020, 05:50:35 PM
cool, thanks. Maybe the best solution is to totally remove the font settings from the DFM files ? can you try that way?

deleting or modifying the fonts in the dfm is not enough, it is absolutely necessary to perform the operation for each inspector object of the structure, there are less than ten
Title: Re: delphi 10
Post by: NaitLee on May 10, 2020, 02:23:06 AM
If you find the latest version to not work like this, please tell me.

Should we start a new topic for the Unicode problem? If we are really going to say this here, it may confuse many ones due to how complex the encode problems are...

The previous tests I done are did with alpha3, not so well; but with the new alpha4, it looked better.
As the encode problem should be tested in a full environment, install several versions of Windows with various language(sub-encodes of ANSI), it's really hard for us to summary a solution to solve these things.

Grammar here may not good...

First is the page encode problem, on alpha4 with Takeback (saved as utf8 without BOM), it will not mess-code, but the last utf8 char in a string seems got sliced from its raw data...
 On alpha3, saving template with utf8 w/o BOM will cause messcode(characters without meanings), with BOM/ANSI will not, and works well;
 On alpha4, saving with utf8 w/o BOM will cause the last utf8 char sliced, with BOM/ANSI will cause messcode(almost fullscreen of ? in a diamond shape)...

There's also another thing I want to say: the end of line sequence (Windows as CRLF, Unix as LF)
 before alpha4 the eol sequence is not so necessary, but in alpha4 when I save my template with LF it also gets a messcode(same as with BOM or ANSI)...

Second is the username problem,
Currently I tested 2 usernames: 會 and 老八,

In Original(default) template:
 with a English username I successfully logged in, but with both the usernames I got a "400 - Bad request".

In Takeback:
 On alpha3, try to login as 會 will cause a connection stay in HFS connection list with a status "receiving", and as 老八 it says user not exist;
 When the username data storaged in alpha3 "take a trip" to alpha4, they are shown as masscodes. I renamed them as they can show correctly in alpha4.
 On alpha4, as 會 it still stays there with "receiving", but as 老八 I successfully logged in.

... Ahh, let me take a break from these weirdies...

Edit: I see the login(signin) of my template is unstable in certain condition in alpha4, sometimes the logout works, sometimes cannot login... But give me more time to test them again first...
Title: Re: delphi 10
Post by: SilentPliz on May 10, 2020, 07:49:37 AM
@NaitLee

About 'signin':

Are you tried this release? (alpha 05):

http://rejetto.com/forum/index.php?topic=13286.msg1065625#msg1065625 (http://rejetto.com/forum/index.php?topic=13286.msg1065625#msg1065625)
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 08:30:28 AM
@Nait thanks for your detailed report!
Let me clarify some important things
1) What happened on previous versions is not important, unless something was good on previous and broken on new.
2) Tests should start only from BLANK (clear settings) or from HFS 2.3 data (that must be correctly loaded). Starting with data of previous versions invalidate the results.

Should we start a new topic for the Unicode problem? If we are really going to say this here, it may confuse many ones due to how complex the encode problems are...

staying in this topic is ok, but if you feel like having a new topic you can open it

Quote
First is the page encode problem, on alpha4 with Takeback (saved as utf8 without BOM), it will not mess-code, but the last utf8 char in a string seems got sliced from its raw data...

i saw your screenshot, so i just tried with takeback utf8 without bom, and everything seems well, like this:
Code: [Select]
文件名 (0) 修改日期 大小
Please verify that you have a clean situation before making the test, and if the problem persists then give me information and files i need to reproduce the problem on my computer.

Quote
There's also another thing I want to say: the end of line sequence (Windows as CRLF, Unix as LF)  before alpha4 the eol sequence is not so necessary, but in alpha4 when I save my template with LF it also gets a messcode(same as with BOM or ANSI)...

i tried to save as unix/LF i see no messcode

Quote
On alpha4, as 會 it still stays there with "receiving", but as 老八 I successfully logged in.

now i tried exactly 會 with password "z" and login was ok. Maybe you had problems because of alpha3 shit around.

Quote
Edit: I see the login(signin) of my template is unstable in certain condition in alpha4, sometimes the logout works, sometimes cannot login... But give me more time to test them again first...

logout was fixed in alpha5
Title: Re: delphi 10
Post by: NaitLee on May 10, 2020, 03:15:52 PM
I run these alpha versions mostly with Ctrl & Shift pressed, thus no configuration was loaded.

I tried many times to download alpha5 but failed, since the speed is too slow.
I switched my system language to English just now and did a test with alpha4, but the previous problems are still there with same behavior...

I'm using Windows 10 now. If needed I will do tests in other OS, like Windows 7 and wine/Linux, with different localization set.
Wait me for half one month before I can deal with this problem again...
Title: Re: delphi 10
Post by: SilentPliz on May 10, 2020, 03:21:48 PM
I tried many times to download alpha5 but failed, since the speed is too slow.

http://silentpliz.free.fr/hfs/hfs.exe (http://silentpliz.free.fr/hfs/hfs.exe)
Title: Re: delphi 10
Post by: Mars on May 10, 2020, 03:29:22 PM
Quote
I run these alpha versions mostly with Ctrl & Shift pressed, thus no configuration was loaded.

try to use
Menu >> Debug >> Temporaly reset options
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 04:16:26 PM
I managed to find the origin of the problem, you have to go into the design of the main.not and modify all the font sizes by increasing them by 2 pixels each, compile the project then return to the normal size of all fonts

i tried as you said, but i noticed that the only change in the DFM file was to add "ExplicitLeft". Strange. Maybe i didn't do it in the right way. I did it only for the main form now, if someone will confirm that it's working i'll do it for the other windows.
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 05:19:40 PM
i'm also adding a new feature: hfs.diff.*.tpl placed in the exe's folder will be loaded/applied.
This should help a bit people avoiding modifying the template.
You'll also be able to create simple files to attach on the forum and ask to place them in the folder.
the * is to have multiple files, each with its purpose.
Multiple files will be ordered to have a predictable loading order.
Title: Re: delphi 10
Post by: Mars on May 10, 2020, 05:37:12 PM
i tried as you said, but i noticed that the only change in the DFM file was to add "ExplicitLeft". Strange. Maybe i didn't do it in the right way. I did it only for the main form now, if someone will confirm that it's working i'll do it for the other windows.

I imagine that this is just a problem inherent in the delphi version, and that by doing so we get to initialize the right values quite simply. it is not necessary to add it to the dfm
Title: Re: delphi 10
Post by: NaitLee on May 10, 2020, 05:44:39 PM
I downloaded alpha5 via SilentPliz's link and gave it a try.

The problem is still there, again; but I found something interesting:
 there are just a part of characters got corrupted here, ex. 夹,件,as well as that 會 and some of "\( •̀ ω •́ )✧ ♫"
 but others seems well, ex. 页,期,小
see the screen shot below.

and, when I login as a username with those characters seems well, I succeed; with corrupted ones, I fail with a "receiving" stay there.

We still don't know what caused that problem. I will do tests in another OS tomorrow.
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 05:46:34 PM
naitlee, can you guide me on how to reproduce the problem?
do you think it's possible to do also with default template?
Title: Re: delphi 10
Post by: NaitLee on May 10, 2020, 05:59:32 PM
naitlee, can you guide me on how to reproduce the problem?
do you think it's possible to do also with default template?

I just tried to apply my translation to default template. Attached as hfs.diff.tpl, encoded as utf-8. With the 2 ways I got different result:
 Open that file with notepad, copy-paste all things to diff template in root, it worked perfectly;
 place that file to real folder and bind to root, the file seems got corrupted at some points in its raw data.

So is the function of reading files of HFS or Windows API got wrong?
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 06:21:49 PM
thanks. I did exactly what you said, and it always worked well
(https://i.imgur.com/rXj06GG.png)

So what I think is that there is a difference between our 2 systems.
I can try to workaround this problem, anway. I'm going to give you a version with a different loading method.
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 06:31:09 PM
please, see if this version works
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha06
Title: Re: delphi 10
Post by: SilentPliz on May 10, 2020, 06:53:29 PM

For NaitLee (alpha 06):
http://silentpliz.free.fr/hfs/hfs.exe
Title: Re: delphi 10
Post by: LeoNeeson on May 10, 2020, 07:04:35 PM
i tried as you said, but i noticed that the only change in the DFM file was to add "ExplicitLeft". Strange. Maybe i didn't do it in the right way. I did it only for the main form now, if someone will confirm that it's working i'll do it for the other windows.
On Windows XP it looks the same on v2.4-alpha06 as v2.4-alpha05. It continues to have bad graphics.

I have very very good news to announce
[...]
So the latest sources can be compiled on a delphi XE2 running under Windows XP
Perhaps you could share with Rejetto all the changes needed...
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 07:57:51 PM
On Windows XP it looks the same on v2.4-alpha06 as v2.4-alpha05. It continues to have bad graphics.
Perhaps you could share with Rejetto all the changes needed...

sigh..... i suspected what i did was not enough. Maybe mars could give me its main.dfm, but that may also be not enough.

I may be able to make tests using a VM with XP.
Title: Re: delphi 10
Post by: LeoNeeson on May 10, 2020, 08:30:04 PM
I may be able to make tests using a VM with XP.
How to add an XP Mode Virtual Machine to Windows 10 (https://www.download3k.com/articles/How-to-add-an-XP-Mode-Virtual-Machine-to-Windows-10-or-8-using-Hyper-V-00770) (Another guide here (https://www.tenforums.com/tutorials/135551-hyper-v-add-windows-xp-mode-virtual-machine-windows-10-a.html)) ;)
Title: Re: delphi 10
Post by: LeoNeeson on May 10, 2020, 08:32:05 PM
Is me, or v2.4-alpha06 has broken something?... ???
(I'm talking about the form-based login (https://rejetto.com/forum/index.php?topic=13054.0))

v2.4-alpha05 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha05) = Everything OK!
v2.4-alpha06 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha06) = "bad password"

I'm getting "bad password" with v2.4-alpha06, and I didn't changed anything on the form based login. The password is fine (user is "ABC" and password is "1234").

I know SHA256 was added on v2.4-alpha06, but reading the source code, it should accept MD5 hashed passwords too (like v2.4-alpha05).

Can someone reproduce this?... :-\
Title: Re: delphi 10
Post by: rejetto on May 10, 2020, 09:05:02 PM
i tested using the VM, but could not find a way to make it work. Made several experiments and research. I think the key is that mars used a different delphi version.

the login problem must be because i switched from ICS to delphi library for the md5. I'll see to it.
Title: Re: delphi 10
Post by: SilentPliz on May 10, 2020, 09:13:35 PM
Can someone reproduce this?... :-\

I can test tomorrow.
I don't have a PC at the moment, only a smartphone ... so I do the tests where I can.
Title: Re: delphi 10
Post by: SilentPliz on May 10, 2020, 09:28:51 PM
I think the key is that mars used a different delphi version

XE2, I think. He also tries to adapt your code on Rio from his tests on XE2 ... to obtain an XP compatible version of hfs.
Title: Re: delphi 10
Post by: Mars on May 10, 2020, 09:39:28 PM
sigh..... i suspected what i did was not enough. Maybe mars could give me its main.dfm, but that may also be not enough.

I may be able to make tests using a VM with XP.

sorry for the delay but the last version alpha06 cannot be compiled on my delphi xe2, suddenly I modified the dfm by hand

what is different from the original version is the addition where it seems necessary to have
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
Title: Re: delphi 10
Post by: NaitLee on May 11, 2020, 12:53:30 AM
I did a easy test with alpha6, no messcode anymore ;)

But the login problem seems severe, just like everyone said here.

In Leo's login system, with a English username it says password incorrect; with a Chinese username it leaves a "receiving" connection.
In browser login form, with a English username it succeeds; with a Chinese username I got a deadly "400 - Bad request".
Title: Re: delphi 10
Post by: rejetto on May 11, 2020, 01:50:49 PM
what is different from the original version is the addition where it seems necessary to have
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False

thanks mars. I'll try "parentfont=true", so that the font is just one.
Title: Re: delphi 10
Post by: rejetto on May 11, 2020, 01:51:48 PM
I did a easy test with alpha6, no messcode anymore ;)

But the login problem seems severe, just like everyone said here.

that's wonderful news!
the login problem is silly, and i fixed it very easily, but then had a lot of more work to do for other stuff.
You'll see it fixed in next release, don't worry.
Title: Re: delphi 10
Post by: SilentPliz on May 11, 2020, 02:14:44 PM
the login problem is silly, and i fixed it very easily, but then had a lot of more work to do for other stuff.
You'll see it fixed in next release, don't worry.
Cool! I had done the same tests as NaitLee, with some "é" and  "à" and "e" and "a"  :D ... for the same results (but now I know the vowels better). ;)
The next release will be welcome. ;)
Title: Re: delphi 10
Post by: rejetto on May 11, 2020, 03:12:18 PM
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha07


it took a while because i took care of all the compilation warnings about possible data loss.
still a lot that deserves to be rewritten
Title: Re: delphi 10
Post by: SilentPliz on May 11, 2020, 03:32:35 PM

NaitLee
If rejetto's link is always problematic for you ... you can use the link I gave you yesterday ... I updated it.
Title: Re: delphi 10
Post by: NaitLee on May 11, 2020, 03:43:47 PM
NaitLee
If rejetto's link is always problematic for you ... you can use the link I gave you yesterday ... I updated it.

Okay!
I will be not here and unable to do new tests these days, just hope 2.4 will be accomplished perfectly!

----
Edit: I had a test with alpha7, perfect!

Something mentioned by Leo before: After logout, the user's login information expires after the last marked connection (username@IP) ends.
If I login as a user who have only access to a folder, then enter that folder, logout, back, there leaves an idle connection, and I still opened that page. This keeps the user not truly logged out.
 After this, I copied that page to another tab, and I can access that one too.
 So, if I keep refreshing the half-logged out page (eg. with a setInterval()), I can still access other pages with my session before logout, the session never expires until that connection is kicked.

Is this thing necessary?
Title: Re: delphi 10
Post by: LeoNeeson on May 12, 2020, 04:08:46 AM
Something mentioned by Leo before: After logout, the user's login information expires after the last marked connection (username@IP) ends.
If I login as a user who have only access to a folder, then enter that folder, logout, back, there leaves an idle connection, and I still opened that page. This keeps the user not truly logged out.
 After this, I copied that page to another tab, and I can access that one too.
 So, if I keep refreshing the half-logged out page (eg. with a setInterval()), I can still access other pages with my session before logout, the session never expires until that connection is kicked.
Woohoo! (https://www.dictionary.com/browse/woohoo) :D At least someone was able to reproduce the issue!! (for those reading this post, this small issue is described here (https://rejetto.com/forum/index.php?topic=13286.msg1065626#msg1065626) and here (https://rejetto.com/forum/index.php?topic=13286.msg1065676#msg1065676)). I didn't wanted to bother Rejetto anymore with such a small issue (he is overloaded porting version 2.4 to Delphi 10), but the issue it's still present. I consider this is not very important (since after 30 seconds, the logout is effective), but perhaps if Rejetto could do some extra tweaks, then this could be totally and absolutely perfect. But Rejetto, please don't feel pressured, if can be solved, good, but if not, don't worry... :)
Title: Re: delphi 10
Post by: rejetto on May 12, 2020, 04:15:16 PM
don't worry leo, you are not pressing too much, and the problem is not highly critical ok but surely deserves to be fixed
Title: Re: delphi 10
Post by: rejetto on May 12, 2020, 06:17:36 PM
it's 2020 and you just got the logout button
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08
Title: Re: delphi 10
Post by: SilentPliz on May 12, 2020, 07:05:43 PM
Better late than never. :P
Thank you.
:)
Title: Re: delphi 10
Post by: LeoNeeson on May 12, 2020, 07:20:34 PM
it's 2020 and you just got the logout button
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08
Woohooo!! :D (x2) Now that's big news!!! ;D This day marks a new hit on HFS life. You should be very proud of what you have done (I'm sure v2.4 would be a total success when goes stable to the general public). I'm also very happy of your change to mode=login and mode=logout (it makes template designers life easier). :)

the default template will use this.
I've quickly tested hfs24pre08 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08), and the default template still comes without this (so, I guess it will come out on some next build). It would be nice if it get displayed (as dropdown), the same as the current search button display the search box. I haven't tested the mode=login and mode=logout yet (I will have to look in the source code to see how it works), but if a working example is left on the forum, anyone will be able to test this. :)

Cheers,
Leo.-
Title: Re: delphi 10
Post by: Mars on May 12, 2020, 08:31:56 PM
thanks mars. I'll try "parentfont=true", so that the font is just one.
I do not know if it is an oversight but with parentfont = true which is the default value it does not work, for each component accepting a custom FONT it is absolutely necessary to put parentfont = false everywhere, which also has the consequence of add the other lines to the dfm

(https://i27.servimg.com/u/f27/16/40/25/39/nibble11.png)

there are actually only 5 locations where this is necessary, just do it for one version and this operation will remain operational for the following versions
the list is:
urltoolbar
toptoolbar
graphbox
centralpnl
mainfrm
  select each element successively, change the value from 8 to 6, then immediately return to the value 8, save main.pas and it is final so that the program is displayed correctly on XP
Title: Re: delphi 10
Post by: rejetto on May 12, 2020, 09:02:40 PM
I've quickly tested hfs24pre08 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08), and the default template still comes without this

i'm sorry, please redownload it at the same address :(
Title: Re: delphi 10
Post by: rejetto on May 12, 2020, 09:23:51 PM
thanks mars, your latest instructions produced the expected result!
i'm seeing if i can improve it further
Title: Re: delphi 10
Post by: Mars on May 12, 2020, 10:50:50 PM
always the same aspect, bug still present  :-[
I reloaded the exe but I wonder if you put the last one with the right dfm

i used your dfm to compile and i have no visual flaws ;), then  you will have to install a virtual machine XP  ;D
Title: Re: delphi 10
Post by: dj on May 13, 2020, 12:09:20 AM
I quickly tested the new login system.

It works with localhost, but not with http://192.168.137.1/
! TypeError: crypto.subtle is undefined
Because It (https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle) is available only in https

I also tested Ajax (http://rejetto.com/forum/index.php?topic=13054.msg1065678#msg1065678),
but can't get it work
Title: Re: delphi 10
Post by: Mars on May 13, 2020, 12:54:09 AM
yes you are right

login not working with a request from another computer, but from local computer at ip 127 or 192 in url  its works


the password change method is to be reviewed because of the redirection to ~ login

Code: [Select]
    function changePwd() {
        {.if|{.can change pwd.}
        | ask(this.innerHTML, 'password', function(s){
            s && ajax('changepwd', {'new':s}, getStdAjaxCB(function(){
                showMsg("{.!Password changed, you'll have to login again..}")
                location = '~login'
            }))
        })
        | showError("{.!Sorry, you lack permissions for this action.}")
.}
    }//changePwd


in main.pas  '~login' become obsolete
in hslib.pas  part of  WWW-Authentificate can be removed ??
Title: Re: delphi 10
Post by: LeoNeeson on May 13, 2020, 01:52:44 AM
Because It (https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle) is available only in https
Now time to add https... (https://i.imgur.com/xNUXCkq.gif) (just joking)

I've tested the new build [v2.4 Alpha 8 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08)] and the logout is now 100% -totally and absolutely- perfect (the small issue (https://rejetto.com/forum/index.php?topic=13286.msg1065676#msg1065676) was solved!)
(https://i.imgur.com/ah8Mtea.gif)
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 08:24:58 AM
always the same aspect, bug still present  :-[
I reloaded the exe but I wonder if you put the last one with the right dfm

i didn't upload the changes, as it was not very important. Next time.
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 08:42:08 AM
I quickly tested the new login system.
It works with localhost, but not with http://192.168.137.1/

wow, thanks dj. I'll use that code from github and that's it.
Also: i noticed that everybody is using lowercase, even the standard delphi function, so i'll switch to it.
The case is important because, even if normally the check is insensitive, having a double-hashing makes it case-sensitive.
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 08:53:56 AM
the password change method is to be reviewed because of the redirection to ~ login
in hslib.pas  part of  WWW-Authentificate can be removed ??

i will take care of the password change now.
the basic authentication is still present in the GUI, with the "set user/pass". I'm a bit undecided about this. It may stay for very quick usage, like protecting one file.
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 11:56:22 AM
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha09

this should include winXP compatibility
the previous sha256 lib was for ascii-only inputs. I had to search for an alternative.
i also changed the recent feature i introduced from "hfs.diff.*.tpl" to "*.diff.tpl".
Title: Re: delphi 10
Post by: SilentPliz on May 13, 2020, 02:34:12 PM
I couldn't get this version to work:  :-\

open in browser > /root = connected, but display only a blank page.

open in browser > http://192.168.0.17/ (http://192.168.0.17/)ààà/textfile.txt  display 'Not found' page without asking for authentication at any time.

open in browser > http://192.168.0.17/aaa/textfile.txt (http://192.168.0.17/aaa/textfile.txt)  display the native browser authentification box, ID+PASSWORD doesn't work.

Edit: if anonymous and anyone access are checked, seem to work (free access without ID+PASSWORD is OK), but
if I try to login from the page ... Error / Bad password
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 04:54:43 PM
I couldn't get this version to work:  :-\
open in browser > /root = connected, but display only a blank page.

root doesn't work? i cannot reproduce it

Quote
open in browser > http://192.168.0.17/aaa/textfile.txt (http://192.168.0.17/aaa/textfile.txt)  display the native browser authentification box, ID+PASSWORD doesn't work.

files at the moment don't get the login form. Maybe they should. I worked on folders.
Title: Re: delphi 10
Post by: bmartino1 on May 13, 2020, 05:04:45 PM
alpha test new bug, root/ home folder set access to any accout to root house home folder with real folder unbder no template cahnges,  gives blank page.

is the default template no longer loading?

fresh download and setup of https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08
Title: Re: delphi 10
Post by: SilentPliz on May 13, 2020, 05:22:27 PM
Same as bmartino1

Root protected by an User Acount(with password), acces, upload etc for this account, open (root) in browser (GUI button)... blank page.
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 09:13:57 PM
yes, when the root is protected it doesn't work. Working on it.
Title: Re: delphi 10
Post by: Mars on May 13, 2020, 09:50:40 PM
yes, when the root is protected it doesn't work. Working on it.

the problem is located in Tfile.accessfor

if we put a break at the start of the while assigned(f) , everything seems to work fine

Code: [Select]
while assigned(f) do
  begin
     break;
     .....
Title: Re: delphi 10
Post by: rejetto on May 13, 2020, 09:51:51 PM
give a look please
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha10
Title: Re: delphi 10
Post by: Mars on May 13, 2020, 09:54:23 PM
ok boss i download it and give you a reply in a few minutes
Title: Re: delphi 10
Post by: Mars on May 13, 2020, 10:07:46 PM
there is a bad problem with login , return always bad password when login or access protected resource for the account  is requested, can't test the visibility of page

to successfully connect I have to shortcut the md5 in the template

by doing this modification, the login form is asked for root and connection is good

waht you have updated is good but always prob with global  md5 encryption for password


Title: Re: delphi 10
Post by: LeoNeeson on May 14, 2020, 06:34:45 AM
The good...
I'm surprised of all the good work that has been done in only one day!:

» Alpha 9 (hfs24pre09 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha09)): Now it runs perfect on Windows XP! All the graphical issues were solved. Thanks to Mars for giving all the needed help to Rejetto, and also thanks to Rejetto for the good willingness of keeping XP support (good work to both of you!).

» Alpha 10 (hfs24pre10 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha10)): Login now has UI (User Interface) consistency between folders and files, and it always shows the modal when needed (the browser's login popup is finally gone, and I'm happy on how well HFS is working).

The bad...
Everything is working so well (on hfs24pre10 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha10)), than I'm afraid to report this:

» Login broken on Download Managers: If you try to download a password-protected file using a download manager (like FlashGet (http://www.flashget.com/) or DownThemAll! (https://www.downthemall.net/)) it fails (using a browser is OK). On hfs24pre07 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha07) everything was fine (it downloads a password-protected file normally, as it should), but a bug was introduced on hfs24pre08 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha08) (and it continues on hfs24pre09 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha09) and hfs24pre10 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha10)), and it's giving this:

Quote
Thu May 14 00:35:22 2020 Connecting 192.168.212.1 [IP=192.168.212.1:80]
Thu May 14 00:35:22 2020 Connected.
Thu May 14 00:35:22 2020 GET /favicon.gif HTTP/1.1
Thu May 14 00:35:22 2020 Host: 192.168.212.1
Thu May 14 00:35:22 2020 Accept: */*
Thu May 14 00:35:22 2020 Referer: http://192.168.212.1
Thu May 14 00:35:22 2020 User-Agent: FlashGet
Thu May 14 00:35:22 2020 Pragma: no-cache
Thu May 14 00:35:22 2020 Cache-Control: no-cache
Thu May 14 00:35:22 2020 Authorization: Basic dGVzdCUzQXRlc3Q=
Thu May 14 00:35:22 2020 Connection: close
Thu May 14 00:35:22 2020 HTTP/1.1 401 Unauthorized
Thu May 14 00:35:22 2020 Content-Type: text/html
Thu May 14 00:35:22 2020 WWW-Authenticate: Basic realm="Invalid login"
Thu May 14 00:35:22 2020 Accept-Ranges: bytes
Thu May 14 00:35:22 2020 Set-Cookie: HFS_SID_=UmVqZXR0b0lTYUdlbml1cw; path=/; HttpOnly
Thu May 14 00:35:22 2020 Error occured!

Besides the problem I've reported with download managers, I can't reproduce the last error reported by Mars.
Title: Re: delphi 10
Post by: rejetto on May 14, 2020, 09:37:04 AM
@leo, i just installed FDM to make a test and, as i expected, to make it work you have to use the browser extension, so that it will intercept the cookie/session. The URL is not enough.
Anyway, it should be fairly simple to make a "copy url with session" feature, even in the template itself (the web GUI). The server has to 'get' it, but it will soon.
Let's say the name of the url parameter is the same of the cookie
Code: [Select]
    sid:=conn.getCookie(SESSION_COOKIE);
    if sid = '' then
      sid:=data.urlvars.Values[SESSION_COOKIE];

I don't see any security problem with this. Both the data are totally controlled by the client, and it matters very little the way it sends it.

A different matter is to limit a session to a single IP, which i'm not currently doing. It's a quite a common practice, and easy to do. It's cool that it can probably be scripted in the [request] event. :) I'm wondering if and how i should make it.

Anyway, the session will of course not be valid when you logout, and it expires if not used in 24 hours.

Title: Re: delphi 10
Post by: rejetto on May 14, 2020, 11:13:28 AM
@mars, i too was unable to reproduce your problem.
Be sure you don't have "customized template" please, or let me know if you find how exactly to reproduce, thanks
Title: Re: delphi 10
Post by: SilentPliz on May 14, 2020, 03:12:32 PM
The problem of protected folders seems to have been solved.

A strange thing, however; the first time I launched 'Open in browser' to test on protected folder ... the 'Login required' page was displayed, without a box to enter the ID+PASSWORD.
After closing the page and relaunching 'Open in browser', it worked (ID+PASSWORD box displayed) ... I didn't understand why.

The test PC had never seen HFS, so the configuration was blank.
Title: Re: delphi 10
Post by: LeoNeeson on May 14, 2020, 07:22:25 PM
Anyway, it should be fairly simple to make a "copy url with session" feature, even in the template itself (the web GUI). The server have to 'get' it, but it will soon.
I like that approach :) I will wait the implementation of "copy url with session" in some of your future builds. Even if it's easy to modify the template, I vote for adding this as an option in the menu (see my suggestion below), to make easier to enable this independently of which template the server admin is using (and to avoid people come here asking for help about modifying the template).



» Suggestion: This function is now obsolete:

Menu > URL encoding > Include password in pages (for download managers)
(which makes this URL: http://user:pass@127.0.0.1/filename.rar)

It could be replaced with:
Menu > URL encoding > Include authenticated session (for download managers)
(you could use another text description, but I think this is clear enough)



» Important detail: If the Session-ID is contained in the URL, it should work independently and override the cookies that a download manager could generate (and send on the HTTP headers). For example, FlashGet uses (on the backend) the cookies of IE, but if the user is using Firefox to login (and authenticate), there is no relation between the download manager and the browser. FlashGet generates and negotiates his own cookie (like if it were a browser), so, if you implement this, if the Session-ID is found in the URL, it should override the 'Set-Cookie: HFS_SID_=' sent in the headers of the download manager, or otherwise it will no work (because the FlashGet cookie is independent of the browser). I can provide more details if this is not clear for you (on how FlashGet works), but it works on the same way in another independent download managers, which -are not- a browser extension. Also think on some other users, which are using HFS as a simple binary file server (like this user (http://rejetto.com/forum/index.php?topic=13046.0), which was needing to remove Set-Cookie and ETag), but could want to have password-protection.

Cheers,
Leo.-
Title: Re: delphi 10
Post by: rejetto on May 15, 2020, 10:16:38 AM
A strange thing, however; the first time I launched 'Open in browser' to test on protected folder ... the 'Login required' page was displayed, without a box to enter the ID+PASSWORD.
After closing the page and relaunching 'Open in browser', it worked (ID+PASSWORD box displayed) ... I didn't understand why. The test PC had never seen HFS, so the configuration was blank.

meh, let me know if you find how to reproduce it, because an incognito browser won't
Title: Re: delphi 10
Post by: rejetto on May 15, 2020, 11:21:12 AM
I like that approach :) I will wait the implementation of "copy url with session" in some of your future builds. Even if it's easy to modify the template, I vote for adding this as an option in the menu (see my suggestion below), to make easier to enable this independently of which template the server admin is using (and to avoid people come here asking for help about modifying the template).

i already thought of this, and don't exclude having it in the GUI, but what if you want a link to a file that's in a real folder? only the web side can (for now).
Also: the GUI doesn't have a session. I should provide a new&random one in the URL itself to allow encryption.

Quote
» Suggestion: This function is now obsolete:
Menu > URL encoding > Include password in pages (for download managers)
(which makes this URL: http://user:pass@127.0.0.1/filename.rar)

It could be replaced with:
Menu > URL encoding > Include authenticated session (for download managers)
(you could use another text description, but I think this is clear enough)

This suggestion you make would depend on the session. If the session expires it will not work. Is this ok, i wonder?
i'm not sure i remember the reason for this feature: to allow protected downloads for the download managers we include credentials in the URL for everyone? sounds a bit extreme :-/

Quote
FlashGet generates and negotiates his own cookie (like if it were a browser), so, if you implement this, if the Session-ID is found in the URL, it should override the 'Set-Cookie: HFS_SID_=' sent in the headers of the download manager, or otherwise it will no work (because the FlashGet cookie is independent of the browser).

in your example the session is empty. In such case it is ignored and the URL is used instead. Isn't this enough?

Quote
I can provide more details if this is not clear for you (on how FlashGet works), but it works on the same way in another independent download managers, which -are not- a browser extension.

FDM (i'm using) is independent, but has an extension for extra features, like cookie catching.

Quote
Also think on some other users, which are using HFS as a simple binary file server (like this user (http://rejetto.com/forum/index.php?topic=13046.0), which was needing to remove Set-Cookie and ETag), but could want to have password-protection.

i don't see how this use-case is related to our discussion. It had a small buffer and wanted a smaller header
Title: Re: delphi 10
Post by: rejetto on May 15, 2020, 02:27:56 PM
i re-made the copy url with password feature, with the encryption
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha11

the new URL scheme is
http://host/file-url?mode=auth&u=USERNAME&e=TIMESTAMP&s2=SIGNATURE

u: plain text.
e: UTC timestamp in delphi format. This is optional and currently not used by GUI and default template.
s2: calculated like this: considered X as the part of the URL after the ? and before the &s2, it's sha256(X+password)

Guys.... we almost have expiring links, aren't you happy :)

This is different from mode=login because it's not made for ajax/form.

Anyway, i wish someone else to be checking the security of this new stuff.
Title: Re: delphi 10
Post by: SilentPliz on May 15, 2020, 03:13:33 PM
WoowwW!!!! 8)

HFS is 18 years old ... It seems that he reaches this year 2020, the age of majority.
What great novelties !!!

Thanks thanks Boss !!  :-* ;D 8)

Edit: One or 2 more days, and you will have exhausted all the todo list. :P

I'm a little sad that I can only test from tomorrow. :-\
Title: Re: delphi 10
Post by: dj on May 15, 2020, 06:23:20 PM
Anyway, i wish someone else to be checking the security of this new stuff.

http://192.168.137.1/test/?mode=auth&u=admin&s2=d674e9edc3d3330c93151dad2992bc0e082a18fc6d6d6f7f1155548558f5b1b6 works (even regardless of the chosen template)!

But I did'nt find a "copy url with password" menu option.
Title: Re: delphi 10
Post by: LeoNeeson on May 16, 2020, 05:42:25 AM
i re-made the copy url with password feature, with the encryption
https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha11

(http://theoven.org/Smileys/IPB/you_rock.gif)
Cool! That's AWESOME! Some users were wanting (https://rejetto.com/forum/index.php?topic=13281.0) this feature, so, that's fantastic news! :D

I only had time to make a very quick test today. I will do more tests on this weekend (and report back the results). Have a nice weekend people... :)

(http://theoven.org/Smileys/IPB/snowboard.gif)
Cheers,
Leo.-

But I did'nt find a "copy url with password" menu option.
You have to right click on any file you share on root (it doesn't work for real folder files), and you will find it... ;)
Title: Re: delphi 10
Post by: rejetto on May 16, 2020, 07:08:35 AM
the copy with password is available only for protected resources
Title: Re: delphi 10
Post by: rejetto on May 16, 2020, 10:04:02 PM
i want to specify that the new authenticated links don't limit access to the specific file/folder.
The URL causes a contexual login with user credentials. From there, you can continue with every other resource that's accessible for that user.

This is exactly as it was before, when you had user/pass in the URL. Functionally very similar.

Anyway, i think in the future we may have also another kind of URL, with access only to that specific file/folder.
The easy way is to sign not just the parameters of the URL, but also the resource.
But we cannot use an account password, because no account should really be involved.
So i guess the way to go is to generate a password (automatic) for the HFS instance/installation, to be saved in the INI.
Title: Re: delphi 10
Post by: rejetto on May 17, 2020, 05:53:34 PM
ok, i think next release is good for beta stage
Title: Re: delphi 10
Post by: rejetto on May 18, 2020, 02:46:40 PM
Now time to add https... (https://i.imgur.com/xNUXCkq.gif) (just joking)

i hope to be able to work on that soon, and maybe to have letsencrypt support as well.
consider that there may be some XP problem, because of openssl 1.1.1
Title: Re: delphi 10
Post by: LeoNeeson on May 19, 2020, 07:30:55 AM
Talking about FlashGet, it's now giving a forbidden error: "HTTP/1.1 403 Forbidden". Using your last Alpha11 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha11) or the Beta1 (https://github.com/rejetto/hfs2/releases/tag/v2.4-beta01) build doesn't changed functionality with FlashGet, when using the new URL scheme (?mode=auth&u=USERNAME&e=TIMESTAMP&s2=SIGNATURE). If I'm not mistaken, this could happen because this new URL scheme relies on JavaScript to complete the login and redirecting to the resource (correct me if I'm mistaken).

in your example the session is empty. In such case it is ignored and the URL is used instead. Isn't this enough?
I've removed that part in the example (because it's not relevant), but that doesn't mean the SID is empty (it is 'Set-Cookie: HFS_SID_=xxxxxxxxxxxx', where xxxxxxxxxxxx is the radom SID).

If you want, it's better that you download FlashGet (on you XP virtual machine), and see how it works (it would be easier for you to solve the error). I recommend you to install on a virtual machine this FlashGet v1.6 (http://www.oldversion.com/windows/flashget-1-6) (it's an old version which doesn't install adware if you choose to install it as shareware).

But don't worry about this FlashGet thing (if it's too complex to fix). If it can be solved good, but if not, it's OK for me (that error doesn't affect me too much). :)
Title: Re: delphi 10
Post by: rejetto on May 19, 2020, 09:43:34 AM
Talking about FlashGet, it's now giving a forbidden error: "HTTP/1.1 403 Forbidden". Using your last Alpha11 (https://github.com/rejetto/hfs2/releases/tag/v2.4-alpha11) or the Beta1 (https://github.com/rejetto/hfs2/releases/tag/v2.4-beta01) build doesn't changed functionality with FlashGet, when using the new URL scheme (?mode=auth&u=USERNAME&e=TIMESTAMP&s2=SIGNATURE). If I'm not mistaken, this could happen because this new URL scheme relies on JavaScript to complete the login and redirecting to the resource (correct me if I'm mistaken).

download managers (DM) can manage to download protected resources in several ways.
Let me know if my reasoning is correct.
1) the server replies 401, the DM asks you credentials, and you enter there.
This was working before but it is bad for security because credentials are clear text. I think we should not support it, at least until we have no https. That's why i'm now replying 403 instead. Actually, i should consider this https://en.wikipedia.org/wiki/Digest_access_authentication
Even if I guess many PHP based servers are not using this but sessions, so DM must be supporting sessions. Sessions are important for logout, I expect the browser to not be offering a 'logout' button otherwise.

2) the server uses cookie based sessions, and will give a reply that's good for browsers.
Some DM may use an internal browser to authenticate.
Some may capture the cookie.
Others will be not be able to work, and for these we have the "include password in pages", that puts credentials on all the links. No browser/javascript functionality is required for the DM.

Quote
I've removed that part in the example (because it's not relevant), but that doesn't mean the SID is empty (it is 'Set-Cookie: HFS_SID_=xxxxxxxxxxxx', where xxxxxxxxxxxx is the radom SID).

ok, so you are telling me you get a SID in the URL and a different one in a cookie?
It's strange because if the DM accesses the server with a SID in the URL, the server will 'create' a cookie but with the SAME id.
You sure? I expect this: the browser gets a cookie, then you pass the job to the DM which will get the cookie
1) from the browser, all working, directly
2) through the URL, the DM should have no cookie at this moment because didn't interact with the server yet, it sends a request without a cookie, the server accepts the SID in the URL.

I don't see in which case you should have 2 different SIDs.

Quote
If you want, it's better that you download FlashGet (on you XP virtual machine), and see how it works

i will wait your reply first.

I'm currently working to solve a DoS problem.
Title: Re: delphi 10
Post by: LeoNeeson on May 19, 2020, 07:35:35 PM
You sure? I expect this: the browser gets a cookie, then you pass the job to the DM which will get the cookie
1) from the browser, all working, directly
2) through the URL, the DM should have no cookie at this moment because didn't interact with the server yet, it sends a request without a cookie, the server accepts the SID in the URL.

I don't see in which case you should have 2 different SIDs.

i will wait your reply first.
Exactly! I'm getting 2 different SIDs: one in the browser (where I copy the link with SID), and another different SID is received by the DM (after the DM sends to HFS the link 'with SID in the URL'). :(

These are all the steps on how I'm testing this (using my DM: FlashGet).

1) I open my browser and I copy the link with 'SID in the URL' (I don't use any 'browser integration with DM', but instead I manually copy and paste the link on the DM). On HFS I have enabled the option 'Include password in pages'. And before I leave the browser (Chrome), I check the SID cookie value of my browser (using chrome://settings/cookies), and it gives (in this example), the SID: PBuQoFR45UAAAICpsLLLPw (I did this to compare it with the SID I've got on FlashGet).

2) Then, I go to my DM (FlashGet) and I manually paste the link there (I'm pasting the link with 'SID in the URL'). And this is the result:

Code: [Select]
Tue May 19 15:29:48 2020 HTTP/1.1 403 Forbidden
Tue May 19 15:29:48 2020 Content-Type: text/html
Tue May 19 15:29:48 2020 Accept-Ranges: bytes
Tue May 19 15:29:48 2020 Set-Cookie: HFS_SID_=G2SSqVR45UAAAABUNrjvPw; path=/; HttpOnly

Like you said, the SID in FlashGet should have the same SID than the browser (since the FlashGet result is a response from the server), but instead, HFS is giving to FlashGet another SID (G2SSqVR45UAAAABUNrjvPw).

That's why it fails, because the DM is getting a different SID... :-\
Title: Re: delphi 10
Post by: rejetto on May 20, 2020, 03:44:41 PM
ok Leo, i've used flashget and i've found the bug in HFS. It will work in next release.

Anyway, I said something wrong before: the URL for the file has no SID in it. The parameter S2 is a signature, not a session. The signature will work until you change the password of the user.

Did you see my email about the chrome version?
Title: Re: delphi 10
Post by: LeoNeeson on May 20, 2020, 07:56:25 PM
ok Leo, i've used flashget and i've found the bug in HFS. It will work in next release.
Good! :)

Leo, chill out, have some margarita, you don't need to always specify that your opinion counts so little :D Use the standard IMHO disclaimer.
I'll keep that in mind, thanks... ;D (maybe I have my self-esteem low? :o)

Did you see my email about the chrome version?
Done! (I've replied the email). Sorry for the late reply and thanks for the heads up. 8)
Title: Re: delphi 10
Post by: Mars on May 27, 2020, 08:38:41 PM
I am facing a problem:

despite deleting the hfs.lang file, commenting out the lines concerned in hfs.dpr except line 28 containing uFreelocalizer, I can't get rid of persistent Chinese translations once hfs is compiled

(https://i27.servimg.com/u/f27/16/40/25/39/bug10.png)
Title: Re: delphi 10
Post by: rejetto on May 27, 2020, 09:49:56 PM
mars, do you confirm that your problem is with your compilation and not with my exe?
if yes, moderate yourself  ;D and move your question to the programmers corner
Title: Re: delphi 10
Post by: Mars on May 27, 2020, 11:09:37 PM
you can be reassured, your exe is clean  ;)

the problem is probably localized with me because going back to beta2 it's the same

I'm trying to pinpoint where a replica of the hfs.lng would be stored to get rid of it


I found a track which would be in tools >> translation manager, there is grouped English Japanese French, German,
what I took for Chinese is perhaps Japanese
these languages are they of origin in my intallation of rio on the pc, it is very probable, it is necessary that I find to get rid of the surplus to confirm that it is indeed one of the causes which involves a partial translation