Skip to content

Commit

Permalink
Merge pull request #6387 from viown/remove-auto-port-forward
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill authored Dec 21, 2024
2 parents c36c58e + fb1ef7d commit 6e3fdbb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 27 deletions.
8 changes: 0 additions & 8 deletions src/controllers/dashboard/networking.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ <h2 class="sectionTitle">${TabNetworking}</h2>
<option value="blacklist">${Blacklist}</option>
</select>
</div>

<div class="checkboxContainer checkboxContainer-withDescription fldEnableUpnp hide">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableUpnp" />
<span>${LabelEnableAutomaticPortMap}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelEnableAutomaticPortMapHelp}</div>
</div>
<div class="inputContainer fldPublicHttpPort hide">
<input is="emby-input" type="number" label="${LabelPublicHttpPort}" id="txtPublicHttpPort" pattern="[0-9]*" required="required" min="1" max="65535" />
<div class="fieldDescription">${LabelPublicHttpPortHelp}</div>
Expand Down
11 changes: 3 additions & 8 deletions src/controllers/dashboard/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import alert from '../../components/alert';
function onSubmit(e) {
const form = this;
const localAddress = form.querySelector('#txtLocalAddress').value;
const enableUpnp = form.querySelector('#chkEnableUpnp').checked;
confirmSelections(localAddress, enableUpnp, function () {
confirmSelections(localAddress, function () {
const validationResult = getValidationAlert(form);

if (validationResult) {
Expand Down Expand Up @@ -54,7 +53,6 @@ function onSubmit(e) {
config.InternalHttpsPort = form.querySelector('#txtHttpsPort').value;
config.EnableHttps = form.querySelector('#chkEnableHttps').checked;
config.RequireHttps = form.querySelector('#chkRequireHttps').checked;
config.EnableUPnP = enableUpnp;
config.BaseUrl = form.querySelector('#txtBaseUrl').value;
config.EnableRemoteAccess = form.querySelector('#chkRemoteAccess').checked;
config.CertificatePath = form.querySelector('#txtCertificatePath').value || null;
Expand Down Expand Up @@ -110,8 +108,8 @@ function showAlertText(options) {
});
}

function confirmSelections(localAddress, enableUpnp, callback) {
if (localAddress || !enableUpnp) {
function confirmSelections(localAddress, callback) {
if (localAddress) {
showAlertText({
title: globalize.translate('TitleHostingSettings'),
text: globalize.translate('SettingsWarning')
Expand Down Expand Up @@ -139,7 +137,6 @@ export default function (view) {
const txtCertificatePath = page.querySelector('#txtCertificatePath');
txtCertificatePath.value = config.CertificatePath || '';
page.querySelector('#txtCertPassword').value = config.CertificatePassword || '';
page.querySelector('#chkEnableUpnp').checked = config.EnableUPnP;
triggerChange(page.querySelector('#chkRemoteAccess'));
page.querySelector('#chkAutodiscovery').checked = config.AutoDiscovery;
page.querySelector('#chkEnableIP6').checked = config.EnableIPv6;
Expand All @@ -154,13 +151,11 @@ export default function (view) {
view.querySelector('.fldExternalAddressFilterMode').classList.remove('hide');
view.querySelector('.fldPublicHttpPort').classList.remove('hide');
view.querySelector('.fldPublicHttpsPort').classList.remove('hide');
view.querySelector('.fldEnableUpnp').classList.remove('hide');
} else {
view.querySelector('.fldExternalAddressFilter').classList.add('hide');
view.querySelector('.fldExternalAddressFilterMode').classList.add('hide');
view.querySelector('.fldPublicHttpPort').classList.add('hide');
view.querySelector('.fldPublicHttpsPort').classList.add('hide');
view.querySelector('.fldEnableUpnp').classList.add('hide');
}
});
view.querySelector('#btnSelectCertPath').addEventListener('click', function () {
Expand Down
7 changes: 0 additions & 7 deletions src/controllers/wizard/remote/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ <h1>${HeaderConfigureRemoteAccess}</h1>
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowRemoteAccessHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableUpnp" />
<span>${LabelEnableAutomaticPortMap}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelEnableAutomaticPortMapHelp}</div>
</div>
<br />
<div class="wizardNavigation">
<button is="emby-button" type="button" class="raised button-cancel" onclick="history.back();">
Expand Down
3 changes: 1 addition & 2 deletions src/controllers/wizard/remote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function save(page) {
loading.show();
const apiClient = ApiClient;
const config = {
EnableRemoteAccess: page.querySelector('#chkRemoteAccess').checked,
EnableAutomaticPortMapping: page.querySelector('#chkEnableUpnp').checked
EnableRemoteAccess: page.querySelector('#chkRemoteAccess').checked
};

apiClient.ajax({
Expand Down
2 changes: 0 additions & 2 deletions src/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,6 @@
"LabelDynamicExternalId": "{0} Id",
"LabelEnableAudioVbr": "Enable VBR audio encoding",
"LabelEnableAudioVbrHelp": "Variable bitrate offers better quality to average bitrate ratio, but in some rare cases may cause buffering and compatibility issues.",
"LabelEnableAutomaticPortMap": "Enable automatic port mapping",
"LabelEnableAutomaticPortMapHelp": "Automatically forward public ports on your router to local ports on your server via UPnP. This may not work with some router models or network configurations. Changes will not apply until after a server restart.",
"LabelEnableHardwareDecodingFor": "Enable hardware decoding for",
"LabelEnableHttps": "Enable HTTPS",
"LabelEnableHttpsHelp": "Listen on the configured HTTPS port. A valid certificate must also be supplied for this to take effect.",
Expand Down

0 comments on commit 6e3fdbb

Please sign in to comment.