-
Notifications
You must be signed in to change notification settings - Fork 8
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
Redirect after Titan request, generate directories #5
Conversation
src/geminim.nim
Outdated
@@ -139,8 +139,17 @@ proc processTitanRequest(server: Server, req: Request): Future[Response] {.async | |||
return response(StatusNotAuthorised, "Token not recognized") | |||
|
|||
var filePath = req.res.filePath | |||
if dirExists(filePath): | |||
filePath = filePath / "index.gmi" # assume we want to write index.gmi | |||
let (parent, _ )= filePath.splitPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) =
I was thinking of (finally) merging the client-side certificate authentification support the following days. This would allow for Titan password(s) to be replaced with certificate authentification, which would be safer and more flexible(i.e for a wiki you could allow clients with trusted certificates to edit certain pages). |
That sounds like a really good idea, yeah! I'll wait for you to do that then before I muck around with the passwords any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You pushed the compiled binary by mistake
whoops fixed |
Hi again!
I realized that the code I submitted last time couldn't generate directories if someone wanted to write to, say,
example.com/posts/test.gmi
but theposts/
directory didn't exist yet. I've added code to fix that!I also added a config flag that causes GemiNim to redirect the client to the uploaded resource after a successful Titan request.
I'd also like to write some code to allow configuration of user-specific titanPasswords, that'll be in another PR later!