🐛 Provide a way to bypass nexus and serving content to prevent nexus reverse proxy issue
This commit is contained in:
@ -241,7 +241,7 @@ func AnalyzeAttachment(file models.Attachment) error {
|
||||
|
||||
// Move temporary to permanent
|
||||
if !linked {
|
||||
if err := ReUploadFileToPermanent(file); err != nil {
|
||||
if err := ReUploadFileToPermanent(file, 1); err != nil {
|
||||
return fmt.Errorf("unable to move file to permanet storage: %v", err)
|
||||
}
|
||||
}
|
||||
|
@ -94,12 +94,15 @@ func CheckChunkExistsInTemporary(meta models.Attachment, cid string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func ReUploadFileToPermanent(meta models.Attachment) error {
|
||||
func ReUploadFileToPermanent(meta models.Attachment, dst int) error {
|
||||
if dst == models.AttachmentDstTemporary || meta.Destination != dst {
|
||||
return fmt.Errorf("destnation cannot be reversed temporary or the same as the original")
|
||||
}
|
||||
if meta.Destination != models.AttachmentDstTemporary {
|
||||
return fmt.Errorf("attachment isn't in temporary storage, unable to process")
|
||||
}
|
||||
|
||||
meta.Destination = models.AttachmentDstPermanent
|
||||
meta.Destination = 0
|
||||
|
||||
destMap := viper.GetStringMap("destinations.permanent")
|
||||
|
||||
|
Reference in New Issue
Block a user