Skip to content

Commit

Permalink
Adding cluster awareness to the Admin setting page. Added documentati…
Browse files Browse the repository at this point in the history
…on and dutch translations.
  • Loading branch information
Anno van Vliet committed Aug 16, 2024
1 parent b072ed5 commit bbad319
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 29 deletions.
5 changes: 5 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@

<h1>HTTP File Upload Plugin Changelog</h1>

<p><b>${project.version}</b> -- (tbd)</p>
<ul>
<li>Added an admin settings page</li>
</ul>

<p><b>1.4.1</b> -- (tbd)</p>
<ul>
<li>Updated Ukrainian (uk_UA) translation, by Vladislav Savchuk (Bruhmozavr)</li>
Expand Down
7 changes: 7 additions & 0 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ <h2 id="configuration">Configuration</h2>
When both a regular and an XML property is defined, then the XML property value will take precedence.
</p>

<h3>Configuration admin page</h3>

<p>
To support the administration, an admin page has been provided which can be found at Server - Server settings -
Http File Upload Settings. The page does not support all available settings but compares the configured announced URL with the actual URL.
</p>

<h3>Storage of data on filesystem</h3>

<table>
Expand Down
10 changes: 6 additions & 4 deletions src/i18n/httpfileupload_i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ httpfileupload.settings.announcedPort.title=Announced TCP Port
httpfileupload.settings.announcedContextRoot.title=Announced Context root
httpfileupload.settings.fileRepo.title=File Directory
httpfileupload.settings.maxFileSize.title=Maximum File size
httpfileupload.settings.fileRepo.cluster.desc=In case of a Cluster using a centralized file storage, all cluster nodes should use the same shared network folder for file storage. Also make sure the service account(s) used to run the Openfire server node(s) have the correct privileges to access this network share.

httpfileupload.settings.logs.title=Web Binding Settings.
httpfileupload.settings.logs.description=File Uploads are shared through a web interface.
httpfileupload.settings.logs.redirect=The {0}HTTP Binding service{1} has to be used to change the actual port on which the Http File Upload service is hosted. If the external address is different for the external users, the values below should be adjusted.
httpfileupload.settings.logs.redirect=The {0}Web Binding settings{1} has to be used to change the actual port on which the Http File Upload service is hosted. If the external address is different for the external users, the values below should be adjusted.
httpfileupload.settings.logs.link.announced=File Uploads are shared through a external web interface at the following announced address: <a href="{0}">{0}</a>.
httpfileupload.settings.logs.link.unsecure=The announced address is not the same as the internal address: <a href="{0}">{0}</a>. This can be corrected by setting the proper values below. However, These values are ignored if XML properties ''plugin.httpfileupload.serverspecific'' are defined.
httpfileupload.settings.logs.link.secure=The announced address is not the same as the internal secure Web address: <a href="{0}">{0}</a>. This can be corrected by setting the proper values below. However, These values are ignored if XML properties ''plugin.httpfileupload.serverspecific'' are defined.
httpfileupload.settings.logs.link.unsecure=The announced address is not the same as the internal address: <a href="{0}">{0}</a>. This can be corrected by setting the proper values below.<br/>However, the values below are ignored if XML properties ''plugin.httpfileupload.serverspecific'' are defined.
httpfileupload.settings.logs.link.secure=The announced address is not the same as the internal secure Web address: <a href="{0}">{0}</a>. This can be corrected by setting the proper values below.<br/>However, these values below are ignored if XML properties ''plugin.httpfileupload.serverspecific'' are defined.
httpfileupload.settings.logs.link.cluster=This node is part of an active cluster. Depending on the configuration chosen, the announced address should be the cluster address: <a href="{0}">{0}</a>. This can be corrected by setting the proper values below.<br/>However, these values below are ignored if XML properties ''plugin.httpfileupload.serverspecific'' are defined.

httpfileupload.sidebar.settings=Http File Upload Settings
httpfileupload.sidebar.settings.desc=Manage Http File Upload Settings.

warning.httpbinding.disabled=The HTTP Binding service appears to be disabled! File Uploads will not be accessible without this service. {0}Please enable the HTTP Binding service here!{1}
warning.httpbinding.disabled=The Web Binding service appears to be disabled! File Uploads will not be accessible without this service. {0}Please enable the Web Binding service here!{1}
29 changes: 29 additions & 0 deletions src/i18n/httpfileupload_i18n_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,32 @@ system_property.plugin.httpfileupload.clamavPort=Definieert de TCP poort die geb
system_property.plugin.httpfileupload.clamavConnectionTimeout=Bepaald de timeout die wordt gebruikt als een connectiepoging naar de (third-party) ClamAV malware scanner daemon wordt opgezet.
system_property.plugin.httpfileupload.fileRepo=Definieert het pad op het bestandssysteem (directory) waarin data op de server wordt opgeslagen. Als dit pad niet wordt opgegeven of ongeldig is, dan wordt een tijdelijke directory gebruikt.
system_property.plugin.httpfileupload.maxFileSize=Definieert de maximale grootte (in bytes) van een bestand dat kan worden geupload.

# admin page setting
httpfileupload.settings.title = Http File Upload instellingen
httpfileupload.settings.success = Http File Upload instellingen zijn opgeslagen.
httpfileupload.settings.message.metadata.title = Upload instellingen
httpfileupload.settings.message.metadata.description =
httpfileupload.settings.description = Gebruik het onderstaande formulier om de HTTP File Upload instellingen aan te passen.
httpfileupload.settings.cancel = Cancel
httpfileupload.settings.update.settings = Instellingen opslaan
httpfileupload.settings.announcedProtocol.title=Geadverteerd protocol
httpfileupload.settings.announcedWebHost.title=Geadverteerde serveradres
httpfileupload.settings.announcedPort.title=Geadverteerde TCP poort
httpfileupload.settings.announcedContextRoot.title=Geadverteerde context root
httpfileupload.settings.fileRepo.title=Bestanden directory
httpfileupload.settings.maxFileSize.title=Maximum bestandsgrootte
httpfileupload.settings.fileRepo.cluster.desc=In het geval van een cluster die een gecentraliseerde bestandsopslag gebruikt, moeten alle clusterknooppunten dezelfde gedeelde netwerkmap gebruiken voor bestandsopslag. Zorg er ook voor dat de serviceaccount(s) die worden gebruikt om de Openfire-serverknooppunt(en) uit te voeren, de juiste rechten hebben om toegang te krijgen tot deze netwerkshare.

httpfileupload.settings.logs.title=Web Binding instellingen.
httpfileupload.settings.logs.description=Bestandsuploads worden gedeeld via een web interface.
httpfileupload.settings.logs.redirect=The {0}Web Binding instellingen{1} moet worden gebruikt om de werkelijke poort te wijzigen waarop de Http File Upload-service wordt gehost. Als het externe adres voor de externe gebruikers anders is, moeten de onderstaande waarden worden aangepast.
httpfileupload.settings.logs.link.announced=Bestandsuploads worden gedeeld via een externe webinterface op het volgende geadverteerde URL: <a href="{0}">{0}</a>.
httpfileupload.settings.logs.link.unsecure=De geadverteerde URL is niet hetzelfde als de interne URL: <a href="{0}">{0}</a>. U kunt dit oplossen door de onderstaande waarden in te stellen. <br/>De onderstaande waarden worden echter genegeerd als XML-eigenschappen ''plugin.httpfileupload.serverspecific'' zijn gedefinieerd.
httpfileupload.settings.logs.link.secure=De geadverteerde URL is niet hetzelfde als de interne beveiligde URL: <a href="{0}">{0}</a>. U kunt dit oplossen door de onderstaande waarden in te stellen.<br/>De onderstaande waarden worden echter genegeerd als XML-eigenschappen ''plugin.httpfileupload.serverspecific'' zijn gedefinieerd.
httpfileupload.settings.logs.link.cluster=This node is part of an active cluster. Depending on the configuration chosen, the announced address should be the cluster address: <a href="{0}">{0}</a>. U kunt dit oplossen door de onderstaande waarden in te stellen.<br/>De onderstaande waarden worden echter genegeerd als XML-eigenschappen ''plugin.httpfileupload.serverspecific'' zijn gedefinieerd.

httpfileupload.sidebar.settings=Http File Upload instellingen
httpfileupload.sidebar.settings.desc=Aanpassen van de Http File Upload instellingen.

warning.httpbinding.disabled=De Web Binding-service lijkt uitgeschakeld te zijn! Bestandsuploads zijn niet mogelijk zonder deze service. {0}Schakel hier de Web Binding-service in!{1}
48 changes: 23 additions & 25 deletions src/web/httpfileupload-settings.jsp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%@page import="org.jivesoftware.openfire.cluster.ClusterManager"%>
<%@page import="java.net.URI"%>
<%@page import="java.net.URISyntaxException"%>
<%@page import="java.io.IOException"%>
Expand Down Expand Up @@ -153,29 +154,25 @@
</p>

<%
if ( HttpFileUploadPlugin.ANNOUNCED_WEB_PROTOCOL.getValue().equals("https") ) {
final String securedAddress = "https://" + XMPPServer.getInstance().getServerInfo().getHostname() + ":" + HttpBindManager.HTTP_BIND_SECURE_PORT.getValue() + "/httpfileupload";
if ( !announcedAddress.equals(securedAddress)) { %>
<div class="warning">
<fmt:message key="httpfileupload.settings.logs.link.secure">
<fmt:param value="<%= securedAddress %>"/>
</fmt:message>
</div>
<% }
} else {
final String unsecuredAddress = "http://" + XMPPServer.getInstance().getServerInfo().getHostname() + ":" + HttpBindManager.HTTP_BIND_PORT.getValue() + "/httpfileupload";
if ( !announcedAddress.equals(unsecuredAddress) ) { %>
<div class="warning">
<fmt:message key="httpfileupload.settings.logs.link.unsecure">
<fmt:param value="<%= unsecuredAddress %>"/>
</fmt:message>
</div>
<% }
}
final boolean cluster = ClusterManager.isClusteringStarted() || ClusterManager.isClusteringStarting();
final boolean secure = HttpFileUploadPlugin.ANNOUNCED_WEB_PROTOCOL.getValue().equals("https");
final String calculatedAddress =
( secure ? "https://" : "http://" )
+ ( cluster ? XMPPServer.getInstance().getServerInfo().getXMPPDomain() : XMPPServer.getInstance().getServerInfo().getHostname() )
+ ":"
+ ( secure ? HttpBindManager.HTTP_BIND_SECURE_PORT.getValue() : HttpBindManager.HTTP_BIND_PORT.getValue() )
+ "/httpfileupload";
String message = (cluster ? "httpfileupload.settings.logs.link.cluster" : (secure ? "httpfileupload.settings.logs.link.secure" : "httpfileupload.settings.logs.link.unsecure" ));
if ( !announcedAddress.equals(calculatedAddress)) { %>
<div class="warning">
<fmt:message key="<%=message %>">
<fmt:param value="<%= calculatedAddress %>"/>
</fmt:message>
</div>
<% }
%>

<p><fmt:message key="httpfileupload.settings.logs.redirect" >
Expand Down Expand Up @@ -238,9 +235,10 @@
<td>
<label class="jive-label"><fmt:message key="httpfileupload.settings.fileRepo.title"/>:</label>
<br>
<fmt:message key="system_property.plugin.httpfileupload.fileRepo"/></td>
<fmt:message key="system_property.plugin.httpfileupload.fileRepo"/><br>
<fmt:message key="httpfileupload.settings.fileRepo.cluster.desc"/></td>
<td>
<input type="text" name="fileRepo" size="20" maxlength="250" value="<%= fileRepo %>" />
<input type="text" name="fileRepo" size="30" maxlength="250" value="<%= fileRepo %>" />
</td>
<td></td>
</tr>
Expand Down

0 comments on commit bbad319

Please sign in to comment.