-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to restrict access to a specific IP per folder #781
Comments
i'm quite sure there's no such feature in hfs2, but you could get the effect with some basic scripting. |
|
For 1) yes, no problem. |
how will hfs know that you are the teacher? |
I work at the pc with IP 10.10.304.99. |
ok, exception made for you, every X has to access folder X and folder 99, right? exports.middleware = ctx => {
if (ctx.ip === '10.10.304.99') return // skip
const n = ctx.path.match(/Platz_(\d+)/)?.[1]
if (n && n !== '99' && ctx.ip !== '10.10.304.' + Number(n))
ctx.status = 403
} put in admin-panel > options > server-code |
Oh, thank you very much!
Now I can access from my smartphone to my PC. But it is allowed to log in as user 1, 2 21 and 27. The smartphone has ip 192.168.178.27. It should only be allowed to have access to folder Platz_27 (which I added). Here are my other settings: |
I'm not sure i'm following. |
Ah - my fault. Thanks for the clarification. |
np, but so, what is the plan, accounts or ips? |
IPs are the correct way. Good to hear that other colleagues like it, too. ;-) |
What I need is to allow my members access based on their static external IP address, blocking them from logging in from different IPs. It would be great if there were plugins that could do this. |
hey, in this issue/topic, accounts are NOT involved, but you say "logging in". |
I remember - many years ago - when I was using HFS there was an option to allow to access a folder only from a given IP-address. I searched in the latest release candidate of today, but did not find this anymore. Is there a solution?
Background: I'd like to use this software (again) in a classroom, where are 25 computers for pupils and 1 for me, the teacher.
Example:
Place 1 with IP 10.10.304.1 should have only access to the folder "Platz_01" and the folder "Platz_99", where the teacher gives (only) download-access to some files/folders to everyone without any permission. (The pupils should not need an account. No pupil should be able to access the account of an other pupil. ;-))
Place 2 with IP 10.10.304.2 should have only access to the folder "Platz_02" and the folder "Platz_99" and so on.
(The teacher can zip the whole folders after the pupils work is done.)
The text was updated successfully, but these errors were encountered: