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

Solution for temporarily uploading DB so it can be built by docker #52

Closed
simonw opened this issue Nov 10, 2017 · 2 comments
Closed

Solution for temporarily uploading DB so it can be built by docker #52

simonw opened this issue Nov 10, 2017 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Nov 10, 2017

For the datasette publish command I ideally need a way of uploading the specified DB to somewhere temporary on the internet so that when the Dockerfile is built by the final hosting location it can download that database as part of the build process.

@simonw simonw added the small label Nov 10, 2017
@simonw simonw added this to the Ship v1 milestone Nov 10, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 10, 2017

https://file.io/ looks like it could be good for this. It's been around since 2015, and lets you upload a temporary file which can be downloaded once.

$ curl -s -F "file=@database.db" "https://file.io/?expires=1d"
{"success":true,"key":"ySrl1j","link":"https://file.io/ySrl1j","expiry":"1 day"}

Downloading from that URL serves up the data with a Content-disposition header containing the filename:

simonw$ curl -vv https://file.io/ySrl1j | more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 34.232.1.167...
* Connected to file.io (34.232.1.167) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: file.io
* Server certificate: Amazon
* Server certificate: Amazon Root CA 1
* Server certificate: Starfield Services Root Certificate Authority - G2
> GET /ySrl1j HTTP/1.1
> Host: file.io
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Fri, 10 Nov 2017 18:14:38 GMT
< Content-Type: undefined
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: Express
< X-RateLimit-Limit: 5
< X-RateLimit-Remaining: 4
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Cache-Control,X-reqed-With,x-requested-with
< Content-disposition: attachment; filename=database.db
...

@simonw simonw modified the milestones: Ship v1, v1 stretch goals Nov 11, 2017
@simonw simonw removed this from the v1 stretch goals milestone Dec 10, 2017
@simonw simonw added the wontfix label Dec 10, 2017
@simonw
Copy link
Owner Author

simonw commented Dec 10, 2017

I don't think this is necessary.

@simonw simonw closed this as completed Dec 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant