Closed mzch closed 5 years ago
I recommend using the docker image to deploy since the Ember app is already included but if you are running mix phx.server
you need to build the assets with npm --prefix ./webapp run build-production-inline
. For Heroku, this is declared in the compile file.
I will leave the issue open to remind me to document this step in the readme 👍
Hi, Thanks.
Before trying native installation, I ran Accent using Docker, but couldn't due to error as below:
WARNING: The rpv variable is not set. Defaulting to a blank string.
Creating network "accent_default" with the default driver
Creating accent ... done
Attaching to accent
accent | a secret cookie must be provided in one of the following ways:\n - with vm.args using the -setcookie parameter,\n or\n by writing the cookie to '/home/accent/.erlang.cookie', with permissions set to 0400
accent exited with code 1
(Sorry, I forgot getting log files...)
And I tried to login thru Github or Google, accent shows white page on https://api.renderere.com/auth/github
or https://api.renderere.com/auth/google
... What did I make a mistake?
mix logged as blow:
Jul 29 18:45:43 n21 mix[30202]: 18:45:43.934 request_id=FbYMBs6sKeu7r1UAAAPC [info] GET /
Jul 29 18:45:43 n21 mix[30202]: 18:45:43.935 request_id=FbYMBs6sKeu7r1UAAAPC [info] Sent 200 in 890µs
apache log as below:
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /auth/github HTTP/1.1" 304 3992 "https://renderere.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /assets/accent-webapp.css HTTP/1.1" 304 227 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /assets/vendor.css HTTP/1.1" 304 227 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /assets/vendor.js HTTP/1.1" 304 227 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /ember-cli-live-reload.js HTTP/1.1" 304 778 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /assets/accent-webapp.js HTTP/1.1" 304 787 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:27 -0700] "GET /_lr/livereload.js?port=443&host=api.renderere.com&path=_lr/livereload HTTP/1.1" 200 9169 "https://api.renderere.com/auth/github" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
203.141.134.112 - - [29/Jul/2019:19:01:28 -0700] "GET /assets/fonts/Inter-Regular.woff2 HTTP/1.1" 304 227 "https://api.renderere.com/assets/accent-webapp.css" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
--Environment
DATABASE_URL=postgres://password@192.168.207.11:5432/accent
MIX_ENV=prod
PORT=4000
WEBAPP_PORT=4200
WEBAPP_AUTH_PROVIDERS=github,google
GITHUB_CLIENT_ID=***
GITHUB_CLIENT_SECRET=***
GOOGLE_API_CLIENT_ID=***
GOOGLE_API_CLIENT_SECRET=***
MAILER_FROM=no-reply@renderere.com
SMTP_ADDRESS=mx1.mail-services.net
SMTP_PORT=465
SMTP_USERNAME=mzch@x7d.com
SMTP_PASSWORD=***
CANONICAL_HOST=renderere.com
API_HOST=https://api.renderere.com
API_WS_HOST=wss://api.renderere.com
WEBAPP_URL=https://renderere.com
Apache conf file
<VirtualHost *:80>
ServerName renderere.com
ServerAlias www.renderere.com api.renderere.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =renderere.com [OR]
RewriteCond %{SERVER_NAME} =www.renderere.com [OR]
RewriteCond %{SERVER_NAME} =api.renderere.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName renderere.com
ServerAlias www.renderere.com
ServerAdmin webmaster@renderere.com
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/renderere.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/renderere.com/privkey.pem
RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:4000/
ProxyPassReverse / http://127.0.0.1:4000/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName api.renderere.com
ServerAdmin webmaster@renderere.com
SSLCertificateFile /etc/letsencrypt/live/renderere.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/renderere.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
RequestHeader set X-Forwarded-Proto "https"
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:4200/$1 [P,L]
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:4200/
ProxyPassReverse / http://127.0.0.1:4200/
ErrorLog ${APACHE_LOG_DIR}/api.error.log
CustomLog ${APACHE_LOG_DIR}/api.access.log combined
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I specified https://api.renderere.com/auth/github/callback
as Github OAuth callback, it's right, isn't it?
Hi, I think this was a bug in master
with WEBAPP_AUTH_PROVIDERS
. I removed it in favor of querying the API to obtain the available login strategy. The 404 in auth/github
was also a bug of compile/runtime configuration with the providers.
Could try again with master
or the latest Docker build https://hub.docker.com/r/mirego/accent
Thank you for your time 😄
Hi,
Thanks! I tried it, but no auth providers shows. Does it need something else XXX_CLIENT_ID
nor XXX_CLIENT_SECRET
?
Could you check the network tab for the call that lists the providers in the login
page?
I have these in my environment and I see the Google login:
GOOGLE_API_CLIENT_ID=xxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_API_CLIENT_SECRET=xxxxxxxxxxxx
Sorry, I misconfigured my Apache. Using Google OAuth, I can login successfully. But Using Github, accent returned an error as below:
Jul 30 07:42:27 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:27.788 request_id=FbY2aZzRwlZXhUgAAAKB [info] GET /
Jul 30 07:42:27 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:27.789 request_id=FbY2aZzRwlZXhUgAAAKB [info] Sent 200 in 629µs
Jul 30 07:42:30 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:30.678 request_id=FbY2akkSKPZPsxYAAAKR [info] POST /graphql
Jul 30 07:42:30 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:30.682 request_id=FbY2akkSKPZPsxYAAAKR [info] Sent 200 in 3ms
Jul 30 07:42:37 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:37.971 request_id=FbY2a_vJzi51og8AAAKh [info] GET /auth/github
Jul 30 07:42:37 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:42:37.972 request_id=FbY2a_vJzi51og8AAAKh [info] Sent 302 in 497µs
Jul 30 07:43:24 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:24.379 request_id=FbY2dsniwRiA1osAAAKx [info] GET /
Jul 30 07:43:24 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:24.379 request_id=FbY2dsniwRiA1osAAAKx [info] Sent 200 in 526µs
Jul 30 07:43:28 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:28.085 request_id=FbY2d6bVK_j5KIMAAALB [info] POST /graphql
Jul 30 07:43:28 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:28.088 request_id=FbY2d6bVK_j5KIMAAALB [info] Sent 200 in 2ms
Jul 30 07:43:30 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:30.216 request_id=FbY2eCXWsSF1slEAAALR [info] GET /auth/github
Jul 30 07:43:30 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:30.217 request_id=FbY2eCXWsSF1slEAAALR [info] Sent 302 in 396µs
Jul 30 07:43:33 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:33.425 request_id=FbY2eOUdoMp69JoAAALh [info] GET /auth/github/callback
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:34.246 request_id=FbY2eOUdoMp69JoAAALh [info] Converted error RuntimeError to 500 response
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:34.246 request_id=FbY2eOUdoMp69JoAAALh [info] Sent 500 in 820ms
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m 14:43:34.248 [error] #PID<0.4883.0> running Accent.Endpoint (connection #PID<0.4874.0>, stream id 6) terminated
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m Server: renderere.com:80 (http)
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m Request: GET /auth/github/callback?code=c5397dc6bedc817612d0
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m ** (exit) an exception was raised:
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m ** (RuntimeError) Unable to access the user's email address
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (ueberauth_github) lib/ueberauth/strategy/github.ex:218: Ueberauth.Strategy.Github.get_primary_email!/1
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (ueberauth_github) lib/ueberauth/strategy/github.ex:170: Ueberauth.Strategy.Github.info/1
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (ueberauth_github) lib/ueberauth/strategy.ex:282: Ueberauth.Strategy.Github.auth/1
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (ueberauth) lib/ueberauth/strategy.ex:319: Ueberauth.Strategy.handle_callback_result/2
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (ueberauth) lib/ueberauth/strategy.ex:308: Ueberauth.Strategy.run_callback/2
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (accent) lib/web/controllers/auth_controller.ex:1: Accent.AuthController.phoenix_controller_pipeline/2
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (accent) lib/accent/endpoint.ex:1: Accent.Endpoint.instrument/4
Jul 30 07:43:34 n21 docker-compose[5694]: #033[36maccent |#033[0m (phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
If it's necessary to get user's email, Github allows to create Github apps instead of OAuth apps, but Github apps needs Webhook URL...
And tried to login by using Slack, and got an error as below:
Jul 30 10:05:01 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:01.640 request_id=FbY-MTYkAEtJ9RwAAAJy [info] GET /auth/slack
Jul 30 10:05:01 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:01.641 request_id=FbY-MTYkAEtJ9RwAAAJy [info] Sent 302 in 506µs
Jul 30 10:05:11 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:11.914 request_id=FbY-M5p_crkaKfkAAAKC [info] GET /auth/slack/callback
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:12.826 request_id=FbY-M5p_crkaKfkAAAKC [info] Converted error :function_clause to 500 response
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:12.827 request_id=FbY-M5p_crkaKfkAAAKC [info] Sent 500 in 913ms
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m 17:05:12.829 [error] #PID<0.4882.0> running Accent.Endpoint (connection #PID<0.4881.0>, stream id 1) terminated
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m Server: renderere.com:80 (http)
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m Request: GET /auth/slack/callback?code=2208268958.699270691411.384832b2040cf95c847293087cae0a35a6c2965ece49f97ff991207cd69f5d4e&state=
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m ** (exit) an exception was raised:
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m ** (FunctionClauseError) no function clause matching in String.downcase/2
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (elixir) lib/string.ex:744: String.downcase(nil, :default)
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/accent/auth/user_remote/authenticator.ex:26: Accent.UserRemote.Authenticator.map_user/2
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/accent/auth/user_remote/authenticator.ex:6: Accent.UserRemote.Authenticator.authenticate/1
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/web/controllers/auth_controller.ex:9: Accent.AuthController.callback/2
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/web/controllers/auth_controller.ex:1: Accent.AuthController.action/2
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/web/controllers/auth_controller.ex:1: Accent.AuthController.phoenix_controller_pipeline/2
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (accent) lib/accent/endpoint.ex:1: Accent.Endpoint.instrument/4
Jul 30 10:05:12 n21 docker-compose[2045]: #033[36maccent |#033[0m (phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
What's wrong...?
If it's necessary to get user's email, Github allows to create Github apps instead of OAuth apps, but Github apps needs Webhook URL...
Here the GitHub I used to test the login:
It’s a regular OAuth App, it should be working with this setup
Hi, here is my setting.
Hi, Github issue is resolved. no selecting 'Public profile > Public email' caused this issue. Slack issue is still investigating.
Sorry, I didn't install Accent on Slack App management. Doing it this issue was fixed. Thanks!
Good! I will update the website to show instructions step by step for each providers 👍
Hi, I'm getting some errors when using slack auth. I can't find the instructions for every provider that you mention @simonprev.
Already have the app installed in slack and my slack user info is registered as shared with the app. I don't know if I need to add any special scope permissions and if yes which ones? (https://api.slack.com/scopes)
08:54:56.338 request_id=FgxkhkFEDEXkJFUAAAXB [info] GET /
08:54:56.339 request_id=FgxkhkFEDEXkJFUAAAXB [info] Sent 200 in 898µs
08:54:56.911 request_id=FgxkhmNq1UJ-qfYAAAXh [info] POST /graphql
08:54:56.917 request_id=FgxkhmNq1UJ-qfYAAAXh [info] Sent 200 in 6ms
08:55:07.201 request_id=FgxkiMjIFs3HG_kAAAYB [info] GET /auth/slack
08:55:07.202 request_id=FgxkiMjIFs3HG_kAAAYB [info] Sent 302 in 877µs
08:56:13.004 request_id=FgxkmBrkYyGZjikAAASj [info] GET /auth/slack/callback
08:56:13.393 request_id=FgxkmBrkYyGZjikAAASj [info] Sent 500 in 389ms
08:56:13.393 request_id=FgxkmBrkYyGZjikAAASj [info] Converted error :function_clause to 500 response
08:56:13.396 [error] #PID<0.5392.0> running Accent.Endpoint (connection #PID<0.5391.0>, stream id 1) terminated
Server: 192.168.60.38:4000 (http)
Request: GET /auth/slack/callback?code=XXXXXXXXXXXXXXXXXXX.XXXXXXXXX&state=
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in Access.get/3
(elixir) lib/access.ex:265: Access.get("{\"ok\":false,\"error\":\"invalid_auth\"}", "ok", nil)
(ueberauth_slack) lib/ueberauth/strategy/slack.ex:189: Ueberauth.Strategy.Slack.fetch_auth/2
(ueberauth_slack) lib/ueberauth/strategy/slack.ex:69: Ueberauth.Strategy.Slack.handle_callback!/1
(ueberauth) lib/ueberauth/strategy.ex:307: Ueberauth.Strategy.run_callback/2
(accent) lib/web/controllers/auth_controller.ex:1: Accent.AuthController.phoenix_controller_pipeline/2
(phoenix) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2
(accent) lib/web/router.ex:1: Accent.Router.call/2
(accent) lib/accent/endpoint.ex:1: Accent.Endpoint.plug_builder_call/2
Hi,
I encountered this issue. How can I make static/webapp/index.html?
erl
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]
elixir
Elixir 1.9.1 (compiled with Erlang/OTP 21)
node
v10.16.0
npm
6.9.0