Skip to content

External links in Zimit ZIM can't be opened by the kiwix-serve viewer #1283

Description

@veloman-yunkan

test.zim.gz

Using Firefox

First link (A) will display Sorry, the url ... is not found on this server
Second link (B) will redirect to the same URL as (A) because of target="_blank"

We would like (A) and (B) to redirect to the external URL without blocking it

Software Stack:

  • kiwix-serve 3.8.2 (latest as of today) via Docker
  kiwix-serve:
    image: ghcr.io/kiwix/kiwix-serve:3.8.2
    hostname: kiwix-serve
    read_only: true
    command:
      - '--monitorLibrary'
      - '--library'
      - 'library.xml'
    volumes:
      - archive:/data:ro

volumes:
  archive:
  • zimit:latest via Docker
  docker run \
  --detach \
  --name "test" \
  --shm-size 2gb --memory 2g --cpu-shares 3072 \
  --volume archive:/output \
  ghcr.io/openzim/zimit:latest zimit \
  --workers 2 \
  --waitUntil domcontentloaded \
  --output="/output/test" \
  --statsFilename="/output/test/task_progress.json" \
  --verbose \
  --keep \
  --name="test" \
  --zim-file="test.zim" \
  --url="http://$(hostname -i)" \
  --title="Test" \
  --description="Test" \
  --favicon="https://wiki.kiwix.org/w/images/favicon.ico"

  kiwix-manage library.xml add test.zim
  • Python Dummy Web Server
mkdir test
cd test
cat <<'EOF' > index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>Test</title>
  </head>
  <body class="section-portrait">
  <ul>
  <li><a href="http://www.ethz.ch/index_EN">(A) Swiss Federal Institute of Technology in Zurich</a></li>
  <li><a href="http://www.ethz.ch/index_EN" target="_blank">(B) Swiss Federal Institute of Technology in Zurich</a></li>
  </ul>
</html>
EOF

python3 -m http.server 80

Originally posted by @jejbq in #1166

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions