[Support] binhex - Code-Server


Recommended Posts

I have a strange issue. I am using code server to run a react-app at port 3000 and when I add the port to the container I can access it from an browser. But when trying to also run json-server at port 3001 I can access it from inside the container by using curl. But when I try to access the server from an react-app also running in the same container I get "ERR_CONNECTION_REFUSED"

 

I have also tried adding the port 3001 to the container but I still can't access it internally or externaly. Does anyone have any idea of how to solve this ?

Link to comment
  • 3 weeks later...

This feels like potentially a dumb question, but I found the example-startup-script at 

`/home/nobody-backup/scripts/example-startup-script.sh`

instead of 

`/config/code-server/scripts/example-startup-script.sh`

as mentioned in the FAQ. Is that second folder location where the file should go to activate it? Any particular name it should have? The file is clear except for this part.

Link to comment
This feels like potentially a dumb question, but I found the example-startup-script at 
`/home/nobody-backup/scripts/example-startup-script.sh`
instead of 
`/config/code-server/scripts/example-startup-script.sh`
as mentioned in the FAQ. Is that second folder location where the file should go to activate it? Any particular name it should have? The file is clear except for this part.
No don't touch that, it's a backup incase you wipe your config,, edit the script shown in the faq

Sent from my CLT-L09 using Tapatalk

Link to comment
I'm having an issue trying to use the "Account" login inside the app:
 
image.png.48e1fb7236597f74b3a8236db7048d6c.png
 
I am using cloudflared + NginxProxyManager for SSL. In the devtools console I am seeing the following warning:
 
image.png.b8c2e030fcebfdaceb93cbd8d4ddd571.png
 

I'm also seeing this warning in the Docker logs: 
 
[12:17:36] Switching to using in-memory credential store instead because Keytar failed to load: Cannot find module 'keytar'

 

Everything works great aside from this issue. I'm hoping to be able to login to my MS/Github account to sync my settings from my local client. If anyone has any ideas on what steps I can take to get this working, it's greatly appreciated.

Link to comment
13 hours ago, itz4blitz said:
I'm having an issue trying to use the "Account" login inside the app:
 
image.png.48e1fb7236597f74b3a8236db7048d6c.png
 
I am using cloudflared + NginxProxyManager for SSL. In the devtools console I am seeing the following warning:
 
image.png.b8c2e030fcebfdaceb93cbd8d4ddd571.png
 

I'm also seeing this warning in the Docker logs: 
 
[12:17:36] Switching to using in-memory credential store instead because Keytar failed to load: Cannot find module 'keytar'

 

Everything works great aside from this issue. I'm hoping to be able to login to my MS/Github account to sync my settings from my local client. If anyone has any ideas on what steps I can take to get this working, it's greatly appreciated.

does the account work if you access it from within your lan?, i can confirm for me it works consistently, so the issue maybe related to cloudflare and/or npm, so you might want to ask on those support threads and see if anybody is doing the same successfully.

Link to comment
4 hours ago, binhex said:

does the account work if you access it from within your lan?, i can confirm for me it works consistently, so the issue maybe related to cloudflare and/or npm, so you might want to ask on those support threads and see if anybody is doing the same successfully.


Hi Binhex,

Thanks for your response. I connected locally and I'm actually getting an error:

 

Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope ('https://192.168.1.122:8500/static/out/vs/workbench/contrib/webview/browser/pre/') with script ('https://192.168.1.122:8500/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-webview.net'): An SSL certificate error occurred when fetching the script..

 

And to answer your original question: I'm having the same issue there when trying to login to the account: it just shows "Loading..."

Link to comment
2 hours ago, itz4blitz said:


Hi Binhex,

Thanks for your response. I connected locally and I'm actually getting an error:

 

Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope ('https://192.168.1.122:8500/static/out/vs/workbench/contrib/webview/browser/pre/') with script ('https://192.168.1.122:8500/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-webview.net'): An SSL certificate error occurred when fetching the script..

 

And to answer your original question: I'm having the same issue there when trying to login to the account: it just shows "Loading..."

looks like a known issue:- https://github.com/coder/code-server/issues/3410

Link to comment
  • 3 weeks later...
  • 1 month later...

Hi binhex, I am very new to Docker, and I am not sure if my question is applicable here. I can access code-server with IP address, but I want to run the code-server with a local domain name, for example, code.local. I did some research online that some answers suggest to

 

set the container's network type as br0 and assign a local IP address,

in /etc/hosts add 127.0.0.1 code.local line

in docker compose yaml file add a port mapping 80:80 and

in a DNS server map the IP address with the domain name. 

 

In my case, I modified the /etc/hosts file (but it won't retain the change after restart the container), added an IP - domain name mapping in Pi-Hole

I set the code-server as

IJjLADU.png

 

I actually changed both internal and external port to 80, but it doesn't seems like having any effect. I still see 8500:8500. No matter what host port I change, I can only access the code-server through port 8500. And I also couldn't find the docker-compose.yml file. I only found a config.yml and it doesn't look any similar to the docker-compose.yml

 

Could you possibly direct me the correct way to set up a local domain name for the code-server, or at least change the port mapping? Thank you so much for the help and I  apologize if this is out of this forum's scope, I will delete it.

 

 

Link to comment
  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 3 months later...

Having installed binhex-code-server and looking for some guidance if possible.
I have code-server installed, can access via the web and using nginx proxy.

But for the life of me, and I'm likely missing something obvious, cannot get the docker mods to run on this container.
 

Some of the details I have are as follows:

 

 

The docker run:

Command execution
docker run
  -d
  --name='binhex-code-server'
  --net='bridge'
  --privileged=true
  -e TZ="Europe/London"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -e HOST_CONTAINERNAME="binhex-code-server"
  -e 'CERT_PATH'=''
  -e 'CERT_KEY_PATH'=''
  -e 'SELF_SIGNED_CERT'='yes'
  -e 'BIND_CLOUD_NAME'=''
  -e 'ENABLE_STARTUP_SCRIPTS'='yes'
  -e 'PASSWORD'='SuperSercret'
  -e 'UMASK'='000'
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'DOCKER_MODS'='linuxserver/mods:code-server-nodejs:latest|linuxserver/mods:code-server-golang:latest'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='https://[IP]:[PORT:8500]/'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/code-server-icon.png'
  -p '3004:8500/tcp'
  -v '/mnt/user/devFiles/codeServer':'/data':'rw'
  -v '/mnt/user/appdata/binhex-code-server':'/config':'rw' 'binhex/arch-code-server'
df32af6e56c670074a55e3e62791a86ee3a388a28e2dc4e7355276b77f5a8e40

The command finished successfully!

 

 

 

The container log after startup:

 

11/01/2023 16:29:33
Created by...
11/01/2023 16:29:33
___.   .__       .__
11/01/2023 16:29:33
\_ |__ |__| ____ |  |__   ____ ___  ___
11/01/2023 16:29:33
 | __ \|  |/    \|  |  \_/ __ \\  \/  /
11/01/2023 16:29:33
 | \_\ \  |   |  \   Y  \  ___/ >    <
11/01/2023 16:29:33
 |___  /__|___|  /___|  /\___  >__/\_ \
11/01/2023 16:29:33
     \/        \/     \/     \/      \/
11/01/2023 16:29:33
   https://hub.docker.com/u/binhex/
11/01/2023 16:29:33
11/01/2023 16:29:33
2023-01-11 16:29:33.338238 [info] Host is running unRAID
11/01/2023 16:29:33
2023-01-11 16:29:33.352994 [info] System information Linux df32af6e56c6 5.19.17-Unraid #2 SMP PREEMPT_DYNAMIC Wed Nov 2 11:54:15 PDT 2022 x86_64 GNU/Linux
11/01/2023 16:29:33
2023-01-11 16:29:33.368226 [info] OS_ARCH defined as 'x86-64'
11/01/2023 16:29:33
2023-01-11 16:29:33.382553 [info] PUID defined as '99'
11/01/2023 16:29:33
2023-01-11 16:29:33.400949 [info] PGID defined as '100'
11/01/2023 16:29:33
2023-01-11 16:29:33.433187 [info] UMASK defined as '000'
11/01/2023 16:29:33
2023-01-11 16:29:33.447987 [info] Setting permissions recursively on '/config'...
11/01/2023 16:29:33
2023-01-11 16:29:33.471235 [info] Deleting files in /tmp (non recursive)...
11/01/2023 16:29:33
2023-01-11 16:29:33.486977 [info] PASSWORD defined as 'SuperSercret'
11/01/2023 16:29:33
2023-01-11 16:29:33.501256 [info] CERT_PATH not defined,(via -e CERT_PATH)
11/01/2023 16:29:33
2023-01-11 16:29:33.518246 [info] CERT_KEY_PATH not defined,(via -e CERT_KEY_PATH)
11/01/2023 16:29:33
2023-01-11 16:29:33.532956 [info] SELF_SIGNED_CERT defined as 'yes'
11/01/2023 16:29:33
2023-01-11 16:29:33.547209 [info] BIND_CLOUD_NAME not defined,(via -e BIND_CLOUD_NAME)
11/01/2023 16:29:33
2023-01-11 16:29:33.561450 [info] ENABLE_STARTUP_SCRIPTS defined as 'yes'
11/01/2023 16:29:33
2023-01-11 16:29:33.588012 [info] Starting Supervisor...
11/01/2023 16:29:33
2023-01-11 16:29:33,685 INFO Included extra file "/etc/supervisor/conf.d/code-server.conf" during parsing
11/01/2023 16:29:33
2023-01-11 16:29:33,685 INFO Set uid to user 0 succeeded
11/01/2023 16:29:33
2023-01-11 16:29:33,686 INFO supervisord started with pid 7
11/01/2023 16:29:34
2023-01-11 16:29:34,688 INFO spawned: 'start-script' with pid 104
11/01/2023 16:29:34
2023-01-11 16:29:34,688 INFO reaped unknown pid 8 (exit status 0)
11/01/2023 16:29:34
2023-01-11 16:29:34,695 DEBG 'start-script' stderr output:
11/01/2023 16:29:34
sed: couldn't open temporary file /usr/lib/code/sed5dZHyR: Permission denied
11/01/2023 16:29:34
11/01/2023 16:29:34
2023-01-11 16:29:34,695 INFO success: start-script entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
11/01/2023 16:29:34
2023-01-11 16:29:34,697 DEBG 'start-script' stderr output:
11/01/2023 16:29:34
sed: couldn't open temporary file /usr/lib/code/seddUFgVQ: Permission denied
11/01/2023 16:29:34
11/01/2023 16:29:34
2023-01-11 16:29:34,698 DEBG 'start-script' stderr output:
11/01/2023 16:29:34
sed: couldn't open temporary file /usr/lib/code/sedKx19Rf: Permission denied
11/01/2023 16:29:34
11/01/2023 16:29:34
2023-01-11 16:29:34,700 DEBG 'start-script' stderr output:
11/01/2023 16:29:34
sed: couldn't open temporary file /usr/lib/code/sedHMS4Nk: Permission denied
11/01/2023 16:29:34
11/01/2023 16:29:35
2023-01-11 16:29:35,030 DEBG 'start-script' stdout output:
11/01/2023 16:29:35
[2023-01-11T16:29:35.029Z] info  code-server 4.8.2 ef82b1a565709cc91a53dc7b609aeee435404c0e
11/01/2023 16:29:35
11/01/2023 16:29:35
2023-01-11 16:29:35,030 DEBG 'start-script' stdout output:
11/01/2023 16:29:35
[2023-01-11T16:29:35.029Z] info  Using user-data-dir /config/code-server/user-data
11/01/2023 16:29:35
11/01/2023 16:29:35
2023-01-11 16:29:35,041 DEBG 'start-script' stdout output:
11/01/2023 16:29:35
[2023-01-11T16:29:35.041Z] info  Using config file /config/code-server/config/config.yml
11/01/2023 16:29:35
11/01/2023 16:29:35
2023-01-11 16:29:35,041 DEBG 'start-script' stdout output:
11/01/2023 16:29:35
[2023-01-11T16:29:35.041Z] info  HTTPS server listening on https://0.0.0.0:8500/ 
11/01/2023 16:29:35
11/01/2023 16:29:35
2023-01-11 16:29:35,041 DEBG 'start-script' stdout output:
11/01/2023 16:29:35
[2023-01-11T16:29:35.041Z] info    - Authentication is enabled
11/01/2023 16:29:35
[2023-01-11T16:29:35.041Z] info      - Using password from $PASSWORD
11/01/2023 16:29:35
[2023-01-11T16:29:35.041Z] info    - Using certificate for HTTPS: ~/.local/share/code-server/localhost.crt

 

 

 

My terminal prompts:

 

bash: /home/nobody/.bashrc: No such file or directory
[nobody@df32af6e56c6 ~]$ go
bash: go: command not found
[nobody@df32af6e56c6 ~]$ node
bash: node: command not found

 

 

I'm not sure where I am going wrong here, so any help appreciated. Thanks

Edited by ByteBool
Link to comment
6 minutes ago, ByteBool said:
-e 'DOCKER_MODS'='linuxserver/mods:code-server-nodejs:latest|linuxserver/mods:code-server-golang:latest'

those mods are not made for this image, they are linuxserver mods for their code-server, you are currently in the binhex code-server support thread.

 

however i do support custom installs of additional packages, see Q5:- https://github.com/binhex/documentation/blob/master/docker/faq/code-server.md

Link to comment

My bad, but i was sure I read they could be used. I've obviously misread something. Cheers for the prompt reply though.

 

Is there a way to install things like go and npm on this Image?


Edit, your link answers this question. cheers again.

Edited by ByteBool
  • Like 1
Link to comment

Hi, I have a very weird problem and couldn't find anything about it. I set code-server up as to run through a nginx reverseproxy on a vm that also serves everything else I run. I changed self_signed_cert to no and changed the password, that's it. The config on the reverseproxy is as follows:


 

server {
    listen 80;
    listen [::]:80;
    server_name code.my.domain.net;
    return 301 https://$server_name:443$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name code.my.domain.net;

    # Use Mozilla's guidelines for SSL/TLS settings
    # https://mozilla.github.io/server-side-tls/ssl-config-generator/
    # NOTE: some settings below might be redundant
    ###SSL Config
    include /etc/nginx/ssl.conf;


    location / {
#      include /etc/nginx/proxy.conf;
      proxy_pass http://192.168.2.125:8500;
      proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection upgrade;
      proxy_set_header Accept-Encoding gzip;
    }
}

 

The problem I have is, whenever I try to access the site through firefox, I get prompted to download a tiny file, but don't get forwarded to the site. When I do this in firefox private mode, I get forwarded, but it seems to not work properly. For example I don't get the previews for the designs. In Edge, regardless of mode, I always get prompted to download the file. In Brave however everything seems to work as it should. I'm totally at a loss here. I also didn't find any hint in the log. Do you guys have any ideas? I've attached an example for such a tiny file and a recent docker log. If you need any other info please let me know.

GpsP1_ti d8b806ed92f95d825a4e3c095d683e7000691c6dc4804a58c194887937518140-json.log

Link to comment
  • 2 months later...

I havent used codeserver for a few months, and now I am greeted with a websocket 1006 error.

 

error.png.a62e93e87540242f255e3572cbfe1364.png

 

did I miss a memo about this?  lol there is a lot of talk about it online, but none of the "solutions" have worked for me.

 

I use swag and CF tunnels as well.  I am hoping this is a simple fix and that I just missed something due to my being complacent when I get busy with work.

 

[EDIT]

 

Apologies, this is an LSIO container.  may or may not be relevant

Edited by danktankk
Link to comment
  • 3 weeks later...

Hello, I would like to use code-server to edit my Home-Assistant (HA) config files. I have HA installed in docker on the same host machine.  I have mapped the HA appdata folder into code-server and code-server can see these files and I can open the files, but code-server does not have write access so I am unable to save any changes.  What is the best way to give code server write access to my HA appdata folder please.

Thanks.

Link to comment
  • 1 month later...

Hello. I have created a container using the following command:

Quote

docker run 
  -d 
  --name='binhex-code-server' 
  --net='bridge' 
  -e TZ="Asia/Shanghai" 
  -e HOST_OS="Unraid" 
  -e HOST_HOSTNAME="Blueness-NAS" 
  -e HOST_CONTAINERNAME="binhex-code-server" 
  -e 'CERT_PATH'='' 
  -e 'CERT_KEY_PATH'='' 
  -e 'SELF_SIGNED_CERT'='no' 
  -e 'BIND_CLOUD_NAME'='' 
  -e 'ENABLE_STARTUP_SCRIPTS'='yes' 
  -e 'PASSWORD'='XXXXX' 
  -e 'UMASK'='000' 
  -e 'PUID'='99' 
  -e 'PGID'='100' 
  -l net.unraid.docker.managed=dockerman 
  -l net.unraid.docker.webui='https://[IP]:[PORT:8500]/' 
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/code-server-icon.png' 
  -p '8500:8500/tcp' 
  -v '/mnt/user/appdata/data':'/data':'rw' 
  -v '/mnt/user/appdata/binhex-code-server':'/config':'rw' 'binhex/arch-code-server'


However, I am unable to use the account sync feature in vscode. When I click on the "Accounts" button and select "Turn on cloud changes...", nothing happens. Currently, I am accessing the service through a Cloudflare tunnel.

Thanks

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.