rejetto forum

Recent Posts

Hi all,

Just a random question to all you guys here on the forum about HFS2.3m.

From running my HFS server for quite a few years and using different versions of HFS, I keep seeing a lot of hacking attempts in my logs that have always connected via the IP (hackers that scanned open ports and ) and not many using the domain name I have set up.

I'm unable to filter out the bad traffic at present since the FQDN for my location uses the same  WAN IP scanned to send the traffic through my router to the server network, then to the server on my local network. I.e. DNS for my FQDN is forwarded to my WanIP router > port forward to LanIP where the server resides.

When looking at the logs, there's lots of hacking attempts from people using the IP only based on the GET header HOST detail. I try it from my mobile using my FQDN (like www . mysitedomanname . com  WITHOUT SPACES) and the HOST detail in the GET header shows my domain name.

Is there any way of using the HOST detail in the GET Header to filter out connections?

On the forum I have found something like this line.

I found
{.if|{.%host ==}|redirect to a specific folder.}
and wondered if it could be modified to only accept connections if the HOST field matched my FQDN like
{.if|{.%host ==}|allow connection|disconnect.}

Also, which file I would need to add the line to?

Any and all help would be appreciated.
Español / Re: [Tutorial] Cómo compilar el código fuente de HFS
« Last post by delphin on November 24, 2023, 09:54:10 AM »
Portable Delphi link is not available anymore. 😔
Bug reports / Re: HFS needs restart
« Last post by rejetto on November 17, 2023, 12:05:16 PM »
yes, you can do it externally.
I wrote some instructions about it
but you may prefer other methods
If people know better methods I will update the documentation.

At the moment there's no automatic service installation. Hopefully in the future.
HFS is now cross-platform, and making system dependent actions is harder for me.
Bug reports / Re: HFS needs restart
« Last post by adam on November 17, 2023, 11:41:21 AM »
The good news is that v3 seems to be stable, no crash since I installed it.

Turning it into service: is that something I can do externally? Our software also has service mode, but as far as I recall, our installer does that programmatically, registering the software as a service through Windows API. Also, I also seem to remember that a service running in the SYSTEM account has issues having access to the network, which again may be an issue as long as HFS should serve files from other computers in the network.

Anyway, this is rather just an aesthetical issue, the old one was nicer with the system tray icon.
HFS ~ HTTP File Server / Re: blocking ip-addresses by country
« Last post by rejetto on November 16, 2023, 04:45:05 PM »
I would like to configure the program so that one specific agent can download

this is the server code:
exports.middleware = ctx => ctx.get('user-agent') === 'YOUR_AGENT' || ctx.socket.destroy()

this code check for exact text. Otherwise you can use, for example, ctx.get('user-agent').startsWith('YOUR_AGENT')

be careful, because this code can stop you from using your browser, and to recover you will have to edit file "config.yaml" with an editor
HFS ~ HTTP File Server / Re: blocking ip-addresses by country
« Last post by ALEX on November 16, 2023, 02:58:40 AM »
yes, plugins, but if you don't intend to distribut your scripts/changes, you can just use "custom html" and "server code".
It depends on what you want to do....

I would like to configure the program so that one specific agent can download
sorry, i missed your post for long.
there's no automatic conversion, best way is to re-do the vfs by hand.
thanks for your contribution, i'll see to add it to next version.
Pусский / Re: Ищу адекватный шаблон
« Last post by rejetto on November 15, 2023, 10:36:03 PM »
sorry I don't speak russian, but you may want to have a look at next version

video files are playable only for formats supported by the browser
HFS ~ HTTP File Server / Re: reCAPTCHA for hfs?
« Last post by rejetto on November 15, 2023, 09:53:57 PM »
cool, Leo!
this is how it is done with HFS 3 instead: you put this line in "server code"

exports.middleware = ctx => === '' || ctx.socket.destroy()

i'm considering to offer this as an option
Bug reports / Re: HFS needs restart
« Last post by rejetto on November 15, 2023, 09:44:12 PM »
see if this can workaround your problem with HFS 2

for HFS 3, "browser at startup" is an option you can disable.
The "powershell window" can be avoided by turning hfs into a Service, or using a utility like this
The Service is the right choice for an always-running server.
Hopefully in the future I will make this easier.