fossasia / meilix-generator

WebApp for generating a custom ISO image based on Meilix http://meilix.org
GNU Lesser General Public License v3.0
1.53k stars 112 forks source link

Replacing the way to send the wallpaper, logo, and zipfiles from the webapp to build server #398

Closed pranav1698 closed 5 years ago

pranav1698 commented 5 years ago

I'm submitting a ... (check one with "x")

Expected Behaviour In the current build, wallpaper in stored in the wallpapers folder in the server and previously this was accessed during the build by accessing https://meilix-generator.herokuapp.com/. This can cause same wallpaper for two different users which have build the ISO using the generator.

Would you like to work on the issue? Open

xeon-zolt commented 5 years ago

you are talking about race condition yes it can happen you can send wallpaper in the API as base64 and keep storing them in with a random name lets say we use uuid for that

pranav1698 commented 5 years ago

I have tried the idea of sending the wallpaper to the API encoding with base64, that happens after #396 is merged, but I have not tested the wallpaper

tabesin commented 5 years ago

Please also keep @meets2tarun in the loop and let's experiment.

pranav1698 commented 5 years ago

@tabesin @xeon-zolt I have tried sending the wallpaper as an encoded base64 string, The problem is that the base64 strings will be so big for a large image that when this will be send to the server as an environment variable, it becomes an unbound variable and cannot be stored in bash script so the build gives a error. The method would work for a smaller image (<500 KB) but it will not work for a bigger image, We need different way to store these base64 encoded strings in the server or a different way to send the binary files

xeon-zolt commented 5 years ago

I have a plan

  1. user will upload an image for wallpaper
  2. then we upload it to transfer.sh
  3. then we get a link from transfer.sh
  4. then we send that link to Travis ci
  5. Travis ci will download from transfer.sh
  6. build iso using the downloaded wallpaper
xeon-zolt commented 5 years ago

aww-board

tabesin commented 5 years ago

If you implement third party services for practical reasons also ensure that the mechanism works without that service. That is the basic proof of concept must be without such external dependencies. If they are added then in a way that you could disable them without coding.

xeon-zolt commented 5 years ago

I too have fear of being reliable on third-party service so we can do one thing can add multiple services like these and use try-except block so in case anyone is down other will be automatically be used