Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ass/commit/ca73a377c4b6e77094f9a150d578710fca1800c4
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
13 additions and
1 deletions
@ -5,7 +5,7 @@ import fs from 'fs-extra';
import { DateTime } from 'luxon' ;
const { WebhookClient , MessageEmbed } = require ( 'discord.js' ) ;
import { doUpload , processUploaded } from '../storage' ;
const { maxUploadSize , resourceIdSize , gfyIdSize , resourceIdType } = require ( '../../config.json' ) ;
const { maxUploadSize , resourceIdSize , gfyIdSize , resourceIdType , spaceReplace } = require ( '../../config.json' ) ;
import { path , log , verify , getTrueHttp , getTrueDomain , generateId , formatBytes } from '../utils' ;
const { CODE_UNAUTHORIZED , CODE_PAYLOAD_TOO_LARGE } = require ( '../../MagicNumbers.json' ) ;
import { data } from '../data' ;
@ -63,6 +63,9 @@ router.post('/', (req: AssRequest, res: AssResponse, next: Function) => {
color : req.headers [ 'x-ass-og-color' ]
} ;
// Fix spaces in originalname
req . file . originalname = req . file . originalname . replace ( /\s/g , spaceReplace === '!' ? '' : spaceReplace ) ;
// Save the file information
const resourceId = generateId ( generator , resourceIdSize , req . headers [ 'x-ass-gfycat' ] || gfyIdSize , req . file ! . originalname ) ;
log . debug ( 'Saving data' , data . name ) ;
@ -9,6 +9,7 @@ const config = {
resourceIdSize : 12 ,
gfyIdSize : 2 ,
resourceIdType : 'random' ,
spaceReplace : '_' ,
mediaStrict : false ,
viewDirect : false ,
frontendName : 'ass-x' ,
@ -132,6 +133,14 @@ function doSetup() {
pattern : /(original|zws|random|gfycat)/gi , // skipcq: JS-0113
message : 'Must be one of: zws, random, gfycat, original'
} ,
spaceReplace : {
description : 'Character to replace spaces in filenames with (must be a hyphen -, underscore _, or use ! to remove spaces)' ,
type : 'string' ,
default : config . spaceReplace ,
required : false ,
pattern : /^[-_!]$/gim ,
message : 'Must be a - , _ , or !'
} ,
gfyIdSize : {
description : 'Adjective count for "gfycat" URL type' ,
type : 'integer' ,