gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.02k stars 1.71k forks source link

teleport fail to read app-name and app-uri from default configuration file #5409

Open lsaavedr opened 3 years ago

lsaavedr commented 3 years ago

Description

What happened:

if I try to start teleport it's throwing this error

$ teleport start --roles=node,app --auth-server=teleport.mysuperexample.com:3080
error: application name (--app-name) and URI (--app-uri) flags are both required to join application proxy to the cluster

What you expected to happen:

that teleport start flawlessly, reading app-name and app-uri from default configuration file /etc/teleport.yaml

How to reproduce it (as minimally and precisely as possible):

use the examples in documentation to add an app in default configuration file and try to run a node with roles: node,app

Environment

webvictim commented 3 years ago

I believe that if you provide a --roles option on the command line, you have to also provide all config options for that role on the command line too. You should either put all settings in /etc/teleport.yaml, or provide them all on the command line. Here are some config file equivalents:

Setting --auth-server in /etc/teleport.yaml:

teleport:
  auth_servers: ['teleport.mysuperexample.com:3080']

--roles=node,app --app-name=myapp --app-uri=http://appserver:3000 in /etc/teleport.yaml:

app_service:
  enabled: true
  apps:
  - name: myapp
    uri: http://appserver:3000
ssh_service:
  enabled: true
webvictim commented 3 years ago

This does look like a bug. @russjones confirmed that the intended behaviour is that CLI flags and config file settings should be merged, with CLI flags taking precedence.

lsaavedr commented 3 years ago

Thanks!