remove publik-emailconf and python3-yaml dependancy (#62652)
This commit is contained in:
parent
c1e48bab1c
commit
6a10ae2f4b
2
Makefile
2
Makefile
|
@ -6,8 +6,6 @@ DIST_FILES = Makefile \
|
||||||
publik-create-users \
|
publik-create-users \
|
||||||
publik-create-databases \
|
publik-create-databases \
|
||||||
publik-cluster-link \
|
publik-cluster-link \
|
||||||
publik-emailconf \
|
|
||||||
publik.conf.example \
|
|
||||||
doc \
|
doc \
|
||||||
nginx
|
nginx
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ Package: publik-common
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: ${misc:Depends},
|
Depends: ${misc:Depends},
|
||||||
python3:any,
|
python3:any,
|
||||||
python3-yaml,
|
|
||||||
postgresql-client,
|
postgresql-client,
|
||||||
publik-base-theme
|
publik-base-theme
|
||||||
Recommends: entrouvert-archive-keyring,
|
Recommends: entrouvert-archive-keyring,
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
import argparse
|
|
||||||
import os
|
|
||||||
import subprocess
|
|
||||||
import yaml
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument('site', help='free form site name, including test/prod/else hints')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
template = """# created by publik-emailconf
|
|
||||||
ADMINS = (('Admin EO', 'admin+{site}.{brique}@entrouvert.com'),)
|
|
||||||
SERVER_EMAIL = 'admin+{site}.{brique}@entrouvert.com'
|
|
||||||
"""
|
|
||||||
|
|
||||||
with open('/etc/publik/publik.conf') as fh:
|
|
||||||
briques = yaml.load(fh.read())['defaults']['briques']
|
|
||||||
|
|
||||||
for brique in briques:
|
|
||||||
if brique == 'authentic2-multitenant':
|
|
||||||
briquename = 'authentic'
|
|
||||||
else:
|
|
||||||
briquename = brique
|
|
||||||
|
|
||||||
if not os.path.isdir('/etc/%s' % brique):
|
|
||||||
continue
|
|
||||||
|
|
||||||
settings_d = '/etc/%s/settings.d' % brique
|
|
||||||
if not os.path.isdir(settings_d):
|
|
||||||
os.mkdir(settings_d)
|
|
||||||
|
|
||||||
with open('/etc/%s/settings.d/email.py' % brique, 'w') as fh:
|
|
||||||
fh.write(template.format(site=args.site, brique=briquename))
|
|
||||||
|
|
||||||
for brique in briques:
|
|
||||||
print('restarting %s' % brique)
|
|
||||||
subprocess.call('systemctl restart %s' % brique, shell=True)
|
|
Loading…
Reference in New Issue