arclanguage / anarki

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.
http://arclanguage.github.io
Other
1.17k stars 160 forks source link

Password recovery fails silently #79

Closed hjek closed 7 years ago

hjek commented 7 years ago

When clicking login, then Forgot your password? and entering an existing username, it says "We've emailed you a link.", although in the server repl, this error message appears:

/bin/sh: 1: sendmail: not found

We should probably be using this, instead of assuming a UNIX-like system with sendmail correctly configured.

hjek commented 7 years ago

Ah, nevermind the linked Racket documentation, it also uses sendmail. Perhaps it should just be better documented or summit.

hjek commented 7 years ago

I got this working fine in Racket now, but Arc is having problems accepting keyword arguments, and additionally claims that $.keyword-apply doesn't exist (even though it is bound in Racket, and also it's mentioned here)

akkartik commented 7 years ago

I'm not following. Why do we need keyword args for sendmail?

Also: ooh, that's a nice resource!

hjek commented 7 years ago

Forgot to say that. It's because Racket's smtp-send-message function requires them.

http://arclanguage.org/item?id=20251

akkartik commented 7 years ago

I see. Hmm. One suggestion: try using keyword args for something simple in Racket? Let's see if they've completely broken somewhere along the way.

hjek commented 7 years ago

Looks completely broken in Arc, even for basic stuff,

arc> ($ (define (a b) b))
#<void>

arc> ($ (define (x a #:b c) a))
define: not an identifier for procedure argument
  at: #:b
  in: (define (x a #:b c) a)
  context...:
   /usr/share/racket/collects/racket/private/norm-define.rkt:46:33: simple-proto
   /usr/share/racket/collects/racket/private/norm-define.rkt:134:33: general-proto
   /usr/share/racket/collects/racket/private/norm-define.rkt:17:6: try-next
   /usr/share/racket/collects/racket/private/norm-define.rkt:166:4: normalize-definition
   /usr/share/racket/collects/racket/private/define.rkt:29:11: go
   /home/pelle/anarki/ac.scm:1222:0: arc-eval
   /home/pelle/anarki/ac.scm:1275:4

arc> ($ (define (x a '#:b c) a))
define: not an identifier for procedure argument
  at: (quote #:b)
  in: (define (x a (quote #:b) c) a)
  context...:
   /usr/share/racket/collects/racket/private/norm-define.rkt:46:33: simple-proto
   /usr/share/racket/collects/racket/private/norm-define.rkt:134:33: general-proto
   /usr/share/racket/collects/racket/private/norm-define.rkt:17:6: try-next
   /usr/share/racket/collects/racket/private/norm-define.rkt:166:4: normalize-definition
   /usr/share/racket/collects/racket/private/define.rkt:29:11: go
   /home/pelle/anarki/ac.scm:1275:4
hjek commented 7 years ago

Of course a keyword-free wrapper for send-smtp-message could be defined in ac.scm, but that would be big time spaghetti. Probably someone on the Arc Forum will have a clue.

akkartik commented 7 years ago

Totally up to you if you want to do that in the meantime.

Another idea would be to determine if keyword args worked in an earlier version. Then we could git bisect.

hjek commented 7 years ago

Oh no. I fixed this, and when I was about to push, git claimed it was in a "detached head" state, and I ran git checkout HEAD and now I have no idea where my fix went. Yikes! Can git just do that?

akkartik commented 7 years ago

That seems strange. Git shouldn't get into that state unless you run git checkout.

In any case, I'm sure no commits are lost. Look at .git/log or something like that to find the older commit hash. Then you should be able to check it out. If you have trouble just email me your repo, and I'll take a look.

hjek commented 7 years ago

I did a git checkout . because I wanted to do git bisect but it never worked in the first place, so didn't go down that path. I'd like to email you the repo, but it was some uncommited files, and one of the uncommitted files (in www which is in .gitignore) had the password for my email in it, for testing. So my email password could be in there too.

In git I basically only use push, pull and commit, so I've no idea what the other stuff does.

I can email it to you, but perhaps in a password protected zip - password being the name of this repo.

akkartik commented 7 years ago

No worries, just take your password out of the uncommitted file. It sounds fairly certain that it won't be in the repo then, but you can also password-protect the zip file if you wanna be safe. I think unzip can handle passwords on Linux/Mac..

hjek commented 7 years ago

I've sent you it now

hjek commented 7 years ago

Git should really have some more warnings, if there's uncommitted stuff that's it'll just scrap like that!

akkartik commented 7 years ago

Are you missing some uncommitted files? git checkout shouldn't mess with those.

hjek commented 7 years ago

See, i just have no clue what git checkout means even though I've spent hours at the documentation.

I had uncommitted stuff in ac.scm and lib/app.arc, and git checkout HEAD blasted it.

hjek commented 7 years ago

There's probably loads of other stuff in the zip that wasn't meant to be published yet, so please just disregard that.

hjek commented 7 years ago

YES! Got it back!

ls -1 .git/lost-found/commit/ | xargs -n 1 git log -n 1 --pretty=oneline whatever that means.

akkartik commented 7 years ago

Glad it worked out!

Yes, git checkout is horrible. Though it will usually warn you if you have uncommitted changes.

hjek commented 7 years ago

Yes, the surprise just made me forgot I'd committed it. I need to go through some more git tutorials, I guess.