ArchiveBox: Bugfix: docker iframe adds /data/ to url incorrectly

Describe the bug

Using the docker-compose.yml instructions, adding a URL works fine. When accessing that URL I get a 404 within the iframe.

Steps to reproduce

  1. Start docker-compose up
  2. Add URL
  3. Click on the URL. I get the top bar, but the iframe is a 404

Screenshots or log output

It looks like the iframe is trying to go to http://server/data/archive/1600957105.659589/site/index.html when the data folder doesn’t exist as a web entity.

Browsing to http://server/archive/1600957105.659589/site/index.html works. (note: without the /data/ folder)

How can I get the iframe working correctly?

image

Software versions

Latest docker-compose.yml

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Yes, it is added in there. However, a trailing slash should not (ideally) break anything at all. I will remove it from that line, but I will leave https://github.com/pirate/ArchiveBox/issues/487 open to find a more permanent solution. Thanks!

@cdvv7788 It failed.

docker build . -t archivebox --no-cache

Step 20/29 : WORKDIR "$CODE_DIR"
 ---> Running in e06219be686e
Removing intermediate container e06219be686e
 ---> 1442435435af
Step 21/29 : ADD . "$CODE_DIR"
 ---> 254a0d4fbc47
Step 22/29 : RUN pip install -e .
 ---> Running in 49333e96986c
Obtaining file:///app
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/app/setup.py'"'"'; __file__='"'"'/app/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-fstf2f7j
         cwd: /app/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/app/setup.py", line 17, in <module>
        VERSION = json.loads((PYTHON_DIR / "package.json").read_text().strip())['version']
      File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c pip install -e .' returned a non-zero code: 1

Yes, it should be possible. If you are getting any issue, please let me know and I will check it.

I will give this a check. This may be related to some changes we made to calculate the path to wget.