0

https://github.com/deanhiller/webpieces is a platform that you can write code in java without rebooting the server via it's DevelopmentServer.

Now, to avoid the cycle of fix code, deploy to cloud, test, fix more code, deploy to cloud to test, I would like to just sync changed files to the cloud container so that the cycle becomes

  1. change code
  2. test

no more deploying and since you are just uploading human changes, it's FAST. Now, webpieces is a webserver that hosts a website or json api or whatever. I am thinking of 2 ways of doing this but not sure the technology is there?

  1. Go to webpage on the cloud server and input local source directories to monitor
  2. Locally, just run a program webpiecesSync configuring source directories and the json api to hit on the cloud instance

Number 2 has an extreme advantage over #1 in that I can register for async file notification of changes so as you change a file, the sync uploads it to the cloud and webpieces DevelopmentServer just saves the file to the needed location and when you hit the webpage with the change, the DevelopmentServer does the work of recompiling when needed.

I am not sure #1 can even come close to #2, but if anyone knows of a technology there, javascript or whatever that could maybe do this, I am wondering if I could make a wizard in the DevelopmentServer sync plugin (if I had one) that would then just keep up to date with changes of the directories and grab those files(assuming the user gives it permission somehow). I am very lost if #1 is even feasible?

Any ideas/guesses greatly appreciated. thanks, Dean

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • Security considerations make #1 unfeasible. Even if it were feasible now, the ever tightening browser security would make it a risky design to follow. – Kayaman Mar 19 '20 at 21:25
  • @Kayaman really? I mean old school applets could do stuff like that and it's like your common phone options of 'do you approve this app to access your files?' – Dean Hiller Mar 19 '20 at 21:41
  • Why are you trying to bypass a CI/CD pipeline that does the build/deploy for you? – Andrew S Mar 19 '20 at 21:42
  • @DeanHiller I remember old school applets quite well, or "brand new applets" as they were called back then. Sure the idea is that you can access local file system securely, but the reality is that you end up providing an attack vector. Both applets and Flash required a plugin, and even a signed applet couldn't be fully trusted. These days plugins are frowned upon, and Javascript won't even attempt to provide [that kind of functionality](https://stackoverflow.com/questions/1087246/can-javascript-access-a-filesystem). – Kayaman Mar 20 '20 at 08:37
  • @AndrewS We have CI/CD for 'production' and for 'staging'. For our development servers when testing google apis, we can iterate MUCH faster by deploying webpieces and changing code locally and running a sync to the cloud dev server(a sync takes 1 second) so the iteration speed on changes in the dev cloud server is FAST FAST!!! – Dean Hiller Mar 23 '20 at 22:00
  • @Kayaman holy crap thanks for that link because -> https://stackoverflow.com/a/4279356/517781 so now I wonder if I can access those files to write changes from eclipse there so javascript can sync the files...hmmm. – Dean Hiller Mar 23 '20 at 22:02
  • I'd be surprised if you could (and I probably wouldn't be the only one). The keyword is "sandbox", and you're trying to breach it (although now from the other side than would usually be attempted, normally the malicious web page would try to write *outside* the sandbox, not local process *inside* the sandbox). Its purpose is small scale storage, but you're looking to use it basically for communication. – Kayaman Mar 25 '20 at 08:49

0 Answers0