File tree 5 files changed +15
-2
lines changed
5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Server Configuration
2
2
PORT = 3000 # The port the server will listen on
3
+ BASE_URL = http://localhost:3000 # The base URL for the application
3
4
4
5
# Upload Settings
5
6
MAX_FILE_SIZE = 1024 # Maximum file size in MB
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ services:
51
51
DUMBDROP_PIN : 123456
52
52
# Upload without clicking button
53
53
AUTO_UPLOAD : false
54
+ # The base URL for the application
55
+ BASE_URL : http://localhost:3000
54
56
` ` `
55
57
56
58
Then run:
@@ -111,6 +113,7 @@ docker run -p 3000:3000 -v "${PWD}\local_uploads:/app/uploads" dumbwareio/dumbdr
111
113
| Variable | Description | Default | Required |
112
114
| ------------------| ---------------------------------------| ---------| ----------|
113
115
| PORT | Server port | 3000 | No |
116
+ | BASE_URL | Base URL for the application | http://localhost:PORT | No |
114
117
| MAX_FILE_SIZE | Maximum file size in MB | 1024 | No |
115
118
| DUMBDROP_PIN | PIN protection (4-10 digits) | None | No |
116
119
| DUMBDROP_TITLE | Site title displayed in header | DumbDrop| No |
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ services:
11
11
MAX_FILE_SIZE : 1024 # Maximum file size in MB
12
12
DUMBDROP_PIN : 123456 # Optional PIN protection (4-10 digits, leave empty to disable)
13
13
AUTO_UPLOAD : true # Upload without clicking button
14
-
14
+ BASE_URL : http://localhost:3000 # The base URL for the application
15
+
15
16
# Additional available environment variables (commented out with defaults)
16
17
# PORT: 3000 # Server port (default: 3000)
17
18
# NODE_ENV: production # Node environment (development/production)
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ const config = {
38
38
// Server settings
39
39
port : process . env . PORT || 3000 ,
40
40
nodeEnv : process . env . NODE_ENV || 'development' ,
41
+ baseUrl : process . env . BASE_URL || `http://localhost:${ process . env . PORT || 3000 } ` ,
41
42
42
43
// Upload settings
43
44
uploadDir : '/app/uploads' , // Internal Docker path
@@ -75,6 +76,13 @@ function validateConfig() {
75
76
if ( config . maxFileSize <= 0 ) {
76
77
errors . push ( 'MAX_FILE_SIZE must be greater than 0' ) ;
77
78
}
79
+
80
+ // Validate BASE_URL format
81
+ try {
82
+ new URL ( config . baseUrl ) ;
83
+ } catch ( err ) {
84
+ errors . push ( 'BASE_URL must be a valid URL' ) ;
85
+ }
78
86
79
87
if ( config . nodeEnv === 'production' ) {
80
88
if ( ! config . appriseUrl ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ async function startServer() {
23
23
24
24
// Start the server
25
25
const server = app . listen ( config . port , ( ) => {
26
- logger . info ( `Server running at http://localhost: ${ config . port } ` ) ;
26
+ logger . info ( `Server running at ${ config . baseUrl } ` ) ;
27
27
logger . info ( `Upload directory: ${ config . uploadDisplayPath } ` ) ;
28
28
29
29
// List directory contents in development
You can’t perform that action at this time.
0 commit comments