Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soratabaka/makeshift-cdn
A simple makeshift CDN API to provide content delivery service for your small needs. This CDN can be self hosted in heroku or your own private server and deliver content as needed
https://github.com/soratabaka/makeshift-cdn
api cdn crud express javascript nodejs
Last synced: 7 days ago
JSON representation
A simple makeshift CDN API to provide content delivery service for your small needs. This CDN can be self hosted in heroku or your own private server and deliver content as needed
- Host: GitHub
- URL: https://github.com/soratabaka/makeshift-cdn
- Owner: SorataBaka
- License: gpl-3.0
- Created: 2021-09-25T10:40:48.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T11:24:50.000Z (almost 2 years ago)
- Last Synced: 2023-03-06T03:13:38.056Z (over 1 year ago)
- Topics: api, cdn, crud, express, javascript, nodejs
- Language: JavaScript
- Homepage: https://makeshift-cdn.herokuapp.com/
- Size: 4.87 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Makeshift CDN
Makeshift CDN is a simple API to host your own content whether that be an image, video, pdf, docfile, etc. On your own private server. It supports multi user by using accounts to store data for each individual seperately while at the same time maintaining security by implementing encryption. This API can be configured to support read-only so that other people may not use your API without permission or be opened to everyone.
**PATHS**
**GET** /register : Retrieves the token of a user. Requires `username` and `password` in raw body.
**POST** /register : Creates a new user. Requires `username` and `password` in raw body.
**DELETE** /register : Deletes a user and all data. Requires `username` and `password` in raw body.
**POST** /update/token : Updates the token for a user. Requires `username` and `password` in raw body.
**POST** /upload/single : Uploads a single file to the API. Requires `token` header.
**GET** /file/:id : Retrieves the file list a user has. Requires `token` header.
**GET** /file/:id/:filename : Retrieves a file from the database.
**ENV**
To host this on your own, simple clone the repository and create an env file with the following parameters:
URI = mongodb://XXXXXXXXXXX0&authSource=admin&retryWrites=true&w=majority
PORT = XXXX
ALLOWWRITE = true
*If any of these env parameters are not provided, the API will NOT start or default to read-only.*The `URI` will be the connection URL to your mongoDB database and the `ALLOWWRITE` parameter will decide if other users may create a user on your client. Make sure you choose Node.JS version 2.2.12 or later in the MongoDB atlas or it won't connect.
**File Restrictions**
To improve security, you can configure what types of files are allowed to be uploaded in to the API. To change this, simply open `restrictedFile.json` in the root directory of the API, the add or delete extensions to your liking. However, I do recommend that you don't leave this empty since certain file types may be harmful. The following are an example of how your json file should look like.
[
"BAT",
"CMD,
"VB",
"VBS"
]