[GH-ISSUE #362] [Feature Request] Make the USER env var configurable #232

Closed
opened 2026-02-25 20:33:07 +03:00 by kerem · 3 comments
Owner

Originally created by @Gerifield on GitHub (Jul 13, 2019).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/362

Hi,
I use asciinema from different machines with different USER env vars.
I didn't want to permanently change the variable on my other machine and it would be great if this variable could come from the config file too.

This is the related line I guess: https://github.com/asciinema/asciinema/blob/develop/asciinema/commands/command.py#L10

Originally created by @Gerifield on GitHub (Jul 13, 2019). Original GitHub issue: https://github.com/asciinema/asciinema/issues/362 Hi, I use asciinema from different machines with different USER env vars. I didn't want to permanently change the variable on my other machine and it would be great if this variable could come from the config file too. This is the related line I guess: https://github.com/asciinema/asciinema/blob/develop/asciinema/commands/command.py#L10
kerem closed this issue 2026-02-25 20:33:07 +03:00
Author
Owner

@ku1ik commented on GitHub (Sep 8, 2019):

You can always make a shell alias like this:

alias asciinema='env USER=foo asciinema'

Would that work?

<!-- gh-comment-id:529188009 --> @ku1ik commented on GitHub (Sep 8, 2019): You can always make a shell alias like this: `alias asciinema='env USER=foo asciinema'` Would that work?
Author
Owner

@Gerifield commented on GitHub (Sep 9, 2019):

Yes, but all the other (important) params could be set in the config file.
The other thing, this would also set the USER env var "inside" the asciinema command and if you'd like to have the original value in you env you should set it back to original inside, during the recording.

<!-- gh-comment-id:529362521 --> @Gerifield commented on GitHub (Sep 9, 2019): Yes, but all the other (important) params could be set in the config file. The other thing, this would also set the USER env var "inside" the asciinema command and if you'd like to have the original value in you env you should set it back to original inside, during the recording.
Author
Owner

@ku1ik commented on GitHub (Apr 19, 2020):

The USER env var is only meaningful when your install ID hasn't been registered on the server (asciinema.org or your own), and it's used for populating temporary username in the database, which we display for asciicasts recorded by non verified users. If you register all your machines with asciinema auth then this username should not matter at all, and would be ignored - the username you've setup on web for your account is then used for display.

The fact we always send USER as username path in basic auth header is to support the "unknown install ID" case. See here: https://github.com/asciinema/asciinema-server/blob/develop/lib/asciinema_web/controllers/api/asciicast_controller.ex#L71 and here https://github.com/asciinema/asciinema-server/blob/develop/lib/asciinema/accounts/accounts.ex#L141-L150

In other words, we might as well not send USER at all, and put "" (blank) as basic auth username, in which case asciicasts for unverified users would display "user:123456" (where 123456 is user ID) as username on the website. Long time ago I thought it would be ok to use it, so we have something to display there, until user fully sets up the account.

<!-- gh-comment-id:616124999 --> @ku1ik commented on GitHub (Apr 19, 2020): The `USER` env var is only meaningful when your install ID hasn't been registered on the server (asciinema.org or your own), and it's used for populating temporary username in the database, which we display for asciicasts recorded by non verified users. If you register all your machines with `asciinema auth` then this username should not matter at all, and would be ignored - the username you've setup on web for your account is then used for display. The fact we always send `USER` as username path in basic auth header is to support the "unknown install ID" case. See here: https://github.com/asciinema/asciinema-server/blob/develop/lib/asciinema_web/controllers/api/asciicast_controller.ex#L71 and here https://github.com/asciinema/asciinema-server/blob/develop/lib/asciinema/accounts/accounts.ex#L141-L150 In other words, we might as well not send `USER` at all, and put `""` (blank) as basic auth username, in which case asciicasts for unverified users would display "user:123456" (where 123456 is user ID) as username on the website. Long time ago I thought it would be ok to use it, so we have something to display there, until user fully sets up the account.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#232
No description provided.