tchiotludo / akhq

Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
https://akhq.io/
Apache License 2.0
3.34k stars 646 forks source link

Forced Redirect when changing log level #568

Closed evaisman-tc closed 3 years ago

evaisman-tc commented 3 years ago

Hi, i was following the docs to try and change the log level of the ROOT and io.micronaut.configuration.security.ldap loggers but i keep getting redirected to the /login page when using POST. When using GET im able to see the current logging configurations as expected. Any suggestions?

image: tchiotludo/akhq:dev

Here's what i've tried

curl -i -X POST -H "Content-Type: application/json" -d '{ "configuredLevel": "ERROR" }' http://kafkahq/loggers/ROOT
HTTP/1.1 307 Temporary Redirect
Location: /login
Date: Fri, 22 Jan 2021 16:09:09 GMT
transfer-encoding: chunked
curl -i -X POST -H "Content-Type: application/json" -d '{ "configuredLevel": "TRACE" }' https://kafkahq/loggers/io.micronaut.configuration.security
HTTP/1.1 307 Temporary Redirect
Location: /login
Date: Fri, 22 Jan 2021 16:13:30 GMT
transfer-encoding: chunked

and here is my application.yml

micronaut:
  security:
    enabled: true
    ldap:
      default:
        enabled: true
        context:
          server: "ldaps://url"
        search:
          base: "ou=People,dc=example,dc=com"
        groups:
          enabled: true
          base: "ou=Group,dc=example,dc=com"
          filter: "(uid={0})"
akhq:
  security:
    default-group: admin
  server:
    access-log: # Access log configuration (optional)
      enabled: true # true by default
      name: org.akhq.log.access # Logger name
      format: "[Date: {}] [Duration: {} ms] [Url: {} {}] [Status: {}] [Ip: {}] [User: {}]" # Logger format
  connections:
    kafka:
      properties:
        bootstrap.servers: "kafkaurl"
        security.protocol: SSL
        ssl.truststore.location: /alloc/certs/truststore.jks
        ssl.truststore.password: truststorepass
        ssl.keystore.location: /alloc/certs/keystore.jks
        ssl.keystore.password: keystorepass
        ssl.key.password: keystorepass
        ssl.endpoint.identification.algorithm: ""
        schema.registry.ssl.truststore.location: /alloc/certs/truststore.jks
        schema.registry.ssl.truststore.password: truststorepass
        schema.registry.ssl.keystore.location: /alloc/certs/keystore.jks
        schema.registry.ssl.keystore.password: keystorepass
        schema.registry.ssl.key.password: keystorepass
      schema-registry:
        url: "schemaurl"
        properties: # standard kafka properties (optional)
          security.protocol: SSL
          schema.registry.ssl.truststore.location: /alloc/certs/truststore.jks
          schema.registry.ssl.truststore.password: truststorepass
          schema.registry.ssl.keystore.location: /alloc/certs/keystore.jks
          schema.registry.ssl.keystore.password: keystorepass
          schema.registry.ssl.key.password: keystorepass
      connect:
        - name: connect-1
          url: "kconnecturl"
          basic-auth-username: kconnectuser
          basic-auth-password: pswd
          ssl-trust-store: /alloc/certs/truststore.jks
          ssl-trust-store-password: truststorepass
          ssl-key-store: /alloc/certs/keystore.jks
          ssl-key-store-password: keystorepass
      ui-options:
        topic:
          default-view: ALL  # default list view (ALL, HIDE_INTERNAL, HIDE_INTERNAL_STREAM, HIDE_STREAM). Overrides default
        topic-data:
          sort: NEWEST # default sort order (OLDEST, NEWEST) (default: OLDEST).  Overrides default
  topic:
    internal-regexps: # list of regexp to be considered as internal (internal topic can't be deleted or updated)
      - "^_.*$"
      - "^.*_schemas$"
      - "^.*connect-config$"
      - "^.*connect-offsets$1"
      - "^.*connect-status$"
    stream-regexps: # list of regexp to be considered as internal stream topic
      - "^.*-changelog$"
      - "^.*-repartition$"
      - "^.*-rekey$"

Server logs:

2021-01-22 16:27:34,707 INFO  pGroup-1-3 org.akhq.log.access        [Date: 2021-01-22T16:27:34.700636Z] [Duration: 6 ms] [Url: POST /loggers/io.micronaut.configuration.security] [Status: 307] [Ip: /127.0.0.1] [User: Anonymous]
2021-01-22 16:27:39,150 INFO  pGroup-1-3 org.akhq.log.access        [Date: 2021-01-22T16:27:39.148868Z] [Duration: 0 ms] [Url: POST /loggers/ROOT] [Status: 307] [Ip: /127.0.0.1] [User: Anonymous]
tchiotludo commented 3 years ago

Hi, The logger don't work with last version and is corrected here : https://github.com/tchiotludo/akhq/commit/477c7046790e1b8371ca73da37df82c375e360bb

Can you try with dev version please ?

tchiotludo commented 3 years ago

Forgot to mention, now the endpoint are on port 8081 to be more secure !

evaisman-tc commented 3 years ago

i'll give it a shot thanks!