Captive Portal - How to manually upload (SFTP) files so it still shows in browse
-
1/ You don't do any similar thing. The files are saved in config.xml to not get lost.
2/ CP is not intended to be used as a webserver. It's a damn simple login page for authentication.May I suggest to focus your completely misdirected efforts elsewhere? There's vHosts package, for starters.
I am experimenting with a branch that makes PFsense NOT a simple web server. And every post I've ever had where you told me it can't be done, I've done it. So thanks for the config.xml heads up - and I am going to do it - I can do this programatically by editing the XML file
This is the developers thread, isn't it? Keep an open mind. My branch is 99% focused on captive portal with VB.NET, JS, and JQuery. You should know by now that I'll find a way, so may as well offer a better solution than my last resort, that we both know sucks
-
afaik port is 8002 for first cp-zone, 8003 for second, n so on
Default lighttpd daemon port for a Captive Portal zone is based on the zone ID. For example, zone ID 2 uses port 8002. There may not be a daemon on port 8000.
-
afaik port is 8002 for first cp-zone, 8003 for second, n so on
Hm? I think you may have misunderstood my answer - looking for a way to upload directly to PFS via SFTP where the files will be seen from browser (right now, it has to be uploaded via the pfs admin control panel – it adds a prefix "captiveportal-" to the file name and adds a link to a different section. Even when replicated the same via SFTP, the file will still not show upin browser.
-
Of course it won't show in browser when your port is wrong. https://doc.pfsense.org/index.php/2.2_New_Features_and_Changes#Captive_Portal
-
Of course it won't show in browser when your port is wrong. https://doc.pfsense.org/index.php/2.2_New_Features_and_Changes#Captive_Portal
This branch is based off PFS 2.1.5
-
Good that you tell us after ~10 posts on this thread. Reminds me why I did put you on my forum ignore list. And back there you go.
-
Good that you tell us after ~10 posts on this thread. Reminds me why I did put you on my forum ignore list. And back there you go.
LOL your 1st troll reply had NOTHING to do with my port, so therefore what you say is 100% moot point. How are you a mod again when you only troll? Name 1 post where you only post 100% relevant info without trolling. Find one, I'll paypal you.
-
Of course it won't show in browser when your port is wrong. https://doc.pfsense.org/index.php/2.2_New_Features_and_Changes#Captive_Portal
This branch is based off PFS 2.1.5
well even if i wanted to help figure it out … i won't bother with unsupported / old releases. you might have better luck if you try this on a current release.
-
Of course it won't show in browser when your port is wrong. https://doc.pfsense.org/index.php/2.2_New_Features_and_Changes#Captive_Portal
This branch is based off PFS 2.1.5
well even if i wanted to help figure it out … i won't bother with unsupported / old releases. you might have better luck if you try this on a current release.
Fairly confident I didn't see in patch notes any changes even remotely relative to what I want done between your version and mine. If i got the latest version I would have the same issue.
If you don't know how to resolve it you don't have to respond or just say "I don't know how". There's no shame here sir.
Edit: latest branch experiences same issue. Happy? Like isaid there's no shame in simply not knowing the answer.
What's with these toxic users that offer no assistance but spam?
-
If you upload it to /usr/local/captiveportal or upload it somewhere and link to it from /usr/local/captiveportal it will be available if it includes "captiveportal" in the name. http://portal_ip:8002/captiveportal-image-asset.png
There is a rewrite in the lighttpd config that disallows the web server from serving any files directly referenced that do not include the string "captiveportal" in its filename (the name of the link in /usr/local/captiveportal)
url.rewrite-once = ( "(.captiveportal.)" => "$1", "(.*)" => "/index.php?zone=guest_zone&redirurl=$1" )
My suggestion is to use one of the many available control panels or CMS to upload assets used in your captive portal page on a separate web server, which is where all but the most basic of portal pages belongs anyway.
-
-
-
If you upload it to /usr/local/captiveportal or upload it somewhere and link to it from /usr/local/captiveportal it will be available if it includes "captiveportal" in the Nain me. http://portal_ip:8002/captiveportal-image-asset.png
There is a rewrite in the lighttpd config that disallows the web server from serving any files directly referenced that do not include the string "captiveportal" in its filename (the name of the link in /usr/local/captiveportal)
url.rewrite-once = ( "(.captiveportal.)" => "$1", "(.*)" => "/index.php?zone=guest_zone&redirurl=$1" )
My suggestion is to use one of the many available control panels or CMS to upload assets used in your captive portal page on a separate web server, which is where all but the most basic of portal pages belongs anyway.
Thanks mate this us perfect and 100% relevant.
I ended up doing just this - the /usr/local/www/ folder is public so made a /cportal folder and uploaded everything there and direct link. Works fantastic. Only had to change some code for this to work. Users can now upload from .NET software and set custom values to skin the UI with ease.
This is what the dev forum is about! Whooo