Giter Site home page Giter Site logo

zws-im / zws Goto Github PK

View Code? Open in Web Editor NEW
1.6K 10.0 118.0 26.26 MB

Shorten URLs using invisible spaces

Home Page: https://zws.im

License: Apache License 2.0

JavaScript 1.74% TypeScript 97.83% Procfile 0.07% CSS 0.35%
url-shortener zws hacktoberfest postgres prisma unicode nodejs typescript nextjs

zws's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar jonahsnider avatar monkeywithacupcake avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zws's Issues

Contact request - collaboration on abuse reporting

TLDR; your link shortner is heavily abused. Please a take care of the abuse.

Several people including me have tried reaching out to you due to abuse of your link shortner but have yet to receive any kind of reply. The url i provided in my email has successfully been blocked but the volume of urls i have every day makes email reports very impractical.
I'd be happy if you are willing to discuss a more direct or even automated way of reporting the urls to you in the near future.

iMessage ignores slashes

When you send a message on iMessage (tested on latest iOS beta version as of writing) the URL https://zws.im will be sent correctly but is displayed as a rich message and the two slashes (which include the zero-width characters) are displayed as the body of the message.

Custom Domain

This is probably a long-shot ask as I have no idea how easy/difficult this would be to implement:

Could we get access to some method of using ZWS on our own domain, without self-hosting the whole database/web server?

Use combining diacritical marks

I suggest using combining diacritical marks to shorten URLs.
https://unicode-table.com/en/blocks/combining-diacritical-marks/
since you still have an extra slash at the end, it's 1-width. the first slash combined with an arbitrary number of combining diacritics is true zero-width (they're just tall when pró́́́́́́́́́́́́́́perly rendered).
test: https://zws.im/̀̀̀̀̀̀̀̀̀̀̀̀.

Also, these (basic 112) combining diacritics are below u07ff which is the upper limit of a 2-byte UTF-8 sequence. when converted to equivalent ASCII URL, it's %xx%xx each instead of %xx%xx%xx each because all "zero-width" named chars are all above u2000. (compression rate of 1/72, haha)

Are there ratelimits?

I want use your service for posting magnet: links to torrent on Discord. Since Discord don't allowing creating links from magnet protocol, using https instead would be only solution. However it may require to follow ratelimits if there any.

P.S. another idea for not filling regular database pool is allowing using names (optional) along with url, e.g. in my case using name magnethttps://zws.im/magnet/ will use it's own pool of urls, but it also may be something else, like youtube, game, movie or even smaller category JohnURLs, SpiderMan, ...

The Compose file './docker-compose.yml' is invalid because

docker-compose can't execute:

The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for volumes: 'db'
Unsupported config option for services: 'db'

Docker version 20.10.8, build 3967b7d
docker-compose version 1.25.0, build unknown
5.8.0-1038-oracle #39~20.04.1-Ubuntu SMP Mon Aug 2 13:33:34 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

scam reporting

found a discord nsfw verify scam using this
image
some sort of reporting thing on the main page would be a good addition btw

Help:About zws _Heroku configuration: SHORT_CHARS

About Heroku configuration

There’s nothing wrong with the procedure, but I’d like to ask a question:

image
If I leave "SHORT_CHARS" configuration blank , my Self-hosting works result will be like this :

{
    "short": "iBeXr",
    "url": "https://weeqeqewx.herokuapp.com/iBeXr"
}

That’s not how I wanted it to be.It not contains zero-width space.

But I don't know how to fill in this configuration, What’s the format?

Please give some advice ! Thank you !

Short ID generation can have duplicates

Short IDs are generated partially using Node.js's Math.random(). This means that—although unlikely—the same short ID could be generated twice. This would cause users to be sent to the incorrect URL when they're redirected.

There should be a better system in place to generate short IDs to prevent this.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bun
package.json
  • drizzle-kit 0.20.17
  • envalid 8.0.0
  • pg 8.11.3
  • pino 8.21.0
  • pino-pretty 10.3.1
  • @biomejs/biome 1.7.1
  • @types/pg 8.11.4
  • prettier 3.2.5
  • prettier-plugin-packagejson 2.5.0
  • prettier-plugin-tailwindcss 0.5.14
  • turbo 1.13.3
  • vercel 33.7.1
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • oven-sh/setup-bun v1
  • actions/cache v4
nodenv
.node-version
  • node 20
npm
apps/api/package.json
  • @anatine/zod-nestjs 2.0.8
  • @anatine/zod-openapi 2.2.5
  • @jonahsnider/util 10.3.0
  • @nestjs/common 10.3.5
  • @nestjs/core 10.3.5
  • @nestjs/platform-express 10.3.5
  • @nestjs/swagger 7.3.0
  • @ntegral/nestjs-sentry 4.0.1
  • @sentry/bun 7.107.0
  • cors 2.8.5
  • devalue 4.3.2
  • drizzle-orm 0.30.2
  • envalid 8.0.0
  • googleapis 134.0.0
  • ioredis 5.3.2
  • ky 1.2.2
  • next-api-utils 1.1.0
  • pg 8.11.3
  • reflect-metadata 0.2.1
  • rxjs 7.8.1
  • superjson 2.2.1
  • zod 3.22.4
  • @nestjs/cli ^10.0.0
  • @nestjs/schematics ^10.0.0
  • @tsconfig/bun 1.0.4
  • @tsconfig/strictest 2.0.3
  • @types/cors 2.8.17
  • @types/express ^4.17.17
  • type-fest 4.14.0
  • typescript 5.4.2
apps/web/package.json
  • @heroicons/react 2.1.3
  • @highlight-run/next 7.4.8
  • @jonahsnider/util 10.3.0
  • @tanstack/react-query 5.28.9
  • @types/node 20.8.7
  • @types/react 18.2.72
  • @types/react-dom 18.2.22
  • @vercel/analytics 1.2.2
  • apexcharts 3.48.0
  • autoprefixer 10.4.19
  • clsx 2.1.0
  • convert 5.0.0
  • dotenv 16.4.5
  • framer-motion 10.18.0
  • millify 6.1.0
  • next 14.1.4
  • next-api-utils 1.0.2
  • next-plausible 3.12.0
  • postcss 8.4.38
  • react 18.2.0
  • react-apexcharts 1.4.1
  • react-dom 18.2.0
  • swagger-ui-react 5.12.3
  • tailwindcss 3.4.1
  • typescript 5.4.3
  • @types/swagger-ui-react 4.18.3
  • @vercel/edge 1.1.1
  • node 20.x

  • Check this box to trigger a request for Renovate to run again on this repository

Pull Request Preview Environments for increasing maintainer productivity

I would like to make life easier for ZWS maintainers by implementing Uffizzi preview environments.
Disclaimer: I work on Uffizzi.

Uffizzi is a Open Source full stack previews engine and our platform is available completely free for ZWS (and all open source projects). This will provide maintainers with preview environments of their PRs in the cloud, allowing them iterate faster and reduce time to merge. You can see the open source repos which are currently using Uffizzi over here

Uffizzi is purpose-built for the task of previewing PRs and it integrates with your workflow to deploy preview environments in the background without any manual steps for maintainers or contributors.

I can go ahead and create an Initial PoC for you right away if you think there is value in this proposal.

TODO:

  • Intial PoC

API token

Use optional bearer authentication to restrict access to POST /.

[NOT A BUG] Information: where does the ZWS encoding actually happen?

Hello,

I was looking through the source code trying to understand how the url is encoded in the unicode zero width space character aka U+200B.

I got to this file (https://github.com/zws-im/zws/blob/main/apps/api/src/urls/urls.service.ts) but that file doesn't seem to mention or reference said unicode character? Please can someone help me understand this?

I apologize in advance if posting this here isn't the most convenient.

Thanks

Twitter ignores second slash

Twitter ignores second slash so when posted the shortlink doesn't work. This is probably a Twitter issue but just wanted to let you know.

Example:
image

Selfhosting on pterodactyl

How can I host this on pterodactyl container?
I have tried with nodejs egg, but when I start it, the app is not listening on the server's PORT, just one is listening 127.0.0.1:Server port, the other is on 0.0.0.0:3000, I have server port in .env as PORT=

Does pterodactyl egg exist for hosting this easily?

PostgreSQL not found (docker-compose)

I recently tried to use docker-compose to test with the ZWS API and eventually host it on my own website.
However, the API Container keeps restarting in an attempt of finding PostgreSQL:

[debug] [config] characters { characters: [ 'a', 'b', 'c' ], length: 12, rewrites: { d: 'a', e: 'b', f: 'c' } }
[debug] [config] env Prod
[info] [config] Using API key to restrict access to routes
[info] [http] Listening at http://0.0.0.0:3000
[info] [db] Starting a postgresql pool with 13 connections.
[info] [db] Encountered error during initialization:
[warn] [db] Prisma.LogEvent.target was undefined
[error] [db]
Can't reach database server at `localhost`:`5432`

Please make sure your database server is running at `localhost`:`5432`.
[fatal] [db] Failed to connect to database Can't reach database server at `localhost`:`5432`

Please make sure your database server is running at `localhost`:`5432`.

  Please make sure your database server is running at `localhost`:`5432`.
  at LineStream.<anonymous> (node_modules/@prisma/client/runtime/index.js:29704:31)
  at LineStream.emit (node:events:394:28)
  at LineStream.emit (node:domain:475:12)
  at addChunk (node:internal/streams/readable:315:12)
  at readableAddChunk (node:internal/streams/readable:289:9)
  at LineStream.Readable.push (node:internal/streams/readable:228:10)
  at LineStream._pushBuffer (node_modules/@prisma/client/runtime/index.js:26457:19)
  at LineStream._transform (node_modules/@prisma/client/runtime/index.js:26451:10)
  at LineStream.Transform._write (node:internal/streams/transform:184:23)
  at writeOrBuffer (node:internal/streams/writable:389:12)

The docker-compose.yml was not changed, the port 5432 is exposed. Changes to it publishing the port and opening it in the firewall would reveal that i am able to connect to the PostgreSQL Database. This suggests that PostgreSQL is working as intended, while the API is not able to connect to it on localhost.

I already checked the firewall for localhost loopbacks to be accepted, as well of attempting it among different systems. I would either require to point the API towards an openly exposed PostgreSQL Database in the internet or making use of the docker-machine ip which not survives a restart of the server or container. Both not really feels intended.
At the other side i don't have enough experience with Docker to say if that is a "bug" or if i just oversee some Basic Docker 101 here that prevents the containers from communicating to each other despite sharing the same network inside docker.

Docker image for aarch64

Please create docker image for aarch64 architecture.
For now I see

api_1         | standard_init_linux.go:228: exec user process caused: exec format error
api_1         | standard_init_linux.go:228: exec user process caused: exec format error
api_1         | standard_init_linux.go:228: exec user process caused: exec format error
api_1         | standard_init_linux.go:228: exec user process caused: exec format error
api_1         | standard_init_linux.go:228: exec user process caused: exec format error

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.