Compare commits

...

13 Commits

Author SHA1 Message Date
Pitu 9367eb5eb8 Merge branch 'master' of github.com:WeebDev/lolisafe 2022-01-14 01:05:46 +09:00
Pitu 6cf87b95ec chore: change to sass 2022-01-14 01:05:43 +09:00
Andy Chan fcd9b7797f
Remove safe.fiery.moe from sites.md (#317)
safe.fiery.moe is no longer active. see: https://blog.fiery.me/safe-fiery-me-shutting-down-soon-tm
2022-01-13 23:19:04 +09:00
Pitu f8d763dca3 chore: change to dart-sass 2022-01-13 23:18:31 +09:00
Brandon Dusseau 556dfbd5f5
Update sharp package to fix crash (#312) 2021-11-25 04:19:32 +09:00
Jason 25897ba6d3
Allow API Access to some endpoints (#304) 2021-11-03 22:17:34 +09:00
Kana 58864852d1
fix: update upload directories 2021-09-02 02:04:57 +09:00
Kana f262fa8069
Update db location 2021-09-02 01:54:17 +09:00
Pitu ff046169bf fix: wrong case on env variable 2021-08-22 22:50:30 +09:00
Pitu 63016a5b74 fix: chunked upload post 2021-08-22 22:40:32 +09:00
Zephyrrus a8b985240d
fix: anon upload and domain fix for album links (#292) 2021-08-22 22:33:28 +09:00
Kana 0d36d03db6
Merge pull request #283 from Devices/patch-1
Remove duplicate proxy_redirect directive
2021-07-01 02:35:21 +09:00
Devices 45ae83d60c
Remove duplicate proxy_redirect directive
The config check run by nginx will fail because this directive is stated twice
2021-06-30 17:40:24 +02:00
13 changed files with 232 additions and 710 deletions

View File

@ -60,7 +60,6 @@ server {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View File

@ -3,7 +3,6 @@
As you are aware by now chibisafe is a project meant to be self-hosted and so we've compiled the list below of sites using it. Some of them are open for registration and some might even offer anonymous uploads.
- [chibisafe.moe](https://chibisafe.moe): A small safe worth protecting.
- [safe.fiery.me](https://safe.fiery.me): Just another clone. *(v3)*
- [dmca.gripe](https://dmca.gripe): a dmca-resistant, permanent file hosting service. *(v3)*
- [safe.succmy.wang](https://safe.succmy.wang): A private clone with a ~~funny~~ bad name
- [discordjs.moe](https://discordjs.moe): A まじ卍 as fuck copy of lolisafe.moe

898
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -74,7 +74,7 @@
"rotating-file-stream": "^2.1.3",
"search-query-parser": "^1.5.5",
"serve-static": "^1.13.2",
"sharp": "^0.27.0",
"sharp": "^0.29.0",
"sqlite3": "^5.0.0",
"systeminformation": "^4.34.5",
"uuid": "^3.3.2",
@ -102,11 +102,11 @@
"eslint-plugin-vue": "^5.2.1",
"jest": "^26.6.3",
"jest-serializer-vue": "^2.0.2",
"node-sass": "^5.0.0",
"nodemon": "^1.19.4",
"postcss-css-variables": "^0.11.0",
"postcss-nested": "^3.0.0",
"puppeteer": "^5.5.0",
"sass": "^1.48.0",
"sass-loader": "^10.1.0",
"vue-jest": "^3.0.7"
},

View File

@ -3,7 +3,7 @@ const Route = require('../../structures/Route');
class albumPOST extends Route {
constructor() {
super('/album/new', 'post');
super('/album/new', 'post', { canApiKey: true });
}
async run(req, res, db, user) {

View File

@ -4,7 +4,7 @@ const Util = require('../../utils/Util');
class albumsGET extends Route {
constructor() {
super('/albums/mini', 'get');
super('/albums/mini', 'get', { canApiKey: true });
}
async run(req, res, db, user) {

View File

@ -3,7 +3,7 @@ const Util = require('../../../utils/Util');
class linkPOST extends Route {
constructor() {
super('/album/link/new', 'post');
super('/album/link/new', 'post', { canApiKey: true });
}
async run(req, res, db, user) {

View File

@ -2,7 +2,7 @@ const Route = require('../../structures/Route');
class albumAddPOST extends Route {
constructor() {
super('/file/album/add', 'post');
super('/file/album/add', 'post', { canApiKey: true });
}
async run(req, res, db, user) {

View File

@ -21,7 +21,8 @@ class configGET extends Route {
metaThemeColor: Util.config.metaThemeColor,
metaDescription: Util.config.metaDescription,
metaKeywords: Util.config.metaKeywords,
metaTwitterHandle: Util.metaTwitterHandle
metaTwitterHandle: Util.metaTwitterHandle,
domain: process.env.DOMAIN
}
});
}

View File

@ -8,7 +8,7 @@ const ThumbUtil = require('../utils/ThumbUtil');
const oldDb = require('knex')({
client: 'sqlite3',
connection: {
filename: nodePath.join(__dirname, '../../', 'db')
filename: nodePath.join(__dirname, '../../../', 'db')
},
useNullAsDefault: true
});
@ -16,7 +16,7 @@ const oldDb = require('knex')({
const newDb = require('knex')({
client: 'sqlite3',
connection: {
filename: nodePath.join(__dirname, '../../database/', 'database.sqlite')
filename: nodePath.join(__dirname, '../../../database/', 'database.sqlite')
},
postProcessResponse: result => {
const booleanFields = ['enabled', 'enableDownload', 'isAdmin', 'nsfw', 'generateZips', 'publicMode', 'userAccounts'];
@ -42,8 +42,8 @@ const start = async () => {
console.log('Starting migration, this may take a few minutes...'); // Because I half assed it
console.log('Please do NOT kill the process. Wait for it to finish.');
await jetpack.removeAsync(nodePath.join(__dirname, '../../uploads/thumbs'));
await jetpack.dirAsync(nodePath.join(__dirname, '../../uploads/thumbs/square'));
await jetpack.removeAsync(nodePath.join(__dirname, '../../../uploads/thumbs'));
await jetpack.dirAsync(nodePath.join(__dirname, '../../../uploads/thumbs/square'));
console.log('Finished deleting old thumbnails to create new ones');
const users = await oldDb.table('users').where('username', '<>', 'root');
@ -121,7 +121,7 @@ const start = async () => {
}
const filename = file.name;
if (!jetpack.exists(nodePath.join(__dirname, '../../uploads', filename))) continue;
if (!jetpack.exists(nodePath.join(__dirname, '../../../uploads', filename))) continue;
ThumbUtil.generateThumbnails(filename);
}
await newDb.batchInsert('files', filesToInsert, 20);

View File

@ -289,10 +289,10 @@ class Util {
const dbFile = await db.table('files')
// eslint-disable-next-line func-names
.where(function() {
if (user === undefined) {
this.whereNull('userId');
} else {
if (user) {
this.where('userId', user.id);
} else {
this.whereNull('userId');
}
})
.where({

View File

@ -1,6 +1,6 @@
<template>
<div
:class="{ 'has-files': alreadyAddedFiles }"
:class="{ 'has-files': alreadyAddedFiles, }"
class="uploader-wrapper">
<b-select
v-if="loggedIn"
@ -176,7 +176,7 @@ export default {
console.error(file, message, xhr);
},
async dropzoneChunksUploaded(file, done) {
const { data } = await this.$axios.post(`${this.config.baseURL}/upload`, {
const { data } = await this.$axios.post('/upload', {
files: [{
uuid: file.upload.uuid,
original: file.name,

View File

@ -29,5 +29,12 @@ export const mutations = {
state.chunkSize = config.chunkSize;
state.publicMode = config.publicMode;
state.userAccounts = config.userAccounts;
state.URL = config.domain;
const lastChar = config.domain.substr(-1);
if (lastChar === '/') {
state.baseURL = `${config.domain}api`;
} else {
state.baseURL = `${config.domain}/api`;
}
}
};