MementoEmbed is a tool to create archive-aware embeddable surrogates for archived web pages (mementos), like the social card above. MementoEmbed is different from other surrogate-generation systems in that it provides access to archive-specific information, such as the original domain of the URI-M, its memento-datetime, and to which collection a memento belongs.
MementoEmbed can also create browser thumbnails like the one below.
In addition, MementoEmbed can create imagereels, animated GIFs of the best five images from the memento, as seen below.
For more information on this application, please visit our Documentation Page and read the original blog post describing the reasons behind MementoEmbed.
MementoEmbed relies on Redis for caching. Install Redis first and then follow the directions for your applicable Linux/Unix system below.
If you would like to use the RPM installer for RHEL 8 and CentOS 8 systems:
MementoEmbed-0.20211106041644-1.el8.x86_64.rpm
)dnf install MementoEmbed-0.20211106041644-1.el8.x86_64.rpm
systemctl start mementoembed.service
If the service does not work at first, you may need to run systemctl start redis
.
To remove MementoEmbed, type dnf remove MementoEmbed
(it is case sensitive). The uninstall process will create a tarball of the /opt/mementoembed/var
directory. This contains the thumbnail cache, imagereel cache, and logs. It is left in case the system administrator needs this data.
MementoEmbed can now be accessed from http://localhost:5550/.
If you would like to use the deb installer for RHEL 8 and CentOS 8 systems:
MementoEmbed-0.20211112212747.deb
)apt-get update
<-- this may not be necessary, but is needed in some cases to make sure dependencies are loadedapt-get install ./MementoEmbed-0.20211112212747.deb
<-- the ./ is important, do not leave it offsystemctl start mementoembed.service
If the service does not work at first, you may need to run systemctl start redis
.
To remove MementoEmbed, type apt-get remove mementoembed
(it is case sensitive). The uninstall process will create a tarball of the /opt/mementoembed/var
directory. This contains the thumbnail cache, imagereel cache, and logs. It is left in case the system administrator needs this data.
Headless Chromium has a problem on Ubuntu. The issue is known to Google. This may manifest in a log with a message such as ERROR:gpu_init.cc(441) Passthrough is not supported, GL is disabled
. MementoEmbed still appears to generate thumbnails, so we are waiting for Google to address the issue.
MementoEmbed can now be accessed from http://localhost:5550/.
If you would like to use the generic installer for Unix (including macOS):
install-mementoembed-0.20211112212747.sh
)sudo ./install-mementoembed-0.20211112212747.sh
systemctl start mementoembed.service
(if your Unix/Linux supports systemd) or /opt/mementoembed/start-mementoembed.sh
if notMementoEmbed can now be accessed from http://localhost:5550/.
To run the latest Docker build use the following commands.
$ docker pull oduwsdl/mementoembed
$ docker run -d -p 5550:5550 oduwsdl/mementoembed
MementoEmbed can now be accessed from http://localhost:5550/.
Download the code and build an image as following:
$ git clone https://github.com/oduwsdl/MementoEmbed.git
$ cd MementoEmbed
$ docker build -t mementoembed .
Then run a container from this image:
$ docker run -it --rm -p 5550:5550 mementoembed
Flags -it
and --rm
will make the container connect to the host TTY in interactive mode and remove the container once the process is killed or terminated.
To run the container in detached mode, run the following command instead:
$ docker run -d -p 5550:5550 mementoembed
In either case, the application should be accessible at http://localhost:5550/.
Download the code and install it within your Python environment.
$ git clone https://github.com/oduwsdl/MementoEmbed.git
$ cd MementoEmbed
$ pip install .
Then set it up to run locally using Flask.
$ export FLASK_APP=mementoembed
$ flask run
The configuration options for MementoEmbed are documented in sample_appconfig.cfg
.
The defaults are stored in config/default.py
.
To use your own configuration file, copy sample_appconfig.cfg
, make modifications, and place it in /etc/mementoembed.cfg
. Then run the application locally as described above.
To use your own configuration file stored at /path/to/my/config.cfg
with a Docker image, use the -v
Docker option:
docker run -it --rm -v /path/to/my/config.cfg:/etc/mementoembed.cfg -p 5550:5550 oduwsdl/mementoembed
The following directory structure exists for organizing MementoEmbed:
The unit tests are designed to be easily run from the setup.py file.
$ pip install .
$ python ./setup.py test
With a fully operational MementoEmbed, integration tests are possible.
python -m unittest discover -s tests/integration
Integration tests, by default, assume that the instance to be tested is running at port 5550. This can be altered with the TESTPORT
environment variable, like so: export TESTPORT=9000
.
Integration tests are heavily dependent on environmental factors such as the current state of web archive playback systems. The favicon detection appears to be especially unpredictable. Because of this, we recommend that integration tests be reviewed by humans and not executed automatically on build.
$ docker build --rm -t local/c8-systemd -f tests/installer/centos8/centos8-systemd-Dockerfile .
$ docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d -p 5550:5550 local/c8-systemd
From here use common docker commands (e.g., docker cp
, docker exec
) to interact with the container.
$ docker build --rm -t local/u2104-systemd -f tests/installer/ubuntu2104/ubuntu2104-systemd-Dockerfile .
$ docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d -p 5550:5550 local/u2104-systemd
From here use common docker commands (e.g., docker cp
, docker exec
) to interact with the container.
Please consult the Contribution Guidelines in CONTRIBUTING.md for submitting bug reports, pull requests, etc.