Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Captive Portal - How to manually upload (SFTP) files so it still shows in browse

    Scheduled Pinned Locked Moved Development
    15 Posts 4 Posters 4.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      heper
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • D
        dylanh724
        last edited by

        @heper:

        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.

        1 Reply Last reply Reply Quote 0
        • D
          doktornotor Banned
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • D
            dylanh724
            last edited by

            @doktornotor:

            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

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • D
                dylanh724
                last edited by

                @doktornotor:

                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.

                1 Reply Last reply Reply Quote 0
                • H
                  heper
                  last edited by

                  @dylanh724:

                  @doktornotor:

                  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.

                  1 Reply Last reply Reply Quote 0
                  • D
                    dylanh724
                    last edited by

                    @heper:

                    @dylanh724:

                    @doktornotor:

                    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?

                    1 Reply Last reply Reply Quote 0
                    • DerelictD
                      Derelict LAYER 8 Netgate
                      last edited by

                      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.

                      Chattanooga, Tennessee, USA
                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                      1 Reply Last reply Reply Quote 0
                      • H
                        heper
                        last edited by

                        1 Reply Last reply Reply Quote 0
                        • D
                          doktornotor Banned
                          last edited by

                          1 Reply Last reply Reply Quote 0
                          • D
                            dylanh724
                            last edited by

                            @Derelict:

                            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

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.