Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use HOME dir if set #2177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: use HOME dir if set #2177

wants to merge 1 commit into from

Commits on Apr 24, 2024

  1. fix: use HOME dir if set

    HOME directory should be preferred source of home directory information.
    
    It's a common pattern to run software with a custom HOME to temporarily isolate it from the system-set home directory. All Unix software I ever worked with would respect HOME.
    
    Preferring `user.Current()` (which I guess reads from `/etc/passwd`) make it impossible to temporarily change effective home, as changing `/etc/passwd` is not an option.
    
    I'm currently migrating things to a self-hosted github-actions runner, where one system user is used for all github actions runners, but each instance gets a different `HOME`, and is otherwise sandboxed to not even have permissions to touch the original home. Everything works except `lncli` which fails with:
    
    ```
    [lncli] could not load global options: could not read profile file /home/github-runner/.lncli/profiles.json: could not load profile file /home/github-runner/.lncli/profiles.json: open /home/github-runner/.lncli/profiles.json: permission denied
    ```
    
    and I traced it to this code.
    dpc authored Apr 24, 2024
    Configuration menu
    Copy the full SHA
    bff8d9d View commit details
    Browse the repository at this point in the history