Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- HPA
- EKS
- windows
- kubernetes
- Karpenter
- inferentia
- go
- ca
- Timeout
- 업그레이드
- vscode
- aws
- upgrade
- AutoScaling
- Kind
- fsx for lustre
- WSL
- curl
- 쿠버네티스
- calico
- device plugin
- KEDA
- AKS
- ansible
- 묘공단
- 컨테이너
- Azure
- ubuntu
- VPA
- amazon vpc lattice
Archives
- Today
- Total
a story
Browser IDE, code-server 사용해보기 본문
Linux VM에서 간단한 테스트를 하기 위해 code-server 를 세팅했습니다.
code-server 는 WEB IDE 혹은 Browser IDE 로 알려진 도구입니다.
설치도 쉽고 vscode 와 UI 가 비슷해서 간단하게 사용할 수 있습니다.
아래 링크의 가이드에 따라 패키지를 설치합니다.
https://github.com/coder/code-server
[root@labco7 ~]# curl -fsSL https://code-server.dev/install.sh | sh
CentOS Linux 7 (Core)
Installing v4.1.0 of the amd64 rpm package from GitHub.
+ mkdir -p ~/.cache/code-server
+ curl -#fL -o ~/.cache/code-server/code-server-4.1.0-amd64.rpm.incomplete -C - https://github.com/coder/code-server/releases/download/v4.1.0/code-server- 4.1.0-amd64.rpm
######################################################################## 100.0%
+ mv ~/.cache/code-server/code-server-4.1.0-amd64.rpm.incomplete ~/.cache/code-server/code-server-4.1.0-amd64.rpm
+ rpm -i ~/.cache/code-server/code-server-4.1.0-amd64.rpm
rpm package has been installed.
To have systemd start code-server now and restart on boot:
sudo systemctl enable --now code-server@$USER
Or, if you don't want/need a background service you can run:
code-server
[root@labco7 ~]#
스크립트에서 OS를 인식하고 패키지 설치를 진행하는 것을 알수 있습니다. (스크립트를 대충 살펴보면 debian 에 대한 처리도 하는 것 같아서 ubuntu 유저도 사용하시면 될거 같습니다)
수행 결과를 보면 데몬으로 실행하거나 혹은 code-server 로 실행하도록 가이드를 제공합니다.
패키지가 설치되고 code-server . & 를 실행하면 ~/.config/code-server 에 하위에 설정파일이 생성되고 접속가능한 URL 이 노출됩니다.
[root@labco7 ~]# code-server . &
[1] 158353
[2022-03-18T07:21:57.394Z] info code-server 4.1.0 9e620e90f53fb91338a2ba1aaa2e556d42ae52d5
[2022-03-18T07:21:57.395Z] info Using user-data-dir ~/.local/share/code-server
[2022-03-18T07:21:57.424Z] info Using config file ~/.config/code-server/config.yaml
[2022-03-18T07:21:57.424Z] info HTTP server listening on http://127.0.0.1:8080/
[2022-03-18T07:21:57.424Z] info - Authentication is enabled
[2022-03-18T07:21:57.424Z] info - Using password from ~/.config/code-server/config.yaml
[2022-03-18T07:21:57.424Z] info - Not serving HTTPS
다만 기본 설정에서는 bind-addr 이 127.0.0.1 이기 때문에 서버에서만 접속이 가능합니다. Localhost로 접속이 불가한 경우라면 아래와 같이 서버 IP로 변경하면 바인딩이 변경되고 해당 IP로 접속이 가능합니다.
여러 사람이 사용하는 경우라면 포트 번호도 각자 수정하시면 됩니다.
[root@labco7 ~]# sed -i 's/127.0.0.1/192.168.10.101/g' ~/.config/code-server/config.yaml
[root@labco7 ~]# cat ~/.config/code-server/config.yaml
bind-addr: 192.168.10.101:8080
auth: password
password: 문자열
cert: false
[root@labco7 ~]# code-server . &
[2] 158486
[root@labco7 ~]# [2022-03-18T07:25:26.775Z] info code-server 4.1.0 9e620e90f53fb91338a2ba1aaa2e556d42ae52d5
[2022-03-18T07:25:26.777Z] info Using user-data-dir ~/.local/share/code-server
[2022-03-18T07:25:26.802Z] info Using config file ~/.config/code-server/config.yaml
[2022-03-18T07:25:26.802Z] info HTTP server listening on http://192.168.10.101:8080/
[2022-03-18T07:25:26.802Z] info - Authentication is enabled
[2022-03-18T07:25:26.802Z] info - Using password from ~/.config/code-server/config.yaml
[2022-03-18T07:25:26.802Z] info - Not serving HTTPS
[root@labco7 ~]#
노출된 URL로 접속하면 패스워드를 입력하는 창이 나오는데 config.yaml 에 있는 password 를 사용하시면 됩니다.
끗
'기타' 카테고리의 다른 글
wsl: docker, kind 설치 (0) | 2023.11.05 |
---|---|
curl 에 timeout 주기 (0) | 2023.10.04 |
개행문자(\n)를 줄바꿈으로 변환하기 (0) | 2022.03.19 |
Windows 에서 ubuntu 의 x window 띄우기 (우분투 GUI 띄우기) (0) | 2022.02.11 |
Windows terminal 의 pane 기능 (0) | 2022.02.05 |