Archive Box

ArchiveBox logo

Note

This integration uses Gosuki’s Marktab feature to automatically archive bookmarks tagged with @archivebox using ArchiveBox.

What is ArchiveBox?

ArchiveBox is a self-hosted web archiving tool that lets you save and preserve web content for offline access. It supports multiple storage methods including Docker, local installation, and remote servers.

Important

The stable release of ArchiveBox doesn’t yet have an official API (though one is in development), so Gosuki uses a script-based integration approach.

How the Integration Works

Gosuki integrates with ArchiveBox through its Marktab feature:

  1. When you add a bookmark tagged with @archivebox:
    • The marktab rule triggers
    • The archivebox-docker-ssh script is executed
    • The script connects to your ArchiveBox instance (via Docker or SSH)
    • The URL is added to ArchiveBox with the appropriate tags

Setup Instructions

1. Install ArchiveBox

Follow ArchiveBox’s official installation guide for your preferred method (Docker, local install, etc.).

Tip

For Docker-based installations, you’ll need to ensure the docker command is available in your PATH.

2. Configure Gosuki Marktab

Edit your marktab file (~/.config/gosuki/marktab) and uncomment the ArchiveBox rule:

@archivebox .* ~/.local/share/gosuki/archivebox-docker-ssh

Caution

Ensure the script at the specified path has executable permissions.

3. Configure the ArchiveBox Script

Edit the script at ~/.local/share/gosuki/archivebox-docker-ssh:

# Set your remote host for SSH access to ArchiveBox
HOST="your-archivebox-host"

# Path to Docker Compose directory on the remote host
COMPOSE_WORKDIR="/path/to/archivebox/compose"

Warning

If you’re using a local Docker installation instead of SSH, set USE_LOCAL_DOCKER=true in the script.

Usage Example

  1. Add a bookmark with title: “My Important Page @archivebox” (or add tag @archivebox)
  2. Gosuki will automatically:
    • Detect the @archivebox tag
    • Run the archive command
    • Archive the URL using your configured ArchiveBox instance

Note

  • For browsers that support bookmark folders, you can also place the bookmark in a folder named @archivebox
  • For browsers without tag support you can add the word @archivebox in the title field of the bookmark

Troubleshooting

Common Issues:

  • “Command not found: docker”: Ensure Docker is installed and in your PATH.

  • SSH connection issues: Verify SSH access to your ArchiveBox host with ssh your-archivebox-host.

  • Marktab rule not triggering: Check that:

    • The tag is exactly @archivebox (case-sensitive)
    • Your marktab file has the correct path to the script
    • The script called by the marktab rule is not executable

Debugging:

Enable debug or trace logs for Gosuki hooks:

gosuki --debug=info,hook=debug ...

Check the log file at ~/.local/share/gosuki/archivebox.log for detailed error messages.

Tip

You can customize the ArchiveBox script to add additional parameters or tags as needed.