Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
/ export-vhost Public archive

Simple app to export RabbitMQ vhost definitions in the context of Cloud Foundry

Notifications You must be signed in to change notification settings

mkuratczyk/export-vhost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple app to export definitions from a RabbitMQ vhost

This application is meant to allow users to export definitions from a single RabbitMQ vhost. RabbitMQ Management API endpoints (/api/definitions and /api/definitions/vhost) require admin privileges and therefore cannot be used by regular users. This app is meant to be used as a "proxy" or a way to gain temporary admin permissions for the purpose of exporting definitions from a vhost.

Warning: once deployed, this application performs no user authentication. Therefore anyone with access to this application will be able to export definitions from any vhost. This is likely harmless, because the applications uses /api/definitions/vhost endpoint, which does not export users nor permissions but make sure it's acceptable in your environment.

Installation

This application is meant to be deployed to Cloud Foundry. It should be bound to a user-provided service that grants admin permissions.

  1. Create a user-provided service
cf cups shared-instance-admin -p 'URL, username, password'
URL> https://pivotal-rabbitmq.<SYS-DOMAIN>:443
username> admin
password> admin

The name of the service (shared-instance-admin) is hardcoded in the application so if you want to changed it, you need to edit main.go as well.

Also, don't forget about the port specification (:443). The default RabbitMQ Management API port is different (15672/15671) so the application will not work with this URL, unless the port is correct.

  1. Deploy the application
cf push

Since the application is written in Go, it can be pushed using the go_buildpack or built locally and deployed using binary_buildpack.

Usage

Send a GET request to the application and specify the vhost parameter with the value you want:

curl 'https://export-vhost.<APP-DOMAIN>/?vhost=my_vhost'

Of course you can use a browser or any other HTTP client instead.

The response should be a JSON that you can now import to any other RabbitMQ instance. Import can be performed from the Management UI or command line:

rabbitmqadmin import file.json

About

Simple app to export RabbitMQ vhost definitions in the context of Cloud Foundry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages