I’ve been building this little app that runs on our work computers. It just some little maintenance stuff at night while we’re out of the office. I added in some functionality the other day so that it connects to a web site and sends its status info in a user agent string. This was pretty cool, cause I can monitor what it’s doing from home. But then I got to wondering, can I remotely change this thing’s configuration settings over the internet? Like switch certain options on or off?
How would I go about such a thing?
Ideally, I would like to have a very basic web page with control panel of sorts, which can then submit the settings to the currently running software.
I have no idea where to even start with something like this. How do you get two things so talk to each other over the internet? What are the core pieces of knowledge I need to look into?
Unfortunately, this leans towards the open-ended side of questions, but I’m a newbie in this area, and could use a point in the correct direction.
My recommendation is to stop using a thick client and prepare to move this to a web based client. This will allow a central point of connection and you won’t have users not updating their client when you need them to perform said updates.
The architecture you may want to consider is a application server, such as Django (since you are using Python). What will happen is you will deploy the application (thin client) to Django and users will now connect to this piece via sessions that the server spits out for them. By doing this it allows you to administer all of the users from one location and flip switches as you desire. At the end of the day this also lowers maintenance costs of both software and of time spent trying to troubleshoot desktop clients.
COMMENT
Well the way it works is there are two types of configuration files. One is user defined, for instance if the user has a preference to show text in Blue and you store that information the server doesn’t care about it as they are generally stored locally.
Now in terms of server configuration files there are a couple of things you can do:
Configure permissions via roles
this entails that you update permissions for users based on their roles. When this update occurs you must terminate all active sessions that would be impacted so the new permissions hit those users, or you can wait for the session to timeout by itself and the new permissions will be picked up.
Modify application server settings
This requires taking down the application, such as maintenance issues that need to be handled i.e. patches.
The program doesn’t poll the server, the server pushes down to the clients. That isn’t even completely true, the clients connect to the server and if there is new data the client receives it generally over a socket. Your session will store the majority of the information which is why it needs to be refreshed/destroyed periodically (logout, etc).
In terms of the program getting its settings, yes. The users have “dummy” terminals that connect to the application, these accounts are generally read only. As such they cannot modify the contents of the server nor should they be able to for security purposes. When the users connect the application will connect to the database and retrieve credentials (you can also use certificates I recommend this approach). Based on the credentials the user has connected with the application will serve that base “profile” to the user plus any user specific information that the server knows about i.e. display name/ last login date.