Giter Site home page Giter Site logo

bravo68web / shx Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 2.32 MB

Shx Menorepo

License: ISC License

Dockerfile 0.15% TypeScript 91.04% Shell 0.12% PLpgSQL 6.09% JavaScript 0.31% CSS 0.14% MDX 2.15%
api cli dashboard discord discord-bot share-x sharex shx hacktoberfest

shx's Introduction

๐Ÿš€ Project SHX

SHX Banner

GitHub package.json version GitHub Workflow Status GitHub last commit GitHub code size in bytes Snyk Vulnerabilities for GitHub Repo

CodeFactor Grade GitHub top language

forthebadge forthebadge forthebadge

Quality gate

๐Ÿ“ Description

Shx is a platform ment to store and share files, images, text and URLs with ease. This server is built using Node.js and Express.js and stores the uploaded content on Cloudflare R2 and PostgreSQL DB. It is compatible with ShareX and other clients that support the same protocol.

๐Ÿ› ๏ธ Technologies Used

  • Node.js
  • Express.js
  • TypeScript
  • Redis
  • Cloudflare R2
  • Hasura Graphql (with PostgreSQL)
  • Commander.js
  • Next.js
  • Tailwind CSS
  • Storybook

๐Ÿš€ Features

  • File upload
  • Image upload
  • Text upload
  • URL shortener
  • CLI Support
  • Web Dashboard

Docs

Read here

๐Ÿ“ License

This project is licensed under the ISC License.

For more information, please see the LICENSE file.

๐Ÿ“ง Contact

If you have any questions or would like to contribute to the project, please contact [email protected].

shx's People

Contributors

bravo68web avatar chirag3003 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

chirag3003 hmshuv

shx's Issues

๐Ÿ› [BUG] Error Fetching All Gists

Description

I experienced two issues at:-

  • GET /gist -> Get All Gists Routes
  • POST /gist -> Create a new gist

Can you check it and fix it?

Reproduction URL

https://github.com/bravo68web/shx

Reproduction steps

Postman Request to /gist API

Logs

{
    "message": "OFFSET must not be negative: {\"response\":{\"errors\":[{\"message\":\"OFFSET must not be negative\",\"extensions\":{\"path\":\"$\",\"code\":\"data-exception\"}}],\"status\":200,\"headers\":{}},\"request\":{\"query\":\"\\n\\t\\t\\tquery listGists($searchString: String!, $pageNo: Int!, $pageSize: Int!) {\\n\\t\\t\\t\\tgists(\\n\\t\\t\\t\\t\\twhere: {\\n\\t\\t\\t\\t\\t\\t_or: [\\n\\t\\t\\t\\t\\t\\t\\t{ content: { _iregex: $searchString } }\\n\\t\\t\\t\\t\\t\\t\\t{ gist_url_key: { _iregex: $searchString } }\\n\\t\\t\\t\\t\\t\\t]\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tlimit: $pageSize\\n\\t\\t\\t\\t\\toffset: $pageNo\\n\\t\\t\\t\\t) {\\n\\t\\t\\t\\t\\tgistID\\n\\t\\t\\t\\t\\tcontent\\n\\t\\t\\t\\t\\tgist_url_key\\n\\t\\t\\t\\t\\tcreated_on\\n\\t\\t\\t\\t\\tisPrivate\\n\\t\\t\\t\\t\\tisOneTimeOnly\\n\\t\\t\\t\\t\\tviews\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\",\"variables\":{\"searchString\":\"\",\"pageNo\":-10,\"pageSize\":10}}}",
    "error": true,
    "data": null,
    "error_stack": "Error: OFFSET must not be negative: {\"response\":{\"errors\":[{\"message\":\"OFFSET must not be negative\",\"extensions\":{\"path\":\"$\",\"code\":\"data-exception\"}}],\"status\":200,\"headers\":{}},\"request\":{\"query\":\"\\n\\t\\t\\tquery listGists($searchString: String!, $pageNo: Int!, $pageSize: Int!) {\\n\\t\\t\\t\\tgists(\\n\\t\\t\\t\\t\\twhere: {\\n\\t\\t\\t\\t\\t\\t_or: [\\n\\t\\t\\t\\t\\t\\t\\t{ content: { _iregex: $searchString } }\\n\\t\\t\\t\\t\\t\\t\\t{ gist_url_key: { _iregex: $searchString } }\\n\\t\\t\\t\\t\\t\\t]\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tlimit: $pageSize\\n\\t\\t\\t\\t\\toffset: $pageNo\\n\\t\\t\\t\\t) {\\n\\t\\t\\t\\t\\tgistID\\n\\t\\t\\t\\t\\tcontent\\n\\t\\t\\t\\t\\tgist_url_key\\n\\t\\t\\t\\t\\tcreated_on\\n\\t\\t\\t\\t\\tisPrivate\\n\\t\\t\\t\\t\\tisOneTimeOnly\\n\\t\\t\\t\\t\\tviews\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\",\"variables\":{\"searchString\":\"\",\"pageNo\":-10,\"pageSize\":10}}}\n    at makeRequest (file:///home/chirag/Projects/shx/node_modules/graphql-request/src/index.ts:426:11)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async GistController.listGistsS (file:///home/chirag/Projects/shx/packages/api/services/gist.service.ts:160:7)\n    at async file:///home/chirag/Projects/shx/packages/api/controllers/gists.controller.ts:129:18"
}



{
    "statusCode": 400,
    "data": {
        "_original": {
            "content": "Raw Data from nothing",
            "isOneTimeOnly": false,
            "isPrivate": false
        },
        "details": [
            {
                "message": "\"isPrivate\" is not allowed",
                "path": [
                    "isPrivate"
                ],
                "type": "object.unknown",
                "context": {
                    "child": "isPrivate",
                    "label": "isPrivate",
                    "value": false,
                    "key": "isPrivate"
                }
            }
        ]
    }
}

Browsers

Firefox, Chrome, Safari, Microsoft Edge, Opera

OS

Windows, Linux, Mac

Move All this logic to a separate service and fetch from database

// TODO: Move All this logic to a separate service and fetch from database
private downloadImage = async (url: string) => {
let filename = nanoid() + url.split('/').pop()!;
filename = sanitize(filename);
const whitelistedExtensions = ['png', 'jpg', 'jpeg', 'gif', 'svg', 'ico'];


This issue was generated by todo-issue based on a TODO comment in 030663e. It's been assigned to @BRAVO68WEB because they committed the code.

Add Interface for Known Function responses

// TODO: Add Interface for Known Function responses
export interface IAPIKeyController {
list(req: ModRequest, res: Response, next: NextFunction): Promise<void>;
generate(req: ModRequest, res: Response, next: NextFunction): Promise<void>;
revoke(req: ModRequest, res: Response, next: NextFunction): Promise<void>;


This issue was generated by todo-issue based on a TODO comment in 971aeb8.

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.