claudepod 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.devcontainer/.env +18 -0
  2. package/.devcontainer/CHANGELOG.md +68 -0
  3. package/.devcontainer/CLAUDE.md +100 -0
  4. package/.devcontainer/README.md +220 -0
  5. package/.devcontainer/config/main-system-prompt.md +118 -0
  6. package/.devcontainer/config/settings.json +41 -0
  7. package/.devcontainer/devcontainer.json +71 -113
  8. package/.devcontainer/features/README.md +113 -0
  9. package/.devcontainer/features/ast-grep/README.md +24 -0
  10. package/.devcontainer/features/ast-grep/devcontainer-feature.json +24 -0
  11. package/.devcontainer/features/ast-grep/install.sh +51 -0
  12. package/.devcontainer/features/ccstatusline/README.md +296 -0
  13. package/.devcontainer/features/ccstatusline/devcontainer-feature.json +19 -0
  14. package/.devcontainer/features/ccstatusline/install.sh +290 -0
  15. package/.devcontainer/features/ccusage/README.md +205 -0
  16. package/.devcontainer/features/ccusage/devcontainer-feature.json +38 -0
  17. package/.devcontainer/features/ccusage/install.sh +132 -0
  18. package/.devcontainer/features/claude-code/README.md +498 -0
  19. package/.devcontainer/features/claude-code/config/settings.json +36 -0
  20. package/.devcontainer/features/claude-code/config/system-prompt.md +118 -0
  21. package/.devcontainer/features/claude-code/config/world-building-sp.md +1432 -0
  22. package/.devcontainer/features/claude-code/devcontainer-feature.json +42 -0
  23. package/.devcontainer/features/claude-code/install.sh +466 -0
  24. package/.devcontainer/features/claude-monitor/README.md +74 -0
  25. package/.devcontainer/features/claude-monitor/devcontainer-feature.json +38 -0
  26. package/.devcontainer/features/claude-monitor/install.sh +99 -0
  27. package/.devcontainer/features/lsp-servers/README.md +85 -0
  28. package/.devcontainer/features/lsp-servers/devcontainer-feature.json +34 -0
  29. package/.devcontainer/features/lsp-servers/install.sh +92 -0
  30. package/.devcontainer/features/mcp-qdrant/CHANGES.md +399 -0
  31. package/.devcontainer/features/mcp-qdrant/README.md +474 -0
  32. package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +57 -0
  33. package/.devcontainer/features/mcp-qdrant/install.sh +295 -0
  34. package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +129 -0
  35. package/.devcontainer/features/mcp-reasoner/README.md +177 -0
  36. package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +20 -0
  37. package/.devcontainer/features/mcp-reasoner/install.sh +177 -0
  38. package/.devcontainer/features/mcp-reasoner/poststart-hook.sh +67 -0
  39. package/.devcontainer/features/splitrail/README.md +140 -0
  40. package/.devcontainer/features/splitrail/devcontainer-feature.json +34 -0
  41. package/.devcontainer/features/splitrail/install.sh +129 -0
  42. package/.devcontainer/features/tree-sitter/README.md +138 -0
  43. package/.devcontainer/features/tree-sitter/devcontainer-feature.json +52 -0
  44. package/.devcontainer/features/tree-sitter/install.sh +173 -0
  45. package/.devcontainer/scripts/setup-aliases.sh +52 -0
  46. package/.devcontainer/scripts/setup-config.sh +28 -0
  47. package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
  48. package/.devcontainer/scripts/setup-lsp.sh +20 -0
  49. package/.devcontainer/scripts/setup-plugins.sh +31 -0
  50. package/.devcontainer/scripts/setup.sh +60 -0
  51. package/README.md +153 -187
  52. package/package.json +5 -9
  53. package/setup.js +2 -2
  54. package/.devcontainer/config/claude/mcp.json +0 -76
  55. package/.devcontainer/config/claude/mcp.json.template +0 -117
  56. package/.devcontainer/config/claude/output-styles/strict-development.md +0 -158
  57. package/.devcontainer/config/claude/settings.json +0 -10
  58. package/.devcontainer/config/claude/system-prompt.md +0 -3
  59. package/.devcontainer/config/searxng/ods_config.json +0 -22
  60. package/.devcontainer/config/searxng/searxng_env_template +0 -71
  61. package/.devcontainer/config/serena/serena_config.yml +0 -72
  62. package/.devcontainer/config/taskmaster/config.json +0 -37
  63. package/.devcontainer/ods_config.json +0 -21
  64. package/.devcontainer/post-create.sh +0 -1077
  65. package/.devcontainer/post-start.sh +0 -551
  66. package/.devcontainer/sanitize-system-prompt.sh +0 -31
  67. package/.devcontainer/scripts/config/claude-core.sh +0 -210
  68. package/.devcontainer/scripts/config/searxng.sh +0 -411
  69. package/.devcontainer/scripts/config/serena.sh +0 -47
  70. package/.devcontainer/scripts/config/taskmaster.sh +0 -41
  71. package/.devcontainer/scripts/generate-mcp-config.js +0 -205
  72. package/.devcontainer/scripts/install/claude-code.sh +0 -112
  73. package/.devcontainer/scripts/shell/zsh-config.sh +0 -271
  74. package/.devcontainer/scripts/utils.sh +0 -44
  75. package/.devcontainer/setup-zsh.sh +0 -234
@@ -1,210 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Claude Core Configuration Module
4
- # Handles Claude directory creation and core configuration files
5
-
6
- setup_claude_core_config() {
7
- echo "🔧 Setting up Claude core configuration..."
8
-
9
- # Claude Code uses multiple possible config locations
10
- local claude_dirs=(
11
- "/home/node/.claude"
12
- "/home/node/.config/claude"
13
- )
14
-
15
- for dir in "${claude_dirs[@]}"; do
16
- if [ ! -d "$dir" ]; then
17
- mkdir -p "$dir"
18
- echo "📁 Created configuration directory: $dir"
19
- fi
20
- # Set proper permissions
21
- chown -R node:node "$dir"
22
- chmod -R 700 "$dir"
23
- done
24
-
25
- # Copy optimized settings.json from devcontainer config
26
- setup_claude_settings
27
-
28
- # Copy MCP configuration
29
- setup_claude_mcp_config
30
-
31
- # Copy system prompt
32
- setup_claude_system_prompt
33
-
34
- # Copy output styles
35
- setup_claude_output_styles
36
-
37
- echo "📋 Claude core configuration processing completed"
38
- }
39
-
40
- setup_claude_settings() {
41
- local settings_source="/workspace/.devcontainer/config/claude/settings.json"
42
- local settings_target_home="/home/node/.claude/settings.json"
43
- local settings_target_workspace="/workspace/.claude/settings.json"
44
-
45
- if [ ! -f "$settings_source" ]; then
46
- echo "âš ī¸ Claude settings template not found, using defaults"
47
- return 1
48
- fi
49
-
50
- # Check if we should override existing files or only create if missing
51
- local copy_settings=false
52
- if [ "${OVERRIDE_CLAUDE_SETTINGS:-false}" = "true" ]; then
53
- echo "📝 OVERRIDE_CLAUDE_SETTINGS=true: Forcing overwrite of Claude settings"
54
- copy_settings=true
55
- elif [ ! -f "$settings_target_home" ] && [ ! -f "$settings_target_workspace" ]; then
56
- echo "📝 Creating Claude settings (no existing files found)"
57
- copy_settings=true
58
- else
59
- echo "📁 Preserving existing Claude settings (set OVERRIDE_CLAUDE_SETTINGS=true to overwrite)"
60
- fi
61
-
62
- if [ "$copy_settings" = "true" ]; then
63
- # Create backups of existing configurations
64
- create_config_backup "$settings_target_home"
65
- create_config_backup "$settings_target_workspace"
66
-
67
- # Copy to home directory (will be bind-mounted to workspace)
68
- cp "$settings_source" "$settings_target_home"
69
- chown node:node "$settings_target_home"
70
- chmod 600 "$settings_target_home"
71
-
72
- # Also copy directly to workspace for redundancy
73
- cp "$settings_source" "$settings_target_workspace"
74
- chown node:node "$settings_target_workspace"
75
- chmod 600 "$settings_target_workspace"
76
-
77
- echo "📋 Claude settings configured"
78
- fi
79
- }
80
-
81
- setup_claude_mcp_config() {
82
- local mcp_source="/workspace/.devcontainer/config/claude/mcp.json"
83
- local mcp_target_home="/home/node/.claude/mcp.json"
84
- local mcp_target_workspace="/workspace/.claude/mcp.json"
85
-
86
- if [ ! -f "$mcp_source" ]; then
87
- echo "📝 MCP configuration template not found, will be generated in post-start phase"
88
- return 0
89
- fi
90
-
91
- local copy_mcp=false
92
- if [ "${OVERRIDE_CLAUDE_MCP:-false}" = "true" ]; then
93
- echo "📝 OVERRIDE_CLAUDE_MCP=true: Forcing overwrite of Claude MCP configuration"
94
- copy_mcp=true
95
- elif [ ! -f "$mcp_target_home" ] && [ ! -f "$mcp_target_workspace" ]; then
96
- echo "📝 Creating Claude MCP configuration (no existing files found)"
97
- copy_mcp=true
98
- else
99
- echo "📁 Preserving existing Claude MCP configuration (set OVERRIDE_CLAUDE_MCP=true to overwrite)"
100
- fi
101
-
102
- if [ "$copy_mcp" = "true" ]; then
103
- # Create backups of existing MCP configurations
104
- create_config_backup "$mcp_target_home"
105
- create_config_backup "$mcp_target_workspace"
106
-
107
- cp "$mcp_source" "$mcp_target_home"
108
- cp "$mcp_source" "$mcp_target_workspace"
109
- chown node:node "$mcp_target_home" "$mcp_target_workspace"
110
- chmod 600 "$mcp_target_home" "$mcp_target_workspace"
111
-
112
- echo "📋 Claude MCP configuration set up"
113
- fi
114
- }
115
-
116
- setup_claude_system_prompt() {
117
- local prompt_source="/workspace/.devcontainer/config/claude/system-prompt.md"
118
- local prompt_target_home="/home/node/.claude/system-prompt.md"
119
- local prompt_target_workspace="/workspace/.claude/system-prompt.md"
120
-
121
- if [ ! -f "$prompt_source" ]; then
122
- echo "📝 System prompt template not found, skipping"
123
- return 0
124
- fi
125
-
126
- local copy_prompt=false
127
- if [ "${OVERRIDE_CLAUDE_SYSTEM_PROMPT:-false}" = "true" ]; then
128
- echo "📝 OVERRIDE_CLAUDE_SYSTEM_PROMPT=true: Forcing overwrite of Claude system prompt"
129
- copy_prompt=true
130
- elif [ ! -f "$prompt_target_home" ] && [ ! -f "$prompt_target_workspace" ]; then
131
- echo "📝 Creating Claude system prompt (no existing files found)"
132
- copy_prompt=true
133
- else
134
- echo "📁 Preserving existing Claude system prompt (set OVERRIDE_CLAUDE_SYSTEM_PROMPT=true to overwrite)"
135
- fi
136
-
137
- if [ "$copy_prompt" = "true" ]; then
138
- # Create backups of existing system prompt configurations
139
- create_config_backup "$prompt_target_home"
140
- create_config_backup "$prompt_target_workspace"
141
-
142
- cp "$prompt_source" "$prompt_target_home"
143
- cp "$prompt_source" "$prompt_target_workspace"
144
- chown node:node "$prompt_target_home" "$prompt_target_workspace"
145
- chmod 600 "$prompt_target_home" "$prompt_target_workspace"
146
-
147
- echo "📋 Claude system prompt configured"
148
- fi
149
- }
150
-
151
- setup_claude_output_styles() {
152
- local styles_source="/workspace/.devcontainer/config/claude/output-styles"
153
- local styles_target_home="/home/node/.claude/output-styles"
154
- local styles_target_workspace="/workspace/.claude/output-styles"
155
-
156
- if [ ! -d "$styles_source" ]; then
157
- echo "📝 Output styles directory not found, skipping"
158
- return 0
159
- fi
160
-
161
- local copy_styles=false
162
- if [ "${OVERRIDE_CLAUDE_OUTPUT_STYLES:-false}" = "true" ]; then
163
- echo "📝 OVERRIDE_CLAUDE_OUTPUT_STYLES=true: Forcing overwrite of Claude output styles"
164
- copy_styles=true
165
- elif [ ! -d "$styles_target_home" ] && [ ! -d "$styles_target_workspace" ]; then
166
- echo "📝 Creating Claude output styles (no existing directories found)"
167
- copy_styles=true
168
- else
169
- echo "📁 Preserving existing Claude output styles (set OVERRIDE_CLAUDE_OUTPUT_STYLES=true to overwrite)"
170
- fi
171
-
172
- if [ "$copy_styles" = "true" ]; then
173
- # Create backups of existing output styles directories
174
- if [ -d "$styles_target_home" ]; then
175
- local backup_dir="/workspace/.devcontainer/config/backups"
176
- mkdir -p "$backup_dir"
177
- local timestamp=$(date +"%Y%m%d_%H%M%S")
178
- local backup_home="${backup_dir}/home_node_.claude_output-styles.${timestamp}.backup"
179
- cp -r "$styles_target_home" "$backup_home"
180
- chown -R node:node "$backup_home"
181
- chmod -R 600 "$backup_home"
182
- echo "đŸ“Ļ Created backup: $backup_home"
183
- fi
184
-
185
- if [ -d "$styles_target_workspace" ]; then
186
- local backup_dir="/workspace/.devcontainer/config/backups"
187
- mkdir -p "$backup_dir"
188
- local timestamp=$(date +"%Y%m%d_%H%M%S")
189
- local backup_workspace="${backup_dir}/workspace_.claude_output-styles.${timestamp}.backup"
190
- cp -r "$styles_target_workspace" "$backup_workspace"
191
- chown -R node:node "$backup_workspace"
192
- chmod -R 600 "$backup_workspace"
193
- echo "đŸ“Ļ Created backup: $backup_workspace"
194
- fi
195
-
196
- # Copy to home directory (will be bind-mounted to workspace)
197
- mkdir -p "$styles_target_home"
198
- cp -r "$styles_source"/* "$styles_target_home"/
199
- chown -R node:node "$styles_target_home"
200
- chmod -R 600 "$styles_target_home"
201
-
202
- # Also copy directly to workspace for redundancy
203
- mkdir -p "$styles_target_workspace"
204
- cp -r "$styles_source"/* "$styles_target_workspace"/
205
- chown -R node:node "$styles_target_workspace"
206
- chmod -R 600 "$styles_target_workspace"
207
-
208
- echo "📋 Claude output styles configured"
209
- fi
210
- }
@@ -1,411 +0,0 @@
1
- #!/bin/bash
2
-
3
- # SearXNG MCP Enhanced Configuration Module
4
- # Handles MCP SearXNG Enhanced installation and configuration setup
5
-
6
- install_searxng_mcp() {
7
- echo "🔧 Installing MCP SearXNG Enhanced..."
8
-
9
- # Define installation paths
10
- local mcp_install_dir="/usr/local/mcp-servers/searxng"
11
- local temp_dir="/tmp/mcp-searxng-enhanced"
12
- local repo_url="https://github.com/OvertliDS/mcp-searxng-enhanced"
13
-
14
- # Create installation directory
15
- sudo mkdir -p "$mcp_install_dir"
16
-
17
- # Clone repository to temporary location
18
- echo "đŸ“Ĩ Cloning MCP SearXNG Enhanced repository..."
19
- if [ -d "$temp_dir" ]; then
20
- rm -rf "$temp_dir"
21
- fi
22
-
23
- git clone "$repo_url" "$temp_dir" 2>/dev/null || {
24
- echo "❌ Failed to clone repository from $repo_url"
25
- return 1
26
- }
27
-
28
- # Install Python dependencies using uv with the correct Python version
29
- echo "đŸ“Ļ Installing Python dependencies..."
30
- sudo /home/node/.local/bin/uv pip install --python /usr/local/python/current/bin/python3 --system -r "$temp_dir/requirements.txt" || {
31
- echo "❌ Failed to install Python dependencies"
32
- return 1
33
- }
34
-
35
- # Copy MCP server files
36
- echo "📋 Copying MCP server files..."
37
- sudo cp "$temp_dir/mcp_server.py" "$mcp_install_dir/"
38
- sudo chmod +x "$mcp_install_dir/mcp_server.py"
39
-
40
- # Copy additional files if they exist
41
- if [ -f "$temp_dir/README.md" ]; then
42
- sudo cp "$temp_dir/README.md" "$mcp_install_dir/"
43
- fi
44
-
45
- # Clean up temporary directory
46
- rm -rf "$temp_dir"
47
-
48
- echo "✅ MCP SearXNG Enhanced installed successfully"
49
- }
50
-
51
- setup_searxng_config() {
52
- echo "🔧 Setting up SearXNG configuration..."
53
-
54
- local config_source="/workspace/.devcontainer/config/searxng/ods_config.json"
55
- local config_target="/home/node/.claude/ods_config.json"
56
-
57
- if [ ! -f "$config_source" ]; then
58
- echo "âš ī¸ SearXNG configuration template not found, using defaults"
59
- return 1
60
- fi
61
-
62
- # Ensure Claude directory exists
63
- mkdir -p "/home/node/.claude"
64
-
65
- local copy_config=false
66
- if [ "${OVERRIDE_SEARXNG_CONFIG:-false}" = "true" ]; then
67
- echo "📝 OVERRIDE_SEARXNG_CONFIG=true: Forcing overwrite of SearXNG configuration"
68
- copy_config=true
69
- elif [ ! -f "$config_target" ]; then
70
- echo "📝 Creating SearXNG configuration (no existing file found)"
71
- copy_config=true
72
- else
73
- echo "📁 Preserving existing SearXNG configuration (set OVERRIDE_SEARXNG_CONFIG=true to overwrite)"
74
- fi
75
-
76
- if [ "$copy_config" = "true" ]; then
77
- # Copy configuration file
78
- cp "$config_source" "$config_target"
79
- chown node:node "$config_target"
80
- chmod 600 "$config_target"
81
-
82
- echo "📋 Copied optimized SearXNG configuration"
83
- fi
84
-
85
- echo "✅ SearXNG configuration ready"
86
- }
87
-
88
- validate_searxng_connection() {
89
- echo "🔍 Validating SearXNG connection..."
90
-
91
- local searxng_url="${SEARXNG_ENGINE_API_BASE_URL:-http://localhost:80/search}"
92
-
93
- # Test connection to SearXNG instance
94
- if command -v curl >/dev/null 2>&1; then
95
- if curl -s --connect-timeout 10 --max-time 30 "${searxng_url%/search}" >/dev/null; then
96
- echo "✅ SearXNG instance at $searxng_url is accessible"
97
- return 0
98
- else
99
- echo "âš ī¸ Warning: SearXNG instance at $searxng_url may not be accessible"
100
- echo " MCP server will still be configured but may fail during runtime"
101
- return 1
102
- fi
103
- else
104
- echo "âš ī¸ curl not found, skipping connection validation"
105
- return 1
106
- fi
107
- }
108
-
109
- setup_searxng_environment() {
110
- echo "🌍 Setting up SearXNG environment variables..."
111
-
112
- # Set default environment variables if not already set
113
- export ODS_CONFIG_PATH="${ODS_CONFIG_PATH:-/home/node/.claude/ods_config.json}"
114
- export SEARXNG_ENGINE_API_BASE_URL="${SEARXNG_ENGINE_API_BASE_URL:-http://localhost:80/search}"
115
- export DESIRED_TIMEZONE="${DESIRED_TIMEZONE:-America/New_York}"
116
-
117
- echo "📋 Environment variables configured:"
118
- echo " ODS_CONFIG_PATH=$ODS_CONFIG_PATH"
119
- echo " SEARXNG_ENGINE_API_BASE_URL=$SEARXNG_ENGINE_API_BASE_URL"
120
- echo " DESIRED_TIMEZONE=$DESIRED_TIMEZONE"
121
-
122
- echo "✅ SearXNG environment ready"
123
- }
124
-
125
- setup_searxng_local_instance() {
126
- echo "đŸŗ Setting up SearXNG local instance..."
127
-
128
- # Check if local instance should be enabled
129
- if [ "${ENABLE_SEARXNG_LOCAL:-true}" != "true" ]; then
130
- echo "â­ī¸ SearXNG local instance is disabled (set ENABLE_SEARXNG_LOCAL=true to enable)"
131
- return 0
132
- fi
133
-
134
- local install_dir="${SEARXNG_LOCAL_INSTALL_DIR:-/opt/searxng-local}"
135
- local temp_dir="/tmp/searxng-local-setup"
136
- local repo_url="https://github.com/searxng/searxng-docker"
137
-
138
- # Ensure install directory exists with proper permissions
139
- sudo mkdir -p "$install_dir"
140
- sudo chown -R node:node "$install_dir"
141
- sudo chmod 755 "$install_dir"
142
-
143
- # Install fresh SearXNG configuration from latest repository if it doesn't exist or is empty
144
- if [ ! -f "$install_dir/docker-compose.yaml" ] || [ ! -s "$install_dir/docker-compose.yaml" ]; then
145
- echo "đŸ“Ĩ Installing SearXNG from latest repository..."
146
-
147
- # Clean up any existing temp directory
148
- if [ -d "$temp_dir" ]; then
149
- rm -rf "$temp_dir"
150
- fi
151
-
152
- # Clone the latest SearXNG Docker repository
153
- if git clone "$repo_url" "$temp_dir" 2>/dev/null; then
154
- echo "✅ Successfully cloned SearXNG repository"
155
-
156
- # Copy the necessary files from the repository
157
- if [ -f "$temp_dir/docker-compose.yaml" ]; then
158
- sudo cp "$temp_dir/docker-compose.yaml" "$install_dir/"
159
- echo "✅ Installed docker-compose.yaml"
160
- fi
161
-
162
- if [ -f "$temp_dir/.env" ]; then
163
- sudo cp "$temp_dir/.env" "$install_dir/"
164
- echo "✅ Installed .env configuration"
165
- fi
166
-
167
- if [ -f "$temp_dir/Caddyfile" ]; then
168
- sudo cp "$temp_dir/Caddyfile" "$install_dir/"
169
- echo "✅ Installed Caddyfile"
170
- fi
171
-
172
- if [ -d "$temp_dir/searxng" ]; then
173
- sudo cp -r "$temp_dir/searxng" "$install_dir/"
174
- echo "✅ Installed SearXNG configuration directory"
175
- fi
176
-
177
- # Ensure node user owns everything
178
- sudo chown -R node:node "$install_dir"
179
- sudo chmod -R u+rwX,g+rX "$install_dir"
180
-
181
- # Clean up temp directory
182
- rm -rf "$temp_dir"
183
-
184
- if [ -f "$install_dir/docker-compose.yaml" ]; then
185
- echo "✅ SearXNG local instance installed successfully from latest repository"
186
- else
187
- echo "❌ Failed to install docker-compose.yaml from repository"
188
- return 1
189
- fi
190
- else
191
- echo "❌ Failed to clone SearXNG repository from $repo_url"
192
- return 1
193
- fi
194
- else
195
- echo "📁 SearXNG local configuration already exists in $install_dir"
196
- fi
197
-
198
- # Always configure SearXNG for local development (even if installation already exists)
199
- configure_searxng_for_local_dev "$install_dir"
200
-
201
- echo "✅ SearXNG local instance setup complete"
202
- return 0
203
- }
204
-
205
- configure_searxng_for_local_dev() {
206
- local install_dir="$1"
207
- echo "🔧 Configuring SearXNG for local development..."
208
-
209
- # Fix Caddyfile if it exists as directory (from previous broken installations)
210
- if [ -d "$install_dir/Caddyfile" ]; then
211
- echo "🔧 Fixing Caddyfile directory issue..."
212
- sudo rm -rf "$install_dir/Caddyfile"
213
- # Re-download proper Caddyfile
214
- local temp_dir="/tmp/searxng-caddyfile-fix"
215
- if git clone "https://github.com/searxng/searxng-docker" "$temp_dir" 2>/dev/null; then
216
- if [ -f "$temp_dir/Caddyfile" ]; then
217
- sudo cp "$temp_dir/Caddyfile" "$install_dir/"
218
- echo "✅ Fixed Caddyfile (was incorrectly a directory)"
219
- fi
220
- rm -rf "$temp_dir"
221
- fi
222
- fi
223
-
224
- # Generate secure secret key
225
- local secret_key=$(openssl rand -base64 32 2>/dev/null || echo "$(date +%s)-$(whoami)-$(hostname)" | base64)
226
-
227
- # Create optimized settings.yml for local development
228
- sudo tee "$install_dir/searxng/settings.yml" > /dev/null << EOF
229
- use_default_settings: true
230
- server:
231
- secret_key: "$secret_key"
232
- limiter: false
233
- image_proxy: true
234
- public_instance: false
235
- bind_address: "0.0.0.0:8080"
236
- method: "POST"
237
- redis:
238
- url: redis://redis:6379/0
239
- search:
240
- safe_search: 0
241
- autocomplete: ""
242
- default_lang: ""
243
- ban_time_on_fail: 0
244
- max_ban_time_on_fail: 0
245
- formats: ['html', 'json']
246
- general:
247
- debug: false
248
- instance_name: "SearXNG Local Development"
249
- enabled_plugins: []
250
- disabled_plugins: ['Hash plugin', 'Tracker URL remover', 'Hostnames plugin', 'Unit converter plugin', 'Self Information', 'Search on category select', 'Tor check plugin']
251
- EOF
252
-
253
- # Disable limiter configuration by renaming the file
254
- if [ -f "$install_dir/searxng/limiter.toml" ]; then
255
- sudo mv "$install_dir/searxng/limiter.toml" "$install_dir/searxng/limiter.toml.disabled"
256
- echo "✅ Disabled SearXNG rate limiter"
257
- fi
258
-
259
- # Fix docker-compose.yaml network configuration for MCP compatibility
260
- echo "🔧 Fixing docker-compose.yaml for MCP server compatibility..."
261
- if [ -f "$install_dir/docker-compose.yaml" ]; then
262
- # Replace network_mode: host with proper networks configuration
263
- sudo sed -i 's/network_mode: host/networks:\
264
- - searxng\
265
- ports:\
266
- - "80:80"\
267
- - "443:443"/' "$install_dir/docker-compose.yaml"
268
- echo "✅ Fixed docker-compose.yaml network configuration"
269
- else
270
- echo "âš ī¸ docker-compose.yaml not found, skipping network fix"
271
- fi
272
-
273
- # Fix Caddyfile proxy target and API paths for MCP compatibility
274
- echo "🔧 Fixing Caddyfile for MCP server compatibility..."
275
- if [ -f "$install_dir/Caddyfile" ]; then
276
- # Replace localhost:8080 with searxng:8080 for container networking
277
- sudo sed -i 's/reverse_proxy localhost:8080/reverse_proxy searxng:8080/' "$install_dir/Caddyfile"
278
-
279
- # Add /search and / paths to @api matcher after /stats/checker
280
- sudo sed -i '/path \/stats\/checker/a\\tpath \/search\
281
- \tpath \/' "$install_dir/Caddyfile"
282
- echo "✅ Fixed Caddyfile proxy target and API paths"
283
- else
284
- echo "âš ī¸ Caddyfile not found, skipping proxy fix"
285
- fi
286
-
287
- # Ensure proper ownership
288
- sudo chown -R node:node "$install_dir"
289
-
290
- echo "✅ SearXNG configured for local development (JSON API enabled, network fixed, no rate limiting)"
291
- }
292
-
293
- test_searxng_functionality() {
294
- echo "đŸ§Ē Testing SearXNG functionality..."
295
-
296
- local searxng_url="${SEARXNG_ENGINE_API_BASE_URL:-http://localhost:80/search}"
297
-
298
- # Wait for services to be ready
299
- local attempts=0
300
- while [ $attempts -lt 30 ]; do
301
- if curl -s --connect-timeout 5 "http://localhost:8080/" >/dev/null 2>&1; then
302
- break
303
- fi
304
- sleep 2
305
- ((attempts++))
306
- done
307
-
308
- if [ $attempts -eq 30 ]; then
309
- echo "âš ī¸ SearXNG web interface not responding after 60 seconds"
310
- return 1
311
- fi
312
-
313
- # Test web interface
314
- if curl -s "http://localhost:8080/" | grep -qi "searxng"; then
315
- echo "✅ SearXNG web interface accessible"
316
- else
317
- echo "âš ī¸ SearXNG web interface not working properly"
318
- return 1
319
- fi
320
-
321
- # Note about API access - may require specific headers/form submission
322
- echo "â„šī¸ SearXNG installed and web interface working"
323
- echo " API access may require proper form submission (not just GET requests)"
324
-
325
- return 0
326
- }
327
-
328
- start_searxng_local_instance() {
329
- echo "🚀 Starting SearXNG local instance..."
330
-
331
- # Check if local instance should be enabled
332
- if [ "${ENABLE_SEARXNG_LOCAL:-true}" != "true" ]; then
333
- echo "â­ī¸ SearXNG local instance startup is disabled"
334
- return 0
335
- fi
336
-
337
- local install_dir="${SEARXNG_LOCAL_INSTALL_DIR:-/opt/searxng-local}"
338
-
339
- # Verify installation directory and docker-compose.yaml exist
340
- if [ ! -f "$install_dir/docker-compose.yaml" ]; then
341
- echo "âš ī¸ SearXNG local configuration not found at $install_dir/docker-compose.yaml"
342
- echo " Run setup_searxng_local_instance first"
343
- return 1
344
- fi
345
-
346
- # Change to the installation directory
347
- cd "$install_dir"
348
-
349
- # Check if Docker daemon is running
350
- if ! docker info >/dev/null 2>&1; then
351
- echo "âš ī¸ Docker daemon is not running. Waiting for Docker to start..."
352
- # Wait up to 30 seconds for Docker to be ready
353
- local attempts=0
354
- while [ $attempts -lt 30 ] && ! docker info >/dev/null 2>&1; do
355
- sleep 1
356
- ((attempts++))
357
- done
358
-
359
- if ! docker info >/dev/null 2>&1; then
360
- echo "❌ Docker daemon is not available after waiting. Cannot start SearXNG local instance."
361
- return 1
362
- fi
363
- fi
364
-
365
- # Start the services using docker-compose
366
- echo "đŸŗ Starting SearXNG and Redis containers..."
367
- if docker compose up -d 2>/dev/null || docker-compose up -d 2>/dev/null; then
368
- echo "✅ SearXNG local instance started successfully"
369
-
370
- # Wait a moment and check container status
371
- sleep 5
372
- if docker compose ps 2>/dev/null | grep -q "Up" || docker-compose ps 2>/dev/null | grep -q "Up"; then
373
- echo "🔍 SearXNG should be accessible at http://localhost:8080"
374
-
375
- # Test functionality
376
- test_searxng_functionality
377
- else
378
- echo "âš ī¸ Containers started but may need more time to initialize"
379
- echo " You can check status with: docker compose ps (in $install_dir)"
380
- fi
381
- else
382
- echo "❌ Failed to start SearXNG local instance"
383
- echo " You can try manually: cd $install_dir && docker compose up -d"
384
- return 1
385
- fi
386
-
387
- return 0
388
- }
389
-
390
- # Main setup function
391
- setup_searxng() {
392
- if [ "${ENABLE_SEARXNG_ENHANCED_MCP:-true}" != "true" ]; then
393
- echo "â­ī¸ SearXNG Enhanced MCP is disabled (set ENABLE_SEARXNG_ENHANCED_MCP=true to enable)"
394
- return 0
395
- fi
396
-
397
- echo "🔄 Setting up MCP SearXNG Enhanced..."
398
-
399
- # Setup local SearXNG instance first (during post-create)
400
- setup_searxng_local_instance || echo " (Local instance setup failed, but continuing with MCP setup)"
401
-
402
- # Run installation and configuration steps
403
- install_searxng_mcp || return 1
404
- setup_searxng_config || return 1
405
- setup_searxng_environment
406
- validate_searxng_connection || echo " (Connection validation failed, but continuing with setup)"
407
-
408
- echo "✅ MCP SearXNG Enhanced setup complete"
409
-
410
- return 0
411
- }
@@ -1,47 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Serena Configuration Module
4
- # Handles Serena MCP server configuration setup
5
-
6
- setup_serena_config() {
7
- echo "🔧 Setting up Serena configuration..."
8
-
9
- local serena_source="/workspace/.devcontainer/config/serena/serena_config.yml"
10
- local serena_target_home="/home/node/.serena/serena_config.yml"
11
- local serena_target_workspace="/workspace/.serena/serena_config.yml"
12
-
13
- if [ ! -f "$serena_source" ]; then
14
- echo "âš ī¸ Serena configuration template not found, using defaults"
15
- return 1
16
- fi
17
-
18
- # Ensure Serena directories exist
19
- mkdir -p "/home/node/.serena" "/workspace/.serena"
20
-
21
- local copy_serena=false
22
- if [ "${OVERRIDE_SERENA_CONFIG:-false}" = "true" ]; then
23
- echo "📝 OVERRIDE_SERENA_CONFIG=true: Forcing overwrite of Serena configuration"
24
- copy_serena=true
25
- elif [ ! -f "$serena_target_home" ] && [ ! -f "$serena_target_workspace" ]; then
26
- echo "📝 Creating Serena configuration (no existing files found)"
27
- copy_serena=true
28
- else
29
- echo "📁 Preserving existing Serena configuration (set OVERRIDE_SERENA_CONFIG=true to overwrite)"
30
- fi
31
-
32
- if [ "$copy_serena" = "true" ]; then
33
- # Copy to home directory (will be bind-mounted to workspace)
34
- cp "$serena_source" "$serena_target_home"
35
- chown node:node "$serena_target_home"
36
- chmod 600 "$serena_target_home"
37
-
38
- # Also copy directly to workspace for redundancy
39
- cp "$serena_source" "$serena_target_workspace"
40
- chown node:node "$serena_target_workspace"
41
- chmod 600 "$serena_target_workspace"
42
-
43
- echo "📋 Copied optimized Serena configuration"
44
- fi
45
-
46
- echo "✅ Serena configuration ready"
47
- }