rejetto forum

Recent Posts

1
Everything else / Saying Hi again :)
« Last post by NaitLee on Yesterday at 02:09:34 PM »
I'm saying Hi again :)

If you have ever concerned: I'm living well and happily coding. I'm mostly active on Codeberg: https://codeberg.org/NaitLee

This time I didn't bring an HFS template (or plugin), but my own specialized servers:
  • omnisrv: For serving sites based on markdown files. Static or dynamic site? You choose!
  • servezip: For serving content directly from zip files. Also demonstrates gocryptfs support with fscrypt in "fscrypt" branch.
  • mfs: Minimal and performant server for media files. Supports anti-leech, though no advanced features like uploading or rate-limiting.
They are still in early stage, and should be compiled from source. And they are for using in commandline, not as user-friendly as HFS.

In case you are wondering: I don't oppose modern web frameworks, as used in HFS 3. I personally use web frameworks in some projects too (some of them are not published though). I prefer using Qwik (v2 with Bun) and Fresh.

Here's my personal site you can play with: https://unseen-site.fun/ 
At the moment, it's powered by Qwik. I will switch to omnisrv in later days.

Thanks HFS (both v2 and v3) for telling me how a web server should work, on both backend and frontend. 
And thanks everyone on the forum again, I have learned many things in the old days.

I may stay inactive here as I'm also focusing on system tools and game/GPU programming. 
(a few of these efforts can be discovered in my codeberg or github contributions)

Cheers,
Nait
2
HFS ~ HTTP File Server / Re: update
« Last post by LeoNeeson on November 05, 2025, 04:32:46 PM »
Recently, my server withstood a 2 day ddos attack.  And the good news:  Leo wrote a stability patch which kept HFS on track during edge-conditions where it could go to 0 bandwidth.  But, there was No problem.  Thank you Leo!! 
Thanks, I appreciate the recognition...


Yeah, my ‘minor contribution’ actually involved quite a few hours of debugging issues that came from your recent changes. I haven’t published any patch here, since my fixes weren’t too relevant for the original HFS sources, only for your custom fork. Glad to hear it worked well for your version of HFS though.

As long as it makes you happy (and your server runs faster), that’s cool.
;D
3
HFS ~ HTTP File Server / update
« Last post by danny on November 04, 2025, 03:25:41 PM »
Nice results from the October/November 2025 updates: 

Recently, my server withstood a 2 day ddos attack.  And the good news:  Leo wrote a stability patch which kept HFS on track during edge-conditions where it could go to 0 bandwidth.  But, there was No problem.  Thank you Leo!! 

Also I had made an edit so that HFS did not exit from attempting to update the screen two different ways at the same time.  Leo's patch and my little edit, work together to help the server stay on track during high load. 


P.S.  Bonus method to reduce bot annoyance:  You can require your access url (such as your dynamic dns).  It goes in an HFS events entry (control+F6).  Don't specify a port if it is 80.  Here is a whitelist example by naitlee.  I like it!
Code: [Select]
[+request]
{.if|{.and|
{.!=|{.header|Host.}|localhost:8080.}|
{.!=|{.header|Host.}|127.0.0.1:8080.}|
{.!=|{.header|Host.}|mydomain.com.}|
{.!=|{.header|Host.}|mydomain.com:8080.}
.}|{:{.disconnect.}:}.}
Similar to Apache's htaccess file, you can find many features by searching for hfs events on the forum.
4
HFS ~ HTTP File Server / HFS v2.4, and security update By DANNY
« Last post by danny on August 09, 2025, 02:58:45 AM »
Thanks Leo!   A lot of your suggestions were incorporated into these new versions.  I really would have been lost without your help with it. 
I do like the idea of supporting the many installs of HFS2x, by providing an option for stable and secure.

And now we have the HFS2.4 template, able to run on our stable and secure version of HFS 2.3
Contributors:  Rejetto, DJ, Rapid, NaitLee, Mars, LeoNeeson, SilentPliz, Danny, Bmartino

Large Folder Capable!  No Slow Paging!   It streams the file list no matter how many files. 
It has HFS native upload pages, browser native icons and native javascript, all for going fast and stable.

Consider this an HFS2.3 > 2.4 adapter, because most of the work in 2.4 was the template itself.
*the template is in the zip files with security-patched HFS from http://software.run.place
5
New versions of Throwback are included in the .zip file with the security-patched editions of HFS.
https://rejetto.com/forum/index.php?topic=13703.0
6
Subject: Re: HFS2.x security update 'p5' on suggestion from forum admin
The suggestion that I got, was (paraphrase):  Disable the .exec macro, to help folks sleep better at night. 
Wait a second... a private message from the forum admin?!  (Rejetto) ??? I demand proof, screenshots, and maybe even a signed affidavit from Rejetto himself! ;D Jokes aside, I actually agree that disabling the .exec macro makes sense if it helps you sleep better at night. 8)

These are new 2025 community editions built from a cleaned-up and stable version of HFS.
Just as a side note on your mention about a “community-edition of HFS”, I wanted to clarify something I’ve said in the past. The idea of creating a true community edition was more of a wishful thought on my part, meant to encourage the participation of other professional Delphi developers. In my view, to actually call it a “community edition”, we would need at least three or more experienced developers working together in sync, which, let’s be honest, is very unlikely to happen.

So while your work is valuable and commendable, and I sincerely appreciate your dedication, I believe it’s still more accurate to see it as your own version of HFS, just as Mars once released his own (some spare builds), and others have done too over the years. And if someday I release a version myself, it won’t be a community edition either, it’ll be just my own personal effort, same as yours is now.

Truth is, we’re each working on our own, doing our best to keep HFS alive, and that’s already a big achievement in itself. I just wanted to make that clear, and also to emphasize that in your version, you are entirely free to do whatever you believe is best, regardless of what I or Mars might suggest. That kind of independence is one of the great things about open source. :)
7
HFS ~ HTTP File Server / HFS2.x security update 'p5' on suggestion from forum admin
« Last post by danny on July 30, 2025, 10:30:16 PM »
The suggestion that I got, was (paraphrase):  Disable the .exec macro, to help folks sleep better at night. 

Although a collection of new filters still prevent macro run from remote... yet it is even more comfortable to know exactly what the .exec macro will do.
So, for "p5" (security patch level 5), the .exec macro function has been changed to make a log entry on-screen, and .exec does nothing else at all.

HFS2.3K_299p5 and HFS2.3N_301p5 are available http://software.run.place

P.S. 
The "K" has tighter timings ideal with the faster templates like throwback and stripes, or
The "N" has the language feature and longer timings to tolerate feature-filled templates.
These new 2025 editions are built from a cleaned-up and stable version of HFS.
Edit:  Now we might want to try for a community edition.
 
8
HFS ~ HTTP File Server / Re: HFS v2.x By DANNY
« Last post by danny on July 24, 2025, 12:22:18 AM »
HFS2.3N is released
And the server you'd download from is running the same version of HFS2.3N


It has:
Added security filter from Leo (result is auto ban) for hfs-specific
Added security filters from me (result inactivated) for unspecified
Added Leo's skip the loop filter for graph workload (no load if feature unused)
Added Leo's skip the loop filter for limiter workload (reduced load if feature unused)
Shielded archive links (logged-in users may archive, bots cannot)
Removed version "M" bugged headers mod (to avoid disrupting the data flow)
Removed operationally reliant hardcoded external reference (was outdated)

9
HFS ~ HTTP File Server / Re: HFS v2.x By DANNY
« Last post by LeoNeeson on July 15, 2025, 07:25:35 AM »
Thanks to Leo for help in bypassing the always-on limiters, and this prevents freezes.

Thanks to Leo for updated code that blocks hfs-specific attack, in the .exe, without reliance on any particular template.
Thanks, Danny, for the acknowledgment, I appreciate it.

My only contribution was two small code tweaks, which I’ve shared here in case anyone is interested in reviewing or using them.

Keep up the good work!
Cheers,
Leo.-
10
Programmers corner / Code tweaks for HFS 2.3 users
« Last post by LeoNeeson on July 15, 2025, 07:24:24 AM »
Hello everyone! :)

One of the pillars of open source software is, without a doubt, promoting transparency — the ability to compile the source code yourself (along with verifying its security and understand its functionality). This becomes even more important when we're talking about an HTTP file server. That's why, whenever I collaborate on something, I always try to make my contributions public.


In this case, I want to publicly thank Danny, who recently shared his own customized version of HFS in this thread. I haven't reviewed his changes in depth — I've only briefly tested his version — but I did help him with two small improvements that I’m sharing here in case anyone finds them useful.

Thanks to Leo for help in bypassing the always-on limiters, and this prevents freezes.

That specific tweak is simply the following code (Danny is using an older build: HFS 2.3k, but it's the same and could be used on other versions as well). Personally, I haven’t been able to reproduce any issues that this is supposed to fix, but technically the change should have a positive effect.

The following is a portion of 'main.pas' in 'hfs2.3m.src.zip'
Add the line marked in red, after line 5061 in 'main.pas'


Quote
  with objByIp(data.address) do
    begin
    if speedLimitIP < 0 then limiter.maxSpeed:=MAXINT
    else limiter.maxSpeed:=round(speedLimitIP*1000);
    if limiter.maxSpeed < MAXINT then
    if conn.limiters.indexOf(limiter) < 0 then
      conn.limiters.add(limiter);
    end;



Thanks to Leo for updated code that blocks hfs-specific attack, in the .exe, without reliance on any particular template.

This change is simple: it bans the IP of any user attempting to execute a macro via the URL (which is the cause of the vulnerability described in this other thread), even though a similar IP ban could already be implemented using macros in a template. Personally, I think this may not be very effective nowadays, since many ISPs assign dynamic IPs (often even changing the subnet), or because proxies can bypass this entirely. Still, it’s one more layer of protection that might interest some users.

The following is a portion of 'main.pas' in 'hfs2.3m.src.zip'
Add all these lines, around line 5091 in 'main.pas'


Code: [Select]
  if anyMacroMarkerIn(conn.request.full) then
    begin
    data.disconnectReason := 'Possible security threat';
    add2log('Hack attempt blocked: '+ansiToUTF8(conn.request.url));
    getPage('ban', data);
    conn.reply.mode := HRM_DENY;
    if not isBanned(conn.address, data.banReason) then
      begin
        i := length(banlist);
        setlength(banlist, i+1);
        banlist[i].ip := conn.address;
        banlist[i].comment := data.disconnectReason;
      end;
    exit;
    end;

These were my only two contributions. The rest of the build reflects Danny’s personal choices and ideas.



Anyone is free to compile HFS (there are many users who have already done it), and if you're not sure how, you can check out the tutorial here. That’s all for now. I'm closing this topic since its purpose was simply to share this. If I ever need to add something else, I’ll ask a moderator to reopen it. ;)

Cheers, 
Leo.-