Hey,
I’m trying to install the codeserver for VS Code on Glitch. Glitch is enough for a nice live browser editor, but to enhance the experience and make it powerful, I’d love to have it installed on Glitch, too. But I’m not sure how the installation goes, if someone knows, would be really helpful.
You have to upload the binary and call it from the terminal
It’s so powerful Glitch would crash.
@javaarchive I believe you have a running instance of Codeserver on Glitch???
I actually tried like a week ago, but I had nothing but a chromebook and it said “no”
This seems like a job for the proof of concept expert @wh0.
Ok, turns out there is an easier way (and I’m testing it to see if it works).
-
Install the code-server npm package from the terminal.
npm i code-server
-
Run
code-server
!
I’m doing this right now, give me a minute to see if this works.
Installing packages using Yarn
There appears to be a problem with my network connection. Retrying…
oh wow, OH WOW!
oh no oh no
(I started typing the oh no when I saw the edit)
Yay! retry installing codespaces!
Good luck!
Ok boys, I got too optimistic, looks like it needs more disk space. Might work on a boosted app though. But I’m still curious how @javaarchive managed to install it.
And my computer would act like it’s been shot if I did it.
Glitch doesn’t like giving up, reinstalling packages
SHOW me the logs!
So @javaarchive had managed to run this on Glitch (http://hyper-zesty-saturday.glitch.me/, hopefully he won’t kill me for revealing it publicly). It’s password protected and I’ll leave it to @javaarchive to explain how he managed to install it and stuff.
What if a glitch project went over the disk limit?
I have two dead instances (that don’t work) of CodeSpaces.
Probably suspend themselves.
Yeah - Wait…
I have the repl.it hacker plan -
you get UNLIMITED disk space
lets just hope codespaces isn’t too big. And I don’t break those terms and conditions.
Okay so, it seems like the disk space is running out, for the least tries we’ve done. I also had the issue about disk space, these are the bash commands, if someone’s out of curiosity how I managed to do so:
apt-get install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh
./start-ubuntu.sh
wget https://github.com/cdr/code-server/releases/download/2.1698/code-server2.1698-vsc1.41.1-linux-arm64.tar.gz
tar -xvf ./code-server2.1698-vsc1.41.1-linux-arm64.tar.gz
cp ./code-server2.1698-vsc1.41.1-linux-arm64/code-server /app
export PASSWORD="password"
I installed ubuntu here, dunno any other way. Also it seemed to throw some permission errors, that it cannot open the lock file.
And to clear that up: Yeah, it turns out we can’t really install codeserver on glitch (unless we have a boosted app?), it seems to take a lot of space, moreover not even feasible at this point.
I can host it on repl.it.
Could you share your workaround so?
Ok, I’ll share the repl
Sorry, but at the moment users cannot use apt or sudo.
@code-alt do let us know how it turns out on Repl.it!
𝗢𝗳𝗳𝗶𝗰𝗶𝗮𝗹 𝘀𝗼𝘂𝗿𝗰𝗲𝘀 = @javaarchive
5gb should be enough @javaarchive right?
I was wondering if everyone was ignoring this because there was something wrong with it. But it worked for me. I was able to install it with their standalone package:
#!/bin/sh -eux
CS_VERSION=3.7.1
if [ -x ~/.local/bin/code-server ]; then
exit 0
fi
mkdir -p ~/.local/bin
cd /tmp
wget "https://github.com/cdr/code-server/releases/download/v$CS_VERSION/code-server-$CS_VERSION-linux-amd64.tar.gz"
tar -xf "code-server-$CS_VERSION-linux-amd64.tar.gz"
ln -s "/tmp/code-server-$CS_VERSION-linux-amd64/bin/code-server" ~/.local/bin/
Anyway, it uses plenty of memory, but it’s still within parameters for an un-boosted project. Dunno how fast it grows with a larger project open though.
It takes about 300 MB on disk, which seems to be no sweat as long as you’re outside of /app
.
app@sugary-internal-mascara:~ 01:23
$ du -sh /tmp/code-server-3.7.1-linux-amd64
300M /tmp/code-server-3.7.1-linux-amd64
app@sugary-internal-mascara:~ 01:32
$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 49G 21G 28G 43% /tmp
Can’t let the public see this demo because then they would be able to trash the project. But you could remix it and do cat /tmp/code-server-config.yaml
to see the password for logging in to your own copy.
Some caveats:
- Setting
PASSWORD
as an environment variable is broken in this version of code-server. so I rigged it up to use a config file in /tmp. - This takes up the www port that Glitch serves for you, so maybe (i) try out this GitHub - coder/code-server: VS Code in the browser hosted solution, (ii) set up a reverse proxy, or (iii) just work on something that isn’t a website.
Thanks for highlighting this thread @RiversideRocks
I wrote a similar script, but hardcoded the version. It went boom when that certain version somehow disappeared from github
and yes since I forgot to say, I did exactly what wh0 did except the logic was slightly different and I hardcoded the version
so basically it installs into /tmp the part that doesn’t change at all
So that’s how you got more disk space.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.