mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Configured rabbitmq
This commit is contained in:
@ -6,4 +6,4 @@ core:
|
|||||||
logsPath: ./logs
|
logsPath: ./logs
|
||||||
tracing:
|
tracing:
|
||||||
rabbitMQEnabled: true
|
rabbitMQEnabled: true
|
||||||
rabbitMQURI: "amqp://guest:guest@localhost:5672/"
|
rabbitMQURI: ""
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
apiVersion: "v1"
|
apiVersion: "v1"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
address: ":8080"
|
address: ":8080"
|
||||||
description: "Wordpress 4.0"
|
description: "Apache 401"
|
||||||
commands:
|
commands:
|
||||||
- regex: "wp-admin"
|
- regex: ".*"
|
||||||
handler: "Unauthorized"
|
handler: "Unauthorized"
|
||||||
headers:
|
headers:
|
||||||
- "Content-Type: text/html"
|
- "www-Authenticate: Basic"
|
||||||
|
- "server: Apache"
|
||||||
statusCode: 401
|
statusCode: 401
|
@ -5,7 +5,16 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
#network_mode: host # Not work on Mac OS
|
#network_mode: host # Not work on Mac OS
|
||||||
container_name: beelzebub
|
container_name: beelzebub
|
||||||
|
restart: always
|
||||||
ports: # Remove me, if use configuration network_mode: host
|
ports: # Remove me, if use configuration network_mode: host
|
||||||
- "22:22"
|
- "22:22"
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
environment:
|
||||||
|
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/
|
||||||
|
depends_on:
|
||||||
|
- rabbitmq
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3-management-alpine
|
||||||
|
container_name: 'rabbitmq'
|
8
main.go
8
main.go
@ -29,7 +29,13 @@ func main() {
|
|||||||
failOnError(err, fmt.Sprintf("Error during ReadConfigurationsServices: "))
|
failOnError(err, fmt.Sprintf("Error during ReadConfigurationsServices: "))
|
||||||
|
|
||||||
if coreConfigurations.Core.Tracing.RabbitMQEnabled {
|
if coreConfigurations.Core.Tracing.RabbitMQEnabled {
|
||||||
conn, err := amqp.Dial(coreConfigurations.Core.Tracing.RabbitMQURI)
|
rabbitMQURI, configured := os.LookupEnv("RABBITMQ_URI")
|
||||||
|
log.Info(rabbitMQURI)
|
||||||
|
if !configured {
|
||||||
|
rabbitMQURI = coreConfigurations.Core.Tracing.RabbitMQURI
|
||||||
|
}
|
||||||
|
log.Info(rabbitMQURI)
|
||||||
|
conn, err := amqp.Dial(rabbitMQURI)
|
||||||
failOnError(err, "Failed to connect to RabbitMQ")
|
failOnError(err, "Failed to connect to RabbitMQ")
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user