code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: code-sever in docker not remember github auth

Open code1704 opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser:
  • Local OS:
  • Remote OS:
  • Remote Architecture:
  • code-server --version:

Steps to Reproduce

  1. run code server docker image
  2. code server web and login github (copilot)
  3. restart code server container and it asks to github copilot login again

Expected

remember my github auth for copilot

Actual

no

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over a secure context?

  • [X] I am using a secure context.

Notes

No response

code1704 avatar Dec 05 '23 13:12 code1704

Are you mounting your data directory (~./local/share/code-server by default)? If the contents are not being persisted between Docker restarts then code-server will be unable to access the previous auth token.

code-asher avatar Dec 05 '23 18:12 code-asher

Are you mounting your data directory (~./local/share/code-server by default)? If the contents are not being persisted between Docker restarts then code-server will be unable to access the previous auth token.

Yes, we mount the home dir (~). But it still requires github login each time. Which file stores the github auth?

code1704 avatar Dec 06 '23 14:12 code1704

The actual GitHub auth token is stored in browser storage, but it is encrypted and half of the key is in ~/.local/share/code-server/serve-web-key-half. The other half of the key is also in browser storage, I believe.

So as long as the server key half is the same and the browser is the same the login should persist.

Also, what version of code-server are you running? Persistent secret storage was broken before 4.17.1.

code-asher avatar Dec 06 '23 22:12 code-asher

@code1704 I think this can be closed, this is the same as #5072

bdsoha avatar Jan 01 '24 11:01 bdsoha