Skip to content

Commit

Permalink
make git domains configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate committed Jan 11, 2019
1 parent d35c6cf commit 0df0987
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion archivebox/archive_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TIMEOUT,
ANSI,
ARCHIVE_DIR,
GIT_DOMAINS,
)
from util import (
check_dependencies,
Expand Down Expand Up @@ -504,7 +505,7 @@ def fetch_favicon(link_dir, link, timeout=TIMEOUT):
def fetch_git(link_dir, link, timeout=TIMEOUT):
"""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['type'] == 'git'):
return
Expand Down
1 change: 1 addition & 0 deletions archivebox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
CHROME_USER_DATA_DIR = os.getenv('CHROME_USER_DATA_DIR', None)
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.',)
GIT_DOMAINS = os.getenv('GIT_DOMAINS', 'github.com,bitbucket.org,gitlab.com').split(',')

### Paths
REPO_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
Expand Down

0 comments on commit 0df0987

Please sign in to comment.