Add files via upload

This commit is contained in:
Sophia Atkinson 2021-08-18 00:11:37 -07:00 committed by GitHub
parent fbd5ee6f06
commit ecd6246099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2410 additions and 0 deletions

32
config.json Normal file
View File

@ -0,0 +1,32 @@
{
"key": [""],
"domain": "localhost",
"puploadKeyGenLength": 64,
"public": true,
"maxUploadSize": 50,
"markdown": true,
"port": 80,
"secure": false,
"fileNameLength": 4,
"shortUrlLength": 3,
"securePort": 443,
"ratelimit": 1000,
"dateURLPath": false,
"allowed":[
"png", "jpg", "gif", "mp4", "mp3", "jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv"
],
"admin":{
"key": ["admin pass key goes here"],
"maxUploadSize": 1024,
"allowed": [
"png", "jpg", "gif", "mp4", "mp3","jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv", "html"
]
},
"paste": {
"maxUploadSize": 20
},
"discordToken": "Discord Token Here (required if you want API monitoring through Discord)",
"discordAdminIDs": ["discord IDs of people who can run commands go here", "Like this"],
"discordChannelID": "the channel you're trying to send api monitor updates to",
"prefix": "enter prefix for bot commands here"
}

61
db.json Normal file
View File

@ -0,0 +1,61 @@
{
"files": [
{
"path": "/",
"ip": "Unknown",
"views": 5
},
{
"path": "/RBTu",
"ip": "127.0.0.1",
"views": 1,
"original": "C:\\Users\\ltlld\\Desktop\\ShareX\\server\\routes/../uploads/RBTu.jpg",
"showCase": false
}
],
"bans": [],
"visitors": [
{
"date": "2021-08-12T22:07:21.090Z",
"ip": "10.0.0.69",
"path": "/"
},
{
"date": "2021-08-12T22:07:49.009Z",
"ip": "10.0.0.69",
"path": "/"
},
{
"date": "2021-08-12T22:08:16.603Z",
"ip": "10.0.0.69",
"path": "/"
},
{
"date": "2021-08-12T22:08:47.570Z",
"ip": "127.0.0.1",
"path": "/"
},
{
"date": "2021-08-12T22:08:53.673Z",
"ip": "127.0.0.1",
"path": "/"
},
{
"date": "2021-08-12T22:09:00.043Z",
"ip": "127.0.0.1",
"path": "/RBTu"
},
{
"date": "2021-08-12T22:30:55.854Z",
"ip": "10.0.0.69",
"path": "/"
}
],
"trafficTotal": [
{
"month": "8/2021",
"total": 6
}
],
"passwordUploads": []
}

44
index.js Normal file
View File

@ -0,0 +1,44 @@
/* eslint-disable global-require */
/* eslint-disable no-console */
const ShareXAPI = require(`${__dirname}/server/app`);
/** Setting definitions for the config file and server class */
let c;
let server;
console.log(`\x1b[31m
======================================================================
|\x1b[0m\x1b[34m ________ ___ ___ ________ ________ _______ ________ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m |\\ ____\\|\\ \\|\\ \\|\\ __ \\|\\ __ \\|\\ ___ \\ |\\ ____\\ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m \\ \\ \\___|\\ \\ \\\\\\ \\ \\ \\|\\ \\ \\ \\|\\ \\ \\ __/|\\ \\ \\___|_ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m \\ \\_____ \\ \\ __ \\ \\ __ \\ \\ _ _\\ \\ \\_|/_\\ \\_____ \\ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m \\|____|\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\\\ \\\\ \\ \\_|\\ \\|____|\\ \\ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m ____\\_\\ \\ \\__\\ \\__\\ \\__\\ \\__\\ \\__\\\\ _\\\\ \\_______\\____\\_\\ \\ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m |\\_________\\|__|\\|__|\\|__|\\|__|\\|__|\\|__|\\|_______|\\_________\\ \x1b[0m\x1b[31m|
|\x1b[0m\x1b[34m \\|_________| \\|_________| \x1b[0m\x1b[31m|
| |
| |
======================================================================
|\x1b[0m\x1b[32m Creator: github.com/TannerReynolds\x1b[0m\x1b[31m |
|\x1b[0m\x1b[32m Discord: https://discord.gg/QTcU89d\x1b[0m\x1b[31m |
======================================================================\x1b[0m`);
/** Determines whether or not to use the test config or not.
* Test env config does not get pushed to git
* @returns {void}
*/
async function loadConfig() {
process.argv[2] === '-test'
? c = require(`${__dirname}/config.real.json`)
: c = require(`${__dirname}/config.json`);
}
loadConfig().then(() => {
/** Starting server using the selected config file */
server = new ShareXAPI(c);
});
process.on('SIGINT', async () => {
server.log.warning('Gracefully exiting..');
process.exit();
});
process.on('unhandledRejection', async err => server.log.uncaughtError(err.stack));
process.on('uncaughtException', async err => server.log.uncaughtError(err.stack));

2250
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "sharexapi",
"version": "4.5.3",
"description": "ShareX API made in Nodejs. Includes images, videos, code, text, and url shortening",
"dependencies": {
"body-parser": "^1.18.3",
"ejs": "^3.1.2",
"eris": "^0.14.0",
"express": "^4.16.4",
"formidable": "^1.2.1",
"fs-extra": "^9.0.0",
"helmet": "^4.0.0",
"lowdb": "^1.0.0",
"path": "^0.12.7",
"remarkable": "^2.0.0",
"exif2": "^0.0.1"
},
"devDependencies": {
"eslint": "^7.2.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.17.1"
}
}