)]}'
{"nodepool/elements/zuul-worker/extra-data.d/60-zuul-user":[{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"f3ec23cdc4bacc281680b107f0f2fa91cb0ecf3d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ZUUL_USER_SSH_PUBLIC_KEY\u003d${ZUUL_USER_SSH_PUBLIC_KEY:-$HOME/.ssh/id_rsa.pub}"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"if [ $ZUUL_USER_SSH_PUBLIC_KEY \u003d $HOME/.ssh/id_rsa.pub ]; then"},{"line_number":12,"context_line":"    if [ -f $ZUUL_USER_SSH_PUBLIC_KEY ]; then"},{"line_number":13,"context_line":"        # save the public key inside the chroot from current user"},{"line_number":14,"context_line":"        cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"1f9dbf25_c18d667c","line":11,"updated":"2018-02-27 11:57:56.000000000","message":"Why do we need this first check? Can\u0027t we just check if $ZUUL_USER_SSH_PUBLIC_KEY is a file, and if so, use that, and if not then echo \"ssh-rsa ...\" ?","commit_id":"a358882df5cb0d48225251df2bc5c2eb11af3fc6"},{"author":{"_account_id":16059,"name":"shangxdy","email":"shang.xiaodong@zte.com.cn","username":"shangxdy"},"change_message_id":"08663cf1ba43a1a31bea79a38cfc0e8bc27dab2c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ZUUL_USER_SSH_PUBLIC_KEY\u003d${ZUUL_USER_SSH_PUBLIC_KEY:-$HOME/.ssh/id_rsa.pub}"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"if [ $ZUUL_USER_SSH_PUBLIC_KEY \u003d $HOME/.ssh/id_rsa.pub ]; then"},{"line_number":12,"context_line":"    if [ -f $ZUUL_USER_SSH_PUBLIC_KEY ]; then"},{"line_number":13,"context_line":"        # save the public key inside the chroot from current user"},{"line_number":14,"context_line":"        cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"1f9dbf25_efcf2955","line":11,"in_reply_to":"1f9dbf25_c18d667c","updated":"2018-02-27 13:40:07.000000000","message":"Becuase there are three cases:\n1. $HOME/.ssh/id_rsa.pub exsits, and it will be used with highest priority;\n2. another file other than case 1;\n3. from enviroment.\n\nBTW: 1 is the highest priority.","commit_id":"a358882df5cb0d48225251df2bc5c2eb11af3fc6"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"c425876fc05090eddfc6a3364cbeaec74be53517","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ZUUL_USER_SSH_PUBLIC_KEY\u003d${ZUUL_USER_SSH_PUBLIC_KEY:-$HOME/.ssh/id_rsa.pub}"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"if [ $ZUUL_USER_SSH_PUBLIC_KEY \u003d $HOME/.ssh/id_rsa.pub ]; then"},{"line_number":12,"context_line":"    if [ -f $ZUUL_USER_SSH_PUBLIC_KEY ]; then"},{"line_number":13,"context_line":"        # save the public key inside the chroot from current user"},{"line_number":14,"context_line":"        cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"1f9dbf25_c151d410","line":11,"in_reply_to":"1f9dbf25_efcf2955","updated":"2018-02-28 09:59:33.000000000","message":"Ah, I didn\u0027t catch that before. Explicitly checking for $HOME/.ssh/id_rsa.pub even if ZUUL_USER_SSH_PUBLIC_KEY is set is potential regression for existing users who might be counting on it being an override.\n\nThe default value of the variable should take care of selecting the $HOME/.ssh/id_rsa.pub vs. user-set value.\n\nThen the check for file vs. content should be sufficient.","commit_id":"a358882df5cb0d48225251df2bc5c2eb11af3fc6"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"c425876fc05090eddfc6a3364cbeaec74be53517","unresolved":false,"context_lines":[{"line_number":21,"context_line":"        cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":22,"context_line":"    else"},{"line_number":23,"context_line":"        # save the specific public key inside the chroot derectly"},{"line_number":24,"context_line":"        echo \"ssh-rsa $ZUUL_USER_SSH_PUBLIC_KEY\" \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":25,"context_line":"    fi"},{"line_number":26,"context_line":"fi"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"1f9dbf25_41ab84d5","line":24,"range":{"start_line":24,"start_character":9,"end_line":24,"end_character":48},"updated":"2018-02-28 09:59:33.000000000","message":"Additionally, we should change this to not prepend ssh-rsa and instead expect that the content in ZUUL_USER_SSH_PUBLIC_KEY contains it. Not all ssh keys are RSA. That would also allow someone to put more than one key into the variable as well.","commit_id":"a358882df5cb0d48225251df2bc5c2eb11af3fc6"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"bbb61cf01f6efd87bd91927ba611c07d92247485","unresolved":false,"context_lines":[{"line_number":13,"context_line":"    cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":14,"context_line":"elif [ -n \"$ZUUL_USER_SSH_PUBLIC_KEY\" ]; then"},{"line_number":15,"context_line":"    # save the specific public key inside the chroot from env derectly"},{"line_number":16,"context_line":"    echo \"ssh-rsa $ZUUL_USER_SSH_PUBLIC_KEY\" \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":17,"context_line":"else"},{"line_number":18,"context_line":"    die \"Can not find public key for zuul user!\""},{"line_number":19,"context_line":"fi"}],"source_content_type":"application/x-shellscript","patch_set":5,"id":"df7087c5_42170853","line":16,"range":{"start_line":16,"start_character":10,"end_line":16,"end_character":18},"updated":"2018-03-16 23:24:29.000000000","message":"As per Monty\u0027s previous comment we should not prepend this with ssh-rsa as there are other key types. Instead users should set ZUUL_USER_SSH_PUBLIC_KEY to a value that includes the correct key type along with the key data. Then both can be appended to the file here.\n\nBasically just remove this prefix.","commit_id":"bb0aecaa08a433943b581b74b9f60d7d7b44f9a3"},{"author":{"_account_id":16059,"name":"shangxdy","email":"shang.xiaodong@zte.com.cn","username":"shangxdy"},"change_message_id":"fd669a8efa586e7c336657cc2bafde7ec2710617","unresolved":false,"context_lines":[{"line_number":13,"context_line":"    cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":14,"context_line":"elif [ -n \"$ZUUL_USER_SSH_PUBLIC_KEY\" ]; then"},{"line_number":15,"context_line":"    # save the specific public key inside the chroot from env derectly"},{"line_number":16,"context_line":"    echo \"ssh-rsa $ZUUL_USER_SSH_PUBLIC_KEY\" \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":17,"context_line":"else"},{"line_number":18,"context_line":"    die \"Can not find public key for zuul user!\""},{"line_number":19,"context_line":"fi"}],"source_content_type":"application/x-shellscript","patch_set":5,"id":"df7087c5_831634a7","line":16,"range":{"start_line":16,"start_character":10,"end_line":16,"end_character":18},"in_reply_to":"df7087c5_42170853","updated":"2018-03-21 03:26:02.000000000","message":"Yes, you are right.","commit_id":"bb0aecaa08a433943b581b74b9f60d7d7b44f9a3"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"89f82f539db848f9ba8b6138408e98ec664440c4","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ZUUL_USER_SSH_PUBLIC_KEY\u003d${ZUUL_USER_SSH_PUBLIC_KEY:-$HOME/.ssh/id_rsa.pub}"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"if [ -f $ZUUL_USER_SSH_PUBLIC_KEY ]; then"},{"line_number":12,"context_line":"    # save the public key inside the chroot from specific file"},{"line_number":13,"context_line":"    cat $ZUUL_USER_SSH_PUBLIC_KEY \u003e\u003e $TMP_HOOKS_PATH/zuul-user-ssh-public-key"},{"line_number":14,"context_line":"elif [ -n \"$ZUUL_USER_SSH_PUBLIC_KEY\" ]; then"}],"source_content_type":"application/x-shellscript","patch_set":6,"id":"bf659307_6b862dbc","line":11,"updated":"2018-04-10 23:16:37.000000000","message":"Sorry to find one more problem but in removing the rsa prefix in the last patchset I realize that makes this:\n\n  [ -f rsa keydatahere ]\n\nwhich will fail with:\n\n  bash: [: rsa: binary operator expected\n\nWe need to quote this variable so that we do:\n\n  [ -f \"$ZUUL_USER_SSH_PUBLIC_KEY\" ]\n\ninstead which will fix this problem.","commit_id":"877e151ac4217354258a3d640b15bbbbb36e1631"}]}
