mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
fix out dir permissions
This commit is contained in:
parent
2d8364a7c7
commit
5593c58a28
1 changed files with 6 additions and 3 deletions
|
@ -25,6 +25,7 @@ FETCH_SCREENSHOT = True
|
||||||
RESOLUTION = '1440,900' # screenshot resolution
|
RESOLUTION = '1440,900' # screenshot resolution
|
||||||
FETCH_FAVICON = True
|
FETCH_FAVICON = True
|
||||||
SUBMIT_ARCHIVE_DOT_ORG = True
|
SUBMIT_ARCHIVE_DOT_ORG = True
|
||||||
|
ARCHIVE_PERMISSIONS = '755'
|
||||||
|
|
||||||
CHROME_BINARY = 'google-chrome' # change to chromium browser if using chromium
|
CHROME_BINARY = 'google-chrome' # change to chromium browser if using chromium
|
||||||
WGET_BINARY = 'wget'
|
WGET_BINARY = 'wget'
|
||||||
|
@ -160,7 +161,7 @@ def fetch_pdf(out_dir, link, overwrite=False):
|
||||||
chrome_args = '--headless --disable-gpu --print-to-pdf'.split(' ')
|
chrome_args = '--headless --disable-gpu --print-to-pdf'.split(' ')
|
||||||
try:
|
try:
|
||||||
run([CHROME_BINARY, *chrome_args, link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # output.pdf
|
run([CHROME_BINARY, *chrome_args, link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # output.pdf
|
||||||
run(['chmod', '755', 'output.pdf'], timeout=5)
|
run(['chmod', ARCHIVE_PERMISSIONS, 'output.pdf'], timeout=5)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
else:
|
else:
|
||||||
|
@ -173,7 +174,7 @@ def fetch_screenshot(out_dir, link, overwrite=False):
|
||||||
chrome_args = '--headless --disable-gpu --screenshot'.split(' ')
|
chrome_args = '--headless --disable-gpu --screenshot'.split(' ')
|
||||||
try:
|
try:
|
||||||
run([CHROME_BINARY, *chrome_args, '--window-size={}'.format(RESOLUTION), link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # sreenshot.png
|
run([CHROME_BINARY, *chrome_args, '--window-size={}'.format(RESOLUTION), link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # sreenshot.png
|
||||||
run(['chmod', '755', 'screenshot.png'], timeout=5)
|
run(['chmod', ARCHIVE_PERMISSIONS, 'screenshot.png'], timeout=5)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
else:
|
else:
|
||||||
|
@ -321,6 +322,8 @@ def dump_website(link, service, overwrite=False):
|
||||||
if not os.path.exists(out_dir):
|
if not os.path.exists(out_dir):
|
||||||
os.makedirs(out_dir)
|
os.makedirs(out_dir)
|
||||||
|
|
||||||
|
run(['chmod', ARCHIVE_PERMISSIONS, out_dir], timeout=5)
|
||||||
|
|
||||||
if link['type']:
|
if link['type']:
|
||||||
print(' i Type: {}'.format(link['type']))
|
print(' i Type: {}'.format(link['type']))
|
||||||
|
|
||||||
|
@ -386,7 +389,7 @@ def create_archive(export_file, service=None, resume=None):
|
||||||
|
|
||||||
dump_index(links, service)
|
dump_index(links, service)
|
||||||
|
|
||||||
run(['chmod', '-R', '755', service], timeout=30)
|
run(['chmod', '-R', ARCHIVE_PERMISSIONS, service], timeout=30)
|
||||||
|
|
||||||
print('[*] [{}] Created archive index with {} links.'.format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), len(links)))
|
print('[*] [{}] Created archive index with {} links.'.format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), len(links)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue