annotate docker_legacy/sat_pubsub/scripts/sat_pubsub @ 164:29873a41aae1

docker: new docker files are now in sat main repos, this one is legacy
author Goffi <goffi@goffi.org>
date Fri, 01 Jan 2021 18:33:52 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python2
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
3
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This script launch SàT PubSub with domain and secret gotten from prosody container
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it make the configuration more easy
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
6 import os, xmlrpclib
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
7
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
8 os.chdir("/usr/share/sat_pubsub")
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
9 proxy = xmlrpclib.ServerProxy("http://prosody:9999/")
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
10 domain = proxy.getenv("DOMAIN")
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
11 secret = proxy.getenv("SAT_PUBSUB_SECRET")
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
12 os.execlp("twistd", "twistd", "-n", "--pidfile", "/tmp/sat_pubsub.pid", "sat_pubsub", "--rhost", "prosody",
29873a41aae1 docker: new docker files are now in sat main repos, this one is legacy
Goffi <goffi@goffi.org>
parents:
diff changeset
13 "--jid", "pubsub.%s" % domain, "--secret", secret)