Define NordVPN plugin configuration

Add the package metadata and OPNsense model for country eligibility, native traffic selectors, direct egress, failure policy, and managed object identity.
This commit is contained in:
ms2k 2026-08-02 23:16:50 +09:00
commit 7184f595ba
6 changed files with 103 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
# Local configuration and secrets # Local configuration and secrets
.env .env
.secrets/ .secrets/
secret/
config.local.* config.local.*
*.token *.token
*.key *.key

25
LICENSE Normal file
View file

@ -0,0 +1,25 @@
BSD 2-Clause License
Copyright (c) 2026, ms2k
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

5
Makefile Normal file
View file

@ -0,0 +1,5 @@
PLUGIN_NAME= nordvpn
PLUGIN_VERSION= 0.1
PLUGIN_COMMENT= Managed NordLynx egress and server failover
.include "../../Mk/plugins.mk"

1
pkg-descr Normal file
View file

@ -0,0 +1 @@
Maintains NordLynx WireGuard egress on OPNsense, selects servers from NordVPN recommendations, and applies the configured failure policy.

View file

@ -0,0 +1,12 @@
<?php
// SPDX-License-Identifier: BSD-2-Clause
// SPDX-FileCopyrightText: 2026 ms2k
namespace OPNsense\NordVPN;
use OPNsense\Base\BaseModel;
class Settings extends BaseModel
{
}

View file

@ -0,0 +1,59 @@
<model>
<mount>//OPNsense/NordVPN</mount>
<version>1.0.0</version>
<description>NordVPN managed egress</description>
<items>
<general>
<countries type="CSVListField"/>
<interfaces type="InterfaceField">
<Multiple>Y</Multiple>
<Filters>
<if>/^(?!lo0$).*/</if>
</Filters>
</interfaces>
<source type="NetworkAliasField">
<Default>any</Default>
<Required>Y</Required>
<Multiple>Y</Multiple>
</source>
<source_not type="BooleanField">
<Default>0</Default>
<Required>Y</Required>
</source_not>
<destination type="NetworkAliasField">
<Default>any</Default>
<Required>Y</Required>
<Multiple>Y</Multiple>
</destination>
<destination_not type="BooleanField">
<Default>0</Default>
<Required>Y</Required>
</destination_not>
<direct_gateway type="JsonKeyValueStoreField">
<ConfigdPopulateAct>interface gateways list -g</ConfigdPopulateAct>
<ValidationMessage>Specify a valid IPv4 gateway.</ValidationMessage>
</direct_gateway>
<failure_policy type="OptionField">
<Default>fail_closed</Default>
<Required>Y</Required>
<OptionValues>
<fail_closed>Fail closed</fail_closed>
<fail_open>Fail open</fail_open>
</OptionValues>
</failure_policy>
<exempt_wireguard type="BooleanField">
<Default>0</Default>
<Required>Y</Required>
</exempt_wireguard>
</general>
<managed>
<instance_uuid type="TextField"/>
<peer_uuid type="TextField"/>
<gateway_uuid type="TextField"/>
<server_hostname type="HostnameField"/>
<server_country type="TextField">
<Mask>/^[A-Z]{2}$/</Mask>
</server_country>
</managed>
</items>
</model>