This project has been deprecated in favor of the main website having an inbuilt URL shortener. Find this here
Nova is a simple link shortener built using TypeScript and Bun.
- A working minimalistic web interface
- An API that is easy to understand and use
- Google OIDC support for link creation
- Password-protected short URLs
- Customisable short URLs
- Customisable short URL validity/expiry
The following are the recommended ways to run Nova.
Do note, the Docker configurations are the exact same, but with different methods of running them.
Run the following command directly. Do replace the environment variables (-e) and port mapping (-p) with a configuration more relevant to you. Please read .env.example for details regarding the environment variables.
docker run \
--name nova \
--restart unless-stopped \
-p 80:3000 \
-e PORT="3000" \
-e MONGODB_CONNECTION_URL="<YOUR_DATABASE_URL>" \
-e LOG_LEVEL="info" \
-e API_AUTH="false" \
-e RANDOM_SLUG_LENGTH="6" \
-e BASE_URL_REDIRECT="false" \
-e PROHIBITED_SLUGS="api" \
-e EXPIRED_LINK_SCAN_INTERVAL="15" \
# -e GOOGLE_OAUTH2_CLIENT_ID="" \
# -e GOOGLE_OAUTH2_CLIENT_SECRET="" \
# -e GOOGLE_OAUTH2_REDIRECT_URI="" \
# -e GOOGLE_OAUTH2_ALLOWED_USERS="" \
ghcr.io/thaddeuskkr/nova:latestCreate a compose.yml file in a empty directory with the following sample content edited to fit your use case. Then, run docker compose up.
services:
nova:
container_name: nova
image: ghcr.io/thaddeuskkr/nova:latest
restart: unless-stopped
ports:
- '80:3000'
environment:
PORT: 3000 # The port to host Nova on.
MONGODB_CONNECTION_URL: YOUR_CONNECTION_URL # The connection URL to your MongoDB database.
LOG_LEVEL: info # The level of logging to use. Set to "debug" for more verbose logging.
API_AUTH: false # The password required to access Nova's API. Can be left empty or set to false to disable authentication.
RANDOM_SLUG_LENGTH: 6 # The length of the random slugs generated for short URLs.
BASE_URL_REDIRECT: false # The URL to redirect to when the base URL (/) is visited. Can be left empty or set to false to disable.
PROHIBITED_SLUGS: api # A comma-separated list of slugs that are prohibited from being used.
EXPIRED_LINK_SCAN_INTERVAL: 15 # The interval, in seconds, to scan for expired links.
# GOOGLE_OAUTH2_CLIENT_ID: "" # Google OAuth2 client ID (optional)
# GOOGLE_OAUTH2_CLIENT_SECRET: "" # Google OAuth2 client secret (optional)
# GOOGLE_OAUTH2_REDIRECT_URI: "" # Google OAuth2 redirect URI (optional)
# GOOGLE_OAUTH2_ALLOWED_USERS: "" # A comma-separated list of allowed Google OAuth2 user IDs or emails (optional)-
Clone this repository
git clone https://github.com/thaddeuskkr/nova.git && cd nova
-
Install all dependencies using Bun
bun install
-
Copy
.env.exampleto.envand fill it incp .env.example .env
-
Run using Bun
bun .
Contributions of all sorts are accepted and greatly appreciated.
To contribute to this codebase, do the following:
- Create a fork of this repository
- Follow the setup process above, but clone your fork instead
- Push the modified code to your fork of this repository
- Create a pull request to the
mainbranch
To suggest a new feature or report a bug in Nova, please create an issue.