rejetto forum

Recent Posts

11
Fran├žais / [SOLVED] Possible cache problem
« Last post by Rom_1983 on November 11, 2022, 07:43:28 PM »
I'm using a HTML page declared in HFS as an index to serve.
In this page, I use Javascript to import HTML partials (it works, I've tested and validated it).
I then use a second JS script to operate on those snippets included in the main HTML.

Problem :
- The second script seems to fail because it doesn't find the nodes he's attempting to target. Indeed, when using console.log() function, it returns an empty node. Yet, both script are loaded at the end of the page, and the second script even wait for the complete loading of the page (in wich the first script import the partials). Also, I've used various technics like async functions, pauses, or await (to wait the first functions to load), with no result.
- When using the Google Chrome inspector, in the "Console" tab, I see that the node is empty (when using console.log() to debug).
- Sometimes it works, especially when I change the content of the 2nd JS script and refresh the page, indicating that a cache problem might occur. But as soon as I push the F5 key again, the script fails again, with the same error messages (again, this is a hint of a cache in action).


Debuging :
Everything works fine if I don't use the first script and just plain copy/paste the snippets in the main HTML, meaning that the 2nd script works.
But it doesn't work anymore if use the importation system : however, I can see in the source code of the page (fully loaded) that the snippets are correctly included.

Important information :
- I checked the "Disable cache" option in the "Network" tab of the inspector.
- I spam F5, Shift+F5, CTRL+F5, with no result.
- I use a DYNDNS to reach my own machine. I use this because : 1) I needed to host the HTML under a server for JS importation to work (because of CORS block), 2) I use a second machine to reach the HTML hosted on the first one, and 3) OBS Studio doesn't allow to reach a LAN machine, he wants a WAN address. :-\

Actual conclusion :
- If Google Chrome doesn't cache, it may be the server serving files who does it.

QUESTION

Is HFS v2 caching things ? If yes, how to disable it for a specific index served ?
12
Beta / Re: version 2.4
« Last post by danny on October 27, 2022, 11:07:51 PM »
. . . it just stops taking new connections, switching the server off and then on fixes it, i couldn't find why this happens and had to resort to run a script that checks 24x7 if hfs is not accepting downloads and kills it and runs it again.
Do you use the Watchcat2 script? https://rejetto.com/forum/index.php?action=dlattach;topic=12055.0;attach=9809

The stuck/off server is made worse by running limits (hfs menu > limits) that make HFS get more busy and stuck more often.
The Worst is Speed limit.  Instead of HFS speed limit, you could spend 3 dollars on a 100 megabit USB2 adapter, assign it a fixed address and assign HFS to the megabit>USB adapter's ip address.   If you were to accidentally get a gigabit adapter, (and therefore get stuck), just go to properties of the network adapter and manually set 100-half.  This also applies to single-thread versions of most web servers. 

Upload and download at the same time will probably get stuck If the connection speed is high.  Perhaps a clever programmer could figure out complete lockout/tagout logic to thoroughly prevent simultaneous uploads+downloads?  The problem is not severe at 100megabit and lower speeds. 

Edit: HFS2.4 RC7 has 'archive-only-selected' for overload protection; however, earlier versions can try to download the entire server with just one click on the archive button (stuck in 1 click).  Possible fixes include search and disable the recursive function. . . Or switch to the RC7 template or takeback or throwback or stripes.  Since the archive feature makes .tar files that the user doesn't want, removing the archive button is an option. 

EDIT:  See HFS 3 https://github.com/rejetto/hfs
13
Programmers corner / Re: Only one thing that wasn't released about HFS...
« Last post by LeoNeeson on October 26, 2022, 05:55:29 AM »
You have read my mind. ;D That's right, I was thinking of using another HFS's instance, to simulate the server (to have an alternative, just in case if someday Rejetto's servers are down). Editing the Windows hosts is one option (and the other is compiling my own executable, and for example, changing 'hfstest.rejetto.com' to a 'xxxxxx.no-ip.com' address).

in the root put  as diff template
[]
1

Yes, that would work (the valid options are: '1' is when is the server is reachable; '2' is when no port specified and '3' is when server does not answer).

And although that would work, you can also run PHP code directly from HFS by calling php.exe using 'exec' (taking as an example, the work done by 'raybob' on his 'FHFS', here).

But I'm interested in having the original PHP code Rejetto have used, because it has a part that would be somewhat difficult for me to replicate (due to my limited knowledge). I mean the part where it detects if is NATted (NAT detection), here:

Quote
http:// hfstest.rejetto.com/ ?port={external_port}&host={external_ip|dns_name}&natted={no|yes}

That's why I hope Rejetto could share the PHP code he is using. :)

He already had released the PHP code for 'ip.php' (for detecting the external IP), here.

So, the only missing code, is the PHP script for 'hfstest.rejetto.com'.
14
Programmers corner / Re: Only one thing that wasn't released about HFS...
« Last post by Mars on October 25, 2022, 07:23:04 PM »
the procedure to reproduce in php seems to be the following

php receives a request from hfs in this format

Code: [Select]
http://hfstest.rejetto.com/?port={external_port}&host={external_ip|dns_name}&natted={no|yes}this should generate a new request using a second channel  from php to hfs on the url of the form

Code: [Select]
http://%host%:%port%/test
if hfs is indeed accessible from the web with this url then it sends as response to php the text 'HFS OK'

from then on the php returns a text by the first channel with '1' as the correct functioning response, otherwise an empty string in the event of an error


*************************************

technically it is possible to simulate this exchange using two hfs sessions and forcing a redirection from hfstest.rejetto.com to a local ip in the windows 'hosts' file by adding this line

127.0.0.1 hfstest.rejetto.com

the server must appear as the php must be launched to listen to it on port 80 and active on 'Any Address'

in the root put  as diff template
[]
1


launch another session of hfs listening on any port other than 80, then launch the "self test", the response obtained will be positively successful

you can also perform this experiment by replacing the localhost address with the local ip (192.168.1.xxx)

If we also use the 'self test' of the hfs of port 80 as a self test, the response will also be positive with 127.0.0.1 , but no response with 192.168.1.xxx
15
Programmers corner / Only one thing that wasn't released about HFS...
« Last post by LeoNeeson on October 21, 2022, 06:00:39 AM »
I totally agree!  100%
HFS should be completely independent!
Hi Rejetto! :D After reading this comment, I've realized there is only one thing that wasn't released about HFS: the PHP code that runs behind hfstest.rejetto.com (Self test). I guess it must be a very simple code (something that any PHP coder could easily replicate it). Anyway, if you could please share it, I would like to have it, to analyze and learn from it (I know it makes a 'ping' from your server to the user's IP, and then it gives a reply with a code).

Do you mind sharing it here? :) (or privately via PM)

Cheers,
Leo.-
16
Beta / Re: version 2.4
« Last post by LeoNeeson on October 13, 2022, 04:18:35 AM »
Is it possible to make a link I created in a folder open in a new tab/window by default, without having to shift or ctrl+click it?
Hi Tim, sorry for my late reply.
It's easy, just do this...

Instructions:
1) Go to HFS, Virtual File System
2) Right-click on the Home/Root
3) Properties...
4) Diff template
5) Paste this text:

Code: [Select]
[+]
<script>
$("div[class^=item-type-link]").each(
 $('a').each(function(){
  $(this).attr('target', '_blank');
 })
);
</script>

6) Click on 'Apply' and 'OK'.
This is only valid for HFS v2.4.0 RC6 (default template)

Cheers,
Leo.-
17
Beta / Make a link open in a new tab/window?
« Last post by TEA-Time on October 10, 2022, 04:10:19 PM »
Hey everyone,


I'm running v2.4 RC7 with the RC6 template.  Is it possible to make a link I created in a folder open in a new tab/window by default, without having to shift or ctrl+click it?  As it stands, it takes the HFS page to where the link points.


Thanks!
-Tim
18
i doubt anyone will actually add 416 to HFS2, but just in case, here is how i added 416 to PHP, the code might be interesting,
https://codereview.stackexchange.com/questions/280259/php-readfile-with-304-not-modified-and-http-206-partial-content-support-httpr
19
HFS ~ HTTP File Server / Re: Why file system cleared?
« Last post by Mars on October 05, 2022, 07:06:04 AM »
the track seems unreliable, the system attributes are not sufficient to prevent a program other than hfs from accessing the VFS file.

I don't see any other solution as it stands than managing a copy of the vfs outside of hfs.

an important thing is to always activate "backup on save" in "Menu > Virtual File System" in order to keep a valid copy
20
HFS ~ HTTP File Server / Re: Why file system cleared?
« Last post by LeoNeeson on October 04, 2022, 09:08:56 AM »
@Mars: Your comment leads me to have this 'theoretical' idea: how about setting up the 'System' file attribute, on the VFS file?. In this way, the file should be considered important enough to not be deleted by Windows or other file utilities. This way, we could discard that some external program could be automatically deleting the file (and concentrate the efforts on knowing if it's an HFS's problem). The 'System' attribute could be changed using Attrib or BulkFileChanger (or any other file utility). What do you think? Is a good or bad idea? (or is useless?)