Skip to content
Snippets Groups Projects
Unverified Commit 965fe67a authored by Martin Weise's avatar Martin Weise
Browse files

Updated config for better central vars

parent f72e0bbc
No related branches found
No related tags found
3 merge requests!231CI: Remove build for log-service,!228Better error message handling in the frontend,!223Release of version 1.4.0
...@@ -87,6 +87,8 @@ server { ...@@ -87,6 +87,8 @@ server {
} }
location /api/upload { location /api/upload {
# allow 128.130.0.0/16;
# deny all;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......
...@@ -7,6 +7,11 @@ class UploadService { ...@@ -7,6 +7,11 @@ class UploadService {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const protocol = config.api.useSsl ? 'https' : 'http' const protocol = config.api.useSsl ? 'https' : 'http'
const baseUrl = `${protocol}://${config.api.endpoint}:${config.api.port}` const baseUrl = `${protocol}://${config.api.endpoint}:${config.api.port}`
if (!tus.isSupported) {
console.error('Your browser does not support uploads!')
Vue.$toast.error('Your browser does not support uploads!')
return
}
const upload = new tus.Upload(file, { const upload = new tus.Upload(file, {
endpoint: `${baseUrl}/api/upload/files`, endpoint: `${baseUrl}/api/upload/files`,
retryDelays: [0, 3000, 5000, 10000, 20000], retryDelays: [0, 3000, 5000, 10000, 20000],
......
...@@ -341,7 +341,7 @@ export default { ...@@ -341,7 +341,7 @@ export default {
}) })
.catch((error) => { .catch((error) => {
this.loading = false this.loading = false
this.$toast.error(`Failed to upload file: ${error}`) this.$toast.error('Failed to upload file')
reject(error) reject(error)
}) })
.finally(() => { .finally(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment