Add FreeBSD specific paths (#6702)

* Add support for FreeBSD specific paths

Reference:	https://svnweb.freebsd.org/ports/head/security/py-certbot/files/patch-certbot_compat.py

* Add CHANGELOG.md entry

* Fix linting error

Pointed out by:	@adferrand
This commit is contained in:
Po-Chuan Hsieh 2019-05-11 14:13:37 +08:00 committed by Adrien Ferrand
parent d391fb8876
commit 7fe82cf1ac
2 changed files with 10 additions and 1 deletions

View file

@ -6,6 +6,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
### Added
* Add FreeBSD specific paths to certbot
*
### Changed

View file

@ -129,7 +129,11 @@ LINUX_DEFAULT_FOLDERS = {
'work': '/var/lib/letsencrypt',
'logs': '/var/log/letsencrypt',
}
FREEBSD_DEFAULT_FOLDERS = {
'config': '/usr/local/etc/letsencrypt',
'work': '/var/db/letsencrypt',
'logs': '/var/log/letsencrypt',
}
def get_default_folder(folder_type):
"""
@ -142,6 +146,10 @@ def get_default_folder(folder_type):
"""
if os.name != 'nt':
# Unix-like
if sys.platform.startswith('freebsd') or sys.platform.startswith('dragonfly'):
# FreeBSD specific
return FREEBSD_DEFAULT_FOLDERS[folder_type]
# Linux specific
return LINUX_DEFAULT_FOLDERS[folder_type]
# Windows specific