rejetto forum

Recent Posts

91
Quote
I'm taking note and will try soon. That would be cool.
Woohooooo  ;D

@NaitLee : I don't succeed in using your commandline. I got these error messages in my CMD :

Code: [Select]
192.168.1.1 - - [22/Apr/2022 18:58:39] "GET / HTTP/1.1" 400 -
192.168.1.1 - - [22/Apr/2022 18:58:48] "GET / HTTP/1.1" 400 -
162.221.192.90 - - [22/Apr/2022 19:00:52] "GET / HTTP/1.1" 200 -
192.168.1.1 - - [22/Apr/2022 19:02:42] "GET / HTTP/1.1" 400 -

The 19:00:52 strange IP address correspond to this in HFS (the only entry appearing in it) :
Code: [Select]
19:00:52 192.168.1.1:55200 Requested GET /
192.168.1.1 is my box/router.

EDIT :
162.221.192.90 is an IP from Dallax, Texas, attributed to Zenlayer : https://www.lookip.net/ip/162.221.192.90
The port 55200 has been known for being used by XSAN : https://www.adminsub.net/tcp-udp-port-finder/55200 , https://en.wikipedia.org/wiki/Xsan
This is not duckdns, located in Canada : https://www.ip-lookup.org/location/duckdns.org
Many abuse reported from this IP : https://www.abuseipdb.com/check/162.221.192.90

WTF ?

Edit (02.24AM) :

I'm still attacked, with PHP injections now (see attachment). I find suspicious that the day someone gives me a Python script, someone attempts to hack me. 🚨
I have several enemies due to my Twitch channel, and was aware since I announced the creation of my website two weeks ago, but anyway, I find this surprising.
@rejetto : can you check the script please ?


92
just  a side comment,
I suspect that I can make quite easily such feature in HFS 3, to serve multiple domains each with its folder. Maybe even as a plugin. I'm taking note and will try soon. That would be cool.
I'm in a rush now and cannot study the solution made by NaitLee for HFS 2, but kudos anyway.
that said, HFS is not designed for serving static websites, it's just a secondary feature, so it's good only for simple cases.
93
Hello @NaitLee,

Firstable, if you programmed this right after having read my topic, I want to thank you for your kindness and professionalism 😦. I like seing developers devoted in improving things, that's a great quality in a world often ruled by ignorance and contempt where users are always seen like importunate beggars. A big congratulation 👍

Now, I'm a bit distrustful concerning a program shared on Internet, that could be malicious, so I want to check the code before executing it (it will take me some hours, although the script doesn't seem too long).  That said, it seems interesting since it gives users the full control about the redirection, independently from the DYNDNS providers : no extra accounts connections nor profile tweaking, and that's great !

I've read carefully what you wrote and I have a few questions :

1 - Does the use of the :80 port will affect other programs running like CADDY SERVER, wich could use this port ? What I suspect is : I have several CADDY server binded to various local URL with the :80 port, and if your script doesn't filter the entering URL requesting through port :80, I don't see how your script and servers like CADDY could coexist if your script blindly redirect anything entering through the :80 port.
2 - Is the -b parameter dedicated to that purpose ?
3 - I don't understand the difference between -b and -d : does the first one gives the possibility to analyze the IP requesting, or to route to another computer ? In the second case, HFS should be on that computer, and I don't see why we should precise the HFS location with -d.
4 - What do you mean by "and HFS sometimes exposes an absolute link that have the "true" path" ?

Also, we need to be sure that :
5 - Is the IP "mask" (ex : project1.duckdns.org) chunked with what is added after it by the webusers requests ? Ex : will the request "project1.duckdns.org/stuff/thing.html" be recomposed in "project1.duckdns.org/public_websites/project1/stuff/thing.html" locally ?

94
Hi,

I've tried event script but didn't find a way either...

Once I'm thinking about a "middleware" for HFS 2 to enhance it in a flexible way.

Though I didn't do it earlier, today I took some time to investigate such thing, and by the way did what you may want: "virtual host" :D

I put my work in attachment, if you can do command line & installed Python >= 3.8, it's very easy to get started.

- Install Python, if not yet there
- Extract to somewhere, if on Windows, right-click while pressing Shift, open CMD or PowerShell.
- Inside invoke middle.py, let's say you want the middleware be at port 80, and let HFS 2 listen 8080:
  py middle.py -p 80 -q 8080 -v project1.duckdns.org,/public_websites/project1 project2.duckdns.org,/public_websites/project2
  (you can put this content in file start.bat and start it by double-clicking later)
- Now go to http://127.0.0.1:80/ and see if it works. (Note: now visiters should use port 80 rather than 8080)

There are also parameter -b and -d to listen other addresses. For more help use -h.
That means you can middleware HFS on another computer.

There are also some drawbacks, for example (currently) slower, and HFS sometimes exposes an absolute link that have the "true" path (though still can't access "true" root directory).

This is not yet considered a "project". Further development not guaranteed...
But fixes in short term is accepted :)
95
router & port problems / Routing system, or several roots for several websites ?
« Last post by Rom_1983 on April 21, 2022, 06:56:18 PM »
Edit (2022-04-29) : /!\ DO NOT USE THE PYTHON SCRIPT PROVIDED BY @NAITLEE, UNTIL MORE ARE INVESTIGATED IN THE SECURITY OF THE SCRIPT AND THIS WARNING HAS BEEN REMOVED /!\


Hello,

I have set several alias in DUCKDNS.ORG, like :
  • project1.duckdns.org
  • project2.duckdns.org

all pointing to my home IP address. They are intented to be public websites.

In HFS, I have REAL folders for each of them :

/
|-- project1
|-- project2

PROBLEM

When I share the URLs, they are like :


Code: [Select]
project1.duckdns.org/project1
project2.duckdns.org/project2


and this is ugly.

This is even worse if I store the REAL folders in a parent "empty" folder :

/
|-- public_websites /
                                   |-- project1
                                   |-- project2

wich leads to URLs like :

Code: [Select]
project1.duckdns.org/public_websites/project1
project2.duckdns.org/public_websites/project2


REQUEST

I would like them to be just project1.duckdns.org and project2.duckdns.org, pointing to the REAL FOLDERS whatever the position in the VFS tree.
For this, I see two solutions.

SOLUTION 1 : A ROUTING SYSTEM

This is basically what's called "URL rewritting".

HFS should provide a way to detect the URL typed, and LINK IT (not redirect !) to REAL FOLDERS, as junctions (in Windows) or hard links (in LINUX) redirect resources of a hard disk.
One way to achieve this would be to right-click on folders, set the URL, allowing us to type "/" in order for HFS to "reroute" the "/" root to those resources, depending on a certain hostname detected.
There's already a macro to detect the important part of the URL :

Code: [Select]
{.header|host.}
But I don't see what to do with it in the DIFF TEMPLATE of the "/" node.  :-[

SOLUTION 2 : SEVERAL ROOTS

HFS should provide several roots ("/") in several UI, like if it was hosting different websites.



If there is already a solution, I would be excited to hear it because I'm actually desperate. DYNDNS don't offer the way to set an IP + a route as a suffix, like "/public_websites/project1", wich would help to translate project1.duckdns.org into something like 70.56.33.81/public_websites/project1 and transmit the request, thus allowing HFS to directly receive and interprete the "/public_websites/project1" route but still letting it hidden to the user in his browser.

97
RAWR-Designs / Re: Looking for updated version of Terayon template
« Last post by zippergalio on April 20, 2022, 12:27:47 AM »
Sorry,

Wrong section of the forum. I want to ask site admins/moderators to move my post to the "HTML & templates" section. Thank you!

98
RAWR-Designs / Looking for updated version of Terayon template
« Last post by zippergalio on April 20, 2022, 12:23:35 AM »
Hello,

I'm looking for updated/more recent version of RAWR's Terayon template. I and my colleagues are using HFS 2.3m on several small servers. We've tested all new templates posted on the first forum page, but we still like Terayon the most. Is there a version with recent updates that includes gallery for pictures/preview, audio player for mp3, ape, flac and etc. that does not use flash, maybe optional posters/info/preview for the uploaded files in one folder (if uploaded content is movies - like in some torrent sites), easy change of theme colors for users, maybe chat room and search engine with more advanced search? Is there updated version of this template? Do someone made fork of it?

Although we like Terayon, other more modern and rich-full template suggestions are also welcome (Throwback and Takeback are tested, but we don't like their design).
99
HFS ~ HTTP File Server / Re: how to inline images in folder view
« Last post by NaitLee on April 18, 2022, 04:45:11 PM »
thanks, and thanks ^^ was kindof hoping to avoid needing a list of image formats filenames, given that HFS already seems to know what formats are images and what isn't... but since that info seemingly isn't added to the HTML, i guess it's nearly unavoidable :( also you forgot "jfif" and "bmp" and "ico" ! i don't know what jfif is exactly, but it's some kind of obscure image format, because HFS knew its an image (the screenshots in the top post actually contains a jfif ^^)

To tell truth, HFS doesn't know "much" -- it's because a Windows system applications have support, and associated to the file extension to open it directly. You can see the icon is from that application. HFS just see you're listing the file, then query Windows (just) for an icon.

The way Web (browser) know what's it is "MIME type". HFS have some common MIME types built in, but not eg. jfif.

I tried to make jfif image but both GIMP and ImageMagick didn't work. It's so rare...
(KDE desktop lists it as a kind of "JPEG image")

But since you already know the way, adding few more isn't a big deal, right? ;D

... messy? try looping an array:
Code: [Select]
['.jpg', '.png', '.gif', '.webp', '.jfif', '.bmp', '.ico'].forEach(function(t) {

    document.querySelectorAll('a[href$="' + t + '"i]').forEach(function(e) {
        // ...
    });
});
(jfif not guaranteed to show in browser)
100
HFS ~ HTTP File Server / Re: how to inline images in folder view
« Last post by hanshenrik on April 18, 2022, 12:11:16 PM »
Rejetto could give you a much better answer than mine, but AFAIK this is a normal behavior, since thumbnail icons are automatically generated by HFS (following a numerical order), based on the registered file extensions found on a Windows system
i think i get it, thanks!  and so far HFS2 has everything i need for a small photo gallery + file sharing among friends thing, and it is much easier to set up than.. idk, Apache+mysql+php whatever alternative ^^ (and i did briefly check out HFS3, and quickly determined that it's not nearly as user-friendly as HFS2 yet, and ignored it ^^)

Hi,

Great DIY job :D

To ignore the dynamic icon problem, in your code replace the selector-parent-each line with this:

Code: [Select]
document.querySelectorAll('a[href$=".jpg"i],a[href$=".png"i],a[href$=".gif"i],a[href$=".webp"i]').forEach(function(e) {
thanks, and thanks ^^ was kindof hoping to avoid needing a list of image formats filenames, given that HFS already seems to know what formats are images and what isn't... but since that info seemingly isn't added to the HTML, i guess it's nearly unavoidable :( also you forgot "jfif" and "bmp" and "ico" ! i don't know what jfif is exactly, but it's some kind of obscure image format, because HFS knew its an image (the screenshots in the top post actually contains a jfif ^^)