Accessing filesystem of one service through another
samuelbarnholdt
TRIALOP

2 years ago

Hi, I have two services A and B. I want to access and modify the filesystem in Service A through Service B. How do I accomplish this?

Essentially this:

  1. curl -X post serviceb.url/write-files
  2. Files in Service A are modified
  3. Profit
Closed

17 Replies

samuelbarnholdt
TRIALOP

2 years ago

N/A


2 years ago

you would need to build that functionality into your code


samuelbarnholdt
TRIALOP

2 years ago

Can I somehow colocate A and B on the same machine? I won't have access to the code inside A


2 years ago

yeah you could, but that comes with its own set of challenges


samuelbarnholdt
TRIALOP

2 years ago

happy to take those on if I have to - unless you think there is a smarter way to accomplish this


samuelbarnholdt
TRIALOP

2 years ago

essentially I want to run someones npm run dev -> embed it through an iframe -> modify code over API


2 years ago

that sounds like a security nightmare


samuelbarnholdt
TRIALOP

2 years ago

live and die by the sword I guess


2 years ago

why run a development server anyway? that's costly and comes with its own issues


samuelbarnholdt
TRIALOP

2 years ago

I'm trying to do dev environments for customers and want hot reload enabled


samuelbarnholdt
TRIALOP

2 years ago

prompt to modify code stuff but with your actual code


2 years ago

respectfully, I think you need to rethink this project, specifically so that you can easily run it on railway


samuelbarnholdt
TRIALOP

2 years ago

As in this will be death to run on railway?


2 years ago

railway or anywhere


samuelbarnholdt
TRIALOP

2 years ago

I mean it's obv not ideal but is really that bad apart from it being a hassle and costly running dev?


2 years ago

it's more than that, from my perspective it seems like the project is chalked full of bad practices.


2 years ago

Lol this is exactly what I did in one of my projects just because Railway doesn't support shared volumes.

I have service A running as an API server that is only exposed to the PRIVATE network within Railway, which itself modifies its own volume contents.

Service B literally just calls service A through the private network and passes in any files or whatever configuration to B's API and modify it from there.

Service A is also exposed to the PUBLIC network through another PORT (since Railway now supports exposing multiple ports) and is read-only.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...