This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-13
Channels
- # announcements (4)
- # babashka (72)
- # beginners (86)
- # biff (24)
- # boot (1)
- # calva (71)
- # cherry (1)
- # cider (8)
- # clerk (7)
- # clj-kondo (23)
- # clojure (78)
- # clojure-art (3)
- # clojure-austin (2)
- # clojure-europe (18)
- # clojure-hamburg (6)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-uk (2)
- # clojuredesign-podcast (21)
- # clojurescript (17)
- # conjure (1)
- # cursive (18)
- # datahike (7)
- # datomic (7)
- # emacs (1)
- # etaoin (5)
- # events (1)
- # figwheel-main (4)
- # graalvm (37)
- # graphql (1)
- # humbleui (12)
- # hyperfiddle (10)
- # introduce-yourself (1)
- # jobs-discuss (7)
- # kaocha (1)
- # malli (5)
- # off-topic (12)
- # pathom (12)
- # practicalli (1)
- # reitit (11)
- # releases (2)
- # shadow-cljs (45)
- # tools-build (33)
- # wasm (18)
@foo Hi - I am working through the eelchat tutorial. In "Channels" the 2nd and 4th code block of chapter "Channels" there are references to existing code:
body]
[:div {:class "grow-[2]"}]]))
but the actual existing code seems to be
body]
[:.flex-grow]
[:.flex-grow]]))
Thanks for the heads up; that must have slipped by. The two blocks are functionally equivalent in any case.
Just updated the tutorial.
I had this working before, but at some point i started getting:
$ bb deploy
Rebuilding...
Done in 551ms.
ssh: connect to host port 22: Network is unreachable
fatal: Could not read from remote repository.
In config.edn, I have :biff/base-url
set to my custom domain. Is there another place where the domain is stored?Check the :biff.tasks/server
setting in config.edn. Looks like it's currently set to
I forgot to mention that, it is also (already) correctly set to my custom domain.
hm, that's interesting
Could you paste the whole :tasks
section of config.edn?
feel free to redact e.g. domain if you prefer
Also what's your biff version in tasks/deps.edn?
:tasks {;; Set this if the auto-detection doesn't work
;; Possible values: macos-x64, macos-arm64, linux-x64, linux-arm64
:biff.tasks/tailwind-build nil
:biff.tasks/clj-args ["-J-XX:-OmitStackTraceInFastThrow"
"-J-XX:+CrashOnOutOfMemoryError"
"-J-Duser.timezone=UTC"
"-M" "-m" "com.eelchat"
"--port" "7888"
"--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]
:biff.tasks/on-soft-deploy "\"(com.eelchat/on-save @com.eelchat/system)\""
;; Replace "master" with e.g. "main:master" or "dev:master" if you
;; want to deploy a different branch, for example:
;:biff.tasks/deploy-cmd ["git" "push" "prod" "main:master"]
:biff.tasks/deploy-cmd ["git" "push" "prod" "master"]
:biff.tasks/server ""}}
This is the implementation of bb deploy
for current version of biff: https://github.com/jacobobryant/biff/blob/master/tasks/src/com/biffweb/tasks.clj#L192. If :biff.tasks/server
is set correctly, I wonder if there's an issue with :biff.tasks/deploy-cmd
or :biff.tasks/{deploy-to,deploy-from}
. Actually since your error message includes the term "repository" it seems like it probably is an issue with the git command...
That config section looks fine; I wonder if the url for the git remote is set to
. Looking up the command to check that now...
does git remote show prod
look correct? For one of my apps it looks like this:
$ git remote show prod
* remote prod
Fetch URL:
Push URL:
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
it should look the same for you, with
being replaced by your domain
Actually git remote -v
would be a better command to run
I get this:
$ git remote -v
origin [email protected]:jacobobryant/yakread.git (fetch)
origin [email protected]:jacobobryant/yakread.git (push)
prod (fetch)
prod (push)
If that's the problem, you can fix it with git remote set-url prod
My bad, I must have copied
$ git remote add prod
without changing the server name, and your solution worked. Thank you so much for your help!No problem! It's an easy mistake to make 🙂
I have a few more issues - is it o.k. to add them in this thread? Recaptcha fails after adding the keys to secrets.env
export POSTMARK_API_KEY=af1ee...
export RECAPTCHA_SECRET_KEY=LcDHJ...
$ bb logs
...
Jun 14 17:39:18 mhrdd-dev sh[3906]: [qtp2017659546-19] INFO com.biffweb.impl.middleware - 771ms 303 post /auth/send-link
Jun 14 17:39:18 mhrdd-dev sh[3906]: [qtp2017659546-23] INFO com.biffweb.impl.middleware - 13ms 200 get /?error=recaptcha
Jun 14 17:41:08 mhrdd-dev sh[3906]: [qtp2017659546-18] INFO com.biffweb.impl.middleware - 0ms 405 post /
Jun 14 17:41:08 mhrdd-dev sh[3906]: [qtp2017659546-20] INFO com.biffweb.impl.middleware - 1ms 404 get /.env
If I add the keys directly in config.edn (replacing the corresponding variables), everything seems to work, but I don't receive an email (I tried several emails and checked the spam folder).
$ bb logs
...
Jun 14 17:28:48 mhrdd-dev sh[3408]: [qtp1500545021-20] INFO com.biffweb.impl.middleware - 154ms 303 post /auth/send-link
Jun 14 17:28:48 mhrdd-dev sh[3408]: [qtp1500545021-16] INFO com.biffweb.impl.middleware - 8ms 200 get /[email protected]
> I have a few more issues - is it o.k. to add them in this thread?
Sure thing 🙂
After you update secrets.env
, have you restarted the app (`bb restart`)? You'll need to do that for environment variables to take effect. Same for updating config.edn
, though in that case a bb refresh
also works and is a bit faster (i.e. restart the application code, but leave the JVM running).
I would be surprised for adding the keys directly to config.edn to not trigger an error--biff will only use those keys as names of environment variables... actually I see that in that case, Biff will bypass the recaptcha check altogether (https://github.com/jacobobryant/biff/blob/master/src/com/biffweb/impl/auth.clj#L17). In any case, I would switch the values in config.edn back to be the environment variable names and try to fix the recaptcha error first, then we can see if email sending is still not working.
For debugging recaptcha, you could make a dummy endpoint that does the recaptcha test, and see what parameters + output you're getting:
(defn debug-recaptcha [{:keys [biff/secret params]}]
(prn (:g-recaptcha-response params))
(prn (secret :recaptcha/secret-key))
(prn (:body (http/post ""
{:form-params {:secret (secret :recaptcha/secret-key)
:response (:g-recaptcha-response params)}
:as :json})))
[:div "ok"])
(def plugin
{:routes [["/debug-recaptcha" {:post debug-recaptcha}]
...]})
Then change the signup form's action from "/auth/send-link"
to "/debug-recaptcha"
(Be sure to redact the recaptcha secret key if you paste the result here)For debugging the email sending, the auth plugin calls whatever function you have set at :biff/send-email
(see https://github.com/jacobobryant/biff/blob/master/src/com/biffweb/impl/auth.clj#L65), which by default is in the email.clj
file in your project: https://github.com/jacobobryant/biff/blob/master/example/src/com/example/email.clj#L82. So you can put some print statements in there to see what's going on.
The event log inside of Postmark/whatever email provider you're using is also handy for checking to see if an email got sent.
If the input parameters for the recaptcha http call look correct, it might be that you haven't added your domain to recaptcha's whitelist. You can go to the recaptcha admin console (https://www.google.com/recaptcha/admin) -> settings page to check that.
I had this working before, but at some point i started getting:
$ bb deploy
Rebuilding...
Done in 551ms.
ssh: connect to host port 22: Network is unreachable
fatal: Could not read from remote repository.
In config.edn, I have :biff/base-url
set to my custom domain. Is there another place where the domain is stored?