Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/turnserver/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PLUGIN_NAME= turnserver
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_COMMENT= The coturn STUN/TURN Server
PLUGIN_DEPENDS= turnserver
PLUGIN_MAINTAINER= opnsense@moov.de
Expand Down
8 changes: 8 additions & 0 deletions net/turnserver/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ WWW: https://github.com/coturn/coturn
Plugin Changelog
================

1.2

Added:
* add support for external IPs and IP mappings (#4906)

Changed:
* modernize UI template

1.1

Added:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
<type>text</type>
<help>Upper bound of the UDP relay endpoints (Default: 65535).</help>
</field>
<field>
<id>turnserver.settings.ExternalIP</id>
<label>External IP</label>
<type>select_multiple</type>
<style>tokenize</style>
<allownew>true</allownew>
<help>If the TURN service is behind a NAT, it's external IP address should be specified. When using multiple external IP addresses, IP Mappings should be used instead, i.e. 60.70.80.91/172.17.19.101 (public-ip/private-ip).</help>
</field>
<field>
<label>TLS Support</label>
<type>header</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<Default>65535</Default>
<Required>Y</Required>
</MaxPort>
<ExternalIP type="CSVListField">
<Required>N</Required>
<Multiple>Y</Multiple>
<Mask>/^((([0-9a-zA-Z._\-]+[\/0-9a-zA-Z._\-]*)([,]){0,1}))*/u</Mask>
<ValidationMessage>Please provide an external IP address or an IP mapping, i.e. 60.70.80.91/172.17.19.101.</ValidationMessage>
</ExternalIP>
<TlsEnabled type="BooleanField">
<Default>0</Default>
<Required>Y</Required>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{#

Copyright (C) 2025 Frank Wall
Copyright (C) 2025-2026 Frank Wall
OPNsense® is Copyright © 2014 – 2015 by Deciso B.V.
All rights reserved.

Expand Down Expand Up @@ -28,30 +28,36 @@ POSSIBILITY OF SUCH DAMAGE.
#}

<script>
$( document ).ready(function() {
mapDataToFormUI({'frm_Settings':"/api/turnserver/settings/get"}).done(function(data){
$(document).ready(function() {
mapDataToFormUI({'frm_Settings': "/api/turnserver/settings/get"}).done(function() {
formatTokenizersUI();
$('.selectpicker').selectpicker('refresh');
});

// link save button to API set action
$("#saveAct").click(function(){
saveFormToEndpoint("/api/turnserver/settings/set",'frm_Settings',function(){
// reconfigure service
ajaxCall(url="/api/turnserver/service/reconfigure", sendData={},callback=function(data,status) {
});
});
updateServiceControlUI('turnserver');
$("#reconfigureAct").SimpleActionButton({
onPreAction: function() {
const dfObj = new $.Deferred();
saveFormToEndpoint(
"/api/turnserver/settings/set",
'frm_Settings',
function() {
dfObj.resolve();
},
true,
function() {
dfObj.reject();
}
);
return dfObj.promise();
},
onAction: function() {
updateServiceControlUI('turnserver');
}
});
});
</script>

<div class="alert alert-info hidden" role="alert" id="responseMsg">

</div>

<div class="col-md-12">
<div class="content-box">
{{ partial("layout_partials/base_form",['fields':settingsForm,'id':'frm_Settings'])}}
</div>

<div class="col-md-12">
<button class="btn btn-primary" id="saveAct" type="button"><b>{{ lang._('Apply') }}</b></button>
</div>
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/turnserver/service/reconfigure', 'data_service_widget': 'turnserver'}) }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ listening-ip={{ listenip }}
listening-port={{ OPNsense.turnserver.settings.ListenPort }}
min-port={{ OPNsense.turnserver.settings.MinPort }}
max-port={{ OPNsense.turnserver.settings.MaxPort }}
{% if helpers.exists('OPNsense.turnserver.settings.ExternalIP') and OPNsense.turnserver.settings.ExternalIP|default("") != "" %}
{% for externalip in OPNsense.turnserver.settings.ExternalIP.split(",") %}
external-ip={{ externalip }}
{% endfor %}
{% endif %}

# TLS
{% if helpers.exists('OPNsense.turnserver.settings.TlsEnabled') and OPNsense.turnserver.settings.TlsEnabled|default("") == "1" %}
Expand Down