@@ -63,6 +63,9 @@ type ServerSelection struct {
6363 // TorOnly is true if VPN servers without tor should
6464 // be filtered. This is used with ProtonVPN.
6565 TorOnly * bool `json:"tor_only"`
66+ // Dedicated is true if dedicated VPN servers should be chosen only.
67+ // This is used with OVPN.
68+ Dedicated * bool `json:"dedicated"`
6669 // OpenVPN contains settings to select OpenVPN servers
6770 // and the final connection.
6871 OpenVPN OpenVPNSelection `json:"openvpn"`
@@ -272,6 +275,8 @@ func validateFeatureFilters(settings ServerSelection, vpnServiceProvider string)
272275 return errors .New ("secure core only filter is not supported" )
273276 case * settings .TorOnly && vpnServiceProvider != providers .Protonvpn :
274277 return errors .New ("tor only filter is not supported" )
278+ case * settings .Dedicated && vpnServiceProvider != providers .Ovpn :
279+ return errors .New ("dedicated filter is not supported" )
275280 default :
276281 return nil
277282 }
@@ -296,6 +301,7 @@ func (ss *ServerSelection) copy() (copied ServerSelection) {
296301 TorOnly : gosettings .CopyPointer (ss .TorOnly ),
297302 PortForwardOnly : gosettings .CopyPointer (ss .PortForwardOnly ),
298303 MultiHopOnly : gosettings .CopyPointer (ss .MultiHopOnly ),
304+ Dedicated : gosettings .CopyPointer (ss .Dedicated ),
299305 OpenVPN : ss .OpenVPN .copy (),
300306 Wireguard : ss .Wireguard .copy (),
301307 }
@@ -319,6 +325,7 @@ func (ss *ServerSelection) overrideWith(other ServerSelection) {
319325 ss .TorOnly = gosettings .OverrideWithPointer (ss .TorOnly , other .TorOnly )
320326 ss .MultiHopOnly = gosettings .OverrideWithPointer (ss .MultiHopOnly , other .MultiHopOnly )
321327 ss .PortForwardOnly = gosettings .OverrideWithPointer (ss .PortForwardOnly , other .PortForwardOnly )
328+ ss .Dedicated = gosettings .OverrideWithPointer (ss .Dedicated , other .Dedicated )
322329 ss .OpenVPN .overrideWith (other .OpenVPN )
323330 ss .Wireguard .overrideWith (other .Wireguard )
324331}
@@ -335,6 +342,7 @@ func (ss *ServerSelection) setDefaults(vpnProvider string, portForwardingEnabled
335342 defaultPortForwardOnly := portForwardingEnabled &&
336343 helpers .IsOneOf (vpnProvider , providers .PrivateInternetAccess , providers .Protonvpn )
337344 ss .PortForwardOnly = gosettings .DefaultPointer (ss .PortForwardOnly , defaultPortForwardOnly )
345+ ss .Dedicated = gosettings .DefaultPointer (ss .Dedicated , false )
338346 ss .OpenVPN .setDefaults (vpnProvider )
339347 ss .Wireguard .setDefaults ()
340348}
@@ -410,6 +418,10 @@ func (ss ServerSelection) toLinesNode() (node *gotree.Node) {
410418 node .Appendf ("Multi-hop only servers: yes" )
411419 }
412420
421+ if * ss .Dedicated {
422+ node .Appendf ("Dedicated servers: yes" )
423+ }
424+
413425 if * ss .PortForwardOnly {
414426 node .Appendf ("Port forwarding only servers: yes" )
415427 }
@@ -501,6 +513,12 @@ func (ss *ServerSelection) read(r *reader.Reader,
501513 return err
502514 }
503515
516+ // Ovpn only
517+ ss .Dedicated , err = r .BoolPtr ("SERVER_DEDICATED" )
518+ if err != nil {
519+ return err
520+ }
521+
504522 err = ss .OpenVPN .read (r )
505523 if err != nil {
506524 return err
0 commit comments