Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ass/commit/5f9af34ac6416717bff00eff047c224c957ea98d
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
18 additions and
18 deletions
@ -19,25 +19,25 @@ const { path, saveData, log, verify, generateToken, generateId } = require('./ut
//#region Variables, module setup
const app = express ( ) ;
// Configure filename and location settings
const storage = multer . diskStorage ( {
destination : saveWithDate ? ( req , file , cb ) => {
filename : saveAsOriginal ? ( _req , file , callback ) => callback ( null , file . originalname ) : null ,
destination : ! saveWithDate ? diskFilePath : ( _req , _file , callback ) => {
// Get current month and year
const [ month , day, year ] = new Date ( ) . toLocaleDateString ( "en-US" ) . split ( "/" )
let [ month , _ day, year ] = new Date ( ) . toLocaleDateString ( "en-US" ) . split ( "/" ) ;
// Add 0 before single digit months eg ( 6 turns into 06)
cons t folder = ` ${ diskFilePath } / ${ year } - ${ ( "0" + month ) . slice ( - 2 ) } `
le t folder = ` ${ diskFilePath } / ${ year } - ${ ( "0" + month ) . slice ( - 2 ) } ` ;
// Create folder if it doesn't exist
fs . ensureDirSync ( folder )
fs . ensureDirSync ( folder ) ;
cb ( null , folder )
} : diskFilePath ,
callback ( null , folder ) ;
}
} ) ;
filename : saveAsOriginal ? ( req , file , cb ) => cb ( null , file . originalname ) : null ,
} )
var upload = multer ( { storage : storage } )
var upload = multer ( { storage } ) ;
var tokens = [ ] ;
var data = { } ;
//#endregion
@ -68,20 +68,20 @@ const setupSchema = {
pattern : /(original|zws|random)/gi ,
message : 'Must be one of: original, zws, random'
} ,
saveWithDate : {
description : 'Do you want to use date folder structure? Eg (uploads/2021-04/image.png)' ,
type : 'boolean' ,
default : config . saveWithDate ,
required : false
} ,
diskFilePath : {
description : ' Where on the disk do you want to save? ',
description : 'Relative path to save uploads to' ,
type : 'string' ,
default : config . diskFilePath ,
required : false
} ,
saveWithDate : {
description : 'Use date folder structure (e.x. uploads/2021-04/image.png)' ,
type : 'boolean' ,
default : config . saveWithDate ,
required : false
} ,
saveAsOriginal : {
description : 'Save as original file name? (Use file name instead of randomly generated characters)' ,
description : 'Save as original file name instead of random',
type : 'boolean' ,
default : config . saveAsOriginal ,
required : false