Comments (14)
Thanks for the reply. So you would have to change the destination manually in the env variables every time, correct? Like, you can't change it from terminal once you're in a code-server session.
You could change the env vars everytime, or manually run rclone commands. Or just make a shell script with the following contents and run it everytime you change the destination. Copied from the entrypoint.sh script.
RCLONE_REMOTE_PATH=${RCLONE_REMOTE_NAME:-code-server-remote}:${RCLONE_DESTINATION:-code-server-files}
echo "rclone sync $RCLONE_FLAGS $RCLONE_SOURCE_PATH $RCLONE_REMOTE_PATH -vv" > /home/coder/push_remote.sh
echo "rclone sync $RCLONE_FLAGS $RCLONE_REMOTE_PATH $RCLONE_SOURCE_PATH -vv" > /home/coder/pull_remote.sh
from deploy-code-server.
I made some small edits to entrypoint.sh. It should be a bit more clear now. So if I'm in the middle of one project, I can run ./push-and-pull-from.sh [project name]
and it will let me set a new destination to push to (probably have to delete any current unrelated files before I push). But I will look into Railway as you said. Thanks!
from deploy-code-server.
To stop auto-pulling from rclone, you can set the RCLONE_AUTO_PULL
env var to false (it has a default value of true). As for sub directories, if you set an id for a root folder when configuring rclone, then you can use the RCLONE_DESTINATION
env var, Setting it to /
will sync everything in the folder. Setting it to something like project1
will create a folder inside the gdrive folder and sync everything into and out of there.
To see a full list of env vars, check out https://github.com/cdr/deploy-code-server/tree/main/deploy-container.
Edit: NOTE: If you are going to try the sub directory methods I mentioned above, I suggest you:
- Create a new rclone config in a new test folder
- Push atleast 1 folder and file into it
- Change
RCLONE_DESTINATION
to a subfolder - Try pushing some files
If any files get deleted than do not use the method. Otherwise, you should be good to go.
from deploy-code-server.
Thanks for the reply. So you would have to change the destination manually in the env variables every time, correct? Like, you can't change it from terminal once you're in a code-server session.
from deploy-code-server.
Thanks. I ended up putting shell script in the .vscode directory in /home/coder/project
, and I replaced -code-server-files
with the name of the new project directory in google drive. RCLONE_SOURCE_PATH=${RCLONE_SOURCE:-$START_DIR}
is also required for the last two commands.
from deploy-code-server.
Thanks. I ended up putting shell script in the .vscode directory in /home/coder/project, and I replaced -code-server-files with the name of the new project directory in google drive.
I'm not sure I'm following. Wouldn't this be solved if you just specified a unique RCLONE_DESTINATION
environment variable when creating it? This would send each project to a unique google drive folder.
Do you need to edit the location after the fact?
from deploy-code-server.
Yeah, I was trying to find a way to change the destination after opening code-server. Instead of changing the Env variables beforehand. I put it in the .vscode directory because I am pulling from an empty base project (that has .vscode) to set the theme from settings.json every time, but I should really just make the shell script in entrypoint.sh...
Apart from the shell script, is there a better way to do this?
from deploy-code-server.
Instead of changing the Env variables beforehand.
if you change the env variables after you open vs code, it will rebuild the workspace
from deploy-code-server.
I run this inside vscode and specify the new destination as an argument. After pushing, everything seems to be fine. Am I doing something wrong? Sorry, I didn't mean to say I was changing the env variables, only push_remote.sh
and pull_remote.sh
.
RCLONE_SOURCE_PATH=${RCLONE_SOURCE:-$START_DIR}
RCLONE_REMOTE_PATH=${RCLONE_REMOTE_NAME:-code-server-remote}:${RCLONE_DESTINATION:-$1}
echo "rclone sync $RCLONE_SOURCE_PATH $RCLONE_REMOTE_PATH -vv" > /home/coder/push_remote.sh
echo "rclone sync $RCLONE_REMOTE_PATH $RCLONE_SOURCE_PATH -vv" > /home/coder/pull_remote.sh
from deploy-code-server.
Totally not doing anything wrong at all! I was mainly confused what it was doing differently from setting the env variable beforehand. In railway itself, you can set the variables after you first deploy it, and then it would redeploy with that variable configured in the environment.
However, passing it as an argument gives you more control. Or do you have multiple projects per railway? That also makes sense! We can add this as an option
from deploy-code-server.
Sweet! So I will definitely implement this, and it will go like
- check if argument ($1 exists)
- if not, use $RAILWAY_DESTINATION (if exists)
- if not, use "code-server-remote" (if exists)
from deploy-code-server.
Wait, sorry if I'm misunderstanding. But when would these 3 occur? I thought the argument is something that is given to change the rclone destination after you open code-server, not during entry point of the container.
And I deployed it to Railway but the workflow seemed pretty much the same. What would the value for $RAILWAY_DESTINATION be? I currently only have one railway project btw.
from deploy-code-server.
RAILWAY_DESTINATION
would just be the name of the single folder that it goes to.
Yeah I would probably rewrite the push_remote and pull_remote to take in arguments, like yours does
from deploy-code-server.
closing because i believe this use case is more centered around supporting multiple remotes
from deploy-code-server.
Related Issues (20)
- Terraform script: OCI Free tier support for A1.Flex images
- Dockerfile permission denied entrypoint.sh
- Error On Oracle Cloud HOT 1
- Code Sever
- Unable to locate package ubuntu-make
- site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx HOT 1
- Railway.md link not valid HOT 1
- fly.io
- print("Hello") HOT 1
- Terminal font is missed up HOT 3
- Coder-Server can't connect because of this Error HOT 1
- "Extension 'actboy168.tasks' not found." with codercom/code-server:4.0.2 HOT 4
- Can't install node modules HOT 3
- Error on Heroku HOT 5
- Support for okteto deployment.
- Want Koyeb cloud support HOT 1
- Error while fetching extensions, server returned 503
- add fly.io guide HOT 5
- pls add render .com support
- Template is not an available Railway plugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deploy-code-server.