File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# .env
22# Server Configuration
33WUZAPI_PORT = 8080
4+ WUZAPI_ADDRESS = 0.0.0.0
45
56# Token for WuzAPI Admin
67WUZAPI_ADMIN_TOKEN = 1234ABCD
Original file line number Diff line number Diff line change @@ -180,6 +180,22 @@ func main() {
180180
181181 flag .Parse ()
182182
183+ // Check for address in environment variable if flag is default or empty
184+ if * address == "0.0.0.0" || * address == "" {
185+ if v := os .Getenv ("WUZAPI_ADDRESS" ); v != "" {
186+ * address = v
187+ log .Info ().Str ("address" , v ).Msg ("Address configured from environment variable" )
188+ }
189+ }
190+
191+ // Check for port in environment variable if flag is default or empty
192+ if * port == "8080" || * port == "" {
193+ if v := os .Getenv ("WUZAPI_PORT" ); v != "" {
194+ * port = v
195+ log .Info ().Str ("port" , v ).Msg ("Port configured from environment variable" )
196+ }
197+ }
198+
183199 if v := os .Getenv ("WEBHOOK_RETRY_ENABLED" ); v != "" {
184200 * webhookRetryEnabled = strings .ToLower (v ) == "true" || v == "1"
185201 }
You can’t perform that action at this time.
0 commit comments