diff --git a/seed/base-machine/funcs/funcs.py b/seed/base-machine/funcs/funcs.py index 11cbccc..6c4599c 100644 --- a/seed/base-machine/funcs/funcs.py +++ b/seed/base-machine/funcs/funcs.py @@ -2,14 +2,14 @@ import __main__ from secrets import token_urlsafe as _token_urlsafe, token_hex as _token_hex from string import ascii_letters as _ascii_letters from random import choice as _choice -from os.path import dirname as _dirname, abspath as _abspath, join as _join, isfile as _isfile, isdir as _isdir -from os import makedirs as _makedirs +from os.path import join as _join, isfile as _isfile, isdir as _isdir +from os import makedirs as _makedirs, environ as _environ #from risotto.utils import ZONES_SERVER -_HERE = _dirname(_dirname(_abspath(__main__.__file__))) +_HERE = _environ['PWD'] _PASSWORD_DIR = _join(_HERE, 'password') diff --git a/seed/letsencrypt/funcs/letsencrypt.py b/seed/letsencrypt/funcs/letsencrypt.py index 2c67f28..7238932 100644 --- a/seed/letsencrypt/funcs/letsencrypt.py +++ b/seed/letsencrypt/funcs/letsencrypt.py @@ -1,14 +1,12 @@ import __main__ from subprocess import run as _run -from os.path import dirname as _dirname, abspath as _abspath, join as _join, isfile as _isfile, isdir as _isdir +from os.path import join as _join, isfile as _isfile, isdir as _isdir from datetime import datetime as _datetime from shutil import copyfile as _copyfile -from os import makedirs as _makedirs +from os import makedirs as _makedirs, environ as _environ - -_HERE = _dirname(_abspath(__main__.__file__)) -_HERE = '/home/gnunux/git/risotto/risotto' +_HERE = _environ['PWD'] _LE_DIR = _join(_HERE, 'pki', 'letsencrypt') _X509_DIR = _join(_HERE, 'pki', 'x509') diff --git a/seed/openldap/funcs/ldap.py b/seed/openldap/funcs/ldap.py index 437e0fd..ea7b8c3 100644 --- a/seed/openldap/funcs/ldap.py +++ b/seed/openldap/funcs/ldap.py @@ -1,12 +1,12 @@ import __main__ -from os import urandom as _urandom +from os import urandom as _urandom, environ as _environ from hashlib import sha1 as _sha1 from base64 import encodebytes as _encodebytes, b64encode as _b64encode from json import load as _load, dump as _dump -from os.path import dirname as _dirname, abspath as _abspath, join as _join, isfile as _isfile +from os.path import join as _join, isfile as _isfile -_HERE = _dirname(_dirname(_abspath(__main__.__file__))) +_HERE = _environ['PWD'] _SSHA_PASSWORD_DIR = _join(_HERE, 'password', 'ssha.json') diff --git a/seed/postfix-relay/funcs/opendkim.py b/seed/postfix-relay/funcs/opendkim.py index 1223de1..ef72dc7 100644 --- a/seed/postfix-relay/funcs/opendkim.py +++ b/seed/postfix-relay/funcs/opendkim.py @@ -1,6 +1,6 @@ import dkim.dknewkey as _dknewkey -from os.path import dirname as _dirname, abspath as _abspath, join as _join, isfile as _isfile, isdir as _isdir -from os import makedirs as _makedirs +from os.path import join as _join, isfile as _isfile, isdir as _isdir +from os import makedirs as _makedirs, environ as _environ from shutil import rmtree as _rmtree import __main__ @@ -10,7 +10,7 @@ def _eprint(*args, **kwargs): _dknewkey.eprint = _eprint -_HERE = _dirname(_dirname(_abspath(__main__.__file__))) +_HERE = _environ['PWD'] _DKIM_DIR = _join(_HERE, 'pki/dkim')