code-server 설치하기 #2 - MacOS

Vince Yi·2022년 9월 1일
0

지난번에는 AWS EC2 기반 리눅스에 설치하는 법을 알아보았다. 이번에는 MacOS에 설치하는 법을 정리한다.

설치하기

brew install

설치 스크립트가 brew 를 통해 install 하므로 brew 가 사전 설치되어야 한다. 정상적으로 설치되면 아래 스크립트로 시작/종료할 수 있다.

$ brew install code-server
# 시작 스크립트
$ brew services start code-server

# 종료 스크립트
$ brew services stop code-server

포트 변경하기

최초 구동 후 설정파일이 생성되기 때문에 포트 충돌이 나더라도 서비스를 시작한다.

기본으로 8080 포트를 사용하기 때문에 다른 서비스와 중복 사용될 확률이 높으므로 적당한 포트로 변경한다.

~/.config/code-server/config.yaml

bind-addr: 127.0.0.1:[포트번호]
auth: password
password: ~~~
cert: false

본 문서에서는 nginx와 연동을 하여 ssl 설정을 별도로 하지 않았는데, ssl 설정을 하지 않으면 기능에 제한이 있다고 한다.

추가적으로 설정할 수 있는 옵션들은 아래와 같다.

Options
--auth                 The type of authentication to use. [password, none]
--password             The password for password authentication (can only be passed in via $PASSWORD or the config file).
--hashed-password      The password hashed with SHA-256 for password authentication (can only be passed in via $HASHED_PASSWORD or the config file).
Takes precedence over 'password'.
--cert                 Path to certificate. A self signed certificate is generated if none is provided.
--cert-host            Hostname to use when generating a self signed certificate.
--cert-key             Path to certificate key when using non-generated cert.
--disable-telemetry    Disable telemetry.
--disable-update-check Disable update check. Without this flag, code-server checks every 6 hours against the latest github release and
then notifies you once every week that a new release is available.
-h --help                 Show this output.
--open                 Open in browser on startup. Does not work remotely.
--bind-addr            Address to bind to in host:port. You can also use $PORT to override the port.
--config               Path to yaml config file. Every flag maps directly to a key in the config file.
--socket               Path to a socket (bind-addr will be ignored).
-v --version              Display version information.
--user-data-dir        Path to the user data directory.
--extensions-dir       Path to the extensions directory.
--list-extensions      List installed VS Code extensions.
--force                Avoid prompts when installing VS Code extensions.
--install-extension    Install or update a VS Code extension by id or vsix. The identifier of an extension is ${publisher}.${name}.
To install a specific version provide @${version}. For example: 'vscode.csharp@1.2.3'.
--enable-proposed-api  Enable proposed API features for extensions. Can receive one or more extension IDs to enable individually.
--uninstall-extension  Uninstall a VS Code extension by id.
--show-versions        Show VS Code extension versions.
--proxy-domain         Domain used for proxying ports.
-e --ignore-last-opened   Ignore the last opened directory or workspace in favor of an empty window.
-n --new-window           Force to open a new window.
-r --reuse-window         Force to open a file or folder in an already opened window.
-vvv --verbose              Enable verbose logging.
--link                 (beta) Securely bind code-server via our cloud service with the passed name. You'll get a URL like
https://hostname-username.cdr.co at which you can easily access your code-server instance.
Authorization is done via GitHub.

References

profile
인생은 40부터

0개의 댓글