Notes - Self-hosting VSCode code-server and researching various text editors
ChromeOS doesn’t have a basic text editor built-in and I think I removed the Google option. I don’t need anything advanced. I just need something for viewing text, html, markdown, yaml, and other misc. files I download on the device for review. I just need to be able to make quick edits to various text files with limited markup and then copy/paste into the terminal or an email.
This is more than just for the chromebook. I bounce around a lot of PCs in the house and I want a consistent editor on every device, regardless of what state the PC is in or if it is someone’s elses PC on my LAN.
Technically, this would also be a replacement for a pastebin, which I am currently using Microbin.
My wishlist:
- Import/upload documents from browser.
- Format and text highlighting for various markup languages.
- Download file.
- Leave file and access from other machines.
- Ideally no database.
VSCode server
This is the server version of vscode. I am using the LSIO code-server in production.
Reqs match:
- ✅ Import/upload documents in browser UI
- ✅ Text highlighting
- ✅ Download file
- ✅ Access same file from other devices
- ✅ No database
Although this setup is much more resource intensive than the options below, it actually checks all of the boxes for my reqs. I chose this over VSCodium because that container is a full KASM desktop. So, uploading is clunky and downloading is even worse. It is technically possible, but running the regular code-server solves both of those problems.
One neat thing that the code-server does that I have discovered since using is you can work with local files. This means you can open a local file with ctrl-o and it will save the edits locally. On my chromebook I can open a file in the browser, edit, and save. When done, I don’t have to re-download the file as it has saved all the edits locally.
Neat.
Setup
https://hub.docker.com/r/linuxserver/code-server https://github.com/linuxserver/docker-code-server
Since I’m not setting up a plain text editor and using a full IDE, I want to pass some paths from the host machine to editor so I can just open and edit. Passing these paths will allow me to quickly edit files in my NFS shares around the lab.
$PATH/remote_systems/nas$PATH/remote_systems/scratch$PATH/docker_compose$PATH/docker_config
Here is the compose file:
---
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
- PASSWORD=[REDACTED]
- PROXY_DOMAIN=[REDACTED]
- DEFAULT_WORKSPACE=/config/workspace
volumes:
- $HOME/docker_config/code-server:/config
- $HOME/remote_systems/nas:/nas_storage
- $HOME/remote_systems/scratch:/LAN_storage
- $HOME/docker_compose:/docker_compose
- $HOME/docker_config:/docker_config
ports:
- [REDACTED]:8443
restart: unless-stopped
Other research
While choosing what editor to run, I researched several others. Below are my notes on each.
Etherpad
Tested at desk and is basic. It saves the file in the browser cache, but doesn’t connect to any background files. You can copy/paste text or import a file. It is centered around collaboration, so has built-in chat and recording history of changes.
One line to run:
docker run -d --name=etherpad -e TZ=America/Los_Angeles -p 9001:9001 etherpad/etherpad
Lots of other options for the config. They don’t recommend using the db it comes with, which is a turn off for me. I don’t want a database to begin with.
Reqs match:
- ✅ Import/upload documents in browser UI
- ⛔️ Text highlighting
- ✅ Download file
- ✅ Access same file from other devices
- ⛔️ No database
Dumbpad
https://github.com/DumbWareio/DumbPad
Very close. Setup is easy and no database requirements. Has a big list of text highlighting and can do markdown previews. Technically you can import files, but you have to drop them into the folder accessible by the container. This means its possible to use, but would be a huge PITA.
Reqs match:
- ⛔️ Import/upload documents in browser UI
- ✅ Text highlighting
- ✅ Download file
- ✅ Access same file from other devices
- ✅ No database
Rustpad
Tried and skipping. No import or download option. Disappointing because the container size is minuscule and runs fast.
Has a dropdown for selecting the language of the doc and will do good text highlighting. Makes it even more of a shame.
https://github.com/ekzhang/rustpad
Reqs match:
- ⛔️ Import/upload documents in browser UI
- ✅ Text highlighting
- ⛔️ Download file
- ✅ Access same file from other devices
- ✅ No database
Ghostboard
Close. Can’t download files.
https://github.com/jon6fingrs/ghostboard
Reqs match:
- ✅ Import/upload documents in browser UI
- ⛔️ Text highlighting
- ⛔️ Download file
- ✅ Access same file from other devices
- ✅ No database
- - - - -
Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.
🙏 😎
Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.