Report an issue

Similar



Anon7614a
ย ย ย 

Problems of managing users and admins

I found there're might be two systems/mechanisms of user management. One is signing up from xxxx.com/login page and this will by default create a new project with that user and make him as owner. Another is with OAuth/SSO or manually added by the owner, which belongs to current project.
My requirement is, there should be only one project, it has one owner and multiple admins, other normal users should create there account with OAuth. I tested and found following problems:
  1. Cannot directly add existing account as project admin (in the teammate page), I have to send invitation email to the corresponding email address of that user, and he has to do sign up again from the invitation url, he cannot use the existing OAuth created account to login to dashboard as this account has no way to set password (maybe the real reason is there're two different accounts, described below). But because I want only one project, it is better to not allow signing up after initializing the first project.
  2. Actually when signing up the email being input do not really need to be the same as the address which received the invitation, so it seems the user owns two accounts now, one for dashbord admin of the project, another for frontend usage of the same project. Even though the user input same email as his frontend OAuth account, these are still two different accounts, and the admin user has to remember yet another password. The good news is if he use same email, then jumping from dashboard to frontend will automatically use the corresponding frontend account.
  3. After adding new user in the dashboard (ADD button in xxxx.com/dashbord/users), it cannot login from the xxxx.com/login entry and it always says email or password incorrect. It seems this is just a frontend account so cannot login from backend. However there's no way to directly login a frontend account using email and password, so I don't know what's the meaning of manually adding users in the dashboard, is it just used for on-behalf things? Another bug is after deleting this manually created user from dashboard and trying to sign up using the same email, it says the email already exists, so it looks like it's not really deleted, but still exists in database.
ย 3
Considering
Nick Douma
ย ย ย 

SMTP send error using self-host option

Using the self-host docker-compose file and the latest clearflask-server image (with digest ed1f3a04bec9), and an external SMTP server configured as such:
# Select generic SMTP ('smtp') or Amazon SES ('ses')
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.useService=smtp
# For SMTP
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpStrategy=SMTP
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpHost=outgoing.server.net
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpPort=587
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpUser=user@tld.com
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpPassword=xxxx
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.emailDisplayName=Clearflask
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.fromEmailLocalPart=noreply
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.fromEmailDomainOverride=company.com
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.bccEmails=nick.douma@company.com
I seem to get an error about building the email body, a class cast exception from multipart_mixed to a DataContentHandler:
clearflask-server_1   | 14:29:57.645 [pool-28-thread-1] ERROR o.s.i.util.concurrent.NamedRunnable - Failed to run sendMail process
clearflask-server_1   | org.simplejavamail.mailer.internal.MailerException: Failed to send email [ID: '<1617344838.3.1706797737574@21f994d5da02>'], reason: Unknown error
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.SendMailClosure.handleException(SendMailClosure.java:85)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:76)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.AbstractProxyServerSyncingClosure.run(AbstractProxyServerSyncingClosure.java:56)
clearflask-server_1   | 	at org.simplejavamail.internal.util.concurrent.NamedRunnable.run(NamedRunnable.java:40)
clearflask-server_1   | 	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
clearflask-server_1   | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
clearflask-server_1   | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
clearflask-server_1   | 	at java.base/java.lang.Thread.run(Thread.java:829)
clearflask-server_1   | Caused by: java.lang.ClassCastException: class com.sun.mail.handlers.multipart_mixed cannot be cast to class jakarta.activation.DataContentHandler (com.sun.mail.handlers.multipart_mixed and jakarta.activation.DataContentHandler are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @2e237e39)
clearflask-server_1   | 	at jakarta.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:620)
clearflask-server_1   | 	at jakarta.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:591)
clearflask-server_1   | 	at jakarta.activation.DataHandler.getDataContentHandler(DataHandler.java:591)
clearflask-server_1   | 	at jakarta.activation.DataHandler.writeTo(DataHandler.java:290)
clearflask-server_1   | 	at jakarta.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1683)
clearflask-server_1   | 	at jakarta.mail.internet.MimeMessage.writeTo(MimeMessage.java:1911)
clearflask-server_1   | 	at org.eclipse.angus.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1305)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.util.TransportRunner.lambda$sendMessage$0(TransportRunner.java:61)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.util.TransportRunner.runOnSessionTransport(TransportRunner.java:81)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.util.TransportRunner.sendMessage(TransportRunner.java:56)
clearflask-server_1   | 	at org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:69)
clearflask-server_1   | 	... 6 common frames omitted
clearflask-server_1   | 	Suppressed: jakarta.mail.MessagingException: Exception reading response
clearflask-server_1   | 		at org.eclipse.angus.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2509)
clearflask-server_1   | 		at org.eclipse.angus.mail.smtp.SMTPTransport.close(SMTPTransport.java:1401)
clearflask-server_1   | 		at org.simplejavamail.mailer.internal.util.TransportRunner.runOnSessionTransport(TransportRunner.java:82)
clearflask-server_1   | 		... 8 common frames omitted
clearflask-server_1   | 	Caused by: java.net.SocketTimeoutException: Read timed out
clearflask-server_1   | 		at java.base/java.net.SocketInputStream.socketRead0(Native Method)
clearflask-server_1   | 		at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
clearflask-server_1   | 		at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
clearflask-server_1   | 		at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
clearflask-server_1   | 		at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
clearflask-server_1   | 		at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
clearflask-server_1   | 		at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
clearflask-server_1   | 		at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1454)
clearflask-server_1   | 		at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1065)
clearflask-server_1   | 		at org.eclipse.angus.mail.util.TraceInputStream.read(TraceInputStream.java:107)
clearflask-server_1   | 		at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
clearflask-server_1   | 		at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)
clearflask-server_1   | 		at org.eclipse.angus.mail.util.LineInputStream.readLine(LineInputStream.java:104)
clearflask-server_1   | 		at org.eclipse.angus.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2489)
clearflask-server_1   | 		... 10 common frames omitted
I've tried all non-TLS and TLS mechanisms supported. When dumping the packets, it seems that the connection goes correctly until the STARTTLS command, and after that nothing is else is sent until the remote server closes the connection. Seems like something goes wrong with building the sender/recipient, or the email body.
Am I configuring this wrong, or is this a bug?
ย 5
Accepted
Anon5b743
ย ย ย 

SMTP Connection

I've just installed a docker based instance and am encountering issues configuring SMTP. This instance is from the latest docker containers ( ghcr.io/clearflask/clearflask-server:latest ) or rather a copy from yesterday.
My configuration:
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpStrategy=SMTP_TLS
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpHost=smtp.sparkpostmail.com
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpPort=587
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpUser=SMTP_Injection
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.smtpPassword=redacted
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.emailDisplayName=displayname
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.fromEmailLocalPart=noreply
com.smotana.clearflask.core.push.provider.EmailServiceImpl$Config.fromEmailDomainOverride=redacted.com

the container itself (clearflask-server) can connect (have tested with nmap) on the cli. However when the web app tries to connect I see logs such as:
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.sparkpostmail.com, port: 587 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
The server requires TLSv1.2 which is not mentioned as disabled in the java.security file and it seems likely this is the correct configuration and a "workable" situation.
openssl s_client -connect smtp.sparkpostmail.com:587 -starttls smtp
Server response snippit:
-----END CERTIFICATE----- subject=CN = *.sparkpostmail.com
issuer=C = US, O = DigiCert Inc, OU = www.digicert.com, CN = RapidSSL TLS RSA CA G1
No client certificate CA names sent Peer signing digest: SHA256 Peer signature type: RSA Server Temp Key: ECDH, P-256, 256 bits
SSL handshake has read 4579 bytes and written 473 bytes Verification: OK
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384
An item I see that may be an issue is the wildcard certificate?
I have followed a suggestion from a previous query on this topic and added the following env var to the server container, however am not seeing any related logs.
`JAVA_OPTS="-Djavax.net.debug=ssl"`
I have also followed the email providers suggestions, no joy: https://support.sparkpost.com/docs/faq/smtp-connection-problems
Can anyone provide some additional suggestions for debugging?
ย 3ย ย ย ย 7
Accepted
Anon9e525
ย ย ย 

Image upload leaves broken picture

Our team has a self hosted clearflask instance behind an nginx proxy server. It is working fine but every time we want to upload an image the only thing being shown is this:
According to our Nginx logs the upload resulted in an HTTP 200
SOME_VALID_IP - - [18/Apr/2023:14:35:25 +0000] "POST /api/v1/project/OUR_PROJECT_ID/content/upload HTTP/2.0" 200 313 "https://clearflask.VALID_DOMAIN_NAME.dev/dashboard/feedback" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"
SOME_VALID_IP - - [18/Apr/2023:14:35:26 +0000] "POST /api/v1/project/OUR_PROJECT_ID/content/upload HTTP/2.0" 200 312 "https://clearflask.VALID_DOMAIN_NAME.dev/dashboard/feedback" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"
SOME_VALID_IP - - [18/Apr/2023:14:35:26 +0000] "POST /api/v1/project/OUR_PROJECT_ID/content/upload HTTP/2.0" 200 313 "https://clearflask.VALID_DOMAIN_NAME.dev/dashboard/feedback" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"
SOME_VALID_IP - - [18/Apr/2023:14:35:26 +0000] "POST /api/v1/project/OUR_PROJECT_ID/content/upload HTTP/2.0" 200 315 "https://clearflask.VALID_DOMAIN_NAME.dev/dashboard/feedback" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"
SOME_VALID_IP - - [18/Apr/2023:14:35:26 +0000] "POST /api/v1/project/OUR_PROJECT_ID/content/upload HTTP/2.0" 200 312 "https://clearflask.VALID_DOMAIN_NAME.dev/dashboard/feedback" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"
We already tried our best to disable all restrictions for the nginx instance with no luck, i mean the 200 code did not change, but pictures are still broken.
Also while filtering through our clearflask logs we did not find any suspicious things at first glance: (our IP's and company name were removed) logs.txt
The docker-compose we are using is this one: (as txt file because github does not support .yml files in messages it seems) (ENV variables are set and working!) docker-compose.yml.txt
Any help or advice would be appreciated as we cannot really find similar problems on the internet.
ย 7
Accepted