7d6719da12
Replace direct npm.Client usage throughout the codebase with the proxy.Provider interface, enabling pluggable proxy backends. The deployer, API layer, and proxy manager now use provider-agnostic route management (ConfigureRoute/DeleteRoute) instead of NPM-specific API calls. Adds ProxyRouteID (string) to Instance model and ProxyProvider setting to Settings, with SQLite migrations for backward compatibility.
27 lines
649 B
Go
27 lines
649 B
Go
package proxy
|
|
|
|
import "context"
|
|
|
|
// NoneProvider is a no-op proxy provider for deployments that don't use a reverse proxy.
|
|
type NoneProvider struct{}
|
|
|
|
func NewNoneProvider() *NoneProvider { return &NoneProvider{} }
|
|
|
|
func (n *NoneProvider) Name() string { return "none" }
|
|
|
|
func (n *NoneProvider) ConfigureRoute(_ context.Context, _, _ string, _ int, _ RouteOptions) (string, error) {
|
|
return "", nil
|
|
}
|
|
|
|
func (n *NoneProvider) DeleteRoute(_ context.Context, _ string) error {
|
|
return nil
|
|
}
|
|
|
|
func (n *NoneProvider) ContainerLabels(_ string, _ int) map[string]string {
|
|
return nil
|
|
}
|
|
|
|
func (n *NoneProvider) Ping(_ context.Context) error {
|
|
return nil
|
|
}
|