[Support] Linuxserver.io - Code-server


Recommended Posts

I recently installed this and it works fine. I'm having a problem getting the reverse proxy to work. I have added the PROXY_DOMAIN variable with code.mydomain.com and setup everything in cloudflare and NginxProxyManager.

 

When I hit code.mydomain.com, it asks for the password to access code-server, I enter that and then I get a page that says 'connect ECONNREFUSED 0.0.0.0:80' I'm not sure where to go from here. It works fine if I hit the local ip addess for it "http://xxx.xxx.x.xxx:2443"

 

Any help would be appreciated.

Link to comment
4 minutes ago, neruve said:

I recently installed this and it works fine. I'm having a problem getting the reverse proxy to work. I have added the PROXY_DOMAIN variable with code.mydomain.com and setup everything in cloudflare and NginxProxyManager.

 

When I hit code.mydomain.com, it asks for the password to access code-server, I enter that and then I get a page that says 'connect ECONNREFUSED 0.0.0.0:80' I'm not sure where to go from here. It works fine if I hit the local ip addess for it "http://xxx.xxx.x.xxx:2443"

 

Any help would be appreciated.

Actually, I was able to get this to work. it confused me, under PROXY_DOMAIN i had mydomain.com because in the logs it looked like it was *.mydomain.com, I updated the PROXY_DOMAIN variable to code.mydomain.com and in the logs it does say *.code.mydomain.com but now it works fine.

Link to comment
  • 3 weeks later...

I am a bit of noob with all of this so I am probably missing something simple but I am trying to get a java project to work in this, but I don't seem to be able to get java properly installed.  I'm not sure of steps needed for this but I was hoping for a little help?

 

I did install the java docker mod but that doesn't seem to installing Java?

 

image.png.c30f5fb1c53486cf3f4f795d1d8f3399.png

 

image.png.437ff206a8fa7d361d6342b9991b6243.png

Link to comment
  • 3 weeks later...

I am using code-server and I added the PUID of 99 and PGID of 100 for nobody and when i use the desktop VSCode and use SMB with my user of name for example which has a different PUID and PGID I have noticed that if I make a file using nobody I can't edit it in the desktop VSCode as name HOWEVER if I do the reverse and I make a file using name and try to edit it using code-server as nobody it works.
How can I make a file editable under both users? What docker flags do I need to add?

Edited by Ustrombase
Link to comment
  • 2 months later...

Hi, I haven'y used code-server for a few months and went to use it the other day and it wouldn't start! I can see some errors in the log but not sure if they are causing the issue? I'm guessing that an update broke it at somepoint? Here is part of the log, if you need more please shout! Cheers, Tim

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
setting up sudo access
setting sudo password using SUDO_PASSWORD env var
New password: Retype new password: passwd: password updated successfully
setting permissions::configuration
setting permissions::workspace
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 95-apt-get: executing...
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:4 https://dl.yarnpkg.com/debian stable InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/universe Sources [267 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/restricted Sources [38.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main Sources [574 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,814 kB]
Hit:9 https://deb.nodesource.com/node_14.x focal InRelease
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,118 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [859 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-security/universe Sources [101 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-security/restricted Sources [36.2 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-security/main Sources [242 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [837 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [790 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,385 kB]
Fetched 8,289 kB in 1s (6,239 kB/s)
Reading package lists...
[cont-init.d] 95-apt-get: exited 0.
[cont-init.d] 98-python3: executing...
**** installing python3 dev environment ****
Reading package lists...
Building dependency tree...
Reading state information...
libffi-dev is already the newest version (3.3-4).

python3-dev is already the newest version (3.8.2-0ubuntu2).

python3-venv is already the newest version (3.8.2-0ubuntu2).

build-essential is already the newest version (12.8ubuntu1.1).

libssl-dev is already the newest version (1.1.1f-1ubuntu2.10).

python3-pip is already the newest version (20.0.2-5ubuntu1.6).

0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
[cont-init.d] 98-python3: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] 99-home-assistant: executing...
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
Hit:4 https://deb.nodesource.com/node_14.x focal InRelease
Hit:5 https://dl.yarnpkg.com/debian stable InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package bsdtar is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libarchive-tools

E: Package 'bsdtar' has no installation candidate
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
/var/run/s6/etc/cont-init.d/99-home-assistant: line 28: uuidgen: command not found
Installing vscode extension: LogFileHighlighter by emilast @ 2.11.0
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/emilast/vsextensions/LogFileHighlighter/2.11.0/vspackage
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
Warning: Transient problem: HTTP error Will retry in 60 seconds. 5 retries

Warning: left.

Throwing away 483 bytes
/var/run/s6/etc/cont-init.d/99-home-assistant: line 44: bsdtar: command not found
[cont-init.d] 99-home-assistant: exited 1.
[cont-init.d] code-server.sh: executing...
[cont-init.d] code-server.sh: exited 0.
[cont-init.d] mosquitto.sh: executing...
ln: failed to create symbolic link '/root/.config/mosquitto_pub': File exists

ln: failed to create symbolic link '/root/.config/mosquitto_rr': File exists

[cont-init.d] mosquitto.sh: exited 1.
[cont-init.d] user.sh: executing...
ln: failed to create symbolic link '/config/.ssh/.ssh': File exists

ln: failed to create symbolic link '/config/.gitconfig': File exists

[cont-init.d] user.sh: exited 1.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting the code server...
[2022-01-08T17:57:41.235Z] error Unknown option --extra-builtin-extensions-dir

[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

 

Link to comment
  • 4 weeks later...
On 9/4/2021 at 1:03 PM, josephsiu said:

Did anyone managed to get SUDO_PASSWORD_HASH working? I'm using the same instruction as HASHED_PASSWORD (different password). The hashed password worked but I was not able to sudo. It kept saying my password was wrong.

 

Method: echo -n "thisismypassword" | npx argon2-cli -e

 

I was able to set a sudo password plaintext by using SUDO_PASSWORD but I would like to hash it.

 

How did you get the echo command to work? I'm getting "bash: npx: command not found"

 

I tried with the openssl command someone suggested but the $sdas$asdas$adasdasd result doesn't work regardless of the password I use.

 

Thanks!

Link to comment
  • 2 weeks later...

I am testing this container.  Installed the stable version, no changes to the config. The container prompts me to login.  Using the default password (password).  I immediately get a 404 error.  

 

I tried removing the proxy config line and I still get the same results.  Log doesn't show anything abnormal.  Any ideas here?

 

Log:

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
setting up sudo access
adding abc to sudoers
setting sudo password using SUDO_PASSWORD env var
New password: Retype new password: passwd: password updated successfully
setting permissions::configuration
setting permissions::workspace
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-02-20T17:06:59.800Z] info code-server 4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd
[2022-02-20T17:06:59.802Z] info Using user-data-dir ~/data
[2022-02-20T17:06:59.822Z] info Using config file ~/.config/code-server/config.yaml
[2022-02-20T17:06:59.822Z] info HTTP server listening on http://0.0.0.0:8443/
[2022-02-20T17:06:59.822Z] info - Authentication is enabled
[2022-02-20T17:06:59.822Z] info - Using password from $PASSWORD
[2022-02-20T17:06:59.822Z] info - Not serving HTTPS

 

Link to comment
12 hours ago, kiowa2005 said:

I am testing this container.  Installed the stable version, no changes to the config. The container prompts me to login.  Using the default password (password).  I immediately get a 404 error.

Same issue here. Everything seems setup fine. It pulled the "latest" version. I get the login page fine but then only ever get the 404 after that. Hopefully someone responds with some helpful solution.

 

Nevermind. Looks like the issue was on the app side. I just saw there was a code-server update and everything works after I updated to it. Thanks whoever.

Edited by TAHerman
Link to comment
  • 1 month later...
On 11/1/2020 at 11:28 PM, romain said:

Does anyone know how to get to the preview page from the Live Server extension?  I saw someone asking about the extension in the past but I think my question is different - Live Server says it's running and that it's running on port 5500.  Normally you would go to 127.0.0.1:5500/index.html if you were using VS Code on your local workstation but since it's a docker container that wouldn't/doesn't work like that - I tried adding a  few ports to the docker configuration to try and let me access ports 5500 through 5505 from my LAN but that didn't work either.  A screen shot of the port 5500 config that I tried to add.  I just did this 6 times for 5500, ..., 5505.

 

This may be more of a routing question than a code-server question, but if anyone here can help me out I'd appreciate it!

 

image.png.aaf95db811ae4c4e6c3dc2474aeb6a48.png

 

This post is from 2020 but I did not see an update if it was ever figured out.  

 

So if anyone is wondering how to accomplish using "Live Server with Code Server".

 

Go into your docker template and add the port 5500 as shown above.  Your docker will now look like the following.  Make note of the "internal docker IP" as I have circled in Red below:

 

codeserverip.jpg.9d04dc0d5264f21a14617d2af85727f0.jpg

 

Now install the Live Server extension within Code Server.  The only thing you have to change is the Host Setting, to match the value shown above, as shown below:

 

liveserverip.jpg.5c10101d989c4063cd27f1ad0644bfbb.jpg

 

Now you can "activate" Live Server within Code Server.  To access while it's running, use http://<unraidserverip>:5500.

 

(Make sure Live Server is set to use port 5500, of course).

 

This extension will allow your browser to automatically refresh upon save of the HTML file within Code Server.  Nice!

 

Note that this method will only work if the computer you're working on VScode in is on the same LAN as your unraid server, or if you are on a VPN to put you on the same network as your unraid server.  This does not get "included" in the reverse proxy as swag is only "proxy passing" the port associated with the primary Code Server app itself (8443), not 5500. 

 

Hope this helps someone as I searched far and wide and could not find an answer anywhere else! :)

 

 

Edited by chrispcrust
Link to comment
  • 3 months later...
  • 11 months later...
  • 5 months later...

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.