Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cyrildever/crumbl-hoster
Easy hosting server for the Crumbl platform
https://github.com/cyrildever/crumbl-hoster
cryptography data-masking javascript-library signing-trusted storage-api typescript-library
Last synced: about 1 month ago
JSON representation
Easy hosting server for the Crumbl platform
- Host: GitHub
- URL: https://github.com/cyrildever/crumbl-hoster
- Owner: cyrildever
- License: other
- Created: 2020-09-16T11:48:06.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T08:39:31.000Z (2 months ago)
- Last Synced: 2024-09-12T19:15:43.915Z (2 months ago)
- Topics: cryptography, data-masking, javascript-library, signing-trusted, storage-api, typescript-library
- Language: TypeScript
- Homepage:
- Size: 391 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crumbl-hoster
_Easy hosting server for the Crumbl™ platform_![Github tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/crumbl-hoster)
![npm](https://img.shields.io/npm/dw/crumbl-hoster)
![Github last commit](https://img.shields.io/github/last-commit/cyrildever/crumbl-hoster)
![Github issues](https://img.shields.io/github/issues/cyrildever/crumbl-hoster)
![NPM](https://img.shields.io/npm/l/crumbl-hoster)This application is a simple hosting service for the Crumbl™ technology patented by Cyril Dever.
### Usage
1. Either you have set your own MongoDB environment compatible with `crumbl-hoster`'s requirements:
```console
npm i crumbl-hoster && npm run compile && npm start
```2. Or you start the Docker container:
```console
git clone https://github.com/cyrildever/crumbl-hoster.git && cd crumbl-hoster && docker-compose up --build -d
```
You might want to use the `./cleanup` script (or `./cleanup.bat` on Windows) before launching any new Docker session (especially when you've built the NPM project).Running the application will write a 'crumbl-hoster.log' file.
#### Production
Change or adapt the following environment variables if need be:
* `HTTP_PORT`: the HTTP port number (default: 8000);
* `MONGO_DOMAIN`: the MongoDB server name (default: localhost);
* `MONGO_PORT`: the MongoDB port number (default: 27017);
* `MONGO_DB`: the name of the MongoDB database (default: crumbl);
* `MONGO_USERNAME`: the MongoDB username;
* `MONGO_PASSWORD`: the MongoDB password for this username;
* `MONGO_COLLECTION`: the name of the collection to use (default: hoster).### API
_// TODO Add headers identifying the requester._
The following endpoints are available:
* `GET /crumbl`
This endpoint returns the full crumbled string from the passed related hashered prefix of a Crumbl, eg. `http://localhost:8000/crumbl?hasheredSrc=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef&token=12345678-90ab-cdef-1234-567890abcdef1`
It expects 2 mandatory arguments:
- `hasheredSrc`: the hashered prefix of the Crumbl;
- `token`: a valid token (in the form of a UUID string).It returns a `200` status code if found along with a JSON object in the body respecting the following format:
```json
{
"crumbled": "",
"hasheredSrc": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
```* `POST /crumbl`
This endpoint records a crumbled string in the local database.
It expects the request body to be the full crumbled string, eg.
```console
$ curl --location --request POST 'localhost:8000/crumbl' --header 'Content-Type: text/plain' --data-raw ''
```It returns a `201` status code if success along with the verification hash string in the body.
### License
The use of the crumbl-hoster server is subject to fees for commercial purpose and to the respect of the [BSD2-Clause-Patent license](LICENSE). \
Please [contact me](mailto:[email protected]) to get further information.
© 2020-2024 Cyril Dever. All rights reserved.