DEV Community

Scott
Scott

Posted on

Deploy Zulip messaging using podman play

What is Zulip?

Zulip is like Slack or Mattermost, a messaging server for teams to communicate on a project. Overview of Zulip features is out of scope for this article, but for those interested you can find more information here.

My reasons for writing this article

My reasons for writing this article are two-fold.

  • Dissatisfaction with the Mattermost interface.. particularly threads being hard to read.
  • My daily driver being Fedora 32, which utilizies cgroups version 2 doesn't support Docker out of the box.

The Mattermost interface has many great things and its integrations are amazing, but it handles threads in a dis-satisfactory manner.

Without Docker I have to translate projects to podman as I go my local environment. I use various tools to do this podman-compose, Kompose, podman generate, etc.

Deploying Zulip with podman

This morning with a lot of work translating docker-zulip, I was able to create the zulip-deployment.yaml file here to deploy Zulip.

Presumptions

  • You have an email server supporting TLS and user login.
  • You have a GitLab account / Server

Configuration

Defaults are fairly secure but for a production environment there are still some things that require tightening. With that warning out of the way to get zulip-deployment.yaml up and running the following substitutions are required.

Substitution Value Description
__POSTGRE_SECURE_PASSWORD The password for the integrated postgresql database
__MEMCACHED_SECURE_PASSWORD The password for the integrated memcached cache
__RABBITMQ_SECURE_PASSWORD The password for the integrated rabbitmq server
__REDIS_SECURE_PASSWORD The password for the integrated redis server
__EXTERNAL_HOST_URL Zulip externally accessible URL e.g. message.myproject_zulip.com, Can also be set to IP or localhost, and port may be included as desired.
__ZULIP_SECRET random string of characters (used internally) preferably 50 characters long.
__EMAIL_SERVER_URL URL of your email server
__EMAIL_USER_NAME User for authenticating your email server
__EMAIL_USER_PASSWORD Password for above username
__GITLAB_URL Url of your GitLab instance, or of Gitlab.com
__GITLAB_APPLICATION_KEY Application key generated as described here
__GITLAB_APPLICATION_SECRET Application secret generated as described here
__ADMIN_ERROR_EMAIL Email at which to recieve errors from Zulip

Deploy

Deployment should be as easy as running the following command.

podman play kube zulip-deployment.yaml
[rustysysdev@localhost zulip-podman-play]$ podman play kube zulip-deployment.yaml 
Pod:
4c475bb55f6f05828d5cb7efe499b8e84722138f16df263320e541722003fe9b
Containers:
bd8762327b8ab970d6a0c7bc8e6f0ff9ea217751e42225ad207d21e82ae834cc
5567fccbadf943a744264deec4a1b2dfd53ec8e49239660ffaf0a2b0008ba8ee
d503c0b9944428a1849e400315ffdff49b2249de9340387e30e089c20f0a9d58
c06c4ea471de0cc72388fdbf69d6ebbceaddcb4535303a3e293cd6e21afe960f
39cdccdcb981802c3f7e6a1168d590452502aa7097857f8136b18ea5b96079d0

Verify the deployment is complete.

podman logs zulip-pod-0-zulip
...
2020-09-03 07:05:21,303 INFO success: zulip_events_embed_links entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,303 INFO success: zulip_events_missedmessage_mobile_notifications entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,303 INFO success: zulip_events_error_reports entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,304 INFO success: zulip_events_digest_emails entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,304 INFO success: zulip_events_email_senders entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,305 INFO success: zulip_deliver_scheduled_messages entered RUNNING state, process has stayed up for > than 1 seconds (startsec

Post deploy setup

After deploying the Zulip server and before using it, you will need to create a new organization. This can be accomplished using the following commands.

  1. exec into your container.

    podman exec -ti zulip-pod-0-zulip bash
    

    output:

    [rustysysdev@localhost zulip-podman-play]$ podman exec -ti zulip-pod-0-zulip bash
    root@zulip-pod-0:/#
    
  2. run the following commands to get a realm creation link.

    su zulip && cd /home/zulip/
    $(find ./ -name manage.py) generate_realm_creation_link
    

    output:

    root@zulip-pod-0:/# su zulip && cd /home/zulip/
    zulip@zulip-pod-0:~$ $(find ./ -name manage.py) generate_realm_creation_link
    Please visit the following secure single-use link to register your 
    new Zulip organization:
    
        https://localhost.localdomain:8443/new/4t1f3r0qet4eu0z0phyork8a
    
    
  3. Open the resultant link in your browser and follow the steps to setup your administrator account and organization.

Alt Text

Conclusion

Creating the zulip server is easy, once finished you can invite users, who can then login using GitLab OAuth!

If you have any questions do not hesitate to ask!

Top comments (0)