rejetto forum

Feature request: folder access by IP address

0 Members and 1 Guest are viewing this topic.

Offline morituruz

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
Hello and thanks for this great software  :)
I know about User Accounts but i need more «simple» solution.
Example: i want to allow users from my LAN (10.0.0.0/24) to access some folder in HFS, and hide this folder from others.


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link

Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
Change ip and Add diff template
Code: [Select]
[list]
{.if |{.%ip%=192.168.1.2.}|

<div id='files_outer'>
<div style='height:1.6em;'></div> {.comment| this is quite ugly, i know, but if i use any vertical padding with height:100% i'll get a scrollbar .}
{.if not| %number% |{: <div style='font-size:200%; padding:1em;'>{.!No {.if|{.length|{.?search.}.}|results|files.}.}</div> :}|{:
        <form method='post'>
            <table id='files'>
            {.set|sortlink| {:<a href="{.trim|
                    {.get|url|sort=$1| {.if| {.{.?sort.} = $1.} |  rev={.not|{.?rev.} .} /if.} /get.}
                /trim.}">{.!$2.}{.if| {.{.?sort.} = $1.} | &{.if|{.?rev.}|u|d.}arr;.}</a>:} .}
            <th>{.^sortlink|n|Name.}{.^sortlink|e|.extension.}
            <th>{.^sortlink|s|Size.}
            <th>{.^sortlink|t|Timestamp.}
            <th>{.^sortlink|d|Hits.}
            %list%
            </table>
        </form>
:}.}
</div>

|forbidden.}

update for your case:
{.if |{.regexp|10\.0\.0\.|%ip%.}|
or {.if |{.{.regexp|.*\.|%host%.}={.regexp|.*\.|%ip%.}.}| or {.if |{.match|10.0.0.*|%ip%.}|
« Last Edit: December 04, 2016, 11:14:20 AM by dj »


Offline morituruz

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
So year later i discovered that i received a pretty good reply :D
Thank you very much!

Actually i need to deny download of *.html files so now I have that code in hfs.events:
Code: [Select]
[request]
{.if
| {.and
| {.not
| {.or
| {.match | 127.0.0.1 | %ip% .}
| {.match | 10.0.*.* | %ip% .}
.}
.}
| {.match | */some_url_path/* | %url% .}
.}
|
{:{.disconnection reason| IP: %ip%.}:}
.}

Surprisingly wiki page http://www.rejetto.com/wiki/?title=HFS:_Event_scripts does not exist anymore.
« Last Edit: December 11, 2017, 01:56:05 PM by morituruz »


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 842
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Cool! :)

Fortunately, Archive.org still has a copy of it.
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.



Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 842
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Hi rejetto, please check your Wiki, since it seems there is a problem with it because I can't login. It shows this error: "There seems to be a problem with your login session; this action has been cancelled as a precaution against session hijacking. Go back to the previous page, reload that page and then try again.". I've tried to login with another browser, but it shows the same error.

See the screenshot: https://i.imgur.com/erYmd81.png


Searching on Google, here, here and here you can find a possible solution (it seems you have to change $wgMainCacheType = CACHE_ACCEL; to $wgMainCacheType = CACHE_NONE; or changing it to $wgSessionCacheType = CACHE_DB; in the cache settings file, located in LocalSettings.php)

Cheers,
Leo.-
« Last Edit: December 12, 2017, 01:45:02 AM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.