mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 22:54:24 +01:00
chore: Add docker to allowed deeplink commands (#2509)
This commit is contained in:
@@ -29,7 +29,7 @@ export function getGooseInstallLink(server: MCPServer): string {
|
||||
}
|
||||
|
||||
const parts = server.command.split(" ");
|
||||
const baseCmd = parts[0]; // jbang, npx or uvx
|
||||
const baseCmd = parts[0]; // docker, jbang, npx or uvx
|
||||
const args = parts.slice(1); // remaining arguments
|
||||
|
||||
const queryParams = [
|
||||
|
||||
@@ -15,7 +15,7 @@ function getStdioConfig(
|
||||
timeout: number
|
||||
) {
|
||||
// Validate that the command is one of the allowed commands
|
||||
const allowedCommands = ['jbang', 'npx', 'uvx', 'goosed'];
|
||||
const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
|
||||
if (!allowedCommands.includes(cmd)) {
|
||||
toastService.handleError(
|
||||
'Invalid Command',
|
||||
|
||||
@@ -168,7 +168,7 @@ export async function replaceWithShims(cmd: string) {
|
||||
|
||||
export function removeShims(cmd: string) {
|
||||
// Only remove shims if the path matches our known shim patterns
|
||||
const shimPatterns = [/goosed$/, /jbang$/, /npx$/, /uvx$/];
|
||||
const shimPatterns = [/goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/];
|
||||
|
||||
// Check if the command matches any shim pattern
|
||||
const isShim = shimPatterns.some((pattern) => pattern.test(cmd));
|
||||
|
||||
@@ -362,7 +362,7 @@ function getStdioConfig(
|
||||
description: string,
|
||||
parsedTimeout: number
|
||||
) {
|
||||
const allowedCommands = ['jbang', 'npx', 'uvx', 'goosed'];
|
||||
const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
|
||||
if (!allowedCommands.includes(cmd)) {
|
||||
handleError(
|
||||
`Failed to install extension: Invalid command: ${cmd}. Only ${allowedCommands.join(', ')} are allowed.`,
|
||||
|
||||
Reference in New Issue
Block a user