Skip to content

Conversation

@Brendon-Hablutzel
Copy link

@Brendon-Hablutzel Brendon-Hablutzel commented Nov 22, 2024

(I accidentally opened a pull request earlier into the ETS repo, disregard that one and use this instead)

Basic frontend and backend implementations of static (extension vs dashboard) routing. Also includes an nginx config, as well as docs for using nginx.

To set whether dashboard and extension routes should be enabled or not, use the following in creds.yaml:

server:
    (other settings)
    disable_dashboard_routes: false
    disable_extension_routes: false

Further, here is a list of places where the dashboard url needs to be modified to support static routing (i.e. ?source=dashboard should be appended to the end of the url):

@DrLynch DrLynch self-assigned this Nov 22, 2024
@DrLynch DrLynch assigned Brendon-Hablutzel and unassigned DrLynch Nov 22, 2024
debug_log("Extension routes are enabled")
else:
debug_log("Extension routes are disabled")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment: I could see instances where we want to enable/disable a lot more of the Learning Observer routes on the system.
Not sure that it's needed for the first pass, but would be good to think about and toy around with.

* the data will be sent to.
*/
var WEBSOCKET_SERVER_URL = "wss://learning-observer.org/wsapi/in/"
var WEBSOCKET_SERVER_URL = "wss://learning-observer.org/wsapi/in?source=extension"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really ought to have the url not hardcoded and pulled from a config of some sort, but that's way beyond the scope of this PR and the work you are doing.
Mostly leaving this note to push it to the front of my brain (I'm most likely to work on it)

@Brendon-Hablutzel
Copy link
Author

Possible bug: PMSS always initializes using the default config file (creds.yaml), and ignores the command line argument --config-file

See here

@bradley-erickson
Copy link

Possible bug: PMSS always initializes using the default config file (creds.yaml), and ignores the command line argument --config-file

See here

The initialization should probably be moved into the load_settings function. Try something like the following. Note I haven't tested this at all, so it might crash and burn.

pmss_settings = None


def load_settings(config):
    '''...'''
    global settings, pmss_settings

    pmss_settings = pmss.init(
        prog=__name__,
        description="A system for monitoring",
        epilog="For more information, see PMSS documentation.",
        rulesets=[pmss.YAMLFileRuleset(filename=config)]
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants