Skip to content

Code-server with code-ready environment.

License

Notifications You must be signed in to change notification settings

nx2k3/code-server-2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSCode Logo      Coder Logo

Visual Studio Code Server

Debian Version Maintainer Maintainance Pulls License: GPL v3
VS Code
CodeServer

Table of contents :

Specifications :

  • Theme : Atom One Dark
  • Icon Theme : Material Icon Theme
  • Font : Monospace
  • Extensions Installed :
    • Bracket Pair Colorizer 2
    • C# Intellisense
    • C/C++ Intellisense
    • Code Runner
    • Draw.io Integration
    • Language Support for Java(TM) by Red Hat
    • Markdown All in One
    • NPM Intellisense
    • PowerShell
    • Python Intellisense
    • VSCode Action Buttons
    • rust-lang
  • Google Drive Upload
  • Languages Installed :

    C  C++  C Sharp  Clojure  Go  Java  Javascript  Lua  Perl  PowerShell  Python  R  Raku  Ruby  Shellscript  Scala  Swift

Environment Variables :

CS_VERSION 3.11
AUTH_TYPE Code-Server login type: {password, none}
PASSWORD Code-Server login password (If AUTH_TYPE=password)
CODESERVER_PORT Code-Server web access port
CUSTOM_HOME Custom home directory for Heroku
WORKSPACE_DIR Code-Server working directory
NGROK_TOKEN Ngrok Token

Installation :

  • For Heroku Users :
    • Fork this repo.
    • Create new app on heroku.
    • Setting up google drive (do the following on local pc) :
      • [ ! ] If you don't want this feature then don't assign any value to DRIVE_ACCESS variable.
      • Follow this & get your client_secret.json file.
      • Add Drive API to the project from here, select the same project made in the above step if needed.
      • Clone/Download this repo.
      • Install Python-3 & install all the requirements via [CLONED/DOWNLOADED REPO]/requirements.txt
      • Now paste your client_secret.json file into the [CLONED/DOWNLOADED REPO] folder.
      • Open a terminal in the repo folder and run the upload.py:
        • python3 upload.py -i upload.py -f "CodeServer Saves" --noauth_local_webserver
      • Copy the URL from the terminal & paste it into browser.
      • Login with your account, accept all the terms, get the success key.
      • Paste it into the terminal & wait for the success message.
      • Now check your drive for CodeServer Saves folder and a upload.py file inside it.
      • If its not there, run python3 upload.py -i upload.py -f "CodeServer Saves", now check in drive.
      • Now go here and upload your drive-access.json from [CLONED/DOWNLOADED REPO]/.credentials/drive-access.json.
      • Now copy the download link & paste it into the DRIVE_ACCESS_URL in Dockerfile.heroku of your forked repo and save it.
      • [ ! ] Download link is a single download link, so repeat from the file upload process if you re-deploy the project.
    • Now hit the Heroku Deploy button on the forked repo's readme.
    • [ ! ] Set AUTH_TYPE value to none if you dont want any login password prompt.
  • For Non-Heroku Users :
    • Setting up google drive (do the following on local pc) :
      • [ ! ] If you don't want this feature then don't assign any value to DRIVE_ACCESS variable in the run command.
      • Follow this & get your client_secret.json file.
      • Add Drive API to the project from here, select the same project made in the above step if needed.
      • Clone/Download this repo.
      • Install Python-3 & install all the requirements for the cloned repo via requirements.txt
      • Now paste your client_secret.json file into the repo folder.
      • Open a terminal in the repo folder and run the upload.py:
        • python3 upload.py -i upload.py -f "CodeServer Saves" --noauth_local_webserver
      • Copy the URL from the terminal & paste it into browser.
      • Login with your account, accept all the terms, get the success key.
      • Paste it into the terminal & wait for the success message.
      • Now check your drive for CodeServer Saves folder and a upload.py file inside it.
      • If it's not there, run python3 upload.py -i upload.py -f "CodeServer Saves", now check in drive.
      • Now copy the drive_access.json from [CLONED/DOWNLOADED REPO]/.credentials/drive-access.json to your system where you want to run code-server. Edit & Run Command :
        docker run --name code-server \
        -e AUTH_TYPE="password" \
        -e PASSWORD="samplepass" \
        -e CODESERVER_PORT="9870" \
        -e NGROK_TOKEN="<YOUR NGROK TOKEN>" \
        -d -p 8080:9870 vital987/code-server && \
        docker cp <path to drive_access.json> code-server:/app/.credentials
        
        [ ! ] Set AUTH_TYPE value to none if you dont want any login password prompt.

Usage :

  • Open the heroku app URL, non-heroku users, port-forward the using Ngrok: ngrok http $CODESERVER_PORT
  • Login with the password (value of $PASSWORD).
  • Buttons present at the bottom bar :
    • : Refresh the buttons.
    • ClearWorkspace : Deletes all the folders in workspace directory.
    • ResetWorkspace : Resets the workspace folder with all sample files.
    • DriveUpload : Archive workspace directory (excluding sample files) and upload to google drive.
    • [ ! ] The buttons need to be refreshed everytime after use.

Screenshots :

  • SS1
  • SS2

Credits :

About

Code-server with code-ready environment.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 80.3%
  • Dockerfile 8.8%
  • HTML 4.1%
  • Python 1.9%
  • Shell 1.0%
  • Java 0.5%
  • Other 3.4%