-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Polyboard is basically just a fancy dashboard template, but with a very extensible module system, and security features!
The overall idea of the modules is that they are separated, but by no means sandboxed. So that you can do whatever you need to do in each module without being prevented from interacting with different parts of the program.
Each module can have one or more tabs, each of which can have one or more pages. Each page can be in a folder, and must reference an HTML file in a page. Each page also must have a permission group that the user must have to access the page. If you don't care about this, you can set it to blank.
In python, the ModuleManager class has all the utility functions that you should need to interact with users, sessions, and anything else. If there is something that isn't there, you can just add it.
This object is given to the modules, when the program init's
There are two protocols that are stacked on top of each other that make up the networking of this.
rawClients are given a random clientID when they connect, and they handle combining the server-side events and http requests that make up the networking
authClients are rawClients that have gone through the login and can be trusted. They have a user object and a rawClient associated with them.
When the program starts it does several things:
- Parses the arguments.
- Check creds.json: If there is not a creds.json file, it will create it.
- Check ssl.crt and ssl.key, if these do not exist, the program will create it.
- Imports each module as if it was a python import
- Loads the webserver, and all of the things associated with it.
- Runs the "init" function in all the modules, and after which, none of the modules can create any new listeners. This is run synchronously.
- Starts the webserver.
- Runs the "main" function in all the modules. This is run asynchronously.