comparison docker/base/Dockerfile @ 84:8dc445c967e2

docker (base): create /usr/share/sat/certificates and tls-cert group to handle certificate + moved conf to /home/sat/.config/sat/sat.conf
author Goffi <goffi@goffi.org>
date Thu, 18 Feb 2016 17:23:08 +0100
parents 8dd32aa49614
children eeff161a19e8
comparison
equal deleted inserted replaced
83:8dd32aa49614 84:8dc445c967e2
29 # it's better to have a dedicated user 29 # it's better to have a dedicated user
30 RUN useradd -m sat 30 RUN useradd -m sat
31 31
32 # will be used to put many SàT specific data 32 # will be used to put many SàT specific data
33 RUN mkdir -p /usr/share/sat 33 RUN mkdir -p /usr/share/sat
34 RUN mkdir /usr/share/sat/certificates
35 RUN addgroup tls-cert --gid 9999 && chown :tls-cert /usr/share/sat/certificates && chmod 2770 /usr/share/sat/certificates
36 RUN adduser sat tls-cert
34 37
35 ################ 38 ################
36 # URWID SÀTEXT # 39 # URWID SÀTEXT #
37 ################ 40 ################
38 41
73 # we want .pid files in /tmp so they are removed if container are deleted 76 # we want .pid files in /tmp so they are removed if container are deleted
74 RUN echo '[DEFAULT]\npid_dir=/tmp' >> /etc/sat.conf 77 RUN echo '[DEFAULT]\npid_dir=/tmp' >> /etc/sat.conf
75 78
76 # we auto-create libervia account if it doesn't exists in Libervia container 79 # we auto-create libervia account if it doesn't exists in Libervia container
77 # so we remove it from reserved_list in plugin account 80 # so we remove it from reserved_list in plugin account
78 RUN echo '[plugin account]\nreserved_list=' >> /etc/sat.conf 81 RUN echo '\n[plugin account]\nreserved_list=' >> /etc/sat.conf
79 82
80 # This script set account domain in sat.conf if not already set 83 # This script set account domain in sat.conf if not already set
81 # if not set, domain is got from prosody container or DOMAIN environment variable 84 # if not set, domain is got from prosody container or DOMAIN environment variable
82 RUN echo '#!/usr/bin/env python2\n\ 85 RUN echo '#!/usr/bin/env python2\n\
83 import os, xmlrpclib, ConfigParser, socket, subprocess\n\ 86 import os, os.path, xmlrpclib, ConfigParser, socket, subprocess\n\
84 from sat.core.constants import Const as C\n\ 87 from sat.core.constants import Const as C\n\
85 from sat.tools import config as sat_config\n\ 88 from sat.tools import config as sat_config\n\
86 SECTION = "plugin account"\n\ 89 SECTION = "plugin account"\n\
87 OPTION = "new_account_domain"\n\ 90 OPTION = "new_account_domain"\n\
88 CONFIG_PATH = "/home/sat/sat.conf"\n\ 91 CONFIG_PATH = "/home/sat/.config/sat/sat.conf"\n\
92 try:\n\
93 os.makedirs(os.path.dirname(CONFIG_PATH))\n\
94 except OSError:\n\
95 pass\n\
89 config = ConfigParser.SafeConfigParser()\n\ 96 config = ConfigParser.SafeConfigParser()\n\
90 config.read(C.CONFIG_FILES)\n\ 97 config.read(C.CONFIG_FILES)\n\
91 domain = sat_config.getConfig(config, SECTION, OPTION)\n\ 98 domain = sat_config.getConfig(config, SECTION, OPTION)\n\
92 if domain is None:\n\ 99 if domain is None:\n\
93 os.getenv("DOMAIN")\n\ 100 os.getenv("DOMAIN")\n\