Yet Another Url Shortner. A simple excercise to learn Svelte.
Are you looking for a reliable solution for self-hosted URL shortening? Look no further! Snapp is the perfect tool for individuals and businesses seeking control over their URL management.
Snapp is a self-hostable open-source platform.
To run Snapp, you need an environment with NodeJS installed and available.
git clone https://github.com/urania-dev/snapp.git
npm install
.env.example
file:
cp .env.example .env && nano .env
npm run dev
npm run build
node -r dotenv/config build
Simply type in your terminal:
docker run -p 3000:3000 uraniadev/snapp:latest
If you run into CORS errors, remember to set the PUBLIC_URL
and ORIGIN
environment variables:
docker run -p 3000:3000 \
-e ORIGIN=https://example.com \
-e PUBLIC_URL=https://example.com \
uraniadev/snapp:latest
At the moment the 0.7.test has major changes and need to migrate shortened url with CSV Exporter from old to this version: Read more and have docker compose in announcement discussion.
version: '3'
services:
redis:
image: redis/redis-stack:latest
# ports: # you can specify LOCAL_IP OR VPN_IP to make db or redis insight available privately
# - (LOCAL_IP or VPN_IP):6379:6379/tcp
# - (LOCAL_IP or VPN_IP):8001:8001
volumes:
- /home/snapp/redis/test:/data:rw
# this make sure to enable persistance through docker restarts
# and shutdowns or updates -- change it to a folder of your choise
- /etc/localtime:/etc/localtime:ro
networks:
- snapp-stack
environment:
REDIS_ARGS: '--save 60 1 --appendonly yes' # Optional: `--requirepass mypassword`
snapp:
image: uraniadev/snapp:0.7
ports:
- 3000:3000
volumes:
# provide origin json downloadable
# from github if you intend to use it
#
# - /home/snapp/app/translations:/app/translations:ro
# - /home/snapp/redis/theme/theme.css:/app/static/custom-theme.css
# See (Discussion about theming)[https://github.com/urania-dev/snapp/discussions/18]
networks:
- snapp-stack
environment:
AUTH_SECRET: very-secure-and-long-pass-words # random string, generate it with bash: openssl rand -base64 32
DB_HOST: redis
# DB_PASS: # Optional: Requires `--requirepass mypassword` in REDIS_ARGS
# DB_PORT: 6379
# DB_IDX: 0
# ALLOW_UNSECURE_HTTP: false
# ENABLE_LIMITS: false
# ENABLE_SIGNUP: true
# ENABLE_HOME: false
# DEFAULT_THEME: dark
# DEFAULT_LANG: en
# LOCALIZATION_FOLDER: /app/translations
# MAX_SHORT_URL: 10
# MAX_USAGES: 0
# MAX_RPM: 0
# MAX_RPD: 0
# UMAMI_WEBSITE_ID:
# UMAMI_URL:
# VIRUSTOTAL_API_KEY:
# PUBLIC_URL: http://host:5173
# ORIGIN: http://host:5173
## all commented vars are optional.
## Note that omitting PUBLIC_URL and ORIGIN
## app expects to be used from http://localhost:3000
networks:
snapp-stack: # Snapp Network so Snapp and redis can communicate but redis is isolated from the wan
external: false
The latest versions of Snapp include CSV Export to facilitate migration. Simply log in and import your URLs from the dashboard, and continue from where you left.
The technology involved: