diff --git a/client/go/outline/config/config.go b/client/go/outline/config/config.go index 830baee91e..a2f2288aea 100644 --- a/client/go/outline/config/config.go +++ b/client/go/outline/config/config.go @@ -47,73 +47,3 @@ func mapToAny(in map[string]any, out any) error { decoder.KnownFields(true) return decoder.Decode(out) } - -/* - -type TunnelConfig struct { - Transport TransportConfig -} - -type TransportConfig DialerConfig - -type DialerConfig any - -type EndpointConfig any - -type DialEndpointConfig struct { - Address string - Dialer *DialerConfig -} - -// ParseTunnelConfig parses and validates the config -func ParseTunnelConfig(configText string) (*TunnelConfig, error) { - var node any - if err := yaml.Unmarshal([]byte(configText), &node); err != nil { - return nil, fmt.Errorf("tunnel config is not valid YAML: %w", err) - } - - var tunnel TunnelConfig - var rawTransport TransportConfig - switch typed := node.(type) { - case string: - rawTransport = typed - - case map[string]any: - if transport, ok := typed["transport"]; ok { - // TODO: support separate TCP and UDP transports. - rawTransport = transport - } else { - // If the transport field is missing, treat the entire object as the transport config. - rawTransport = typed - } - - default: - return nil, fmt.Errorf("tunnel config of type %T is not supported", typed) - } - - parsedTransport, err := parseDialerConfig(rawTransport) - if err != nil { - return nil, err - } - tunnel.Transport = parsedTransport - return &tunnel, nil -} - -func parseDialerConfig(node any) (DialerConfig, error) { - switch typed := node.(type) { - case string: - // TODO: Implement URL config. - return nil, errors.New("transport string not implemented") - - case map[string]any: - if _, ok := typed["$type"]; ok { - // TODO(fortuna): Implement other types. - return nil, errors.New("typed transport not implemented") - } - - return parseShadowsocksConfig(typed) - } - return nil, fmt.Errorf("transport config of type %T is not supported", node) -} - -*/ diff --git a/client/go/outline/config/endpoint.go b/client/go/outline/config/endpoint.go index 36ebca6499..d5a19509c2 100644 --- a/client/go/outline/config/endpoint.go +++ b/client/go/outline/config/endpoint.go @@ -27,7 +27,6 @@ type DialEndpointConfig struct { Dialer ConfigNode } -// TODO(fortuna): implement Endpoint firstHop. func registerDirectDialEndpoint[ConnType any](r TypeRegistry[*Endpoint[ConnType]], typeID string, newDialer BuildFunc[*Dialer[ConnType]]) { r.RegisterType(typeID, func(ctx context.Context, config ConfigNode) (*Endpoint[ConnType], error) { if config == nil { diff --git a/client/src/www/app/main.ts b/client/src/www/app/main.ts index af5daaa729..3225e94adc 100644 --- a/client/src/www/app/main.ts +++ b/client/src/www/app/main.ts @@ -28,7 +28,7 @@ import { import {OutlinePlatform} from './platform'; import {Settings} from './settings'; import {EventQueue} from '../model/events'; -import { ServerRepository } from '../model/server.js'; +import {ServerRepository} from '../model/server.js'; // Used to determine whether to use Polymer functionality on app initialization failure. let webComponentsAreReady = false; diff --git a/client/src/www/app/outline_server_repository/config.ts b/client/src/www/app/outline_server_repository/config.ts index a0196afe02..aace959c8a 100644 --- a/client/src/www/app/outline_server_repository/config.ts +++ b/client/src/www/app/outline_server_repository/config.ts @@ -102,7 +102,9 @@ export async function parseTunnelConfig( }; } -export async function parseAccessKey(accessKeyText: string): Promise { +export async function parseAccessKey( + accessKeyText: string +): Promise { try { const accessKeyUrl = new URL(accessKeyText.trim());