Page 1 of 1

Customize FTP Port & Customize Email Ports

Posted: Thu 24. Sep 2020, 17:44
by hexacube
Dear all. I am using Keyhelp in Google Cloud Virtual Machine. Due to firewall restrictions, I use port 2121 for FTP & port 2587 for sending emails through amazon SES SMTP relay. Everything is configured properly and working fine.

But in user's dashboard under FTP and EMAIL, the default ports are displayed under "Connection data -> Show". Is there anyway to edit / customize this? Much appreciated if this is kept as an option under configurations / under white label.

Screenshots attached for reference. Thank You.

Re: Customize FTP Port & Customize Email Ports

Posted: Mon 28. Sep 2020, 09:09
by Alexander
Right now, the values are hard-coded.

In an upcoming update, I could potentially also read them from the /etc/services file. In this case, if this file lists the correct ports, than they would be shown.
Beside of that, you can also use the white label settings and write some lines of Javascript to update the port numbers accordingly.

Re: Customize FTP Port & Customize Email Ports

Posted: Tue 29. Sep 2020, 10:12
by hexacube
Thank you @Alexander. I will try white label with js codes to replace the port numbers displayed.

Re: Customize FTP Port & Customize Email Ports  [SOLVED]

Posted: Tue 29. Sep 2020, 21:32
by hexacube

Code: Select all

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    if (window.location.href.indexOf("page=user_ftp") > -1) {
      $("td:contains('21')").html("2121");
	  $("td:contains('server.mywebserver.com')").html("ftp.mywebserver.com");
    }
    if (window.location.href.indexOf("page=user_email") > -1) {
      $("tH:contains('Connection data')").html("");
	  $("td:contains('Show')").html("");
    }	
  });
</script>
I have added the above javascript + jquery under white label configuration. Its perfectly working.

1. The FTP port is now displayed as 2121 instead of 21.
2. The email ports are completely hidden for users. Since I use amazon ses as smtp, I don't want my users to take control of smtp credentials and options to use external email clients.

Let me know whether the above code is correct and safe?

Re: Customize FTP Port & Customize Email Ports

Posted: Wed 30. Sep 2020, 09:09
by Alexander
You can remove the jquery include and the <script> tag, as this is taken care by KeyHelp.

Re: Customize FTP Port & Customize Email Ports

Posted: Wed 30. Sep 2020, 19:53
by hexacube
Thank you @Alexander

As suggested by u, I have removed them. Script is working fine as previous.