Giter Site home page Giter Site logo

docker-openfire's Introduction

Openfire Docker Container

This will build a vanilla installation of Openfire inside of a Docker container. Because Openfire wants persistent data, I've copied over the vanilla contents of the following directories to be mounted as persistent volumes.

  • /usr/share/openfire/conf
  • /usr/share/openfire/resources/security
  • /usr/share/openfire/embedded-db
  • /usr/share/openfire/plugins

Building The Container

If you prefer to build the container yourself, you'll need to do some prep work.

  1. Enter the build directory.
  2. Review the Dockerfile for the version of Openfire that you wish to install. Change the environment variable OF_VERSION to match.
  3. While you're there, review the version of dumb-init. If you need to change it, change the DI_VERSION environment variable.
  4. . Run docker build and optionally give it a tag that you like.

Running The Container

Copy the contents of the run directory to a location on the filesystem from where you run containers. I keep all container operations under /opt/docker/<container>, so for the rest of this document I'll presume /opt/docker/openfire, which I'll refer to as $rundir.

Via Docker Compose

  1. From $rundir, optionally edit docker-compose.yml to change the tag for the container.
  2. If you don't want to use the admin console over HTTP, remove 9090 from the ports config.
  3. Run docker-compose up to start the container in the foreground or docker-compose up -d to start it in the background.

Manually

  1. From $rundir, optionally edit the run.sh file to change the tag for the container.
  2. If you don't want to use the admin console over HTTP, remove 9090 from the ports config.
  3. Execute run.sh to kick off the container. This will mount the directories in their appropriate places, start Openfire, and tail the logfile.

Connecting To Openfire

You'll be able to connect by opening a browser and going to http://localhost:9090, optionally replacing localhost with the hostname or IP of your Docker host system.

If you're doing an upgrade and have configured TLS, you'll be able to connect to the admin console over HTTPS on port 9091.

As long as you start future iterations of the container from this directory, changes to the configuration, plugins, and the embedded database will be preserved.

Installing SSL Certificates

For ease in installing SSL certificates, see this post.

Both KeyStoreImport.java and KeyStoreImport.class are contained in this repository, in the security folder. The latter is provided in case your origin container only provides the JRE.

  1. Connect to the container and start a shell

     $ docker run -it monachus/openfire /bin/ash
    
  2. Follow along with the post, changing /etc/openfire/security to /usr/share/openfire/resources/security

In case that post disappears in the future, an abridged version of it is saved here.

Upgrading The Container (minor versions)

When the time comes to upgrade the container, it's quite simple.

  1. Stop and remove the existing container with docker kill and docker rm. All of your data is persistent.
  2. Make a backup of $rundir just in case something goes south.
  3. Follow the build steps from above for the latest version of Openfire.
  4. Start your new container.
  5. If everything went well, remove the backups.

Upgrading from Openfire 3 to Openfire 4

Caveats

  • /etc/openfire is now /usr/share/openfire/conf
  • There is no more lib directory. Plugins are at the top level.
  • /etc/openfire/security is now /resources/security
  • Openfire runs as daemon instead of its own user

Upgrade Steps

  1. Backup lib/embedded-db, lib/plugins, and etc
  2. Stop and remove the v3 container.
  3. Rename your current $rundir to $rundir.old
  4. From this source copy run to $rundir (creating a new directory)
  5. From your backups, copy the following:
    • The contents of etc/security to security
    • The remaining contents of etc to conf (excluding the security folder)
    • The contents of lib/plugins to plugins except the admin folder
    • The contents of lib/embedded-db to embedded-db
  6. Restart the container via your chosen means

docker-openfire's People

Contributors

oskapt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

docker-openfire's Issues

Registration & Login - java.lang.NoSuchMethodError: XMPPServer.getIQAuthHandler()

I did a docker build off tag image: monachus/openfire:latestand spun up the image with docker-compose.

So far the image is working fine when connecting via XMPP clients and sending messages.

But when I try to access the Registration & Login section on the Admin Console, I get the error:

java.lang.NoSuchMethodError: org.jivesoftware.openfire.XMPPServer.getIQAuthHandler()Lorg/jivesoftware/openfire/handler/IQAuthHandler;

When I followed the build steps here - https://github.com/oskapt/docker-openfire#building-the-container I didn't see any error regarding the QAuthHandler.

Also looking at the JavaDocs for Openfire there is no getIQAuthHandler method that I can see in the http://download.igniterealtime.org/openfire/docs/latest/documentation/javadoc/org/jivesoftware/openfire/XMPPServer.html module.

Did you notice the same on any of your builds?
Looking at the issues there isn't a similar issue raised for this exception. It seems that the link it the admin console is calling XMPPServer.getIQAuthHandler()

Complete exception log:

Exception:
java.lang.NoSuchMethodError: org.jivesoftware.openfire.XMPPServer.getIQAuthHandler()Lorg/jivesoftware/openfire/handler/IQAuthHandler;
	at org.jivesoftware.openfire.admin.reg_002dsettings_jsp._jspService(reg_002dsettings_jsp.java:96)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:76)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:53)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:165)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)

pull fails on fs-layer

Your openfire on docker sounds like just what I need to run multiple servers (serving multiple domains) on one machine. However the docker pull command fails when it's trying to download the 300+ MB "fs-layer" from the registry. It aborts at the ~40MB mark every time. This is possibly not your fault.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.