diff --git a/.gitignore b/.gitignore index 0b41d46..e611d36 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ node_modules/ dist/ .nuxt/ logs/ -# Lolisafe specifics +# Chibisafe specifics database.sqlite uploads/ .env diff --git a/README.md b/README.md index 330a542..7613052 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,25 @@ -![lolisafe](https://lolisafe.moe/8KFePddY.png) +

+ +

+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/kanadeko/Kuro/master/LICENSE) [![Chat / Support](https://img.shields.io/badge/Chat%20%2F%20Support-discord-7289DA.svg?style=flat-square)](https://discord.gg/5g6vgwn) -[![Support me](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.herokuapp.com%2Fpitu&style=flat-square)](https://www.patreon.com/pitu) +[![Support me](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dpitu%26type%3Dpledges&style=flat-square)](https://www.patreon.com/pitu) [![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/kana) ### Attention If you are upgrading from v3 to v4 (current release) and you want to keep your files and relations please read the [migration guide](docs/migrating.md). +### What is this? +Chibisafe is a file uploader service written in node that aims to to be easy to use and easy to set up. It's mainly intended for images and videos, but it accepts anything you throw at it. +- You can run it in public or private mode, making it so only people with user accounts can upload files as well as controlling if user signup is enabled or not. +- Out of the box support for ShareX configuration letting you upload screenshots and screencaptures directly to your chibisafe instance. +- Browser extension to be able to right click any image/video and upload it directly to your chibisafe instance. +- Chunk uploads enabled by default to be able to handle big boi files. +- API Key support so you can integrate the service with whatever you desire. +- Albums, tags and Discord-like search function +- User list and control panel + ### Pre-requisites This guide asumes a lot of things, including that you know your way around linux, nginx and internet in general. @@ -24,18 +37,18 @@ This guide asumes a lot of things, including that you know your way around linux 2. Run `yarn install` 3. Run `yarn setup` -Lolisafe is now installed, configured and ready. Now you need to serve it to the public by using a domain name. +Chibisafe is now installed, configured and ready. Now you need to serve it to the public by using a domain name. -6. Check the [nginx](docs/nginx.md) file for a sample configuration that has every step to run lolisafe securely on production. +6. Check the [nginx](docs/nginx.md) file for a sample configuration that has every step to run chibisafe securely on production. -After you finish setting up nginx, you need to start lolisafe by using pm2. If you want to use something else like forever, ensure that the process spawned from `npm run start` never dies. +After you finish setting up nginx, you need to start chibisafe by using pm2. If you want to use something else like forever, ensure that the process spawned from `npm run start` never dies. 7. Run `pm2 start pm2.json`: 8. Profit ## Author -**lolisafe** © [Pitu](https://github.com/Pitu), Released under the [MIT](https://github.com/WeebDev/lolisafe/blob/master/LICENSE) License.
+**Chibisafe** © [Pitu](https://github.com/Pitu), Released under the [MIT](https://github.com/WeebDev/chibisafe/blob/master/LICENSE) License.
Authored and maintained by Pitu. -> [lolisafe.moe](https://lolisafe.moe) · GitHub [@Pitu](https://github.com/Pitu) +> [chibisafe.moe](https://chibisafe.moe) · GitHub [@Pitu](https://github.com/Pitu) diff --git a/docs/migrating.md b/docs/migrating.md index 9166581..c622dff 100644 --- a/docs/migrating.md +++ b/docs/migrating.md @@ -9,9 +9,9 @@ For starters we recommend cloning the new version somewhere else instead of `git - This will migrate the v3 database to v4 and regenerate every single thumbnail in webp to save bandwidth. - After the migration finishes, the last step is to update your nginx config with the [newly provided script](./nginx.md). - Restart nginx with `sudo nginx -s reload`. -- And lastly start your lolisafe instance with `pm2 start pm2.json`. +- And lastly start your chibisafe instance with `pm2 start pm2.json`. ### Breaking changes -- If you are using the lolisafe extension from one of the stores, the new version has been submitted and could take up to a week to get approved. In the meantime you can load the unpacked extension by cloning [this repo](https://github.com/WeebDev/loli-safe-extension). -- The lolisafe browser extension needs your new token. Instead of pasting your jwt token into it like before, you need to log in to lolisafe, go to your user settings and generate an `API KEY`, which you will use to access the service from 3rd party apps like the browser extension, ShareX, etc. +- If you are using the chibisafe extension from one of the stores, the new version has been submitted and could take up to a week to get approved. In the meantime you can load the unpacked extension by cloning [this repo](https://github.com/WeebDev/chibisafe-extension). +- The chibisafe browser extension needs your new token. Instead of pasting your jwt token into it like before, you need to log in to chibisafe, go to your user settings and generate an `API KEY`, which you will use to access the service from 3rd party apps like the browser extension, ShareX, etc. - To upload a file to an album directly users used to use the endpoint `/api/upload/${albumId}`. This is no longer the case. To upload directly to an album now it's necessary to pass a header called `albumid` with an integer as the value of the album to which you want to upload the file to. diff --git a/package.json b/package.json index 7fe5d5a..d4c509c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "lolisafe", + "name": "chibisafe", "version": "4.0.0", "description": "Blazing fast file uploader and bunker written in node! 🚀", "license": "MIT", @@ -17,14 +17,14 @@ "seed": "yarn knex seed:run", "api": "node src/api/structures/Server", "update": "git pull && yarn install && yarn migrate && yarn build && yarn restart", - "restart": "pm2 restart lolisafe" + "restart": "pm2 restart chibisafe" }, "repository": { "type": "git", - "url": "https://github.com/WeebDev/lolisafe" + "url": "https://github.com/WeebDev/chibisafe" }, "bugs": { - "url": "https://github.com/WeebDev/lolisafe/issues" + "url": "https://github.com/WeebDev/chibisafe/issues" }, "engines": { "node": ">=12.0.0" @@ -114,6 +114,7 @@ } }, "keywords": [ + "chibisafe", "lolisafe", "upload", "uploader", diff --git a/pm2.json b/pm2.json index ae34600..e5737f6 100644 --- a/pm2.json +++ b/pm2.json @@ -1,7 +1,7 @@ { "apps": [ { - "name": "lolisafe", + "name": "chibisafe", "script": "npm", "args": "run start", "env": { diff --git a/src/api/routes/albums/albumZipGET.js b/src/api/routes/albums/albumZipGET.js index 26da2ba..0722f80 100644 --- a/src/api/routes/albums/albumZipGET.js +++ b/src/api/routes/albums/albumZipGET.js @@ -44,7 +44,7 @@ class albumGET extends Route { Make sure the file exists just in case, and if not, continue to it's generation. */ if (exists) { - const fileName = `lolisafe-${identifier}.zip`; + const fileName = `chibisafe-${identifier}.zip`; return res.download(filePath, fileName); } } @@ -77,7 +77,7 @@ class albumGET extends Route { .update('zippedAt', db.fn.now()); const filePath = path.join(__dirname, '../../../../', process.env.UPLOAD_FOLDER, 'zips', `${album.userId}-${album.id}.zip`); - const fileName = `lolisafe-${identifier}.zip`; + const fileName = `chibisafe-${identifier}.zip`; return res.download(filePath, fileName); } catch (error) { log.error(error); diff --git a/src/api/routes/albums/albumsGET.js b/src/api/routes/albums/albumsGET.js index 93a23e3..8d238a9 100644 --- a/src/api/routes/albums/albumsGET.js +++ b/src/api/routes/albums/albumsGET.js @@ -11,7 +11,7 @@ class albumsGET extends Route { /* Let's fetch the albums. This route will only return a small portion of the album files for displaying on the dashboard. It's probably useless - for anyone consuming the API outside of the lolisafe frontend. + for anyone consuming the API outside of the chibisafe frontend. */ const albums = await db .table('albums') diff --git a/src/api/routes/auth/loginPOST.js b/src/api/routes/auth/loginPOST.js index 71867f0..373252b 100644 --- a/src/api/routes/auth/loginPOST.js +++ b/src/api/routes/auth/loginPOST.js @@ -34,7 +34,7 @@ class loginPOST extends Route { Create the jwt with some data */ const jwt = JWT.sign({ - iss: 'lolisafe', + iss: 'chibisafe', sub: user.id, iat: moment.utc().valueOf() }, process.env.SECRET, { expiresIn: '30d' }); diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js index cc1064f..b8952a9 100644 --- a/src/api/structures/Server.js +++ b/src/api/structures/Server.js @@ -35,7 +35,7 @@ class Server { if ((req.url.includes('/api/album/') || req.url.includes('/zip')) && req.method === 'GET') return next(); // This bypasses the headers.accept if we are accessing the frontend if (!req.url.includes('/api/') && req.method === 'GET') return next(); - if (req.headers.accept && req.headers.accept.includes('application/vnd.lolisafe.json')) return next(); + if (req.headers.accept && req.headers.accept.includes('application/vnd.chibisafe.json')) return next(); return res.status(405).json({ message: 'Incorrect `Accept` header provided' }); }); this.server.use(bodyParser.urlencoded({ extended: true })); diff --git a/src/setup.js b/src/setup.js index def57f6..4a9be7f 100644 --- a/src/setup.js +++ b/src/setup.js @@ -16,17 +16,17 @@ async function start() { const wizard = [ { type: 'input', - query: 'Port to run lolisafe in:', + query: 'Port to run chibisafe in:', handle: 'SERVER_PORT' }, { type: 'input', - query: 'Full domain this instance is gonna be running on (Ex: https://lolisafe.moe):', + query: 'Full domain this instance is gonna be running on (Ex: https://chibisafe.moe):', handle: 'DOMAIN' }, { type: 'input', - query: 'Name of the service? (Ex: lolisafe):', + query: 'Name of the service? (Ex: chibisafe):', handle: 'SERVICE_NAME' }, { @@ -117,7 +117,7 @@ async function start() { MAX_LINKS_PER_ALBUM: 5, META_THEME_COLOR: '#20222b', META_DESCRIPTION: 'Blazing fast file uploader and bunker written in node! 🚀', - META_KEYWORDS: 'lolisafe,upload,uploader,file,vue,images,ssr,file uploader,free', + META_KEYWORDS: 'chibisafe,lolisafe,upload,uploader,file,vue,images,ssr,file uploader,free', META_TWITTER_HANDLE: '@its_pitu' }; diff --git a/src/site/assets/images/logo.png b/src/site/assets/images/logo.png index eedc960..f72de04 100644 Binary files a/src/site/assets/images/logo.png and b/src/site/assets/images/logo.png differ diff --git a/src/site/assets/styles/_bulma_colors_extender.scss b/src/site/assets/styles/_bulma_colors_extender.scss index 69dbd1e..815e063 100644 --- a/src/site/assets/styles/_bulma_colors_extender.scss +++ b/src/site/assets/styles/_bulma_colors_extender.scss @@ -3,14 +3,14 @@ @import "../../../node_modules/bulma/sass/utilities/functions"; // Setup our custom colors -$lolisafe: #323846; -$lolisafe-invert: findColorInvert($lolisafe); +$chibisafe: #323846; +$chibisafe-invert: findColorInvert($chibisafe); // XXX: EXPERIMENTAL, CHECK IF WE NEED ORIGINAL PRIMARY ANYWHERE -// $primary: $lolisafe; -// $primary-invert: $lolisafe-invert; +// $primary: $chibisafe; +// $primary-invert: $chibisafe-invert; // declare custom colors $custom-colors: ( - "lolisafe":($lolisafe, $lolisafe-invert) + "chibisafe":($chibisafe, $chibisafe-invert) ); diff --git a/src/site/assets/styles/style.scss b/src/site/assets/styles/style.scss index 6056379..79d0c8d 100644 --- a/src/site/assets/styles/style.scss +++ b/src/site/assets/styles/style.scss @@ -269,9 +269,9 @@ table.table { } } -.lolisafe-input input, -.lolisafe-select select, -.lolisafe-textarea textarea { +.chibisafe-input input, +.chibisafe-select select, +.chibisafe-textarea textarea { border: 2px solid #21252d; border-radius: 0.3em !important; background: rgba(0, 0, 0, 0.15); @@ -287,7 +287,7 @@ table.table { } } -.lolisafe-input .icon { +.chibisafe-input .icon { color: #323846 !important; } @@ -368,15 +368,15 @@ table.table { align-items: center; } -.lolisafe-on-border.field.is-floating-label .label:before { - background-color: $lolisafe; +.chibisafe-on-border.field.is-floating-label .label:before { + background-color: $chibisafe; } -.is-lolisafe.divider::after, .is-lolisafe.divider::before { +.is-chibisafe.divider::after, .is-chibisafe.divider::before { background-color: #21252d; } -.lolisafe.taginput { +.chibisafe.taginput { .taginput-container { background-color: #21252d; border: 2px solid #21252d; diff --git a/src/site/components/footer/Footer.vue b/src/site/components/footer/Footer.vue index 3e7fda3..7d65505 100644 --- a/src/site/components/footer/Footer.vue +++ b/src/site/components/footer/Footer.vue @@ -3,7 +3,7 @@
-

lolisafe

+

chibisafe

© 2017-{{ getYear }} v{{ version }}
@@ -55,7 +55,7 @@ export default { "FileFormName": "files[]", "Headers": { "authorization": "Bearer ${this.token}", - "accept": "application/vnd.lolisafe.json" + "accept": "application/vnd.chibisafe.json" }, "ResponseType": "Text", "URL": "$json:url$", diff --git a/src/site/components/home/links/Links.vue b/src/site/components/home/links/Links.vue index 7be76f2..05915b9 100644 --- a/src/site/components/home/links/Links.vue +++ b/src/site/components/home/links/Links.vue @@ -1,12 +1,12 @@