rejetto forum

Recent Posts

1
Everything else / Best DynDNS alternative: FreeDNS.afraid.org
« Last post by LeoNeeson on November 22, 2022, 08:46:34 AM »
Many users of HFS have asked in the past (on this forum), what is the best alternative to DynDNS, and from my own experience, nothing beats FreeDNS.afraid.org
(and this is NOT an advertisement, since I'm not getting paid for commenting this).

His owner (Joshua Anderson) is very friendly, and his services are trustworthy (he has more than 20 years of experience, working online since 2001). You can use it for free or by paying only $5 USD/monthly ($60/yr). Although I'm not a Premium member of them (since I currently can't afford it), I highly recommend it to anyone here, and I can't say enough good things about this service.

You can use your own domain (to delegate your DNS to them) and start using it to self-host content (for example, using HFS as server); or by choosing a subdomain from any of their 41,950 domains, which half of them, are only available if you are a paid customer (by getting a Premium Membership). But if your budget is tight, you can use a subdomain, and start using it for free, for as long as you want.

If you need any help to configure and use it with HFS, just leave a message here, and I will try my best to help you. :)

Cheers,
Leo.-
2
Bug reports / There was a message here yesterday...
« Last post by LeoNeeson on November 17, 2022, 03:55:25 AM »
» Edit: there was a message here, only valid for yesterday: November 17, 2022 (but it seems he has forgotten about us: his loyal community of users ). By the way, my message now it's being replaced with the following image (as a meme). From my point of view, this is how it looks for the average user of HFS v2...


Versione italiana per lui (English version for the rest, here)

...I don't want to sound dramatic, but when HFS v3 started flying high (and when v2.4 stalled with an ‘RC’ version, without ever seeing a final stable version), from that moment I began to worry. The difference with my comparison, is that this was intentional (in favor of the new v3.x), and not something accidental, since the ‘captain’ got tired of supporting the old v2.x branch. But don't worry, HFS v2.x is unsinkable .

Sorry, I had to say it.- 8) ;D ::)
3
HFS ~ HTTP File Server / Re: Rejetto HFS file server alternative?
« Last post by Mars on November 15, 2022, 03:44:12 PM »
Why shouldn't you wake a sleeping cat?
Cats who are deprived of these stages of sleep can become lethargic or irritable, it is therefore better to avoid waking them up as much as possible

and I must say that taking care of an awakened Fysack is not easy  ;D ;D ;D
4
HFS ~ HTTP File Server / Re: Rejetto HFS file server alternative?
« Last post by LeoNeeson on November 15, 2022, 04:30:53 AM »
madmax leo my man
Fysack! it's been a long time since your visit on the forum. I'm wondering how are you (I hope you are doing well). HFS v2 needs your fixes! ...and this forum some more action.
5
Programmers corner / Re: Macros matching only a Content-Type
« Last post by LeoNeeson on November 12, 2022, 02:56:04 AM »
I've also tried this (without success, since it doesn't work as expected):

Code: [Select]
[pre-filter-request]
{.add header|Expires: 0|if=
   {.and
      |{.match|*text/html*|{.header|Content-Type.}.}
   .}   
.}

Neither this works...

Code: [Select]
[pre-filter-request]
{.if|
   {.match|*html*|{.header|Content-Type.}.}|
{:
          {.add to log|Web site served 2.}
  {.add header|Expires: 2.}
:}
   .}
.}

This is puzzling, but after many crazy tests, I think we got a bug...

See, this example SEEMS to working (but it's working bad, see at the end):

Code: [Select]
[+request]
{.disconnection reason|It seems to work since all UA have Mozilla|if=
   {.and
      |{.match|*Mozilla*|{.header|User-Agent.}.}
   .}   
.}

But this another example should NOT work (since 'Content-Type' can never be 'Mozilla'):

Code: [Select]
[+request]
{.disconnection reason|Whoa there, something is wrong here|if=
   {.and
      |{.match|*Mozilla*|{.header|Content-Type.}.}
   .}   
.}

And another crazy example...

Code: [Select]
[+request]
{.disconnection reason|It should work since there is no mysterious browser|if=
   {.and
      |{.match|*mysterious*|{.header|User-Agent.}.}
   .}   
.}

» Result: Something weird is happening here (or I'm doing all wrong)... :o

*** Since I already know Rejetto is not actively working on v2.4x (and I don't expect him to do it), I'm open to receive the modifications needed in the source code to fix this (since I can compile HFS by myself). ***
6
Programmers corner / Macros matching only a Content-Type
« Last post by LeoNeeson on November 12, 2022, 12:52:55 AM »
After reading this post, I have a hypothetical question about macros. I already know how to make a macro that match a file extension in a URL (for example: {.match|*.jpg;*.gif|%url%.}), but I don't know how to ONLY match a 'Content-Type' found in a header. (I've read the Wiki, but found nothing relevant to my question)

I've tried with the following, without success:

Code: [Select]
[pre-filter-request]
{.if|{.match|*text/html*|{.header|Content-Type.}.}|{:
{.add to log|Web page was served.}
{.add header|Expires: 1.}
:}.}

My idea is ONLY match requests, with any of these headers:

Content-Type:"text/html; charset=utf-8"

and/or

Content-Type:"text/html"

Do you know how to ONLY match a header, with a 'Content-Type' of 'text/html'?. I do NOT want to match files with *.html or *.htm extension (I repeat: I do NOT want to filter or match files by extension). The type of 'Content-Type' was only an example, but it can be any other type.

What am I doing wrong?... :-\
7
Français / Re: Possible cache problem
« Last post by Rom_1983 on November 11, 2022, 11:50:41 PM »
Thanks for the answers @LeoNeeson, but I found the source of the problem : it was probably a mix of my Javascript bugging and of the URL I used in my second computer.

I used my real IP with the port :80, and I worked to rewrite my JS scripts.

After a simple test with the new URL showing that a simple HTML line was correctly displaying, I started to rework my code.

I found that my second script was not seing the first script DOM modification probably because it was doing it too fast. So I added a pause somewhere (after billions of rewrittings ^^) and it finally worked.

Here's an excerpt of my code if you want just an insight :

At the bottom of my <body>, I call my JS controller :
Code: [Select]
<script>
window.onload = function(){
jsController();
};
</script>

In my controller :
Code: [Select]
async function jsController() {

console.log("jsController() => Lancement.");
await includeAllPartials(root); // We import the HTML snippets.
// await includeHTML(); // To use with w3_includeHTML.js, alternatively of the includeAllPartials() method if it fails.
await pause(1000); // Absolutely necessary for the DOM to be rewritten after the importation, or launchCarrousel() won't find the nodes.
await launchCarrousel();

}

I made me going crazy for 6 hours, but I finally found the light.

Quote
Can you upload those files you use?

Can't do this for now, I need to complete my work for the next weeks. In a near future, I should share it on Github.
It's a simple HTML that allow to import other HTML in wich I create <article> of news, and the main HTML is then used in OBS Studio to display some news in a carrousel, one by one.

Quote
In the meantime, the solution to avoid the cache, is adding a random number to the URL of your .js (JavaScript) files
That's a crazy good workaround. I'll try to remember it the next time I'll face such a "cache" suspicion. ^^

Cheers.

PS : go to twich.tv/sandwich_ttv if you want to watch the carrousel in action in my VODs.
8
Français / Re: Possible cache problem
« Last post by LeoNeeson on November 11, 2022, 11:20:46 PM »
» Edit: after reading your message below...

Can you upload those files you use?
Can't do this for now, I need to complete my work for the next weeks. In a near future, I should share it on Github.
It's a simple HTML that allow to import other HTML in wich I create <article> of news, and the main HTML is then used in OBS Studio to display some news in a carrousel, one by one.
Don't worry, I don't need it (it was only to help you, but you have solved your problem)

Thanks for the answers @LeoNeeson, but I found the source of the problem : it was probably a mix of my Javascript bugging and of the URL I used in my second computer.
You're welcome, I'm glad you solved the issue.  :)

Cheers,
Leo.-
9
Français / Re: Possible cache problem
« Last post by LeoNeeson on November 11, 2022, 09:26:05 PM »
In the meantime, the solution to avoid the cache, is adding a random number to the URL of your .js (JavaScript) files. I've asked you to upload the files, to give you a direct solution, but if you can do it by yourself (adapting it to your code), you can try something like this:

Code: [Select]
<script type="text/javascript">
    document.write('\x3Cscript type="text/javascript" src="script.js?r='+ (new Date()).getTime() +'">\x3C/script>');
</script>

Or something like this:

Code: [Select]
<script>
    var axel = Math.random() + "";
    var num = axel * 1000000000000000000;
    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.setAttribute('src', 'script2.js?r='+ num +'?');
    document.write(script.outerHTML);
</script>



Another possible solution (at server level, without changing your code).

1) In HFS, press Alt+F6 (or go to: Menu -> Other options -> Edit event scripts)

2) When it opens the 'hfs.events' file, paste the following code:

Code: [Select]
[pre-filter-request]
{.add header|Cache-Control: no-cache, no-store, must-revalidate.}
{.add header|Pragma: no-cache.}
{.add header|Expires: 0.}

This is the most cross-browser headers I've found to avoid cache (supporting HTTP 1.1, HTTP 1.0 and proxy clients). If you only need to support 'HTTP 1.1', then you can skip the last 2 headers ('Pragma: no-cache' and 'Expires: 0').

If my solution has solved your problem, leave a comment here, as reference for other users (in case someone comes with a similar issue in the future). :)

Hope this helps,
Leo.-
10
Français / Re: Possible cache problem
« Last post by LeoNeeson on November 11, 2022, 08:14:45 PM »
Hi!, I will try to help you...

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.
Can you upload those files you use? (to try to replicate the error and think of a solution). In case these files contain private content, you can remove the private parts, and upload those files as a .zip file (as attachment on the forum).