Serve up a dynamic web page for guests with no login

Posted on
Thu Aug 01, 2019 4:40 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Serve up a dynamic web page for guests with no login

I built a bar in my garage, because I am in my 40s and I now hide from my children in my garage the same way I used to hide from my parents when in my teens.

The point is, I want the neighbors to know when it’s open for entertaining. I will be designing something I can to a “bat signal” in a separate thread.

In the meantime, I want to be able to give friends a website that they can check that lets them know whether there is a party going on. I might even have snapshots or currently playing music. I want them to be able to access this without having access to the rest of my HA.

Plausible solutions:
1. Use python to write a php or html page in the indigo/public folder
2. Uh, um, maybe there’s a way to script copying a control page to the public folder?
3. “I like turtles!”

Thoughts?

Posted on
Fri Aug 02, 2019 1:58 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Serve up a dynamic web page for guests with no login

Add subscribed text alerts, and make the bat signal massive!

PS Saw my first turtle in the wild in February, loved it ;)

Late 2018 mini 10.14

Posted on
Fri Aug 02, 2019 7:52 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Serve up a dynamic web page for guests with no login

Doing a web page is possible, but don't forget that if you want it hosted on your Indigo server you'll need to port forward from your router and set up a DDNS entry as well.

Do you already have a public website somewhere? If so, the easiest way to do it is to make a pair of HTML files that change the status on that page to open/closed, and then use FTP to push the current page up to the server.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Aug 02, 2019 10:22 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Serve up a dynamic web page for guests with no login

mat wrote:
Add subscribed text alerts, and make the bat signal massive!

PS Saw my first turtle in the wild in February, loved it ;)


In time, in time :)

Oh, the turtles reference was my self-depreciating comparison of my general web-server know-how to this kid: https://youtu.be/CMNry4PE93Y

Posted on
Fri Aug 02, 2019 10:32 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Serve up a dynamic web page for guests with no login

FlyingDiver wrote:
Doing a web page is possible, but don't forget that if you want it hosted on your Indigo server you'll need to port forward from your router and set up a DDNS entry as well.

Do you already have a public website somewhere? If so, the easiest way to do it is to make a pair of HTML files that change the status on that page to open/closed, and then use FTP to push the current page up to the server.


Thanks for the reply-
I already have a registered domain and 8176 port-forwarding on, so the access to the public folder should be easy (hence my investigating that first).

I haven’t spun up a web server since 2012, and it was brief at that time to play with php. If that is a better idea, I can do that on my host mac, or on my NAS (Synology DS918+). The main limitation here is putting any dynamic info on the pages (e.g. now-playing, number of people, photos of the party, estimated closing time).

I guess there’s no way to copy an indigo control page to the public folder? At least that would save me having to re-learn web design.

I really suspect there’s an easy kludge for such a limited scope. I’ll look again at some posts i saw for limited-access users.

Posted on
Mon Aug 05, 2019 12:54 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Serve up a dynamic web page for guests with no login

:lol: :lol: :lol: :lol: :lol:

Late 2018 mini 10.14

Posted on
Mon Aug 05, 2019 6:58 pm
virgahyatt offline
Posts: 132
Joined: Jan 11, 2014

Re: Serve up a dynamic web page for guests with no login

Easiest way would be to setup Mac OS Server and use the web server there. It will auto create a landing page that you can edit to display what you want.

Posted on
Sat May 07, 2022 11:07 am
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Serve up a dynamic web page for guests with no login

@mundmc, what did you wind up doing for this ?

Posted on
Sat May 07, 2022 8:53 pm
jltnol offline
Posts: 989
Joined: Oct 15, 2013

Re: Serve up a dynamic web page for guests with no login

FWIW, it would be nice if Indigo allowed access to Control Pages w/o a login. Not sure how hard it would be for that to happen, but it would be nice to be able to use a webpage in Social Media sometimes. I'm sure I can manage the routing and port forwarding to make it happen... but I'm still stuck with everyone needing a login.

Posted on
Sun May 08, 2022 1:05 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Serve up a dynamic web page for guests with no login

Wow- reading this thread i didn’t realize i started it!
I never got back to this one of dozens of projects, but am curious about it still.

Posted on
Sun Jun 18, 2023 9:53 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Serve up a dynamic web page for guests with no login

For perpetuity, I finally figured this out. I wrote a Python script in indigo to update the contents of a file "isParty.txt" to true or false.

JavaScript checks the contents of that file and changes the HTML as a result. It's simple, but it's a start.

HTML:
Code: Select all
<!DOCTYPE html>
<html>
<head>
    <title>Party Status</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
    <h1 id="partyStatus">Checking party status...</h1>
    <script src="script.js"></script>
</body>
</html>


Javascript:
Code: Select all
function updatePartyStatus() {
    fetch('isParty.txt')
        .then(response => response.text())
        .then(data => {
            var statusElement = document.getElementById('partyStatus');
   
            if (data.trim() === 'true') {
                statusElement.textContent = 'A party is happening!';
                statusElement.style.color = '#2ecc71'; // green for party
            } else if (data.trim() === 'false') {
                statusElement.textContent = 'A party is not happening.';
                statusElement.style.color = '#e74c3c'; // red for no party
            } else {
                statusElement.textContent = 'No status found.';
                statusElement.style.color = '#333'; // default color
            }
        })
        .catch(error => {
            console.error('Error:', error);
        });
}

// Update the status every second
setInterval(updatePartyStatus, 1000);


Have I mentioned that ChatGPT 4is really helpful? It took a couple goes for me to push it to understand what I wanted to do.

Posted on
Tue Jun 20, 2023 11:07 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Serve up a dynamic web page for guests with no login

This looks like an excellent templat e doing all sorts of interesting things with an indigo script generated HTML page. Thanks! Going to play with this today.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sun Jun 25, 2023 11:10 am
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Serve up a dynamic web page for guests with no login

Wow- hi praise, I appreciate it! Don't get me wrong, I'm sure this is completely a security nightmare that might be giving Matt and Jay chest pains, but as long as it's used for simple data reporting, I think it's pretty safe.

Posted on
Sun Jun 25, 2023 1:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serve up a dynamic web page for guests with no login

mundmc wrote:
Wow- hi praise, I appreciate it! Don't get me wrong, I'm sure this is completely a security nightmare that might be giving Matt and Jay chest pains, but as long as it's used for simple data reporting, I think it's pretty safe.


Note: plugins can also serve up web content which would be protected by the built-in authentication. Check out the Example HTTP Responder plugin in the Plugin SDK for a great starting point. It's really pretty simple as a starting point.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jun 25, 2023 7:19 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Serve up a dynamic web page for guests with no login

jay (support) wrote:
Note: plugins can also serve up web content which would be protected by the built-in authentication. Check out the Example HTTP Responder plugin in the Plugin SDK for a great starting point. It's really pretty simple as a starting point.


For example, I've written a plugin that serves up dynamic content using Indigo's built-in web server via a single page application (SPA). It's written in JavaScript and I use it to interact with Indigo from desktop and mobile. It's a work in progress. I know there are others that are working on similar things.

I don't bring this up to show off, but to highlight the capabilities of the awesome Indigo Web Server which can handle some pretty cool stuff.

Screenshot 2023-06-25 at 8.11.43 PM-2.png
Screenshot 2023-06-25 at 8.11.43 PM-2.png (327.44 KiB) Viewed 1178 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest