Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pull request] Backend rewrite and many improvements #68

Open
ViRb3 opened this issue May 1, 2021 · 2 comments
Open

[Pull request] Backend rewrite and many improvements #68

ViRb3 opened this issue May 1, 2021 · 2 comments

Comments

@ViRb3
Copy link
Contributor

ViRb3 commented May 1, 2021

Hello! I love this project and I have been using it for a long time, but after looking at the code, I noticed multiple problems. I ended up rewriting the whole backend and I think it works much better now. My rewrite is fully backwards-compatible with your project.

You can find my rewrite here: https://github.com/ViRb3/gosses
If you are interested, I would be happy to merge all my changes into this project.

Here are the major changes:

  • Echo is now used as the HTTP webserver, removing certain manual implementations.
  • zerolog is now used for logging, providing colorful, structured logs. Additionally, a -json flag has been added for pure JSON logs.
  • The frontend is now automatically embedded using Go 1.16's native implementation, removing the need for manual build steps.
  • All errors are now properly checked and handled instead of skipping them and hoping something would crash if there's a problem.
  • Path building is now accomplished using the standard path and filepath packages instead of manually appending strings. This ensures robust handling in all cases. Path traversal is also safeguarded by the standard packages.
  • ZIP files are now streamed directly to the client instead of building them in memory. This makes handling larger files much more effective.
  • ZIP file compression is disabled (Store), removing any performance impact.
  • Docker images are now multi-arch and support all major architectures instead of just amd64.
  • Dependabot is enabled for automatic dependency updates.
  • Automatic versioning is enabled through semantic-release.

Thanks!

@pldubouilh
Copy link
Owner

Hey ! Thanks a lot for this :) Sorry for the slow reply, been busy these past few weeks, but I'll review that soon !

@pldubouilh
Copy link
Owner

hey - sorry for the slow turnout ! So I ended up pulling a lot of changes from your branch 👍

  • zip changes (store & streaming)
  • errs handling & reformat
  • use native go embed
  • streamlined path building
  • cross platform dockerbuild

I didn't bring over the server & logging, to remain dependency-free. I'll think of maybe logging in Common Log Format at some point, so it's easy to mangle into another format through third party tool.

Also I managed to get reproducible builds ! (manage is a large statement for adding a single -trimpath to the build haha :) so I thought auto-release became less necessary - I cut a release or two a year, and it'd be trivial to compare the hashes to see that nothing nefarious happened from my end.

I co-authored you on the commits I pulled from your branch - feel free to keep me posted what you think of the changes, it's on PR #72. Thanks ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants