Simpletalk icon indicating copy to clipboard operation
Simpletalk copied to clipboard

Upload

Open ApproximateIdentity opened this issue 3 years ago • 9 comments

This is an initial implementation of the upload functionality. Going to the examples/upload.html file and then logging in and uploading should work if you have an account.

ApproximateIdentity avatar Sep 16 '21 09:09 ApproximateIdentity

@ApproximateIdentity i rebased this over master, but I am not clear about a number of things in terms of the build, deploy and serve process, so maybe you can add some descriptions of the below into the readme and i can do a run through

  • In the deploy doc the bundle is built and the serve directory is tarred. Do you run this on the DO droplet server or locally? or does it not matter I don't see anything like a git repo on the server, so I assume you were running all this locally and then ssh'ing to the droplet, but perhaps we should stick with one flow for simplicity
  • What actually serves here? nginx? I see it's pointing to a simpletalk.sock file
    • how does this work?
  • There is a python flask API somewhere that takes care of all the auth.
    • Where is the code for this?
    • what runs it? nginx, https ? how do you deploy it.
    • Maybe the code should be in this repo
  • i know there is a site you made for login/out upload/delete etc
    • what serves this?
    • what is the current url for it?
    • i also know there was a CLI way to add/delete authors or whatnot; how does that work?

I think that should do it for now

oh and you are still pushing as me; no need for that i think

dkrasner avatar Nov 01 '21 11:11 dkrasner

@ApproximateIdentity i rebased this over master, but I am not clear about a number of things in terms of the build, deploy and serve process, so maybe you can add some descriptions of the below into the readme and i can do a run through

* In the [deploy doc](https://github.com/dkrasner/Simpletalk/pull/96/files#diff-eccc26ba3bdf0e29d8e334b0fc488de7ee8c9a545ec9762b7883889f7c0aa7b7) the bundle is built and the serve directory is tarred. Do you run this on the DO droplet server or locally? or does it not matter  I don't see anything like a git repo on the server, so I assume you were running all this locally and then ssh'ing to the droplet, but perhaps we should stick with one flow for simplicity

It doesn't matter. The only things that are produced are static files which are then hosted. So this could be fun on the server or a local machine or whatever. I agree it makes sense to do it consistently though so I'll pick something and update the docs for clarity.

* What actually serves here? nginx? I see it's pointing to a simpletalk.sock file
  
  * how does this work?

Yeah so nginx serves the static files (produced by the build process above) and then forwards any calls to the underlying auth system to the flask app handling that side of things. The socket is just for handling the backend flask app.

* There is a python flask API somewhere that takes care of all the auth.
  
  * Where is the code for this?
  * what runs it? nginx, https ? how do you deploy it.
  * Maybe the code should be in this repo

I'd like to keep this separate from the rest of the simpletalk setup because (1) it doesn't really have anything to do with simpletalk and it's convenient to keep it decoupled and (2) I don't really want to open it to the world (I don't think security through obscurity is the best, but I'd rather not be too open the implementation at the moment). But yeah you and Eric need to be added to the repo for that code and it needs to have some more docs added there.

* i know there is a [site](https://github.com/dkrasner/Simpletalk/pull/96/files#diff-77fc8b6705d8be7d4eb8ea256da012f0fe91efa768b25df48154f17c98fb4118) you made for login/out upload/delete etc
  
  * what serves this?
  * what is the current url for it?
  * i also know there was a CLI way to add/delete authors or whatnot; how does that work?

I'll update the docs to explain this (just as shown above).

I think that should do it for now

oh and you are still pushing as me; no need for that i think

Am I? The last 4 commits show me as the author and you as the committer, but that makes sense since you rebased it right? I think it would show me as the author and the committer if I were to rebase it. But I'll double-check and make sure I don't have anything weird setup.

ApproximateIdentity avatar Nov 02 '21 22:11 ApproximateIdentity

@ApproximateIdentity ok you really have to imagine that I know nothing about anything and am setting up a brand new droplet from scratch. I understand your answers but they explain more why you did X and not the steps one needs to reproduce them. This is actually what I am doing, on a new test droplet. I tried to reverse engineer some of what you did but couldn't do it for obvious reasons you explain above.

So just bullet points.

  • Spin up a droplet
  • clone this repo
  • clone that repo
  • run this install
  • make these symlinks
  • copy over this nginx config file
  • restart nginx
  • etc etc

For example,

Yeah so nginx serves the static files (produced by the build process above) and then forwards any calls to the underlying auth system to the flask app handling that side of things. The socket is just for handling the backend flask app.

What I mean by "How does this work?" is how do you configure it. I can see it's nginx but I don't see much in the nginx config file that tells me how to set this up from scratch. Imagine brand new droplet, setting it up from scratch.

* There is a python flask API somewhere that takes care of all the auth.
  
  * Where is the code for this?
  * what runs it? nginx, https ? how do you deploy it.
  * Maybe the code should be in this repo

I'd like to keep this separate from the rest of the simpletalk setup because (1) it doesn't really have anything to do with simpletalk and it's convenient to keep it decoupled and (2) I don't really want to open it to the world (I don't think security through obscurity is the best, but I'd rather not be too open the implementation at the moment). But yeah you and Eric need to be added to the repo for that code and it needs to have some more docs added there.

We can keep the code separate. It's not ST core, so that makes sense, although I could really care less about someone security issues from our code being on the repo here... But yeah once you add us to the repo and update the docs, I can do a run through.

* i know there is a [site](https://github.com/dkrasner/Simpletalk/pull/96/files#diff-77fc8b6705d8be7d4eb8ea256da012f0fe91efa768b25df48154f17c98fb4118) you made for login/out upload/delete etc
  
  * what serves this?
  * what is the current url for it?
  * i also know there was a CLI way to add/delete authors or whatnot; how does that work?

I'll update the docs to explain this (just as shown above).

I think that should do it for now oh and you are still pushing as me; no need for that i think

Am I? The last 4 commits show me as the author and you as the committer, but that makes sense since you rebased it right? I think it would show me as the author and the committer if I were to rebase it. But I'll double-check and make sure I don't have anything weird setup.

dkrasner avatar Nov 03 '21 10:11 dkrasner

@dkrasner I just updated the deploy file here https://github.com/dkrasner/Simpletalk/blob/upload/SERVER_DEPLOY.md and added some config files here https://github.com/dkrasner/Simpletalk/tree/upload/sysadmin

Those config files actually exist in the simplestorage repo as well, but honestly they don't really make sense there (they are specific to simpletalk) so they should probably be removed.

Anyway let me know if these instructions make a bit more sense. I'm sure sure there are still things that I've messed up and/or left out, but hopefully they are small issues now at least...

ApproximateIdentity avatar Nov 03 '21 19:11 ApproximateIdentity

ok i'll give it a run-through tomorrow and see how things go

dkrasner avatar Nov 03 '21 20:11 dkrasner

@ApproximateIdentity I don't have access to either the simpleauth or simplestorage repos (or at least I'm not seeing them on Github)

darth-cheney avatar Nov 16 '21 14:11 darth-cheney

@darth-cheney @dkrasner I sent you both invites to be collaborators on the repo a couple weeks back. It looks like @dkrasner accepted the invite to simplestorage, but not the one to simpleauth. I re-sent the invites (except for the one that @dkrasner already accepted) so check your emails.

ApproximateIdentity avatar Nov 17 '21 17:11 ApproximateIdentity

cool tu

dkrasner avatar Nov 19 '21 19:11 dkrasner

@ApproximateIdentity we tried to go through this and ran into a bunch of issues, some of which we fixed and added to the docs and some not:

Btw we are doing all of this on a new droplet so make sure we can...

We can't get ST to load and just get the default nginx page... we can guess what you wanted there, but it would be better not to guess.

We are not sure what this exactly means: $ cd /path/to/serve && ln -s ../public at the end of the deploy doc

It looks like you need to setup a pwdless root user for mysql which you mention here but the deploy install depend on that, so they should be here, or all of it should consolidated etc

It's not clear what you do if you get to the end of the deploy instructions. Where to do you go? the droplet IP, is that admin page running somewhere?

there were also CLI instruction for adding and deleting people etc

So we are going to destroy our test droplet. Can you make a test-droplet and walk through the deploy doc step by step, updating as necessary, to fill in the holes.

dkrasner avatar Nov 24 '21 18:11 dkrasner