Skip to content

Conversation

@daniellacosse
Copy link
Contributor

@daniellacosse daniellacosse commented Feb 26, 2025

See setup details in the README.


With this, we can successfully call the Management API from the browser:

results

@gemini-code-assist
Copy link

Important

The terms of service for this installation has not been accepted. Please ask the Organization owners to visit the Gemini Code Assist Admin Console to sign it.

export type * from './generated';

export default (baseUrl: string) => {
client.setConfig({ baseUrl, headers: { "ngrok-skip-browser-warning": "69420" } });
Copy link
Contributor Author

@daniellacosse daniellacosse Feb 26, 2025

Choose a reason for hiding this comment

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

One of the gotchas, this doesn't work without this header (ngrok sends a warning HTML file otherwise)

// Start Prometheus subprocess and wait for it to be up and running.
const prometheusConfigFilename = getPersistentFilename('prometheus/config.yml');
const prometheusTsdbFilename = getPersistentFilename('prometheus/data');
// TODO: Figure out why prometheus crashes infinitely.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oddly, Prometheus continuously crashes while ngrok is active. Needs further investigation.

// ipv6 loopback address doesn't work
addr: `https://127.0.0.1:${process.env.SB_API_PORT || 8081}`,
authtoken_from_env: true,
verify_upstream_tls: false,
Copy link
Contributor Author

@daniellacosse daniellacosse Feb 26, 2025

Choose a reason for hiding this comment

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

We need to both turn off upstream verification and forward the SSL CERT/KEY files for ngrok to successfully connect to our local service.

FWIW, the ngrok cli does not seem to have this limitation - however, I was asked to uninstall that by Google Security.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also - where would we want this to live?

{test: /\.ts(x)?$/, use: 'ts-loader'},
{
test: /\.node$/,
loader: 'node-loader',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a gotcha - the ngrok javascript SDK pulls in binaries that webpack doesn't know how to handle. This loader is needed for the server to build.

@daniellacosse daniellacosse changed the title [DO NOT MERGE] "Manager SDK" Prototype [DO NOT MERGE] Web Management Library Exploration - TLS + OpenAPI Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants