Skip to content
πŸ”— A free and open source URL shortening, file sharing and pastebin service.
Java HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Dockerfile
LICENSE
README.md
azure-pipelines.yml
pom.xml

README.md

VH7

A free and open source URL shortening, file sharing and pastebin service.

Website

Azure DevOps Build Status

Overview

  • Free. VH7 is not only free to use on the official instance but is also free to download and run for yourself.
  • Open Source. All of VH7's source code is available here for the community to take a look under the hood. We also accept community contributions, just open a pull request!
  • Multi-purpose. Unlike other mainstream URL shorteners, VH7 also provides file sharing and a pastebin also with short links.

Installation

To run VH7 in production, you must set the following environment variables:

Key Example Production Value Description
SPRING_PROFILES_ACTIVE production The Spring profile to use (production is designed for use in production).
VH7_MYSQL_HOST 127.0.0.1 The host of the MySQL database for VH7 to use.
VH7_MYSQL_PORT 3306 The port of the MySQL database for VH7 to use.
VH7_MYSQL_DATABASE vh7 The database of the MySQL database for VH7 to use.
VH7_MYSQL_USERNAME vh7-user The username for the MySQL database for VH7 to use.
VH7_MYSQL_PASSWORD password The password for the MySQL database for VH7 to use.
VH7_SHORTURL_SALT gh5489ghu47 The salt to be used for generating short URLs. Any random string can be used. This must not change once an instance has been setup!(*)
VH7_URL https://vh7.uk/ The URL that users will access VH7 from. This is used for building the short URLs.

(*) - If the salt is changed all short URLs will regenerate and old ones will no longer work. So it's best not to change the salt!

Docker (recommended)

A ready for production Docker image is available at jake-walker/vh7.

docker run --detach \
           --name vh7 \
           --publish 8080:8080 \
           --restart always \
           -e SPRING_PROFILES_ACTIVE="production" \
           -e VH7_MYSQL_HOST="127.0.0.1" \
           -e VH7_MYSQL_PORT="3306" \
           -e VH7_MYSQL_DATABASE="vh7" \
           -e VH7_MYSQL_USERNAME="vh7-user" \
           -e VH7_MYSQL_PASSWORD="password" \
           -e VH7_SHORTURL_SALT="gh5489ghu47" \
           -e VH7_URL="https://vh7.uk/" \
           jakewalker/vh7:latest

Build Docker Image Manually

This command requires Java JDK 8 or later and Apache Maven.

mvn clean package
docker build -t jakewalker/vh7 .

The built Docker image is saved as jakewalker/vh7. You can then use the same command above to run the newly built Docker image.

Additional help on Dockerfile generation is available here.

Ordinary Java

This command requires Java JDK 8 or later and Apache Maven.

# Build Application
mvn clean package

# Setup Environment
export SPRING_PROFILES_ACTIVE="production"
export VH7_MYSQL_HOST="127.0.0.1"
export VH7_MYSQL_PORT="3306"
export VH7_MYSQL_DATABASE="vh7"
export VH7_MYSQL_USERNAME="vh7-user"
export VH7_MYSQL_PASSWORD="password"
export VH7_SHORTURL_SALT="gh5489ghu47"
export VH7_URL="https://vh7.uk/"

# Run VH7
java -jar ./target/vh7-1.x.x.jar

Development

VH7 requires Java JDK 8 or later and Apache Maven.

First clone the repository:

git clone https://github.com/jake-walker/vh7.git

Then build and run VH7:

Note: Using the development Spring profile will store data in a temporary in-memory H2 database and use a development salt and instance URL (see Installation section for more info). No environment variables are required.

mvn clean package
java -jar ./target/vh7-1.x.x.jar -Dspring.profiles.active=development

Once you have made changes, feel free to open a pull request. Your code will be automatically checked by Azure Pipelines and then reviewed.

You can’t perform that action at this time.