Giter VIP home page Giter VIP logo

easybox's Introduction

EasyBox

EasyBox is a website created to easily host and update a database with only HTTP requests. It is heavily inspired by jsonbox and jsonstore. We're currently in the process on transitioning from jsonbox to this because of two main reasons:

  • Unlimted storage
  • Free and reliable

There is also a public copy of this repo running on https://easybox.bots.wtf if you want to use that instead.

Contributing

If you want to you can contribute to this to improve it. Just fork this GitHub repo on your device, set to enviroment variables MONGODB (connection url for mongodb) and HASH_KEY (a random key used for generating box id) and then run npm start! Check the TODO in index.js, add some things and create a PR!

Documentation

POST /new (send empty data OR if you want a protected box with authorization, send { 'requiresAuth': true }) - Will return a value called ``boxID`` with the ID of your box. If you need authorization, it will also send a key. You will need to put this on the ``Authorization`` header when sending requests to your bot.
POST /copy/<box_id> (send empty data) - Will return a value called ``boxID`` with the ID of your box. All data from the jsonbox provided will be copied to your box
GET /box/<box_id> - Will return a JSON data containing all the collections in the box.
GET /box/<box_id>/<collection_name> - Will return JSON data from the collection name listed
POST /box/<box_id>/<collection_name> - Add data to a collection with the data in the body
DELETE /box/<box_id>/<collection_name> - Will delete a collection, which will delete all the element in the collection.
DELETE /box/<box_id>/<collection_name>/<document_id> - Will delete the document from the collection
PUT /box/<box_id>/<collection_name>/<document_id> - Will update the document in that collection with the new data

easybox's People

Contributors

hackermondev avatar mend-bolt-for-github[bot] avatar ttury avatar

Stargazers

 avatar

Watchers

 avatar

easybox's Issues

CVE-2022-0235 (Medium) detected in node-fetch-2.6.1.tgz

CVE-2022-0235 - Medium Severity Vulnerability

Vulnerable Library - node-fetch-2.6.1.tgz

A light-weight module that brings window.fetch to node.js

Library home page: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /easybox/node_modules/node-fetch/package.json

Dependency Hierarchy:

  • โŒ node-fetch-2.6.1.tgz (Vulnerable Library)

Found in base branch: master

Vulnerability Details

node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

Publish Date: 2022-01-16

URL: CVE-2022-0235

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-r683-j2x4-v87g

Release Date: 2022-01-16

Fix Resolution: node-fetch - 2.6.7,3.1.1


Step up your Open Source Security Game with WhiteSource here

Bug with inserting multiple data

Describe the bug
If I send a POST request to add data to a collection and then do it again without waiting for the first one to finish, only one of them will save. We don't want this to happen, we want both of them to save.

Expected behavior
A clear and concise description of what you expected to happen.
Both of the data to save instead of only one getting saved.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
This probably can be fixed by caching data instead of making requests to MongoDB each time the user requests data or changes data.

Suggestion

Can you please create npm package for easier managing it should be like quick.db.

Or just create example codes how to do the following:

// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }

// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }

// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }

// Repeating previous examples:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }

// Fetching individual properties
db.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // ['Sword', 'Watch']

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.