trap icon indicating copy to clipboard operation
trap copied to clipboard

Add support for environment variables.

Open lotyp opened this issue 1 year ago • 1 comments

It would be good to have ability to use TRAP_* env variables to configure /vendor/bin/trap

For example:

TRAP_SENDERS=console,server
TRAP_DEBUG_PORTS=9912,xxxx,yyyy
TRAP_UI_PORT=8000

Which would simplify usage in docker, here is current example:

  trap:
    image: wayofdev/php-dev:8.3-cli-alpine-latest
    container_name: ${COMPOSE_PROJECT_NAME}-trap
    restart: on-failure
    networks:
      - default
    ports:
      - '${TRAP_PORT:-9912}:9912'
      - '${TRAP_UI_PORT:-8000}:8000'
    volumes:
      - ./:/app:rw
      - ~/.composer:/.composer
    env_file:
      - .env
    entrypoint:
      - /app/vendor/bin/trap
      - --ui
      - --port=${TRAP_PORT:-9912}
      - --sender=server
      - --sender=console

Also, currently, there is no way to customize UI port number. 8000 port is used by many other applications, and it would be nice, to be able to customize it via console command attributes and also via ENV variables.

lotyp avatar May 01 '24 12:05 lotyp

TRAP_TCP_PORTS and TRAP_UI_PORT are implemented.

roxblnfk avatar May 01 '24 20:05 roxblnfk