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

Improvements #89

Open
4 of 14 tasks
mifi opened this issue Jan 15, 2021 · 9 comments
Open
4 of 14 tasks

Improvements #89

mifi opened this issue Jan 15, 2021 · 9 comments
Assignees
Labels
enhancement prio-3 sdks Integrations for Transloadit's API

Comments

@mifi
Copy link
Collaborator

mifi commented Jan 15, 2021

Potential improvements discovered during #87 but not blocking its merge:

  • github action slack notification like we had in travis
  • Use github releases with release notes instead of changelog. (I normally use np for publishing npm modules as it reduces chances of forgetting something)
  • disable travis builder
  • Option to auto-download results files (downloadResults: true) for createAssembly? I already created an example for this, but it could be a nice feature to be integrated in the API. Then we could even create a simple transloadit CLI that allows people to process local files using predefined templates for different useful operations!
  • allow specifying filename and contentType of uploaded streams? See form-data
    • Maybe merge the concept of filename and fieldname (it's a bit confusing)
  • Show off more cool things in readme (visual examples? gifs)
    • More files under examples/
  • Create types for all any fields in ts

Logs / Global Event Emitter

Could allow the user subscribe to:

  • Log events
  • onProgress event
  • (Suggested by kvz:) I think it would be nice if there was an option: reporter. By default it would be false. It could be set to nodesdk.consoleLogger or a custom function (progressCb add default console logger).
    Is this still needed now that we have the debug module for logging?

If we decide to add an EventEmitter it could lead to breaking changes (e.g. removing onUploadProgress and onAssemblyProgress from method options and move them to event listener)

Tests improvements

@mifi mifi mentioned this issue Jan 16, 2021
53 tasks
@lekevbot lekevbot added the sdks Integrations for Transloadit's API label Feb 4, 2021
@kvz kvz assigned mifi Feb 8, 2021
mifi added a commit that referenced this issue Feb 16, 2021
@mifi
Copy link
Collaborator Author

mifi commented Mar 3, 2021

localtunnel is down, causing github actions to fail. I think we should find a better solution
https://github.com/transloadit/node-sdk/runs/2021853285?check_suite_focus=true

@kvz
Copy link
Member

kvz commented Mar 4, 2021

As per our docs https://transloadit.com/docs/ we could use ngrok which has a business (model) behind it, but allows limited free use(?)

@mifi
Copy link
Collaborator Author

mifi commented Mar 5, 2021

Turns out ngrok doesn't work for requests coming from services hosted on AWS, so we should update our docs at https://transloadit.com/docs/ also to instead use localtunnel or something else. Or maybe we can host our own similar tunnelling service (possibly with a whitelist from transloadit IP ranges).

inconshreveable/ngrok#408

@kvz
Copy link
Member

kvz commented Mar 9, 2021

Or maybe we can host our own similar tunneling service (possibly with a whitelist from transloadit IP ranges)

I like this idea.. It could maybe even work agnostically/transparently for a few SDKs if we build in support for that 🤔

(for now i am leaving a comment in our docs as well)

@mifi
Copy link
Collaborator Author

mifi commented Jul 24, 2022

so localtunnel seems to be down most of the time and causing a lot of failed builds recently.

there's a myriad of different open source proxies we could set up and run, but we would have to set up and maintain a server.

there's also cloudflare that seems to support this as a service. which solution should we go for?

@kvz
Copy link
Member

kvz commented Jul 25, 2022

We could ask @calbrecht to set up an ngrok service on our us-east-1 observer on maybe? https://github.com/inconshreveable/ngrok/blob/master/docs/SELFHOSTING.md any security implications with that?

we could host it on ngrok.transloadit.net. or can it not be hosted on a subdomain?

@kvz
Copy link
Member

kvz commented Jul 25, 2022

You know what, if Cloudflare can solve the problem immediately, let's use that first, and consider selfhosting an upgrade after that for which we can then reserve more time?

@mifi
Copy link
Collaborator Author

mifi commented Jul 29, 2022

I found something new called Cloudflare Quick Tunnels:
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare
It means we can create these "demo" tunnels with the cloudflared cli, without any configuration or dns (or even authentication!) So I will try this first and see if it works ebef58b

@mifi
Copy link
Collaborator Author

mifi commented Aug 1, 2022

Have now replaced localtunnel with cloudflare quick tunnels #143. The cloudflared CLI is a bit lacking quality: It doesn't report when the tunnel is actually ready, so I needed to

  1. do a regex on its stderr to find the URL
  2. poll a DNS query of the hostname until it's ready using node.js resolve4 api (not using the operating system's lookup, as it will poison the dns cache).
  3. poll a HTTP request through the tunnel in order to know that the tunnel is "healthy" before we can use it in our tests.

After a lot of obscure issues I have finally managed to work this all out, so it works now! for those curious, the logic is in https://github.com/transloadit/node-sdk/blob/master/test/testserver.js and https://github.com/transloadit/node-sdk/blob/master/test/tunnel.js

Note that when cloudflared starts up it prints:

line 2022-08-01T17:34:37Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps

So it's not for production, but for our tests it should work, unless they start blocking Github actions' IPs. If they do that, we can go ahead and setup the private tunnels instead, and that shouldn't be too much work because they also use the same cloudflared CLI.

@lekevbot lekevbot added the prio-3 label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement prio-3 sdks Integrations for Transloadit's API
Projects
None yet
Development

No branches or pull requests

3 participants