Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 889787 Details for
Bug 1091432
Make binding ports configurable for GIT and SSH daemons
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Code patch
Make_binding_ports_configurable_by_system_properties_.patch (text/plain), 5.01 KB, created by
Pedro Zapata
on 2014-04-25 15:07:51 UTC
(
hide
)
Description:
Code patch
Filename:
MIME Type:
Creator:
Pedro Zapata
Created:
2014-04-25 15:07:51 UTC
Size:
5.01 KB
patch
obsolete
>Index: uberfire-nio2-backport/uberfire-nio2-impls/uberfire-nio2-jgit/src/main/java/org/uberfire/java/nio/fs/jgit/JGitFileSystemProvider.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>UTF-8 >=================================================================== >--- uberfire-nio2-backport/uberfire-nio2-impls/uberfire-nio2-jgit/src/main/java/org/uberfire/java/nio/fs/jgit/JGitFileSystemProvider.java (date 1397253871000) >+++ uberfire-nio2-backport/uberfire-nio2-impls/uberfire-nio2-jgit/src/main/java/org/uberfire/java/nio/fs/jgit/JGitFileSystemProvider.java (revision ) >@@ -67,6 +67,8 @@ > import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; > import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; > import org.eclipse.jgit.util.FileUtils; >+import org.slf4j.Logger; >+import org.slf4j.LoggerFactory; > import org.uberfire.commons.cluster.ClusterService; > import org.uberfire.commons.data.Pair; > import org.uberfire.commons.message.MessageType; >@@ -137,6 +139,8 @@ > public class JGitFileSystemProvider implements FileSystemProvider, > SecurityAware { > >+ private static final Logger logger = LoggerFactory.getLogger(JGitFileSystemProvider.class); >+ > protected static final String DEFAULT_IO_SERVICE_NAME = "default"; > > public static final String GIT_DEFAULT_REMOTE_NAME = DEFAULT_REMOTE_NAME; >@@ -158,11 +162,13 @@ > public static File FILE_REPOSITORIES_ROOT; > public static boolean DAEMON_ENABLED; > public static int DAEMON_PORT; >+ public static int DAEMON_BIND_PORT; > private static String DAEMON_HOST_ADDR; > private static String DAEMON_HOST_NAME; > > private static boolean SSH_ENABLED; > private static int SSH_PORT; >+ private static int SSH_BIND_PORT; > private static String SSH_HOST_ADDR; > private static String SSH_HOST_NAME; > private static File SSH_FILE_CERT_DIR; >@@ -201,12 +207,14 @@ > final String host = System.getProperty( "org.uberfire.nio.git.daemon.host" ); > final String hostName = System.getProperty( "org.uberfire.nio.git.daemon.hostname" ); > final String port = System.getProperty( "org.uberfire.nio.git.daemon.port" ); >+ final String bindPort = System.getProperty( "org.uberfire.nio.git.daemon.bind.port" ); > > final String sshEnabled = System.getProperty( "org.uberfire.nio.git.ssh.enabled" ); > final String sshHost = System.getProperty( "org.uberfire.nio.git.ssh.host" ); > final String sshHostName = System.getProperty( "org.uberfire.nio.git.ssh.hostname" ); > final String sshPort = System.getProperty( "org.uberfire.nio.git.ssh.port" ); > final String sshCertDir = System.getProperty( "org.uberfire.nio.git.ssh.cert.dir" ); >+ final String sshBindPort = System.getProperty( "org.uberfire.nio.git.ssh.bind.port" ); > > if ( bareReposDir == null || bareReposDir.trim().isEmpty() ) { > FILE_REPOSITORIES_ROOT = new File( REPOSITORIES_ROOT_DIR ); >@@ -230,6 +238,15 @@ > } else { > DAEMON_PORT = Integer.valueOf( port ); > } >+ >+ if ( bindPort == null || bindPort.trim().isEmpty() ) { >+ // Set binding port as the same as the daemon port by default >+ DAEMON_BIND_PORT = DAEMON_PORT; >+ } else { >+ DAEMON_BIND_PORT = Integer.valueOf(bindPort); >+ } >+ >+ > if ( host == null || host.trim().isEmpty() ) { > DAEMON_HOST_ADDR = DEFAULT_HOST_ADDR; > } else { >@@ -262,6 +279,12 @@ > } else { > SSH_PORT = Integer.valueOf( sshPort ); > } >+ if ( sshBindPort == null || sshBindPort.trim().isEmpty() ) { >+ SSH_BIND_PORT = SSH_PORT; >+ } else { >+ SSH_BIND_PORT = Integer.valueOf( sshBindPort ); >+ } >+ > if ( sshHost == null || sshHost.trim().isEmpty() ) { > SSH_HOST_ADDR = DEFAULT_HOST_ADDR; > } else { >@@ -459,13 +482,16 @@ > > gitSSHService = new GitSSHService(); > >- gitSSHService.setup( SSH_FILE_CERT_DIR, SSH_HOST_ADDR, SSH_PORT, authenticationManager, authorizationManager, receivePackFactory, new RepositoryResolverImpl<BaseGitCommand>() ); >+ logger.info("GIT SSH DAEMON: Binding to " + SSH_HOST_ADDR + ":" + SSH_BIND_PORT); > >+ gitSSHService.setup( SSH_FILE_CERT_DIR, SSH_HOST_ADDR, SSH_BIND_PORT, authenticationManager, authorizationManager, receivePackFactory, new RepositoryResolverImpl<BaseGitCommand>() ); >+ > gitSSHService.start(); > } > > private void buildAndStartDaemon() { >- daemonService = new Daemon( new InetSocketAddress( DAEMON_HOST_ADDR, DAEMON_PORT ) ); >+ logger.info("GIT DAEMON: Trying to bind to " + DAEMON_HOST_ADDR + ":" + DAEMON_BIND_PORT); >+ daemonService = new Daemon( new InetSocketAddress( DAEMON_HOST_ADDR, DAEMON_BIND_PORT ) ); > daemonService.setRepositoryResolver( new RepositoryResolverImpl<DaemonClient>() ); > try { > daemonService.start();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1091432
: 889787