Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions install_docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,19 @@ function Try-Extract-Config {

function Update-AuthBypassOrPassword {
Write-Host ""; Write-Info "Setting up authentication for your Morphik deployment:"
Write-Info " • For external access, set a LOCAL_URI_PASSWORD."
Write-Info " • Set a LOCAL_URI_PASSWORD when you want to protect local connection URI generation."
Write-Info " • For local-only access, press Enter to enable bypass_auth_mode."
Write-Info " • With a LOCAL_URI_PASSWORD set, use POST /local/generate_uri with password_token in the form body to create an authorized local connection URI."
$password = Read-Host "Enter a secure LOCAL_URI_PASSWORD (or press Enter to skip)"
if ([string]::IsNullOrWhiteSpace($password)) {
Write-Info "No password provided - enabling authentication bypass (bypass_auth_mode=true)."
$content = Get-Content morphik.toml -Raw
$content = $content -replace '(?m)^bypass_auth_mode\s*=\s*false', 'bypass_auth_mode = true'
Set-Content morphik.toml -Value $content
} else {
Write-Ok "LOCAL_URI_PASSWORD set - keeping production mode (bypass_auth_mode=false)."
Write-Ok "LOCAL_URI_PASSWORD set - keeping authenticated mode (bypass_auth_mode=false)."
Write-Info "Use POST /local/generate_uri with password_token in the form body to create authorized local connection URIs."
Write-Info "Treat generated local connection URIs as bearer credentials."
(Get-Content .env -Raw) -replace 'LOCAL_URI_PASSWORD=', "LOCAL_URI_PASSWORD=$password" |
Set-Content .env
}
Expand Down
9 changes: 5 additions & 4 deletions install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ fi
# 5.0.5 Now that morphik.toml exists, handle LOCAL_URI_PASSWORD configuration
echo ""
print_info "🔐 Setting up authentication for your Morphik deployment:"
print_info " • If you plan to access Morphik from outside this server, setting a LOCAL_URI_PASSWORD will secure your deployment"
print_info " • Set LOCAL_URI_PASSWORD when you want to protect local connection URI generation"
print_info " • For local-only access, you can skip this step (bypass_auth_mode will be enabled)"
print_info " • With a LOCAL_URI_PASSWORD set, you'll need to use /generate_local_uri endpoint for authorization tokens"
print_info " • With a LOCAL_URI_PASSWORD set, use POST /local/generate_uri with password_token in the form body to create an authorized local connection URI"
echo ""
read -p "Please enter a secure LOCAL_URI_PASSWORD (or press Enter to skip for local-only access): " local_uri_password < /dev/tty
if [[ -z "$local_uri_password" ]]; then
Expand All @@ -346,8 +346,9 @@ if [[ -z "$local_uri_password" ]]; then
print_warning "morphik.toml not found, cannot set bypass_auth_mode"
fi
else
print_success "LOCAL_URI_PASSWORD set - keeping production mode (bypass_auth_mode=false) with authentication enabled"
print_info "Use the /generate_local_uri endpoint with this password to create authorized connection URIs"
print_success "LOCAL_URI_PASSWORD set - keeping authenticated mode (bypass_auth_mode=false)"
print_info "Use POST /local/generate_uri with password_token in the form body to create authorized local connection URIs"
print_info "Treat generated local connection URIs as bearer credentials"
fi

# Only update .env if a password was provided
Expand Down