Git Product home page Git Product logo

prosody's Introduction

Prosody

From 616.pub. Using the following steps to setup a self-hosted jabber server.

0. Requirements

  • A linux server with docker installed
    • As low as 1 core, 512MB memory
  • A domain under your control
  • A pair of hCaptcha keys filter spamming in register page

1. Define some varibles

# You need a domain
DOMAIN=yourdomain.com
# Your jabber account on that server, will be created as admin.
JID="yourname@${DOMAIN}"
# hCaptcha keys
CAPTCHA_PRIVATE=xxx
CAPTCHA_PUBLIC=yyy

2. DNS configure

Suppose your server IP is 1.2.3.4, the following records should be set ( replace DOMAIN with your real domain name):

;; A Records
DOMAIN.	1	IN	A	1.2.3.4

;; CNAME Records
room.DOMAIN.	1	IN	CNAME	DOMAIN.
upload.DOMAIN.	1	IN	CNAME	DOMAIN.

;; SRV Records
_xmpp-client._tcp.DOMAIN.	1	IN	SRV	0 5 5222 DOMAIN.
_xmpps-client._tcp.DOMAIN.	1	IN	SRV	0 5 5223 DOMAIN.
_xmpps-client._tcp.DOMAIN.	1	IN	SRV	5 0 443 DOMAIN.
_xmpp-server._tcp.DOMAIN.	1	IN	SRV	0 5 5269 DOMAIN.

3. Obtain domain SSL certs

mkdir -p acme.sh
docker volume create --driver local --opt type=none --opt device=$PWD/acme.sh --opt o=bind acme.sh
docker run -it --rm --name acme.sh -p 80:80 -v acme.sh:/root/.acme.sh ghcr.io/ichuan/prosody \
  /root/.acme.sh/acme.sh --home /root/.acme.sh --issue --standalone \
  --server letsencrypt -d $DOMAIN -d upload.$DOMAIN

Certs will be renewed automatically.

4. Running

# database
mkdir prosody

# datetime when this server goes live
SINCE="2018/9/2"

# ports: 5223:legacy_ssl, 80:http, 443:https, 5000:proxy65, 5222:c2s, 5269:s2s
docker run --restart always -itd --name iprosody \
  -p 5222:5222 -p 5223:5223 -p 5269:5269 -p 80:80 -p 443:443 -p 5000:5000 \
  -v $PWD/prosody:/var/lib/prosody \
  -v acme.sh:/root/.acme.sh \
  -e ADMIN_JID=$JID -e DOMAIN=$DOMAIN -e SINCE=$SINCE \
  -e CAPTCHA_PRIVATE=$CAPTCHA_PRIVATE \
  -e CAPTCHA_PUBLIC=$CAPTCHA_PUBLIC \
  ghcr.io/ichuan/prosody

Now, head to https://DOMAIN to see it.

5. Maintenance

# Create your admin JID
docker exec -it iprosody prosodyctl adduser $JID
# or via web: https://${DOMAIN}/register

6. Upgrading

docker pull ghcr.io/ichuan/prosody
docker stop iprosody && docker rm iprosody
# re-run with previous command line
docker run --restart always ...

prosody's People

Contributors

ichuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prosody's Issues

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.