mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-26 15:54:36 +02:00
make git domains configurable
This commit is contained in:
@@ -30,6 +30,7 @@ from config import (
|
|||||||
TIMEOUT,
|
TIMEOUT,
|
||||||
ANSI,
|
ANSI,
|
||||||
ARCHIVE_DIR,
|
ARCHIVE_DIR,
|
||||||
|
GIT_DOMAINS,
|
||||||
)
|
)
|
||||||
from util import (
|
from util import (
|
||||||
check_dependencies,
|
check_dependencies,
|
||||||
@@ -504,7 +505,7 @@ def fetch_favicon(link_dir, link, timeout=TIMEOUT):
|
|||||||
def fetch_git(link_dir, link, timeout=TIMEOUT):
|
def fetch_git(link_dir, link, timeout=TIMEOUT):
|
||||||
"""download full site using git"""
|
"""download full site using git"""
|
||||||
|
|
||||||
if not (link['domain'] == 'github.com'
|
if not (link['domain'] in GIT_DOMAINS
|
||||||
or link['url'].endswith('.git')
|
or link['url'].endswith('.git')
|
||||||
or link['type'] == 'git'):
|
or link['type'] == 'git'):
|
||||||
return
|
return
|
||||||
|
@@ -33,6 +33,7 @@ WGET_USER_AGENT = os.getenv('WGET_USER_AGENT', 'ArchiveBox')
|
|||||||
CHROME_USER_DATA_DIR = os.getenv('CHROME_USER_DATA_DIR', None)
|
CHROME_USER_DATA_DIR = os.getenv('CHROME_USER_DATA_DIR', None)
|
||||||
TIMEOUT = int(os.getenv('TIMEOUT', '60'))
|
TIMEOUT = int(os.getenv('TIMEOUT', '60'))
|
||||||
FOOTER_INFO = os.getenv('FOOTER_INFO', 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.',)
|
FOOTER_INFO = os.getenv('FOOTER_INFO', 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.',)
|
||||||
|
GIT_DOMAINS = os.getenv('GIT_DOMAINS', 'github.com,bitbucket.org,gitlab.com').split(',')
|
||||||
|
|
||||||
### Paths
|
### Paths
|
||||||
REPO_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
|
REPO_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
|
||||||
|
Reference in New Issue
Block a user