mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 07:17:52 +10:00
properly handle chowning DATA_DIR on init when using sudo
This commit is contained in:
@@ -19,13 +19,16 @@ from .settings import LDAP_CONFIG, get_ldap_lib
|
||||
|
||||
###################### Config ##########################
|
||||
|
||||
def get_LDAP_LIB_path(paths):
|
||||
def get_LDAP_LIB_path(paths=()):
|
||||
LDAP_LIB = get_ldap_lib()[0]
|
||||
if not LDAP_LIB:
|
||||
return None
|
||||
|
||||
# check that LDAP_LIB path is in one of the specified site packages dirs
|
||||
lib_path = Path(inspect.getfile(LDAP_LIB))
|
||||
if not paths:
|
||||
return lib_path
|
||||
|
||||
for site_packges_dir in paths:
|
||||
if str(lib_path.parent.parent.resolve()) == str(Path(site_packges_dir).resolve()):
|
||||
return lib_path
|
||||
@@ -57,7 +60,7 @@ class LdapBinary(BaseBinary):
|
||||
"packages": lambda: ['python-ldap>=3.4.3', 'django-auth-ldap>=4.1.0'],
|
||||
},
|
||||
apt.name: {
|
||||
"abspath": lambda: get_LDAP_LIB_path((*USER_SITE_PACKAGES, *SYS_SITE_PACKAGES)),
|
||||
"abspath": lambda: get_LDAP_LIB_path(),
|
||||
"version": lambda: get_LDAP_LIB_version(),
|
||||
"packages": lambda: ['libssl-dev', 'libldap2-dev', 'libsasl2-dev', 'python3-ldap', 'python3-msgpack', 'python3-mutagen'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user