Beispiel #1
0
def arkon_tinc():
    logger.info("setup tinc")
    conf = "/etc/tinc"
    tinc = f"{this_dir}/etc/tinc"
    fs_mkdir(conf)
    fs_copy(tinc, conf)
    fs_chmod(conf, dir_off=0o007, file_off=0o007)
    fs_chown(conf, 'root', 'root')
Beispiel #2
0
def arkon_systemd():  # TODO
    if not convert_text2bool(os.environ.get('ARKON_SYTEMD', 'no')):
        return
    logger.info("setup systemd")
    conf = "/etc/systemd"
    systemd = f"{this_dir}/etc/systemd"
    fs_mkdir(conf)
    fs_copy(systemd, conf)
    fs_chmod(conf, mode=0o555, dir_on=0o6000, file_off=0o111)
    fs_chown(conf, 'root', 'root')
Beispiel #3
0
def syncer_make_pipe(
    pipe_path: str,
    own_uid="service",
    own_gid="dovecot",
) -> None:
    "produce fifo pipe for the syncer plugin"
    pipe_dir = os.path.dirname(pipe_path)
    fs_mkdir(pipe_dir)
    fs_rmany(pipe_path)
    os.mkfifo(pipe_path)
    fs_chmod(pipe_dir, mode=0o660, dir_on=0o2770)
    fs_chown(pipe_dir, own_uid, own_gid)
Beispiel #4
0
def akron_postfix():
    logger.info("setup postfix")
    #
    conf = "/etc/postfix"
    fs_mkdir(conf)
    postfix_prepare(conf)
    fs_chmod(conf, mode=0o640, dir_on=0o6750)
    fs_chown(conf, 'root', 'postfix')
    #
    snap = f"{conf}/conf.snap"  # configuration snapshot
    fs_mkdir(snap)
    os.system(f'postconf -f  > "{snap}/postconf-main-settings.conf"')
    os.system(f'postconf -fn > "{snap}/postconf-main-override.conf"')
    os.system(f'postconf -fM > "{snap}/postconf-master.conf"')
    fs_chmod(snap, mode=0o640, dir_on=0o6750)
    fs_chown(snap, 'root', 'root')
Beispiel #5
0
def arkon_dovecot():
    logger.info("setup dovecot")
    #
    conf = "/etc/dovecot"
    fs_mkdir(conf)
    fs_chmod(conf, mode=0o640, dir_on=0o6750)
    fs_chown(conf, 'root', 'dovecot')
    #
    pipe = "/run/dovecot/syncer"
    fs_mkdir(pipe)
    fs_chmod(pipe, mode=0o660)
    fs_chown(pipe, 'service', 'dovecot')
    #
    data = "/home/data"
    fs_mkdir(data)
    fs_chmod(data, mode=0o660, dir_on=0o6750)
    fs_chown(data, 'service', 'service')
    #
    snap = f"{conf}/conf.snap"  # configuration snapshot
    fs_mkdir(snap)
    os.system(f'doveconf -a > "{snap}/dovecot-settings.conf"')
    os.system(f'doveconf -n > "{snap}/dovecot-override.conf"')
    fs_chmod(snap, mode=0o640, dir_on=0o6750)
    fs_chown(snap, 'root', 'root')
Beispiel #6
0
def arkon_opendkim():
    logger.info("setup opendkim")
    conf = "/etc/opendkim"
    fs_mkdir(conf)
    fs_chmod(conf, mode=0o640, dir_on=0o6750)
    fs_chown(conf, 'root', 'opendkim')
Beispiel #7
0
def arkon_getmail():
    logger.info("setup getmail")
    conf = "/etc/getmail"
    fs_mkdir(conf)
    fs_chmod(conf, mode=0o640, dir_on=0o6750)
    fs_chown(conf, 'service', 'service')
Beispiel #8
0
def arkon_tls():
    logger.info("setup tls")
    conf = "/etc/tls"
    fs_mkdir(conf)
    fs_chmod(conf, mode=0o640, dir_on=0o550)
    fs_chown(conf, 'root', 'root')