Redirects web requests to URLs set via table file
This service runs using an embedded Jetty server and is invoked from the command line.
- MacOS, Rocky Linux 8+, Ubuntu 20+, and most other Linux distributions should work
- Java 17+ (jdk to build)
- Make (to build)
- Maven 3.6 or higher (to build)
Commands build Redirect Service assuming machine has Git command line tools installed and above Java modules have been installed.
# In lieu of git one can just download repo and unzip it
git clone https://github.com/ndexbio/redirect-service.git
cd redirect-service
mvn clean installThe above command will create a jar file under target/ named
redirect-service-<VERSION>-jar-with-dependencies.jar that
is a command line application
# In lieu of git one can just download repo and unzip it
git clone https://github.com/ndexbio/redirect-service.git
cd redirect-service
mvn clean install
mkdir -p /tmp/redirect/logs
cp systemd/server.conf /tmp/redirect/.
cp systemd/redirects.csv /tmp/redirect/.
cp systemd/pathway_redirects.csv /tmp/redirect/.
java -jar target/redirect-service*jar --conf /tmp/redirect/server.conf --mode runserver
# Visit the following to see the mapping uniprot needs
# http://localhost:8081/uniprot_mapping_file
#
# To test a redirect visit
# http://localhost:8081/ndexThe service reads Java properties from the file passed with --conf.
runserver.log.dir = /tmp/redirect/logs
runserver.port = 8081
redirects.file = /tmp/redirect/redirects.csv
pathway.redirects.file = /tmp/redirect/pathway_redirects.csv
runserver.log.level = INFO
root.log.level = INFOredirects.file sets the CSV file used for regular redirects. If this
property is omitted, the service defaults to redirects.csv in the current
working directory. The CSV must include this header:
UNIPROT,ID,OPTIONAL_1,URLRequests to /{ID} are matched against the ID column and redirect to the
corresponding URL. ID matching is case-insensitive.
pathway.redirects.file sets the CSV file used for pathway redirects. If this
property is omitted, the service defaults to pathway_redirects.csv in the
current working directory. The CSV must include this header:
ID,URLRequests to /pathway/{ID} and /pathways/{ID} are matched against the ID
column and redirect to the corresponding URL. ID matching is case-insensitive.
Set pathway.redirects.file to a non-empty CSV file before using these pathway
redirect endpoints.
/{ID}redirects usingredirects.file/pathway/{ID}redirects usingpathway.redirects.file/pathways/{ID}redirects usingpathway.redirects.file/statusreturnsOK/UNIPROT_MAPPING_FILEreturns the UniProt-to-ID mapping generated fromredirects.file
Releases are created by pushing a version tag that starts with v.
Before tagging a release, update pom.xml so the project version matches the
release version and does not include -SNAPSHOT.
mvn test
git tag v1.1.0
git push origin v1.1.0Pushing the tag triggers the GitHub Actions release workflow. The workflow
fails if the tag version does not match the pom.xml project version. For
example, tag v1.1.0 must match pom.xml version 1.1.0.
If the version check passes, the workflow builds the project with:
mvn -B clean packageIt then creates a GitHub Release for the tag and uploads the runnable jar:
target/redirect-service-<VERSION>-jar-with-dependencies.jar
Release tags matching v* should be protected with a GitHub tag ruleset so
only authorized maintainers can create, update, or delete release tags.