Proxy Environment
Surfly supports deployment in environments that use HTTP proxies for outbound connections. This is common in corporate networks where direct internet access is restricted and all outbound traffic must go through a proxy server.
Configuration Overview
Section titled “Configuration Overview”Surfly doesn’t require special configuration for proxy support. Instead, it uses standard proxy environment variables that are configured at the system level. All Surfly containers will automatically inherit and use these proxy settings.
System-Level Proxy Configuration
Section titled “System-Level Proxy Configuration”Configure proxy settings by adding environment variables to your system’s /etc/environment file. This ensures all processes, including containerized services, use the proxy configuration.
Basic Proxy Setup
Section titled “Basic Proxy Setup”Edit the system environment file:
sudo vi /etc/environmentAdd the following proxy configuration (replace with your actual proxy server details):
HTTP_PROXY=http://192.168.5.1:8080HTTPS_PROXY=http://192.168.5.1:8080NO_PROXY="localhost,127.0.0.1"
# Also include lowercase versions for compatibilityhttp_proxy=http://192.168.5.1:8080https_proxy=http://192.168.5.1:8080no_proxy="localhost,127.0.0.1"Container-Specific Configuration
Section titled “Container-Specific Configuration”If you need to override proxy settings for specific containers, you can modify the container environment files:
Global Container Environment
Section titled “Global Container Environment”Edit the main configuration file:
vi ~/surfly/config.envAdd proxy variables:
# Your existing configCLIENT_ID=your_client_idCLIENT_SECRET=your_client_secret
# Proxy configurationHTTP_PROXY=http://192.168.5.1:8080HTTPS_PROXY=http://192.168.5.1:8080NO_PROXY=localhost,127.0.0.1Apply Configuration
Section titled “Apply Configuration”After configuring proxy settings, apply them to your session and restart services:
System-Wide Changes
Section titled “System-Wide Changes”For system-wide environment changes to take effect, logout and log back in to apply the new configuration.
Restart Surfly Services
Section titled “Restart Surfly Services”If Surfly is already running, restart services to pick up new proxy configuration:
systemctl --user restart ss-surfly.targetVerification
Section titled “Verification”Verify that proxy settings are working correctly:
Test Outbound Connectivity
Section titled “Test Outbound Connectivity”Test connectivity to Surfly domains through the proxy:
# Test registry accesscurl -I https://registry.surfly.com
# Test build agent accesscurl -I https://build-agent.surfly.comCheck Container Environment
Section titled “Check Container Environment”Verify that containers are using proxy settings:
# Check environment variables in running containerpodman exec ss-haproxy env | grep -i proxyTroubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”SSL/TLS Certificate Verification If your proxy uses custom certificates, you may need to add them to the system trust store:
# Copy proxy certificate to system trust directorysudo cp proxy-cert.crt /etc/pki/ca-trust/source/anchors/sudo update-ca-trustDNS Resolution Ensure DNS resolution works through your proxy:
# Test DNS resolutionnslookup registry.surfly.comdig registry.surfly.comDebugging Proxy Issues
Section titled “Debugging Proxy Issues”Enable verbose logging to debug proxy connectivity:
# Set environment variables for debuggingexport CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crtexport REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt
# Test with verbose outputcurl -v -x http://192.168.5.1:8080 https://registry.surfly.com