[ VS Code Server ] [ 4.9.1 ] Code-server is VS Code IDE, accessible through the browser.

This is the best place for community developers to publish their genius work. Your Apps enrich the QNAP Turbo NAS.
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

[ VS Code Server ] [ 4.9.1 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

Image
Source : https://github.com/cdr/code-server

Download : amd64 , arm 64

https://www.myqnap.org/product/vs-code/

QPKG INTEGRATION

- Default password is your NAS $HOSTNAME (NAME of your NAS) .. can be modified in the PASSWORD export in /opt/VSCode/VSCode.sh
- Listen by default to HTTP on port 54442
- To run under HTTPS, example if you have LETSEncrypt certs for your qnapcloud
you can add the following flags to the command line in /opt/VSCode/VSCode.sh

--cert /mnt/HDA_ROOT/.config/QcloudSSLCertificate/cert/cert --cert-key /mnt/HDA_ROOT/.config/QcloudSSLCertificate/cert/key

or set your own certificate path if you have

Code: Select all

Commande line flags /opt/VSCode/code-server/code-server --help

Usage: code-server [options] [path]

Options
      --auth                The type of authentication to use. [password, none]
      --cert                Path to certificate. Generated if no path is provided.
      --cert-key            Path to certificate key when using non-generated cert.
      --disable-updates     Disable automatic updates.
      --disable-telemetry   Disable telemetry.
      --host                Host for the HTTP server.
   -h --help                Show this output.
      --open                Open in browser on startup. Does not work remotely.
      --port                Port for the HTTP server.
      --socket              Path to a socket (host and port will be ignored).
   -v --version             Display version information.
      --user-data-dir       Path to the user data directory.
      --extensions-dir      Path to the extensions directory.
      --list-extensions     List installed VS Code extensions.
      --force               Avoid prompts when installing VS Code extensions.
      --install-extension   Install or update a VS Code extension by id or vsix.
      --uninstall-extension Uninstall a VS Code extension by id.
      --show-versions       Show VS Code extension versions.
 -vvv --verbose             Enable verbose logging.
About :

Image

Code anywhere: Code on your Chromebook, tablet, and laptop with a consistent dev environment. Develop on a Linux machine and pick up from any device with a web browser.
Server-powered: Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. Preserve battery life when you're on the go since all intensive computation runs on your server.
Last edited by QNAP_Stephane on Thu Dec 22, 2022 3:07 pm, edited 7 times in total.
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ VS Code Server ] [ 3.2.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

updated
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
Agosh
New here
Posts: 2
Joined: Tue Mar 27, 2018 7:48 pm

Re: [ VS Code Server ] [ 3.2.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by Agosh »

Ciao, good work!
I found some issue:
- HTTPS not working (uncommented row in .sh file and commented the other row);
- changing password in /opt/VSCode/VSCode.sh is not working
- Update on VSCode is not working (it says: code-server has an update v3.3.1 but when i press apply it's not working)

EDIT: first two issue are related to a wrong kill of process when you suspend the application. The third issue is related to a missing pkg on github. So, for now, it's necessary to fix the stop/restart command and trap error of start command
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ VS Code Server ] [ 3.3.1 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

I updated to 3.3.1

cannot reproduce your issue on my TBS-453DX
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
kitchenerer
Starting out
Posts: 25
Joined: Thu May 15, 2014 12:01 am

Re: [ VS Code Server ] [ 3.3.1 ] Code-server is VS Code IDE, accessible through the browser.

Post by kitchenerer »

Hi Stephane,

could this be upgraded to 3.4.0?
which includes a key fix solves the issue when proxying via cloudflare CDN: https://github.com/cdr/code-server/issues/1451
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ VS Code Server ] [ 3.3.1 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

it has already been updated ;)
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
kitchenerer
Starting out
Posts: 25
Joined: Thu May 15, 2014 12:01 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by kitchenerer »

thanks!
somehow one js still got rocket loaded by cloudflare, I disabled rocket loader in cloudflare's page rule as a workaround.
really appreciate your work on compiling these amazing apps:)
dean_007_b
New here
Posts: 4
Joined: Fri Jan 31, 2020 10:58 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by dean_007_b »

I bought your vscode extension and I am trying to install python extension, but it reports it failed to install, is there anything else i need to edit or setup?

if i try to install javascript from clicking it under tools and languages on the welcome page its states Unable to write file '/tmp/7faa5c08-ab28-435f-8260-9421cb5b6c66' (Unknown (FileSystemError): Error: ENOSPC: no space left on device, write)
dean_007_b
New here
Posts: 4
Joined: Fri Jan 31, 2020 10:58 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by dean_007_b »

I have found the issue, the /tmp folder is only 64MB and it fills up before it can complete the download

as a temporary fix, if you have enough ram (i believe this is what is used ) is to use the command

Code: Select all

mount -o remount,size=1024m /tmp
This allowed me to download and install python

you would need to run this every time you start you nas to keep it that size.

so looking for an option where i can move the /tmp folder to another location. any ideas?
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by OneCD »

dean_007_b wrote: Tue Aug 18, 2020 1:12 pm so looking for an option where i can move the /tmp folder to another location. any ideas?
Moving it is a problem. Apps and services can have open files there, so it's best done with nothing running. In QTS, this is quite difficult to achieve. :(

You might see if this app supports specifying a path other than [/tmp].

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
dean_007_b
New here
Posts: 4
Joined: Fri Jan 31, 2020 10:58 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by dean_007_b »

You might see if this app supports specifying a path other than [/tmp].
Yes I agree, sorry that was poorly worded by myself I meant it needs to be reassigned to another folder,

This is where the extensions are installed

/share/CACHEDEV1_DATA/.qpkg/VSCode/.local/share/code-server

so maybe a tmp folder can be created here? I've looked around and cannot find where to reassign this though, the only thing i could find was on a portable installation
TMP directory#
By default, the default TMP directory is still the system one even in Portable Mode, since no state is kept there. If you wish to also have your TMP directory within your portable directory, you can create an empty tmp directory inside the data folder. As long as a tmp directory exists, it will be used for TMP data.
https://code.visualstudio.com/docs/editor/portable
dean_007_b
New here
Posts: 4
Joined: Fri Jan 31, 2020 10:58 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by dean_007_b »

just as an update,

i tried to get this working but found so many issues trying to work with the installed on qnap, one example is that qnap doesnt have git or pip to install packages

to enable you to be able to connect via ssh you have to AllowTcpForwarding which should be easy you update a file restart the service and bang you are running but issue is, qnap resets all files if you restart a service or restart the machine, so you have to find clever ways to set this things

Set up Autorun.sh

Code: Select all

mount $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config

vim /tmp/config/autorun.sh

### EDIT FILE ###
:wq

# chmod +x /tmp/config/autorun.sh

# umount /tmp/config
Autorun.sh

Code: Select all

#!/bin/sh

#expand tmp dir for vscode extension installs
mount -o remount,size=1024m /tmp

# allow ssh TCP port forwarding
setcfg LOGIN "SSH AllowTcpForwarding" TRUE

# SSH Config - copy pre edited file and restart service
cp /share/homes/admin/sshd_config /etc/ssh/sshd_config
#/etc/init.d/login.sh restart
/etc/init.d/login.sh restart & disown
#setsid /etc/init.d/login.sh restart

# https://forum.qnap.com/viewtopic.php?t=47222 - disable password ssh so you can use keys // cannot disable passwords does not work!!!

/etc/init.d/login.sh stop
/bin/sed s/#PasswordAuthentication\ yes/PasswordAuthentication\ no/ /etc/ssh/sshd_config |\
/bin/sed s/#ChallengeResponseAuthentication\ yes/ChallengeResponseAuthentication\ no/ |\
/bin/sed s/#UsePAM\ no/UsePAM\ no/ > /tmp/sshd_config
/bin/mv /tmp/sshd_config /etc/ssh/
/etc/init.d/login.sh start


please not the above my differ depending on the model you have, but it may give some a quick start


BUT.... overall you are better off running a virtual machine you can fully control

Good luck all
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ VS Code Server ] [ 3.4.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

thanks for this info

Git is available with QGit package (will be installed on NAS $PATH)

pip3 is available in QPython3 package ( export PATH=/opt/QPython3/bin:$PATH)

pip not sure usefull since Python2 is EOL
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ VS Code Server ] [ 3.9.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by QNAP_Stephane »

updated
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
Agosh
New here
Posts: 2
Joined: Tue Mar 27, 2018 7:48 pm

Re: [ VS Code Server ] [ 3.9.0 ] Code-server is VS Code IDE, accessible through the browser.

Post by Agosh »

Hi, is there any way to keep password stored during the update?
Post Reply

Return to “Community Apps”