Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions uploader/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""uploader.py: upload WARC files toward the Internet Archive

rsync mode (RSYNC_URL set): upload everything to an rsync endpoint
such as fos.
such as ArchiveTeam targets.

s3 mode (S3_URL set): upload everything directly to the Internet Archive

Expand Down Expand Up @@ -36,7 +36,8 @@ def __init__(self):

self.url = os.environ.get('RSYNC_URL')
if self.url != None:
if '/localhost' in self.url or '/127.' in self.url:
local_urls = ['/localhost','/127.','/[::1]']
if any(local_url in self.url for local_url in local_urls):
raise RuntimeError('Won\'t let you upload to localhost because I '
'remove files after uploading them, and you '
'might be uploading to the same directory')
Expand Down