1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-11-22 08:19:54 +00:00
Just Short It (damnit)! The most KISS single-user URL shortener there is.
Go to file
2023-11-18 18:47:29 +01:00
.github Create FUNDING.yml 2023-11-18 18:47:29 +01:00
Components fixed: urls inspect form validation errors not displayed 2023-11-18 16:57:22 +01:00
Model Initial Commit 2023-04-15 15:40:46 +02:00
Properties changed: migrated project to .NET 8, port changed to 8080 2023-11-17 22:08:03 +01:00
Service Initial Commit 2023-04-15 15:40:46 +02:00
wwwroot added: logo and favicon 2023-11-18 13:11:12 +01:00
.dockerignore changed: migrated project to .NET 8, port changed to 8080 2023-11-17 22:08:03 +01:00
.gitattributes Initial Commit 2023-04-15 15:40:46 +02:00
.gitignore added: tailwindcss packages and config 2023-11-18 02:05:36 +01:00
appsettings.Development.json changed: migrated urls page to razor components 2023-11-18 16:05:05 +01:00
appsettings.json Initial Commit 2023-04-15 15:40:46 +02:00
CHANGELOG.md chore: updated changelog 2023-11-18 16:42:34 +01:00
Dockerfile added: docker multi-platform support (buildx) 2023-11-17 23:23:44 +01:00
jsi-logo.afdesign added: logo and favicon 2023-11-18 13:11:12 +01:00
JustShortIt.csproj changed: migrated urls page to razor components 2023-11-18 16:05:05 +01:00
JustShortIt.sln Initial Commit 2023-04-15 15:40:46 +02:00
LICENSE Initial Commit 2023-04-15 15:40:46 +02:00
package-lock.json removed: bulma 2023-11-18 03:12:14 +01:00
package.json removed: bulma 2023-11-18 03:12:14 +01:00
postcss.config.js added: tailwindcss packages and config 2023-11-18 02:05:36 +01:00
Program.cs removed: unused code (razor pages) 2023-11-18 16:54:53 +01:00
README.md added: jsi logo to readme 2023-11-18 13:21:38 +01:00
tailwind.config.js added: tailwindcss packages and config 2023-11-18 02:05:36 +01:00

Just Short It (damnit)!

The most KISS single user URL shortener there is.

To simply run Just Short It in a container run:

docker run -e JSI_BaseUrl=<your-url> \
           -e JSI_Account__Username=<your-username> \
           -e JSI_Account__Password=<your-password> \
           -p 80:8080
           miawinter/just-short-it:latest

In Docker Compose:

version: '3.4'

services:
  just-short-it:
    container_name: JustShortIt
    image: miawinter/just-short-it:latest
    ports:
      - "80:8080"
    environment:
      - "JSI_BaseUrl=<your-url>"
      - "JSI_Account__Username=<your-username>"
      - "JSI_Account__Password=<your-password>"

Redis

By default Just Short It saves all the redirects in a in-memory distributed Cache, which get's lost whenever the container restarts, so if you want to keep your redirects you wanna use redis.

You can configure the connection to redis using the environment variables JSI_Redis__ConnectionString and optional JSI_Redis__InstanceName (default is "JustShortIt").

If you want to run both with compose, the most simple setup looks like this:

version: '3.4'

services:
  just-short-it:
    container_name: JustShortIt
    image: miawinter/just-short-it:latest
    ports:
      - "80:8080"
    environment:
      - "JSI_BaseUrl=<your-url>"
      - "JSI_Account__Username=<your-username>"
      - "JSI_Account__Password=<your-password>"
      - "JSI_Redis__ConnectionString=redis,password=<your-redis-password>"
    depends_on:
      - redis
  redis:
    container_name: Redis
    image: redis:alpine
    environment:
      - "REDIS_PASSWORD=<your-redis-password>"
    volumes:
      - redis:/data

volumes:
  redis:

There you go, now your urls survive a restart!

Https

Just Short It! is not supporting Https, I reconmend using a reverse Proxy for hosting that handles SSL. I can highly reconmend jwilders nginx-proxy togehter with acme-companion, there is no easier way to get a reverse proxy with automatic certificate renewal.

Here is an Example of how to use Just Short It! togehter with nginx-proxy:

version: '3.4'

services:
  # Just Short It
  just-short-it:
    container_name: JustShortIt
    image: miawinter/just-short-it:latest
    environment:
      - "JSI_BaseUrl=<your-url>"
      - "JSI_Account__Username=<your-username>"
      - "JSI_Account__Password=<your-password>"
      - "JSI_Redis__ConnectionString=redis,password=<your-redis-password>"
    environment:
      - "VIRTUAL_HOST=<your-url>"
      - "VIRTUAL_PORT=8080"
      - "LETSENCRYPT_HOST=<your-url>"
    depends_on:
      - redis
      - acme-companion
  redis:
    container_name: Redis
    image: redis:alpine
    environment:
      - "REDIS_PASSWORD=<your-redis-password>"
    volumes:
      - redis:/data

  # nginx-proxy with acme-companion
  nginx-proxy:
    container_name: nginx-proxy
    restart: unless-stopped
    image: jwilder/nginx-proxy:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - certs:/etc/nginx/certs:ro
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
    environment:
      - "DHPARAM_GENERATION=false" # Not sure you need this actually
      - "DISABLE_ACCESS_LOGS" # Always nice to comply with GDPR
  acme-companion:
    container_name: acme-companion
    restart: unless-stopped
    image: nginxproxy/acme-companion
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - certs:/etc/nginx/certs:rw
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /etc/acme.sh:/etc/acme.sh
    environment:
      - "DEFAULT_EMAIL=<your-email>"
      - "NGINX_PROXY_CONTAINER=nginx-proxy"
    depends_on:
      - nginx

volumes:
  # Just Short It!
  redis:
  # Proxy
  certs:
  conf:
  vhost:
  html:

License and Attribution

Just Short It by Mia Winter is licensed under the MIT License.

Just Short It uses tailwindcss, licensed under the MIT License
Just Short It uses daisyUI, licensed under the MIT License
Just Short It uses PostCSS, licensed under the MIT License
Just Short It uses PostCSS CLI, licensed under the MIT License
Just Short It uses autoprefixer, licensed under the MIT License
Just Short It uses cssnano, licensed under the MIT License
Just Short It uses heroicons, licensed under the MIT License

Copyright (c) 2023 Mia Winter