-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luci-app-libreswan: Add LuCI for Libreswan #5932
Conversation
1c0359e
to
96d1dca
Compare
f51d3b1
to
4e851a5
Compare
Looks good, logical. Problems with 0.0.0.0/0 masks - IPv4 only. The GUI assumes that the necessary kernel modules are installed (and loaded). Have you tested in the absence of a (configured for use) crypto module? It's a start. Handling certs would be a good improvement, but increases complexity, ofc. |
Did not get you with "Problems with 0.0.0.0/0 masks - IPv4 only",
The GUI assumes that the necessary kernel modules are installed (and loaded).
|
4e851a5
to
fd6c795
Compare
fd6c795
to
ade187c
Compare
Just a thought, but given that libreswan and strongswan are virtually identical, can this GUI be dual purpose and used for both? I actually don't know what needs to be done in the package descriptions and/or permissions files, but maybe @jow has a tip here. |
ade187c
to
fa4f970
Compare
fa4f970
to
064394e
Compare
great stuff, it works
|
Tested-by: Lucian [email protected] |
064394e
to
39bee1d
Compare
o.optional = false; | ||
|
||
o = s.taboption('authentication', form.Value, 'psk', _('Preshare Key')); | ||
o.datatype = 'and(string, minlenght(8))' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minlength(8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
|
||
o = s.taboption('authentication', form.ListValue, 'authby', _('Auth Method')); | ||
o.default = 'secret' | ||
o.value('secret', 'Preshare Key'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preshared Key
Also, please add never
and null
types. Useful to some.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
o.value('sha512', _('SHA512')); | ||
|
||
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method')); | ||
o.default = '3des'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this default, and mark 3des with a *
, and a GUI note explaining it as unsafe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method')); | ||
o.default = '3des'; | ||
o.value('3des', _('3DES')) | ||
o.value('aes', _('AES')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark AES as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
o = s.taboption('general', form.MultiValue, 'hash_algorithm', _('Hash Algorithm')); | ||
o.default = 'md5'; | ||
o.value('md5', _('MD5')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark this hash with a *
:
o.value('md5', _('MD5*'));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o = s.taboption('general', form.MultiValue, 'hash_algorithm', _('Hash Algorithm')); | ||
o.default = 'md5'; | ||
o.value('md5', _('MD5')); | ||
o.value('sha1', _('SHA1')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark this hash with a *
:
o.value('sha1', _('SHA1*'));
- Move to a better, more collision resistant hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
o = s.taboption('advanced', form.Value, 'ikelifetime', _('IKE Life Time')); | ||
o.datatype = 'uinteger'; | ||
o.default = 10800; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add multiple values to choose from (and hint in readable text the amount of hours it represents), and permit the user to enter their own values.
If the current libreswan version is >=4.2, then the default is 8h
.
I do not think that this should be an unsigned integer...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions: 1h, 2h, 4h, 8h, 12h, 16, 24h, custom...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o.modalonly = true; | ||
o.optional = false; | ||
|
||
o = s.taboption('authentication', form.Value, 'psk', _('Preshare Key')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a depends
where authentication = secret - future iterations may add other auth methods.
for (var i = 0; i < netDevs.length; i++) { | ||
var addrs = netDevs[i].getIPAddrs(); | ||
for (var j = 0; j < addrs.length; j++) { | ||
var subnet = calculateNetwork(addrs[j].split('/')[0], addrs[j].split('/')[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested what happens here with an IPv6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This app version does not support IPv6, getIPAddrs
only returns IPv4 addresses.
/**
* Query all IPv4 addresses of the logical interface.
*
* @returns {string[]}
* Returns an array of IPv4 addresses in CIDR notation which have been
* registered by the protocol handler. The order of the resulting array
* follows the order of the addresses in `ubus` runtime information.
*/
getIPAddrs: function() {
Why can't it be merged, this app is very much needed |
Error after latest main build
|
tested it today on master and I don't have that issue, all seems to work |
@jempatel can you address my comments, and let me know when you're done. |
Sure, Let me address the comments and test changes. |
5e53eb1
to
64ae849
Compare
If you did something, nothing has changed here... |
I've recently rebased the master branches of both |
64ae849
to
2a260fa
Compare
This PR depends on |
@systemcrash all the comments are addressed and PR in packages is also merged now. If everything is fine, we can merge this as well |
Almost, you have the right values there, but they should be made translation (i18n) friendly. e.g. o.value('secret', 'Shared Secret'); should be o.value('secret', _('Shared Secret')); |
o.value('sha384', _('SHA384')); | ||
o.value('sha512', _('SHA512')); | ||
|
||
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to e.g.:
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method'), _('* = unsafe'));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method')); | ||
o.default = 'aes'; | ||
o.value('3des', _('3DES* [Unsafe]')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 3DES*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With ofc
o = s.taboption('general', form.MultiValue, 'encryption_algorithm', _('Encryption Method'), _('* = unsafe'));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o.value('aes256', _('AES256')); | ||
o.value('camellia_cbc', _('CAMELLIA_CBC')); | ||
|
||
o = s.taboption('general', form.MultiValue, 'dh_group', _('DH Group')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment _('* = unsafe. See <a href="%s">RFC8247</a>.').format('https://www.rfc-editor.org/rfc/rfc8247#section-2.4')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o.value('dh19', _('DH Group 19')); | ||
o.value('dh20', _('DH Group 20')); | ||
o.value('dh21', _('DH Group 21')); | ||
o.value('dh22', _('DH Group 22')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark dh22 as DH Group 22*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
o = s.taboption('general', form.MultiValue, 'dh_group', _('DH Group')); | ||
o.default = 'modp1536'; | ||
o.value('modp1536', _('DH Group 5')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark with *
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with ofc
o = s.taboption('general', form.MultiValue, 'dh_group', _('DH Group'), _('* = unsafe'));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
o.default = '9m'; | ||
o.value('5m', '5m'); | ||
o.value('9m', '9m'); | ||
o.value('15m', '15h'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 🧐
@jempatel please fix these most recent additions |
2a260fa
to
ce11cc5
Compare
Done |
o.value('camellia_cbc', _('CAMELLIA_CBC')); | ||
|
||
o = s.taboption('general', form.MultiValue, 'dh_group', _('DH Group'), | ||
('* = %s, See <a href="%s">RFC8247</a>.').format(_('Unsafe'), 'https://www.rfc-editor.org/rfc/rfc8247#section-2.4')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure that translatable sections start with _
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its already handled inside the format function except string "See"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps just put See also in with Unsafe, e.g. _('Unsafe, See')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
LuCI Support for IPSec VPN (Libreswan) Signed-off-by: Jaymin Patel <[email protected]>
ce11cc5
to
068e9f0
Compare
I held back merging this as the underlying packages PR were open for a long time, but it seems they finally got merged last week, so let's go ahead! We can still continue polishing this in subsequent PRs if the need arises. @jempatel - thanks a lot for your effort and patience. |
Merged via 9f65244 |
@jempatel looks like you missed the 15m -> 15h thing I flagged in the review. |
Ahh, Yup I missed that. Looks like someone had already updated and merged that to master. |
A new app for Libreswan IPSec with LuCI Support.
We also need openwrt/packages#19079
We also need openwrt/packages#19233
Screenshots from the new Luci App Libreswan:
Overview:
Globals:
Proposals:
Proposals Edit:
Tunnels:
Tunnels (General):
Tunnels (Authentication):
Tunnels (Interface):
Tunnels (Advanced):