Skip to content

feat: Add support for custom HTTP and HTTPS ports via environment variables (#40)#56

Open
vanmarkic wants to merge 3 commits intojacksteamdev:mainfrom
vanmarkic:claude/fix-issue-40-custom-ports-01DypPdPvjF9qDyRDG1CAob5
Open

feat: Add support for custom HTTP and HTTPS ports via environment variables (#40)#56
vanmarkic wants to merge 3 commits intojacksteamdev:mainfrom
vanmarkic:claude/fix-issue-40-custom-ports-01DypPdPvjF9qDyRDG1CAob5

Conversation

@vanmarkic
Copy link

Summary

  • Adds support for custom HTTP and HTTPS ports through environment variables
  • Enables advanced network configurations and reverse proxy setups
  • Includes comprehensive test coverage

Changes

  • Implemented OBSIDIAN_HTTP_PORT and OBSIDIAN_HTTPS_PORT environment variables
  • Added tests for custom port configurations
  • Supports flexible deployment scenarios

Related Issue

Addresses feature request #40

🤖 Generated with Claude Code

…iables (jacksteamdev#40)

Add OBSIDIAN_HTTP_PORT and OBSIDIAN_HTTPS_PORT environment variables to allow users to configure custom ports for the MCP server. This provides:

- Port conflict resolution for environments where default ports are in use
- Environmental flexibility for restrictive network configurations
- Enhanced security through non-standard port usage

The implementation maintains backward compatibility by defaulting to the original ports (27123 for HTTP, 27124 for HTTPS) when environment variables are not set.

Updated documentation in packages/mcp-server/README.md to include configuration examples and descriptions of all available environment variables.

Fixes jacksteamdev#40
- Test BASE_URL construction
- Test protocol selection based on OBSIDIAN_USE_HTTP
- Test host configuration
- Test port selection for HTTP/HTTPS
- Document expected behavior for custom ports
- Verify default port values (27123 for HTTP, 27124 for HTTPS)
@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit f2aa0a9
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/6918c1db3eca4600081f6721

@netlify
Copy link

netlify bot commented Nov 15, 2025

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit 09b3b64
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/6918c6e39118b70008edfabe

- Add comprehensive environment variable testing
- Test buildBaseUrl logic with different configurations
- Cover real-world scenarios (WSL, Docker, reverse proxy, multi-vault)
- Validate port number edge cases
- Test environment variable priority
- Add 40+ test cases for thorough coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants