mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 06:34:26 +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 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 args = parts.slice(1); // remaining arguments
|
||||||
|
|
||||||
const queryParams = [
|
const queryParams = [
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function getStdioConfig(
|
|||||||
timeout: number
|
timeout: number
|
||||||
) {
|
) {
|
||||||
// Validate that the command is one of the allowed commands
|
// 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)) {
|
if (!allowedCommands.includes(cmd)) {
|
||||||
toastService.handleError(
|
toastService.handleError(
|
||||||
'Invalid Command',
|
'Invalid Command',
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ export async function replaceWithShims(cmd: string) {
|
|||||||
|
|
||||||
export function removeShims(cmd: string) {
|
export function removeShims(cmd: string) {
|
||||||
// Only remove shims if the path matches our known shim patterns
|
// 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
|
// Check if the command matches any shim pattern
|
||||||
const isShim = shimPatterns.some((pattern) => pattern.test(cmd));
|
const isShim = shimPatterns.some((pattern) => pattern.test(cmd));
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ function getStdioConfig(
|
|||||||
description: string,
|
description: string,
|
||||||
parsedTimeout: number
|
parsedTimeout: number
|
||||||
) {
|
) {
|
||||||
const allowedCommands = ['jbang', 'npx', 'uvx', 'goosed'];
|
const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
|
||||||
if (!allowedCommands.includes(cmd)) {
|
if (!allowedCommands.includes(cmd)) {
|
||||||
handleError(
|
handleError(
|
||||||
`Failed to install extension: Invalid command: ${cmd}. Only ${allowedCommands.join(', ')} are allowed.`,
|
`Failed to install extension: Invalid command: ${cmd}. Only ${allowedCommands.join(', ')} are allowed.`,
|
||||||
|
|||||||
Reference in New Issue
Block a user