Web server + authentication

139 views
Skip to first unread message

Stephen Foster

unread,
Jan 21, 2020, 4:43:25 PM1/21/20
to Racket Users
Ruby on Rails has a nice package called Devise, which handles things like: letting users log into your webapp, letting them reset their passwords, etc.  In the Racket ecosystem, I'm struggling even to find examples of managing users.

I'm about to start digging here: https://github.com/tonyg/racket-pkg-website

Are there other places I could look?


Jens Axel Søgaard

unread,
Jan 21, 2020, 5:10:11 PM1/21/20
to Stephen Foster, Racket Users
Look at `koyo`.

    https://docs.racket-lang.org/koyo/index.html?q=koyo

For simple user login with secure sessions look at 
    https://github.com/soegaard/racket-stories/blob/master/app-racket-stories/control.rkt#L58

But I haven't implemented "reset password" functionality yet. I need to figure out how best to handle sending mails
from a server. My concern is being flagged for spamming - so I don't dare use my normal mail.

/Jens Axel


--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/93a77b99-f238-4315-9f10-0b1aa6929262%40googlegroups.com.


--
--
Jens Axel Søgaard

Bogdan Popa

unread,
Jan 22, 2020, 3:00:35 AM1/22/20
to Jens Axel Søgaard, Stephen Foster, Racket Users

Jens Axel Søgaard writes:

> But I haven't implemented "reset password" functionality yet. I need
> to figure out how best to handle sending mails from a server. My
> concern is being flagged for spamming - so I don't dare use my normal
> mail.

I like using Postmark[0] for this. Their free plan lets you send up to
100 e-mails a month, their paid plans come at a reasonable price and
they have helpful docs and validators to help you set up SPF, DMARC and
DKIM.

I use this client that I wrote with Racket:

http://docs.racket-lang.org/postmark@postmark-client/index.html

[0]: https://postmarkapp.com

Matthew Butterick

unread,
Jan 22, 2020, 7:47:40 PM1/22/20
to Jens Axel Søgaard, Racket Users
I concur on Postmark. For 2+ yrs I've used it with the Racket web server for mbtype.com. I pass the server settings to `smtp-send-message` from `net/smtp`.

Philip McGrath

unread,
Jan 22, 2020, 8:57:07 PM1/22/20
to Matthew Butterick, Jens Axel Søgaard, Racket Users
I configure Postfix to send external mail via Amazon's "Simple Email Service," then use `net/sendmail`. Having a working mail-transfer agent means you can easily send yourself mail from other tools on the system, too, like a cron job to renew the TLS certificates. (I haven't looked at Postmark, so I can't compare.)

As far as managing users generally, the website code for digitalricoeur.org isn't (yet!) public, but I could provide access if it would be useful as an example. We use a passwordless approach based on emailing one-time-use links, which continuations make especially pleasant.

-Philip

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.

Stephen Foster

unread,
Jan 23, 2020, 11:54:16 AM1/23/20
to Racket Users
Philip -- My general thinking is: the more Racket examples in the world, the better.  I'd certainly be interested to see how you used continuations to do your one-time-use links.

Bogdan --  Lack of examples is also my main blocker when it comes to Koyo.  The API docs are good, but I'm one of those developers who needs to see examples either in the docs or in a repo somewhere.  I ended up rolling my own session management system yesterday instead of using Koyo.  (I'll note, however, that I've fully embraced your Deta package because the docs are filled with examples.  Great stuff!)


On Wednesday, January 22, 2020 at 5:57:07 PM UTC-8, Philip McGrath wrote:
I configure Postfix to send external mail via Amazon's "Simple Email Service," then use `net/sendmail`. Having a working mail-transfer agent means you can easily send yourself mail from other tools on the system, too, like a cron job to renew the TLS certificates. (I haven't looked at Postmark, so I can't compare.)

As far as managing users generally, the website code for digitalricoeur.org isn't (yet!) public, but I could provide access if it would be useful as an example. We use a passwordless approach based on emailing one-time-use links, which continuations make especially pleasant.

-Philip

On Wed, Jan 22, 2020 at 7:47 PM Matthew Butterick <m...@mbtype.com> wrote:
I concur on Postmark. For 2+ yrs I've used it with the Racket web server for mbtype.com. I pass the server settings to `smtp-send-message` from `net/smtp`.


On 22 Jan 20, at 3:00 AM, Bogdan Popa <bog...@defn.io> wrote:

I like using Postmark[0] for this.  Their free plan lets you send up to
100 e-mails a month, their paid plans come at a reasonable price and
they have helpful docs and validators to help you set up SPF, DMARC and
DKIM.

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket...@googlegroups.com.

Jens Axel Søgaard

unread,
Jan 23, 2020, 7:29:44 PM1/23/20
to Racket Users
Two recommendations!

I took a second look at Postmark and was impressed by their service,
so I went ahead and added password recovery emails via Postmark.

Some nice features:
    - don't need to setup and maintain a mail server
    - weekly report on the "spam status" of your domain
    - email templates (html mails are hard)
    - an ios app to track mails
    - 100 mails free pr month (which for Racket Stories is plenty)

Thanks for the push.


Stephen, I think, password resets were what you originally asked for (see latest commit).

     https://github.com/soegaard/racket-stories

The code hasn't been deployed yet - it'll happen sometime tomorrow.

Philip: I'll keep your solution in mind, if I for some reason need to change it.

/Jens Axel




John Clements

unread,
Feb 15, 2020, 1:55:40 PM2/15/20
to Jens Axel Søgaard, Racket Users
Wait, we *all* have postmark libraries?

Sigh.

John
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CABefVgzNd2ZF1fpChjPKu9uYP1JambVJNzONUqKeTquPR-v2Lg%40mail.gmail.com.



Reply all
Reply to author
Forward
0 new messages