cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
149 stars 45 forks source link

Backstage fails to parse the gitea password: Unexpected flow-seq-end token in YAML stream: "]" #283

Closed cmoulliard closed 1 week ago

cmoulliard commented 3 weeks ago

Issue

Backstage fails to parse the gitea password containing some special chars and raises such an error within the backend log Unexpected flow-seq-end token in YAML stream: "]"

YAMLParseError: Unexpected flow-seq-end token in YAML stream: "]" at line 82, column 31:
       password: *e=sUnx)4Eu-2]k$j~cX-]l$,8EZ"4m7tC!?+C9q

Remark: The export of the secrets using json output could be an issue too as special chars are converted into unicode chars

./idpbuilder get secrets -o json
[
  {
    "name": "gitea-credential",
    "namespace": "gitea",
    "data": {
      "password": "-f!F[-g\u0026V\u0026|\u003e\\7e5[%E7\u003e\\x\u0026(K~,Zjwa3Z8*JHQ~",
      "username": "giteaAdmin"
    }
  },
...
---------------------------
Name: gitea-credential
Namespace: gitea
Data:
  password : -f!F[-g&V&|>\7e5[%E7>\x&(K~,Zjwa3Z8*JHQ~
  username : giteaAdmin

Originally posted by @cmoulliard in https://github.com/cnoe-io/idpbuilder/issues/276#issuecomment-2149072795

nabuskey commented 3 weeks ago

Hmm I didn't notice the encoding issue in json output. We need to fix.

As for the issue itself, does it work if you use the environment variables in the app-config instead? Kinda like this:

https://github.com/cnoe-io/idpbuilder/blob/b104f0a0664a2acc546d8ea11fab5fa5db9d4ecb/examples/ref-implementation/backstage/manifests/install.yaml#L108-L116

cmoulliard commented 2 weeks ago

As for the issue itself, does it work if you use the environment variables in the app-config instead? That seems to work. I need now to create a repository using a backstage template to fully validate that Screenshot 2024-06-12 at 09 01 35

cmoulliard commented 1 week ago

The problem is fixed if the backstage user double quotes the gitea password

gitea: 
         - host: gitea.cnoe.localtest.me:8443 
           username: giteAdmin
           password: "dhdhdh556DEDSDSD((§!(ç§!ç(§fdn"