Skip to content

[Feat]: I wonder if you can create a choice that we can chose config file in other path #6240

Closed as not planned

Description

@Eggwardhan

What is your suggestion?

My Home path is no space left,So I try to read config from other places.

[houzhaohui@BJ-IDC1-10-10-17-36 code-server-4.0.1-linux-amd64]$ ./bin/code-server --config=./.config/config.yaml 
[2023-05-29T13:57:44.948Z] info  code-server 4.0.1 735c6da829535969ff7193c79379299e4a1cb9bc
[2023-05-29T13:57:44.950Z] info  Using user-data-dir ~/.local/share/code-server
[2023-05-29T13:57:44.953Z] error parent:54473 Uncaught exception: ENOSPC: no space left on device, write
[2023-05-29T13:57:44.954Z] error parent:54473 Error: ENOSPC: no space left on device, write
[2023-05-29T13:57:44.965Z] info  Using config file ./.config/config.yaml
[2023-05-29T13:57:44.965Z] info  HTTP server listening on http://10.10.17.36:8484/ 
[2023-05-29T13:57:44.966Z] info    - Authentication is enabled
[2023-05-29T13:57:44.966Z] info      - Using password from ./.config/config.yaml
[2023-05-29T13:57:44.966Z] info    - Not serving HTTPS 

Why do you want this feature?

start code server by defining other config path.

Are there any workarounds to get this functionality today?

No

Are you interested in submitting a PR for this?

No

Activity

  1. changed the title [-][Feat]: I wonder if you can create [/-] [+][Feat]: I wonder if you can create a choice that we can chose config file in other place[/+] on May 29, 2023
  2. changed the title [-][Feat]: I wonder if you can create a choice that we can chose config file in other place[/-] [+][Feat]: I wonder if you can create a choice that we can chose config file in other path[/+] on May 29, 2023
  3. code-asher commented on May 30, 2023

    @code-asher
    Member

    You can change the config file with --config, is that what you mean?

    For example:

    code-server --config=/tmp/config.yaml
    

    The data directory can also be changed:

    code-server --user-data-dir /tmp/code-server-data
    
  4. mirekphd commented on Jun 26, 2023

    @mirekphd

    --config

    Yes, so say your docs (at least for --user-data-dir), but neither of these two options seems to be available in code-server binary:

    (base) coder@5800d4264eeb:/home/jovyan$ code-server --version
    1.79.2
    695af097c7bd098fbf017ce3ac85e09bbc5dda06
    x64
    
    (base) coder@5800d4264eeb:/home/jovyan$ code-server --user-data-dir
    Ignoring option 'user-data-dir': not supported for code-server.
    
    (base) coder@5800d4264eeb:/home/jovyan$ code-server --config
    Ignoring option 'config': not supported for code-server.
    
  5. mirekphd commented on Jun 26, 2023

    @mirekphd

    neither of these two options seems to be available in code-server binary:

    Turns out there are two instances of code-server available at runtime, and the one which is executed by default (without specifying its path) is the "wrong one" (/usr/lib/../remote-cli/code-server).
    The "right one" does have both --user-data-dir and --config options available.

    More info:

    # have been using the wrong one:
    (base) coder@5800d4264eeb:/home/jovyan$ which code-server
    /usr/lib/code-server/lib/vscode/bin/remote-cli/code-server
    
    (base) coder@5800d4264eeb:/home/jovyan$ /usr/lib/code-server/lib/vscode/bin/remote-cli/code-server --config
    Ignoring option 'config': not supported for code-server.
    
    (base) coder@5800d4264eeb:/home/jovyan$ /usr/lib/code-server/lib/vscode/bin/remote-cli/code-server --user-data-dir
    Ignoring option 'user-data-dir': not supported for code-server.
    
    #
    #
    # ... but finally realized there is another code-server in the container (still a mystery to me why),
    # so I switched to the "right one" (the one I actually directly installed in the Dockerfile):
    (base) coder@5800d4264eeb:/home/jovyan$ /usr/bin/code-server --user-data-dir
    [2023-06-26T11:47:53.539Z] error --user-data-dir requires a value
    
    (base) coder@5800d4264eeb:/home/jovyan$ /usr/bin/code-server --config
    [2023-06-26T11:48:06.579Z] error --config requires a value
    

    Probably aliasing the correct code-server version could prevent such cases (ping to the docs authors).

  6. code-asher commented on Jun 26, 2023

    @code-asher
    Member
  7. code-asher commented on Jun 26, 2023

    @code-asher
    Member

    Maybe it would be good to override this with our binary though to provide a consistent experience. Before that though we would want to implement the remaining features missing from ours that are present in VS Code's (--wait for example).

  8. code-asher commented on Jul 13, 2024

    @code-asher
    Member

    I think we ended up leaving the other binary so as to have parity with Codespaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSome improvement that isn't a feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions