Code Monkey home page Code Monkey logo

wormholes's Introduction

wormholes

GitHub GitHub

Lighting Fast Link Shortener


Getting Started

You can run wormholes from provided compose.yml.

git clone --depth=1 [email protected]:noquark/wormholes.git
cd wormholes
# Change PostgresQL and Redis configuration
docker compose up -d

Redirection Endpoint

  1. GET :5000/:id

API Endpoints

  1. PUT :5000/api/
  2. POST :5000/api/:id
  3. GET :5000/api/:id
  4. DELETE :5000/api/:id
  5. GET :5000/api/:id

Configuration

Customizing Ports

  • PORT - Application port. Default value is 5000.
  • GEN_PORT - Generator port. Default value is 5001

Customizing database connections

Wormholes uses PostgreSQL and Redis. You can customize connection to these using environment variables as follows โ€”

PostgreSQL

  • PG_URI - This controls the URI for connecting to PostgreSQL. The default is postgres://postgres:postgres@localhost:5432/postgres.
  • PG_MAX_CONN - This controls the max connections for PostgreSQL. The default is 5000.

Redis

  • REDIS_URI - THis controls the URI connecting to Redis and the default is redis://:redis@localhost:6379/0.

Links Ingestion

Links are ingested in a batch to avoid excessive database connections. We can control it's behavior with following environment variables โ€”

  • BATCH_SIZE - This controls number of links ingested in a batch. The default value is 10000.

Customizing ID Generation

  • ID_SIZE - This controls the size of generated IDs. The default value is 7.
  • BLOOM_MAX - This configures bloom-filters based on approx number of IDs to store. The default value is 1000000.
  • BLOOM_ERROR - This controls the rate of false positives in bloom filter and the default is 0.0000001.
  • BUCKET_SIZE - Inside generator, IDs to be used are stored in buckets. This controls the number of buckets to store IDs 8.
  • BUCKET_CAP - This controls the number of IDs to store in a single bucket which is 100000 by default.

Contributing

Feel free to open an issue or pull request.

wormholes's People

Contributors

mohitsinghs avatar singhisbling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

anhgeeky

wormholes's Issues

ERROR: manifest unknown

I am unable to run wormholes with docker-compose nor by pulling the image from ghcr.

Pulling wormholes (ghcr.io/wormholesdev/wormholes:latest)...
latest: Pulling from wormholesdev/wormholes
ERROR: manifest unknown

I am using Docker version 20.10.21, build 20.10.21-0ubuntu1~22.04.3 on x86 architecture.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.