Skip to content

Commit

Permalink
Merge in devel code (#117)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Manojav Sridhar <[email protected]>

* 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 <[email protected]>
Co-authored-by: Manojav Sridhar <[email protected]>
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 <[email protected]>
Co-authored-by: Manojav Sridhar <[email protected]>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jun 18, 2021
1 parent 6ca6854 commit 7791bb5
Show file tree
Hide file tree
Showing 12 changed files with 1,161 additions and 666 deletions.
534 changes: 326 additions & 208 deletions net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/wg.inc

Large diffs are not rendered by default.

736 changes: 517 additions & 219 deletions net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/wg_api.inc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@ require_once('globals.inc');

global $g, $wgg;

define('WG_ERROR_IF_NAME', 1);
define('WG_ERROR_IF_CREATE', 2);
define('WG_ERROR_IF_GROUP', 4);
define('WG_ERROR_IF_ADDRESSES', 8);
define('WG_ERROR_IF_UP', 16);
define('WG_ERROR_IF_DOWN', 32);
define('WG_ERROR_IF_SYNC', 64);
define('WG_ERROR_IF_DESTROY', 128);

define('WG_ERROR_SVC_RUNNING', 1);
define('WG_ERROR_SVC_START', 2);
define('WG_ERROR_SVC_STOP', 4);
define('WG_ERROR_SVC_BUILD', 8);
define('WG_ERROR_PEER_SET', 1);
define('WG_ERROR_PEER_ENDPOINT', 2);

define('WG_ERROR_IF_NAME', 1);
define('WG_ERROR_IF_CREATE', 2);
define('WG_ERROR_IF_GROUP', 4);
define('WG_ERROR_IF_SETADDR', 8);
define('WG_ERROR_IF_DELADDR', 16);
define('WG_ERROR_IF_UP', 32);
define('WG_ERROR_IF_DOWN', 64);
define('WG_ERROR_IF_SYNC', 128);
define('WG_ERROR_IF_DESTROY', 256);

define('WG_ERROR_SVC_RUNNING', 1);
define('WG_ERROR_SVC_START', 2);
define('WG_ERROR_SVC_STOP', 4);
define('WG_ERROR_SVC_CREATE', 8);

$wgg = array(
'wg' => '/usr/local/bin/wg',
Expand Down Expand Up @@ -72,11 +76,15 @@ $wgg = array(
300 => array('class' => 'text-warning', 'title' => gettext('Greater than 5 minutes')),
0 => array('class' => 'text-success', 'title' => gettext('Less than 5 minutes'))),
'error_flags' => array(
'tunnel' => array(
'peer' => array(
WG_ERROR_PEER_SET => gettext('Unable to set peer configuration'),
WG_ERROR_PEER_ENDPOINT => gettext('Unable to resolve peer endpoint')),
'interface' => array(
WG_ERROR_IF_NAME => gettext('Invalid WireGuard tunnel name'),
WG_ERROR_IF_CREATE => gettext('Unable to create WireGuard tunnel interface'),
WG_ERROR_IF_GROUP => gettext('Unable to add WireGuard tunnel interface to the WireGuard interface group'),
WG_ERROR_IF_ADDRESSES => gettext('Unable to update WireGuard tunnel interface addresses'),
WG_ERROR_IF_SETADDR => gettext('Unable to set WireGuard tunnel interface address(es)'),
WG_ERROR_IF_DELADDR => gettext('Unable to delete WireGuard tunnel interface address(es)'),
WG_ERROR_IF_UP => gettext('Unable to bring up WireGuard tunnel interface'),
WG_ERROR_IF_DOWN => gettext('Unable to bring down WireGuard tunnel interface'),
WG_ERROR_IF_SYNC => gettext('Unable to sync WireGuard tunnel configuration with wg(8)'),
Expand All @@ -85,11 +93,12 @@ $wgg = array(
WG_ERROR_SVC_RUNNING => gettext('WireGuard service is already running'),
WG_ERROR_SVC_START => gettext('Unable to start WireGuard service'),
WG_ERROR_SVC_STOP => gettext('Unable to stop WireGuard service'),
WG_ERROR_SVC_BUILD => gettext('Unable to build WireGuard tunnel(s)'))),
'default_mtu' => 1420,
'default_port' => 51820,
'max_port' => 65535,
'max_tunnels' => 32768
WG_ERROR_SVC_CREATE => gettext('Unable to create WireGuard tunnel(s)'))),
'default_mtu' => 1420,
'default_port' => 51820,
'default_resolve_interval' => 300,
'max_port' => 65535,
'max_tunnels' => 32768
);

// These all depend on one more more of the above values
Expand Down
Loading

0 comments on commit 7791bb5

Please sign in to comment.