Coder Social home page Coder Social logo

neoscript / pubsub-emulator-ui Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 15.0 583 KB

A handy UI tool that provides visibility into the gcloud pusub emulator

License: MIT License

Dockerfile 0.51% JavaScript 2.76% TypeScript 65.12% HTML 20.17% SCSS 11.43%
emulator gcloud gcloud-pubsub google-cloud pubsub ui

pubsub-emulator-ui's Issues

Non-English characters in messages are not correctly encoded

The app uses btoa/atob to convert the message content to/from base-64. However, this treats the content as a binary string, using Latin1/ISO-8859-1 encoding. But most applications expect text in UTF-8 encoding.

For instance, if I send the message "café", it's encoded as Y2Fm6Q==. Trying to decode this as UTF-8 in the application that receives the message produces an incorrect result: "caf�".

The emulator UI should use UTF-8 to encode the message, or at least give the choice of which encoding to use.

Licence + Improve dockerfile

Hello, lovely single page application already in a container, thanks for sharing.

  • To make it a bit more usable, could you add a LICENCE.md ? you can find a ton of them on github, I usually use apache, but MIT is nice too. I cannot help more since it have to be your choose.
  • Can I suggest to improve the dockerfile by adding a nginx conf in order to allow refreshing the page and avoid getting 404 (spa application). Like so:

Dockerfile in the last stage:

COPY scripts/docker/docker_nginx.conf /etc/nginx/conf.d/default.conf

scripts/docker/docker_nginx.conf content:

server {
	listen 80 default_server;

	gzip on;
	gzip_min_length 1000;
	gzip_types text/plain text/xml application/javascript text/css;

	root /app;

	# normal routes
	# serve given url and default to index.html if not found
	# e.g. /, /user and /foo/bar will return index.html
	location / {
		add_header Cache-Control "no-store";
		try_files $uri $uri/index.html /index.html;
	}

	# files
	# for all routes matching a dot, check for files and return 404 if not found
	# e.g. /file.js returns a 404 if not found
	location ~ \.(?!html) {
		add_header Cache-Control "public, max-age=3600";
		try_files $uri =404;
	}
}

I'll make feedback while using it if you do add a licence ;)

feature: add possibility to pre-provision projects to Docker Container env

Similar to echocode-io/gcp-pubsub-emulator-ui project please add possibility to predefine projects on container build, ie.:

version: "3.9"

services:
  pubsub_emulator:
    image: messagebird/gcloud-pubsub-emulator:latest
    ports:
      - "8681:8681"
    environment:
      - PUBSUB_PROJECT1=test-project,topic1:topic1-sub,topic2:t2-s1:t2-s2

  emulator-ui:
    image: ghcr.io/neoscript/pubsub-emulator-ui:latest
    ports:
      - "7200:80"
    environment:
      - PUBSUB_PROJECTS=test-project

Gives the ability to use another port for PubSub

It is not possible yet to use another port for PubSub (not configurable).

I've the following docker-compose:

pubsub:
  image: 'google/cloud-sdk'
  command: 'gcloud beta emulators pubsub start --host-port=0.0.0.0:8085'
  ports:
    - '8085:8085'

pubsub-dashboard:
  image: ghcr.io/neoscript/pubsub-emulator-ui:latest
  ports:
    - '8086:80'

that expose PubSub on port 8085 which makes it impossible to use the UI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.