mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add allow root setting for Ubuntu and Web Mode users (#16027)
* add allow root setting for Ubuntu and Web Mode users
This commit is contained in:
@@ -54,6 +54,11 @@
|
|||||||
"default": true,
|
"default": true,
|
||||||
"description": "%notebook.overrideEditorTheming.description%"
|
"description": "%notebook.overrideEditorTheming.description%"
|
||||||
},
|
},
|
||||||
|
"notebook.allowRoot": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "%notebook.allowRoot.description%"
|
||||||
|
},
|
||||||
"notebook.maxTableRows": {
|
"notebook.maxTableRows": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"default": 5000,
|
"default": 5000,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"notebook.collapseBookItems.description": "Collapse Book items at root level in the Notebooks Viewlet",
|
"notebook.collapseBookItems.description": "Collapse Book items at root level in the Notebooks Viewlet",
|
||||||
"notebook.remoteBookDownloadTimeout.description": "Download timeout in milliseconds for GitHub books",
|
"notebook.remoteBookDownloadTimeout.description": "Download timeout in milliseconds for GitHub books",
|
||||||
"notebook.pinnedNotebooks.description": "Notebooks that are pinned by the user for the current workspace",
|
"notebook.pinnedNotebooks.description": "Notebooks that are pinned by the user for the current workspace",
|
||||||
|
"notebook.allowRoot.description": "Allow Jupyter server to run as root user",
|
||||||
"notebook.command.new": "New Notebook",
|
"notebook.command.new": "New Notebook",
|
||||||
"notebook.command.open": "Open Notebook",
|
"notebook.command.open": "Open Notebook",
|
||||||
"notebook.analyzeJupyterNotebook": "Analyze in Notebook",
|
"notebook.analyzeJupyterNotebook": "Analyze in Notebook",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const pinnedBooksConfigKey = 'pinnedNotebooks';
|
|||||||
export const maxBookSearchDepth = 'maxBookSearchDepth';
|
export const maxBookSearchDepth = 'maxBookSearchDepth';
|
||||||
export const remoteBookDownloadTimeout = 'remoteBookDownloadTimeout';
|
export const remoteBookDownloadTimeout = 'remoteBookDownloadTimeout';
|
||||||
export const collapseBookItems = 'collapseBookItems';
|
export const collapseBookItems = 'collapseBookItems';
|
||||||
|
export const allowRoot = 'allowRoot';
|
||||||
|
|
||||||
export const winPlatform = 'win32';
|
export const winPlatform = 'win32';
|
||||||
export const macPlatform = 'darwin';
|
export const macPlatform = 'darwin';
|
||||||
|
|||||||
@@ -204,12 +204,16 @@ export class PerFolderServerInstance implements IServerInstance {
|
|||||||
* started when the log message with URL to connect to is emitted.
|
* started when the log message with URL to connect to is emitted.
|
||||||
*/
|
*/
|
||||||
protected async startInternal(): Promise<void> {
|
protected async startInternal(): Promise<void> {
|
||||||
|
let startCommand: string;
|
||||||
|
let notebookConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(constants.notebookConfigKey);
|
||||||
|
let allowRoot: boolean = notebookConfig.get(constants.allowRoot);
|
||||||
if (this.isStarted) {
|
if (this.isStarted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let notebookDirectory = this.getNotebookDirectory();
|
let notebookDirectory = this.getNotebookDirectory();
|
||||||
this._token = await utils.getRandomToken();
|
this._token = await utils.getRandomToken();
|
||||||
let startCommand = `"${this.options.install.pythonExecutable}" "${this.notebookScriptPath}" --no-browser --ip=127.0.0.1 --allow-root --no-mathjax --notebook-dir "${notebookDirectory}" --NotebookApp.token=${this._token}`;
|
const allowRootParam = allowRoot ? '--allow-root' : '';
|
||||||
|
startCommand = `"${this.options.install.pythonExecutable}" "${this.notebookScriptPath}" --no-browser --ip=127.0.0.1 ${allowRootParam} --no-mathjax --notebook-dir "${notebookDirectory}" --NotebookApp.token=${this._token}`;
|
||||||
this.notifyStarting(this.options.install, startCommand);
|
this.notifyStarting(this.options.install, startCommand);
|
||||||
|
|
||||||
// Execute the command
|
// Execute the command
|
||||||
|
|||||||
Reference in New Issue
Block a user