Skip to content

Commit 7791bb5

Browse files
rcmcdonald91vajonamallcontributors[bot]
authored
Merge in devel code (#117)
* back merge main onto devel (#94) * Update main to latest (#77) * Updated pkg-plist * Makefile fix * Experimenting with wireguard service * Update README.md Co-authored-by: vajonam <152501+vajonam@users.noreply.github.com> Co-authored-by: Manojav Sridhar <manojav@manojav.com> * docs: add theonemcdonald as a contributor (#84) * docs: update README.md [skip ci] * docs: create .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * Update README.md * Update README.md * Update .all-contributorsrc * Update .all-contributorsrc * Update README.md * Update README.md * Update Makefile * Cleanup * Cleanup * Clean upload of v0.1.2 * Create FUNDING.yml * Add files via upload Co-authored-by: vajonam <152501+vajonam@users.noreply.github.com> Co-authored-by: Manojav Sridhar <manojav@manojav.com> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * Clean ups * Syntax * Updated README * Improve input error clarity * Syntax * More syntax * Fix missing address, allowedip fields after tunnel or peer input errors * Reorganized peer post validation * Reorder all input errors to be consistent with UI order * Fix input being flushed on peer validation error * Fix * Test * Fix #98 * Also Fix #98 * v0.1.3 will be reserved for the next PR with Netgate * Further fixes #98 * More fixes for #98... * Removed exit() while working on #98 * Refactor wg_generate_tunnel_address_popover_link for readability * Working on guiconfig cleaning * Should fix #99 * Fix variable #99 * Fix re-saving unchanged tunnel or peer * Fix broke status icon * Back out some boiler plate code * Relocate pf reload trigger on tunnel sync * Test * Fixes some php errors on newer PHP versions * this has to be absolute apparently * Can't redeclare this * wg_clamp_key and wg_is_key_clamped functions * wg_gen_publickey now detects if a privkey was clamped or not * fix wg_gen_keypair to correctly consume new gen_publickey * Bump net/wireguard-kmod to 0.0.20210606 * Fix some logic in new functioons * syntax * Clamp private keys on UI * Don't block unclamped private keys in the UI * Validate pre-shared key * Missed a call that needs tweaking * Slight cleanup * Candidate 0.1.3 build for Netgate PR * Small bump * Tweak subsystem names * Testing * Add some comments to .conf files for the curious * Add some useful debug bits to .conf files * Testing extra services restart on apply * We are now going to restart extra services (currently dpinger and unbound) on config apply (in addition to service restart) * Bump v0.1.2_5 * Enable data-sortable on relevant tables * Missed a table * Peers should become unassigned when their tunnel is deleted * allowedips needs to be an array even when empty * Implement package apply conf on tunnels_edit.php * Tweaks to form post handling * Syntax * Private and PSKs are now hidden by default * Syntax * sortable tables doesn't play nicely with popovers, will revisit in the future * Slight UI tweaks * syntax * Improve sync logic * Test * Testing * Implement conf file downloads from UI * Fixed incorrect tunnel name variable * Bump 0.1.2_6 * Testing * fix plist * Add timestamp to conf download * Typo * " * Working on DNS race * Syntax * Working on DNS * Syntax * MVCd the settings page * Syntax * syntax * More DNS work * More DNS work * Playing with DNS bits * DNS testing * More DNS work * Working on DNS improvements * Resync pakage on post * DNS work * A bit more DNS work * DNS Testing * DNS work * Final DNS work * Some backend rewrites * Cleanups * Some more work * Tweaks * Fixed some variables * Fix variable * Work * Testing some refactoring * Fix some GUI stuff after refactor * Fixes from refactoring * Fix typo * Typo fix * Fix bug * Fix gui bug * This should be count() not max() Co-authored-by: vajonam <152501+vajonam@users.noreply.github.com> Co-authored-by: Manojav Sridhar <manojav@manojav.com> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
1 parent 6ca6854 commit 7791bb5

File tree

12 files changed

+1161
-666
lines changed

12 files changed

+1161
-666
lines changed

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/wg.inc

Lines changed: 326 additions & 208 deletions
Large diffs are not rendered by default.

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/wg_api.inc

Lines changed: 517 additions & 219 deletions
Large diffs are not rendered by default.

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/wg_globals.inc

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,23 @@ require_once('globals.inc');
2727

2828
global $g, $wgg;
2929

30-
define('WG_ERROR_IF_NAME', 1);
31-
define('WG_ERROR_IF_CREATE', 2);
32-
define('WG_ERROR_IF_GROUP', 4);
33-
define('WG_ERROR_IF_ADDRESSES', 8);
34-
define('WG_ERROR_IF_UP', 16);
35-
define('WG_ERROR_IF_DOWN', 32);
36-
define('WG_ERROR_IF_SYNC', 64);
37-
define('WG_ERROR_IF_DESTROY', 128);
38-
39-
define('WG_ERROR_SVC_RUNNING', 1);
40-
define('WG_ERROR_SVC_START', 2);
41-
define('WG_ERROR_SVC_STOP', 4);
42-
define('WG_ERROR_SVC_BUILD', 8);
30+
define('WG_ERROR_PEER_SET', 1);
31+
define('WG_ERROR_PEER_ENDPOINT', 2);
32+
33+
define('WG_ERROR_IF_NAME', 1);
34+
define('WG_ERROR_IF_CREATE', 2);
35+
define('WG_ERROR_IF_GROUP', 4);
36+
define('WG_ERROR_IF_SETADDR', 8);
37+
define('WG_ERROR_IF_DELADDR', 16);
38+
define('WG_ERROR_IF_UP', 32);
39+
define('WG_ERROR_IF_DOWN', 64);
40+
define('WG_ERROR_IF_SYNC', 128);
41+
define('WG_ERROR_IF_DESTROY', 256);
42+
43+
define('WG_ERROR_SVC_RUNNING', 1);
44+
define('WG_ERROR_SVC_START', 2);
45+
define('WG_ERROR_SVC_STOP', 4);
46+
define('WG_ERROR_SVC_CREATE', 8);
4347

4448
$wgg = array(
4549
'wg' => '/usr/local/bin/wg',
@@ -72,11 +76,15 @@ $wgg = array(
7276
300 => array('class' => 'text-warning', 'title' => gettext('Greater than 5 minutes')),
7377
0 => array('class' => 'text-success', 'title' => gettext('Less than 5 minutes'))),
7478
'error_flags' => array(
75-
'tunnel' => array(
79+
'peer' => array(
80+
WG_ERROR_PEER_SET => gettext('Unable to set peer configuration'),
81+
WG_ERROR_PEER_ENDPOINT => gettext('Unable to resolve peer endpoint')),
82+
'interface' => array(
7683
WG_ERROR_IF_NAME => gettext('Invalid WireGuard tunnel name'),
7784
WG_ERROR_IF_CREATE => gettext('Unable to create WireGuard tunnel interface'),
7885
WG_ERROR_IF_GROUP => gettext('Unable to add WireGuard tunnel interface to the WireGuard interface group'),
79-
WG_ERROR_IF_ADDRESSES => gettext('Unable to update WireGuard tunnel interface addresses'),
86+
WG_ERROR_IF_SETADDR => gettext('Unable to set WireGuard tunnel interface address(es)'),
87+
WG_ERROR_IF_DELADDR => gettext('Unable to delete WireGuard tunnel interface address(es)'),
8088
WG_ERROR_IF_UP => gettext('Unable to bring up WireGuard tunnel interface'),
8189
WG_ERROR_IF_DOWN => gettext('Unable to bring down WireGuard tunnel interface'),
8290
WG_ERROR_IF_SYNC => gettext('Unable to sync WireGuard tunnel configuration with wg(8)'),
@@ -85,11 +93,12 @@ $wgg = array(
8593
WG_ERROR_SVC_RUNNING => gettext('WireGuard service is already running'),
8694
WG_ERROR_SVC_START => gettext('Unable to start WireGuard service'),
8795
WG_ERROR_SVC_STOP => gettext('Unable to stop WireGuard service'),
88-
WG_ERROR_SVC_BUILD => gettext('Unable to build WireGuard tunnel(s)'))),
89-
'default_mtu' => 1420,
90-
'default_port' => 51820,
91-
'max_port' => 65535,
92-
'max_tunnels' => 32768
96+
WG_ERROR_SVC_CREATE => gettext('Unable to create WireGuard tunnel(s)'))),
97+
'default_mtu' => 1420,
98+
'default_port' => 51820,
99+
'default_resolve_interval' => 300,
100+
'max_port' => 65535,
101+
'max_tunnels' => 32768
93102
);
94103

95104
// These all depend on one more more of the above values

0 commit comments

Comments
 (0)