Home Assistant Community Add-on: Visual Studio Code

Thanks! Will use that

UPDATE: Solved but I expect more people to run into this; As I already authenticated locally (local IP) it did not work via the new external URL. Just clear your cache and you will be asked to login again. All fine.


So I added below to caddy but get:

401 Access Denied

or of I enable ssl=true in the config of this add-on I get below:

[19:50:20] FATAL: SSL has been enabled using the 'ssl' option,
[19:50:20] FATAL: this requires a SSL certificate file which is
[19:50:20] FATAL: configured using the 'certfile' option in the
[19:50:20] FATAL: add-on configuration.
[19:50:20] FATAL: 
[19:50:20] FATAL: Unfortunately, the file specified in the
[19:50:20] FATAL: 'certfile' option does not exists.
[19:50:20] FATAL: 
[19:50:20] FATAL: Please ensure the certificate file exists and
[19:50:20] FATAL: is placed in the Hass.io '/ssl/' directory.
[19:50:20] FATAL: 
[19:50:20] FATAL: In case you don't have SSL yet, consider getting
[19:50:20] FATAL: a SSL certificate or setting the 'ssl' option
[19:50:20] FATAL: to 'false' in case you are not planning on using
[19:50:20] FATAL: SSL with this add-on.
[19:50:20] FATAL: 
[19:50:20] FATAL: Check the add-on manual for more information.

In the docs its mentions a possibility to add a password but when I add this and save this then itā€™s automatically removed again.

When I use local URL (192.168.1.xx:1337) it all works so it has something to do with the Caddy config I guess?

Entry in caddy:

havs.xxxxxxx.com {
    proxy / 192.168.1.zz:1337 {
        transparent
        websocket
    }
tls [email protected]
log caddyhavs.log
}

Thanks for the good work but I am getting a blank screen. I am running Hassio on my NUC and I am using ssl. I can connect to the URL via ā€œopen web UIā€ link and am able to login. After login the screen is blank!

 [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Visual Studio Code
 Fully featured VSCode experience, to edit your HA config in the browser, including auto-completion!
-----------------------------------------------------------
 Add-on version: 0.2.0
 You are running the latest version of this add-on.
 System: HassOS 2.10  (amd64 / qemux86-64)
 Home Assistant version: 0.91.0
 Supervisor version: 152
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in e.g, GitHub, forums or the Discord chat.

Hope someone can help.

Set SSL to false for Caddy, and it should work. Caddy handles the encryption.

It works for me with the config @ronschaeffer shows. You donā€™t seem to be using a sub-domain in your config

im trying to add a nginx letencrypt proxy pointing from HA subdomain /vscode to port 1337 where the service runs.
When i access my.ha.address/vscode, it VSCode asks me for authentication but when i provide correct credentials , it opens ā€œCannot GET /vscodeā€ error page.
Has someone had any luck with setting this up?

Does anyone know Howto solve this, still not able to solve this.

My config is nothing more than default and I am running Hass.io on my VMware Workstation NUC and am running https on the frontend.

{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "packages": [],
  "init_commands": []
}

Hope someone can help.

Whatā€™s the issue you are having? Error logs?

This is my log! I cannot seem to find any errors in the log. The only strange thing is that the log points to port 8443 and it has been set to port 1337, both doesnā€™t work.

> [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
> [s6-init] ensuring user provided files have correct perms...exited 0.
> [fix-attrs.d] applying ownership & permissions fixes...
> [fix-attrs.d] done.
> [cont-init.d] executing container initialization scripts...
> [cont-init.d] 00-banner.sh: executing... 
> -----------------------------------------------------------
>  Hass.io Add-on: Visual Studio Code
>  Fully featured VSCode experience, to edit your HA config in the browser, including auto-completion!
> -----------------------------------------------------------
>  Add-on version: 0.2.0
>  You are running the latest version of this add-on.
>  System: HassOS 2.10  (amd64 / qemux86-64)
>  Home Assistant version: 0.91.2
>  Supervisor version: 155
> -----------------------------------------------------------
>  Please, share the above information when looking for help
>  or support in e.g, GitHub, forums or the Discord chat.
> -----------------------------------------------------------
> [cont-init.d] 00-banner.sh: exited 0.
> [cont-init.d] 01-log-level.sh: executing... 
> [cont-init.d] 01-log-level.sh: exited 0.
> [cont-init.d] 10-requirements.sh: executing... 
> [cont-init.d] 10-requirements.sh: exited 0.
> [cont-init.d] 11-nginx.sh: executing... 
> [cont-init.d] 11-nginx.sh: exited 0.
> [cont-init.d] 20-link-common-dirs.sh: executing... 
> [cont-init.d] 20-link-common-dirs.sh: exited 0.
> [cont-init.d] 30-defaults.sh: executing... 
> [cont-init.d] 30-defaults.sh: exited 0.
> [cont-init.d] 50-user-ssh-folder.sh: executing... 
> [cont-init.d] 50-user-ssh-folder.sh: exited 0.
> [cont-init.d] 51-git-config.sh: executing... 
> [cont-init.d] 51-git-config.sh: exited 0.
> [cont-init.d] 80-user-packages.sh: executing... 
> [cont-init.d] 80-user-packages.sh: exited 0.
> [cont-init.d] 81-user-scripts.sh: executing... 
> [cont-init.d] 81-user-scripts.sh: exited 0.
> [cont-init.d] done.
> [services.d] starting services
> [services.d] done.
> [07:46:13] INFO: Starting the code server...
> INFO  code-server v1.32.0-310
> INFO  Additional documentation: http://github.com/codercom/code-server
> INFO  Initializing {"data-dir":"/data/vscode","working-dir":"/config","log-dir":"/root/.cache/code-server/logs/20190410054616097"}
> INFO  Starting webserver... {"host":"127.0.0.1","port":8443}
> WARN  No certificate specified. This could be insecure.
> WARN  Documentation on securing your setup: https://coder.com/docs
> WARN  Launched without authentication.
> INFO   
> INFO  Started (click the link below to open):
> INFO  http://localhost:8443/
> INFO   
> INFO  Starting shared process [1/5]...
> [07:46:16] INFO: Starting NGinx...
> INFO  Connected to shared process

Log shows internals, 8443 is used internally.

1337 is the facing port (unless you change it yourself in the addon panel).

Your logs look fine and showing it started correctly. Have you tried accessing it on the internal IP address of your system with the port number?

Hi frenck,

Love your addons, and this one by far is up there with Node-Red. Great work!
Itā€™s working great on my NUC with Hass.IO, but just wondering if youā€™ve found a way to get it work with editing docker instances.
Would be great to use to ā€˜tweakā€™ docker files, however canā€™t seem to get anything working.

Iā€™ve disabled protection mode, installed the ā€˜Docker Workspaceā€™ addon, but no luck.
Anyone else have any suggestions?

This addon cannot Access Hassioā€™s Docker, so that isnā€™t possible.

Sads.
Thanks for the quick reply!

Do you think it would be beneficial to replace VSCode with VSCodium (same software but without sending data to Microsoft)?

@dinth That wonā€™t work.
This add-on is powered by code-server.

As Frenck said, this add-on is simply an implementation of Code-Server, which is an open-source implementation of VSCode on docker that can run in a web interface. If you want Frenck to make an addon that runs VSCodium then you need to either convince the code-server project to switch to it, or make one yourself which frenck can turn into an add-on.

Iā€™m still having an immediate memory link issue with the amd64 image of the 2.0 addon release. Has no one else experienced this?

hello,
I have this error when I start the addon, do you have any suggestions?
thanks

[11:17:21] INFO: Starting the code serverā€¦
Error: /data/vscode/dependencies/pty.node: failed to map segment from shared object
at f (/usr/local/bin/code-server:2286:1092)
at u (/usr/local/bin/code-server:2286:1344)
at c (/usr/local/bin/code-server:2286:2750)
at b.require (/usr/local/bin/code-server:2286:3346)

I did see that but tried to connect to the LAN IP on both 1337 and 8443, from port 8443 I get nothing but from port 1337 I get a login screen, after login I am getting a black just a black screen.

Iā€™m expecting to drop a new release of the add-on soon, which addresses a lot of memory issues.

1 Like