Online Config VS Code

Github Discussionsjoin ustwittercode-serverdocsDocker Automated BuildDocker Build File

Run VS Code on any machine anywhere and access it in the browser.

Arm please vist code-server vscode arm

View

image-20210212010743794

image-20210212011307032

image-20210212013820201

Install

Code Server Update

Datebase :You are advised to create a Docker container for the database

docker run -it -d \
--name vs-db \
-p 8003:3306 \
-e "MYSQL_ROOT_PASSWORD=vscode" \
mariadb:latest

# vs-db ipaddress
# $ docker exec -it vs-db bash
# $ apt update -y && apt upgrade -y && apt install net-tools iputils-ping
# $ ifconfig | grep inet | grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"

Let’s go to vscode first

image-20210212022724821

Turn on SSH

$ cat code-server/vscode.sh | grep ssh
/usr/sbin/sshd -D &

Open SSL

First, upload your certificate file to vscode, or drag your file to vscode to upload

vi /root/.config/code-server/config.yaml

bind-addr: 0.0.0.0:8080
auth: password
password: password
cert: true

Restart the vscode container

docker restart vscode
docker exec -it vscode /bin/zsh
cd /root/.local/share/code-server
cp /root/xrsec.key localhost.key
cp /root/xrsec.crt localhost.crt
exit
docker restart vscode

or vist web like https://localhost:8765/?folder=/www/bak/ssl_cert/

Then you can notice in the upper right corner that you need to configure SSL to use it

image-20210212023530539

image-20210212023722967

It’s like real vscode

Xdebug

php74-fpm && nginx
php54-fpm && nginx

Open https://localhost:8765/?folder=/www/wwwroot/myapp on the page

Breakpoint testing with PHP debug plug-in

Then visit the web page, such as https://localhost:31003/

Other

pecl74 install 
pecl56 install

/root/code-server/vscode.sh

/root/code-server/server/php/php56/lib/php.ini
/root/code-server/server/php/php74/lib/php.ini
/etc/nginx/nginx.conf
/etc/proxychains.conf
/etc/ssh/sshd_config
/root/.ssh
/root/.zshrc
/root/.pip/pip.conf
/root/.gitconfig

Bug

  1. When you switch to the applet and then switch to the directory, the page will not respond. It may be a problem with PWA. You just need to open it with a browser

image-20210212025357794

image-20210212025446227

Then it will be displayed normally

  1. on Mac && ctrl + ~ Vim’s ESC button cannot be used on the command line
vim 1
i
esc ????????
# You cannot use the ESC key to exit editing mode

# advice
# $ cat /etc/profile
# ctrl && Click file path The editor can be summoned
  1. PHP5.6 with PHP xdebug.launch.json ; There is a special configuration, but I forgot, please help me
  2. I had to consider using the Github API to automatically obtain new versions of software packages due to the high update frequency and low compilation speed,so ,The container may be started later. The update program will be automatically executed and the code server version will be updated. You need to restart the docker container manually
  3. If you have other suggestions or ideas, please feel free to send them

XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way