-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] "Manager SDK" Prototype #1648
base: master
Are you sure you want to change the base?
Conversation
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" } }); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
See setup details in the README.
With this, we can successfully call the Management API from the browser: