If you're seeking a self-hosted URL shortening solution, Snapp might be what you need. It's designed for those who value control over their URL management and want to explore various technologies.
This project began as a personal endeavor to explore new technologies and make use of free time. With version 0.7, some development issues emerged, prompting a complete redesign and rebuild. By version 0.8, we've laid the groundwork for what will become the first version 1.
Currently, you can migrate URLs between versions using a CSV export tool. Note that these files are only valid for direct transitions from one version to the next; for example, exports from version 0.6 to 0.7 won't work for moving from 0.7 to 0.8. We’ve reverted to using Prisma to ensure a more stable and maintainable platform going forward.
This latest version supports multiple architectures, including ARM and ARM64 platforms, and offers integration with various databases, now accessible with just a ENV Variable.
The app has undergone a major refactor, bringing numerous improvements, including a fresh UI built with ShadCN and Svelte. The platform is now stable and mature enough to be considered a release candidate. This will need a new reinitiation of a plain database, so export your URL and be prepared to a new importer that should be able to guide you assign any kind of CSV to the platform.
Please, note that for the time being the release candidate will be updated as fixed version. Once stable will be released as Latest and v.1.0.0.
- Intuitive User Interface: Snapp offers a user-friendly interface for easy link shortening.
- Secure Authentication: Enjoy secure sessions for your user. Their information is protected.
- Custom Short Codes: Personalize your short codes to make your links memorable and easy to share.
- Expiration Dates: Manage link lifespans with expiration dates. You can set expiry dates for added security or let links remain active indefinitely.
- Secret Links: Enhance security with secret links, allowing you to share with a select audience using unique secrets.
- Usage Analytics: Access detailed, anonymous analytics for your links. Snapp provides insights into link engagements.
- Extended Metrics: Integrate Snapp with your self-hosted or cloud-based Umami Analytics for advanced metrics.
- URL Reputation Check: Ensure the safety of links with VirusTotal API reputation checks.
- REST API: Community-requested REST API endpoints enable remote management of your Snapp instance. Find all Scalar Docs here.
Snapp is an open-source platform you can host yourself.
services:
snapp:
image: uraniadev/snapp:0.9-rc-004
ports:
- 3000:3000
environment:
DATABASE_URL: "file:./db.sqlite"
DATABASE_PROVIDER: sqlite # mysql | sqlite | postgres
TOKEN_SECRET: # openssl rand -base64 32
ORIGIN: https://example.com
Note: SQLite database is located in /app/dbschema/sqlite/prisma/{DATABASE_URL} if you want to mount it
Update8.1: In order to make it actually work it ended up requiring
better specification of schemas for Prisma Clients, the combinations are:
Update0.9-rc: Now integrate Zenstack and improved ENV definition to restrict:
DATABASE_PROVIDER=sqlite # postgres | mysql
DATABASE_URL=file:./db.sqlite
# DATABASE_URL=mysql://root:password@localhost:3306/db
# DATABASE_URL=postgres://root:password@localhost:5432/db
If ENV variables ADMIN_USERNAME and ADMIN_PASSWORD are not set it defaults to the very secure:
username: admin
password: password
You can always set a SMTP server and use password recovery process to change it later. (not very secure tho...)
Snapp at his version 0.8 includes from start Italian, English, German, French, Spanish and Galician. This are very amateurish translation with the help of ChatGPT, so errors are to be expected, feel free to open a related issue if any
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.
Some configuration moved from envs variable to settings page in-app, thou there are some ENV that could be set as default on first launch:
APPNAME=Snapp # can be customized on startup before database initiation
[email protected]
ADMIN_PASSWORD=password
ADMIN_USERNAME=admin
AUTH_PROVIDERS=
AUTH_AUTHELIA_CLIENT_ID=
AUTH_AUTHELIA_CLIENT_SECRET=
AUTH_AUTHELIA_ISSUER=
AUTH_GOOGLE_CLIENT_ID=
AUTH_GOOGLE_CLIENT_SECRET=
AUTH_GOOGLE_ISSUER=
AUTH_KEYCLOAK_CLIENT_ID=
AUTH_KEYCLOAK_CLIENT_SECRET=
AUTH_KEYCLOAK_CLIENT_SCOPE=
AUTH_KEYCLOAK_ISSUER=
DATABASE_PROVIDER=
DATABASE_URL=
DISABLE_HOME=
ENABLE_SIGNUP=
ENABLED_MFA=
LOG_LEVEL=
ORIGIN=
PORT=
PUBLIC_ADMIN_CONTACT=
PUBLIC_UMAMI_URL=
PUBLIC_UMAMI_WEBSITE_ID=
PUBLIC_URL=
SMTP_FROM=
SMTP_HOST=
SMTP_PASS=
SMTP_PORT=
SMTP_SSL=
SMTP_USER=
VTAPI_KEY=
TOKEN_SECRET=
Snapp can now integrate Oauth & OIDC compatible SSO. It requires env variables
prefixed with AUTH as the example above Users are checked on email, unregistered
user will rejected if sign ups are disabled. Registered callback URI at
/auth/oauth/{provider}/callback
If you find yourself limited by the UI configuration for your SMTP Server should
be enough to change smtp.config.cjs
file
services:
snapp:
image: uraniadev/snapp:0.9-rc-004
ports:
- 3000:3000
volumes:
- ./smtp.config.cjs:/app/smtp.config.cjs
environment:
TOKEN_SECRET: # openssh rand --base64 32
The file should export a promise that returns a Nodemailer's TransportOptions type, the original one requires the promise to pick up config from db.
module.exports = async () => ({
host: 'smtp.example.com',
port: '587',
secure: false,
auth: {
user: 'username',
pass: 'password'
},
tls:{
...
}
});
This could lead to trouble, so test carefully.
The technology involved:
- Svelte Kit
- Zenstack x Prisma
- Lucia Auth
- ShadCN-Svelte x Tailwind CSS
- MaxMind
- Phosphor Icons
- SwaggerUI
- AMCharts
- LayerChart