Operating Multiple HTTPS-Enabled Containers with Traefik

Overview This is a note on how to operate multiple HTTPS-enabled containers with Traefik. https://github.com/traefik/traefik Background Previously, I was using jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion with the following configuration. Proxy version: '3' # proxy services: nginx-proxy: image: jwilder/nginx-proxy container_name: nginx-proxy ports: - "80:80" - "443:443" volumes: - html:/usr/share/nginx/html - dhparam:/etc/nginx/dhparam - vhost:/etc/nginx/vhost.d - certs:/etc/nginx/certs:ro - /var/run/docker.sock:/tmp/docker.sock:ro - /srv/docker/nginx-proxy-with-encrypt/log:/var/log/nginx labels: - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy" restart: always letsencrypt: image: jrcs/letsencrypt-nginx-proxy-companion container_name: nginx-proxy-lets-encrypt depends_on: - "nginx-proxy" volumes: - certs:/etc/nginx/certs:rw - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - /var/run/docker.sock:/var/run/docker.sock:ro volumes: certs: html: vhost: dhparam: networks: default: external: name: common_link Container Below is a Django example. ...

July 4, 2024 · 2 min · Nakamura

Fixing Issues with the Omeka S GoogleAnalytics Module

Overview In Omeka S, there is a module called Google Analytics for enabling Google Analytics. https://github.com/Libnamic/Omeka-S-GoogleAnalytics/ When enabling this module, there were cases where the following error message was displayed. Undefined index: additional_snippet in (...) /modules/GoogleAnalytics/Module.php on line 316 The following issue had also been raised regarding this. https://github.com/Libnamic/Omeka-S-GoogleAnalytics/issues/9 I will share the method for addressing this issue. Fix Method Make the following changes. https://github.com/Libnamic/Omeka-S-GoogleAnalytics/pull/10/commits/0123ce557d0f38834c5c37fa1ac9c986c87cbc90 Specifically, the changes are as follows. ...

July 3, 2024 · 2 min · Nakamura

Redirecting Using Amazon S3 and Route 53

Overview I needed to redirect from one URL to another and was able to accomplish this using Amazon S3 and Route 53, so this is a memo of the process. Method This method uses an S3 bucket for the redirect and Route 53 for DNS configuration. The steps are explained below. Step 1: Amazon S3 Bucket Configuration Create a new bucket in Amazon S3. The bucket name should match the domain name you want to redirect (e.g., example.com). In the bucket properties, select “Static website hosting.” In the “Static website hosting” options, choose “Redirect requests” and enter the redirect destination URL (e.g., http://example.net). Step 2: DNS Configuration in Route 53 In Route 53, open the hosted zone for the domain name you want to redirect. Create a new record set. Select A as the record type. Set “Alias” to “Yes.” As the alias target, select the static website hosting endpoint of the S3 bucket configured in Step 1 (e.g., example.com.s3-website-us-east-1.amazonaws.com). With this setup, when someone accesses the specified domain, they will be redirected to the configured URL. This method is simple yet effective for redirecting from one domain to another URL. ...

July 3, 2024 · 1 min · Nakamura

Configuring CORS for Docker-based Omeka S

Overview When implementing CORS configuration for a Docker-based Omeka S as described in the following article, a server error occurred. This is a memo about that issue. Dockerfile The target is a Dockerfile like the following. FROM php:apache LABEL maintainer="Satoru Nakamura <na.kamura.1263@gmail.com>" RUN a2enmod rewrite ENV DEBIAN_FRONTEND noninteractive RUN apt-get -qq update && apt-get -qq -y upgrade RUN apt-get install -y \ zlib1g-dev \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ imagemagick \ unzip \ wget # PHP extensions RUN docker-php-ext-install -j$(nproc) iconv pdo pdo_mysql mysqli gd RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/ # Download Omeka-s ARG version=4.1.1 RUN wget https://github.com/omeka/omeka-s/releases/download/v${version}/omeka-s-${version}.zip -O /var/www/omeka-s-${version}.zip \ && unzip -q /var/www/omeka-s-${version}.zip -d /var/www/ \ && rm /var/www/omeka-s-${version}.zip \ && rm -rf /var/www/html/ \ && mv /var/www/omeka-s/ /var/www/html/ COPY ./.htaccess /var/www/html/.htaccess # Configure volumes and permissions COPY ./database.ini /var/www/html/volume/config/ RUN mkdir -p /var/www/html/volume/files/ \ && rm /var/www/html/config/database.ini \ && ln -s /var/www/html/volume/config/database.ini /var/www/html/config/database.ini \ && rm -Rf /var/www/html/files/ \ && ln -s /var/www/html/volume/files/ /var/www/html/files \ && chown -R www-data:www-data /var/www/html/ \ && find /var/www/html/volume/ -type f -exec chmod 600 {} \; VOLUME /var/www/html/volume/ CMD ["apache2-foreground"] Cause and Solution The following line needed to be added. ...

July 2, 2024 · 1 min · Nakamura

Commands for Batch Replacing IIIF Canvas URIs

There are cases where you want to batch replace Canvas URIs across multiple IIIF manifest files. For example, the command to replace www.dl.ndl.go.jp with dl.ndl.go.jp in JSON files under the current directory is as follows. The -i '' option is specific to macOS syntax. find . -type f -name "*.json" -exec sed -i '' 's/www\.dl\.ndl\.go\.jp/dl\.ndl\.go\.jp/g' {} + Note: This script directly modifies files. Before using it on important data, I recommend taking precautions such as creating backups. Additionally, please be careful about the types of files you apply this to, as performing text replacement on binary files (such as images or executables) may corrupt them. ...

July 2, 2024 · 1 min · Nakamura

Configuration Example for Using BulkImport in Omeka S

Overview When performing bulk data registration using Omeka S’s BulkImport, you can configure various settings for the registration method. While these settings can be configured each time you upload, using pre-registered settings can help reduce errors made by operators. Here, I introduce a configuration example for bulk registration when associating IIIF images with already registered items. Item Example Create an item with sample as the dcterms:identifier as shown below: ...

July 2, 2024 · 2 min · Nakamura

Bug in the BulkImport Module for Omeka S

Overview When using the BulkImport module with the combination of PHP 8.1.29 and Omeka S version 4.0.4, the following error occurred. Fatal error: Uncaught TypeError: mb_substr(): Argument #1 ($string) must be of type string, null given in /home/xxx/www/omeka-s/modules/BulkImport/src/Processor/ResourceProcessor.php:1079 Stack trace: #0 /home/xxx/www/omeka-… I have not been able to identify the root cause at this point, but I will describe the workaround. Workaround By using BulkImport v3.4.51 below, the above error no longer occurred. ...

July 2, 2024 · 1 min · Nakamura

CORS Error with Omeka S IIIF Server Module

Overview When distributing IIIF manifests using the Omeka S IIIF Server module, the following CORS error occurred in external viewers. Access to fetch at 'https://xxx/iiif/2/09fd29d5-8497-4def-a64d-ca104284f90d/manifest' from origin 'https://universalviewer.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. This article introduces measures to address CORS errors in Omeka S. ...

July 2, 2024 · 1 min · Nakamura

Service with name "Omeka\Acl" could not be created

Overview When installing the CleanUrl module on Omeka S 4.1.x, the following error occurred. Laminas\ServiceManager\Exception\ServiceNotCreatedException Service with name "Omeka\Acl" could not be created. Reason: Resource id 'Omeka\Controller\Site\Page' already exists in the ACL This issue had also been reported in the following forum. https://forum.omeka.org/t/error-installing-version-4-1/22522 Solution The issue was resolved by downgrading to Omeka S 4.0.x. Summary I hope you find this helpful.

July 1, 2024 · 1 min · Nakamura

'session.name' is not a valid sessions-related ini setting

Overview The following error occurred during Omeka S operation. 'session.name' is not a valid sessions-related ini setting This same issue was reported in the following forum. https://forum.omeka.org/t/session-name-is-not-a-valid-sessions-related-ini-setting/15499 Cause and Solution This appears to occur with the combination of Omeka S version 3.x and PHP 8.1. The issue here is PHP 8.1 specifically. You won’t see it on 8.0 or older versions. An upcoming release of Omeka S will resolve this problem with PHP 8.1, but I don’t have a date currently set on when that will release. ...

July 1, 2024 · 1 min · Nakamura

LEAF Writer: How to Add Sample Data

Overview This is a record of investigating how to customize LEAF Writer. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer This time, it is a memo on how to add sample data. We add custom sample data as shown below. Method Please refer to the following. https://gitlab.com/nakamura196/leaf-writer/-/commit/c4e98090c94874037980819c9672eea10814eedb In addition to updating samples.json, it was also necessary to update apps/commons/src/icons/index.tsx to add an icon, although this is not mandatory. Result As shown below, the editor environment could be opened from the sample data. ...

June 29, 2024 · 1 min · Nakamura

LEAF Writer: How to Use the Image Viewer

Overview LEAF Writer provides a feature for displaying text and images side by side, as shown below. It also offers a feature where the text moves in sync when you navigate through image pages. This article introduces TEI/XML markup examples for displaying images in the Image Viewer section. Method Specify the pb tag as follows. https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/blob/master/xml/lw/01.xml Specifically, it looks like this: ... <pb corresp="#zone_0005" facs="https://dl.ndl.go.jp/api/iiif/3437686/R0000022/0,0,3445,4706/full/0/default.jpg" n="5"/> ... The image specified in the facs attribute of the pb element appears to be displayed in the Image Viewer section. ...

June 29, 2024 · 1 min · Nakamura

LEAF Writer: CSS Customization

Overview This is a research note on how to customize LEAF Writer. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer This article specifically covers CSS-based visual customization. This allows you to set up an editing environment with vertical text display, as shown below. The following shows the display before customization. Method Specify the schema file as follows. https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/blob/master/xml/lw/01.xml Specifically: <?xml-stylesheet type="text/css" href="https://kouigenjimonogatari.github.io/lw/tei_genji.css"?> LEAF Writer reads this schema file and changes the editor’s style accordingly. This is not a LEAF Writer-specific feature but is supported by general web browsers as well. ...

June 29, 2024 · 1 min · Nakamura

LEAF Writer: Customizing Schemas

Overview This is an investigation record on how to customize LEAF Writer. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer This time, it is a memo on how to customize schemas. The goal is to display Japanese translations and other customizations as shown below. Below is the display before customization. Based on the following schema, many elements are displayed with English descriptions. https://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng Method Specify the schema file as follows. https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/blob/master/xml/lw/01.xml Specifically: <?xml-model href="https://kouigenjimonogatari.github.io/lw/tei_genji.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> LEAF Writer reads this schema file and uses it for validation and presenting available elements. ...

June 29, 2024 · 2 min · Nakamura

Google Spreadsheet + GAS (Google Apps Script) onEdit Executing Twice

Overview When using GAS (Google Apps Script) to add processing when editing a Google Spreadsheet, there were cases where the onEdit function was executed twice upon editing the spreadsheet. Cause and Solution The cause was that the onEdit function was also selected as a trigger for spreadsheet editing. Since onEdit is a reserved function, there was no need to set up a trigger for it. Summary I hope this is helpful for anyone experiencing the same issue. ...

June 28, 2024 · 1 min · Nakamura

Understanding the Relationship Between RDF, Turtle, JSON-LD, and IIIF Manifest Files

Overview To verify that IIIF manifests are written in JSON-LD, I tried converting them to other formats, so this is a memo of that process. We hope this serves as a useful reference for understanding the relationship between RDF and file formats such as JSON-LD and Turtle, as well as their relationship with IIIF manifest files described in JSON-LD. Target For this exercise, we will use the following manifest file published on the NDL Digital Collection. ...

June 28, 2024 · 3 min · Nakamura

Partial Update to TEI/XML Published in the Koui Genji Monogatari Text Data Repository

Overview I publish TEI/XML files for the Koui Genji Monogatari (Variorum Tale of Genji) in the following repository. https://github.com/kouigenjimonogatari I made some changes to the TEI/XML published here, so this is a note about those changes. Folder Structure Files before the modifications are stored here. There are no changes from before. https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/tree/master/tei The updated files are stored here. https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/tree/master/xml/lw This directory contains XML files with the modifications described below. Modifications Adding a Schema The following rng file was added. ...

June 28, 2024 · 2 min · Nakamura

LEAF Writer: Entity Lookup for Japan Search

Overview This is an investigation record on how to customize LEAF Writer. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer This time, it is a memo on how to add Entity Lookup. Specifically, we add functionality to query the Japan Search utilization schema, as shown below. Method The following changes were made to the forked repository. https://gitlab.com/nakamura196/leaf-writer/-/commit/69e10e2ddd17f6cd01501fbf29f0dd86d1e86a3a Usage You can try a version with partially Japanese-localized UI using the following repository. https://gitlab.com/nakamura196/leaf-writer Please refer to the following for startup instructions. ...

June 27, 2024 · 1 min · Nakamura

LEAF Writer: Adding Japanese UI

Overview This is a research note on how to customize LEAF Writer. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer This article covers how to add Japanese UI as a note. Method The following changes were made to a forked repository. https://gitlab.com/nakamura196/leaf-writer/-/commit/c9b7053814fc1e5a27a1847f20076096832dd68b Usage You can try a version with partially Japanese-localized UI using the following repository. https://gitlab.com/nakamura196/leaf-writer For startup instructions, please refer to the following. Summary I hope this is helpful for applications of LEAF Writer. ...

June 27, 2024 · 1 min · Nakamura

Published the Mirador 4 Version of mirador-sync-windows Repository

Overview In the following article, I introduced the creation of the Mirador 4 (3) version of mirador-sync-windows. This time, I am writing a quick note about publishing the repository for this plugin. Repository It is available at the following URL. https://github.com/nakamura196/mirador-sync-windows Demo Page You can try it out at the following URL. https://nakamura196.github.io/mirador-sync-windows/ Here are the configurations I made for publishing on GitHub Pages. webpack I made some changes to the following file. ...

June 27, 2024 · 1 min · Nakamura