T
Twenty6mo ago
paulyili

Setting up URL/Domain

I get a little stuck on this. in the .env there's the:
SERVER_URL=https//lcoalhost:3000
# FRONT_BASE_URL=http://lcoalhost:3000
SERVER_URL=https//lcoalhost:3000
# FRONT_BASE_URL=http://lcoalhost:3000
If i have nginx proxy manager pointing crm.mydomain.com to port 3000. all the methods i try, each time i try to use crm.mydomain.com, i get the same "Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure resource '<URL>'. This request has been blocked; the content must be served over HTTPS." what would be the correct method insetting up the URLs in the .env? running on docker on ubuntu server. i used the "One Command" method to install it. which is great.
30 Replies
charles
charles6mo ago
the issue is that your frontend is served over https but your backend is served over http ; your browser considers this as a security flax (and it is right!) You need to serve your backend over https. To do that you can either use a certificate manager such as let's encrypt or use another service that can generate ssl for you (such as cloudflare or cloudfront)
paulyili
paulyili6mo ago
ahh i figured that was the case. previously i had both behind it's own nginx and had forwarded the nginx ip to my nginx proxy manager.
i felt like that was a good way do didn't need to manage SSls
charles
charles6mo ago
you should be able to do the same here!
paulyili
paulyili6mo ago
99% sure i got it working using nginx. no errors are showing up. Is the email sync working? i can't seem to get my emails to sync. i can SSO and i can add the email account (multiple) with no issues.
charles
charles6mo ago
do you have your worker running? yarn worker:prod? sorry this part is BADLY documented (when I say badly, is inexistent, it will be one of our April priority)
paulyili
paulyili6mo ago
that's okay. it's still early days. Im mostly just testing and experimenting. workers are running. i ran yarn worker:prod and everything is initalised.
paulyili
paulyili6mo ago
but when i click "email settings" i get this error (screen shot)
No description
charles
charles6mo ago
@Weiko @Raphaël for you!
Weiko
Weiko6mo ago
Hi @paulyili this error is unrelated to the sync, I can reproduce it on main though (cc @Raphaël), thank you I will create a ticket. For the sync to work you will need to run some crons that will enqueue jobs in your queue. You will need to run
yarn command:prod cron:messaging:gmail-partial-sync
yarn command:prod cron:messaging:gmail-fetch-messages-from-cache
yarn command:prod cron:messaging:gmail-partial-sync
yarn command:prod cron:messaging:gmail-fetch-messages-from-cache
However, even without the queue, a first sync should have been executed (what we call "full-sync") already and you should see some emails in your message table (and even some contact automatically created). Let me know if that's not the case Then gmail-partial-sync will take care of syncing your emails, you can adjust the cron pattern before executing the command above, in packages/twenty-server/src/modules/messaging/commands/crons/patterns/fetch-all-workspaces-messages.cron.pattern.ts (which is actually a bad name...). It will first query gmail and store all the new email ids in a cache. The second cron will take care of scanning the cache and fetch the content of those emails if the cache is not empty, this one should be executed right after.
paulyili
paulyili6mo ago
Hi Weiko, This is what i've noticed. in 0.3.3 it would sync my gmail and add all gmail contacts in the CRM and sync all emails in 0.3.4 it would only sync the emails. not add any contacts. in 0.4.0 it wont do either. I tried to run those 2 commands with no luck. this with the self hosted docker FYI.
Weiko
Weiko6mo ago
Few things to check: - If you are self-hosting, you need to make sure that your workspace has "active" in the subscriptionStatus, we should probably change that for self-hosting since it does not make much sense but currently we check that value when we run the cron. - As I've described above, a cache is involved and if you don't use redis it will be in-memory which means after each refresh/reload of the server (so even code change will trigger it) it will probably reset that cache and messages that are waiting to be imported will be lost with the cache, that could explain the issue 🤔 - In 0.3.4 we moved contact creation outside of the message import logic to delegate it through a listener and its dedicated job, however the logic shouldn't have changed so as long as your contact emails do not match with those email providers packages/twenty-server/src/utils/email-providers.ts it should correctly create people/companies and assign them (personId within the messageParticipant table)
paulyili
paulyili6mo ago
@Weiko how do i check the subscription status? i installed redis and i connected twenty to it. it connected no problem. when i try log in or create an accoung i get this in the logs(i've changed the names and id for secury reasons) as soon as disconnect from redis, there's no errors.
Exception Captured
{
user: {
id: '11111111-2222-3333-4444-555555555555',
email: 'Paul@mycompany.com',
firstName: 'Paul',
lastName: 'Lastname',
workspaceId: '12345567-1234-1234-1234-123456789098',
workspaceDisplayName: 'MyCompany'
}
}
[ [ErrorReply: ERR value is not an integer or out of range] ]
Exception Captured
Exception Captured
{
user: {
id: '11111111-2222-3333-4444-555555555555',
email: 'Paul@mycompany.com',
firstName: 'Paul',
lastName: 'Lastname',
workspaceId: '12345567-1234-1234-1234-123456789098',
workspaceDisplayName: 'MyCompany'
}
}
[ [ErrorReply: ERR value is not an integer or out of range] ]
Exception Captured
Weiko
Weiko6mo ago
Subscription status is inside core.workspace table. For your Redis error, that's weird. Does it only happen when you try to connect your google account in the settings? What's your redis version? We don't use any Redis command that expects an integer 🤔 Do you have the stackstrace?
paulyili
paulyili6mo ago
will check the db shortly. redis version is 7.2.4. i just installed it using docker run --name my-redis -d -p 6379:6379 redis im not sure what stackstrace is. sorry im somewhat new to some of this,
Weiko
Weiko6mo ago
I've tried with 7.2.4 and can't reproduce your issue 🤔. Unfortunately the email sync won't work without Redis because we need to have a persistent cache shared between the worker and the main app which won't work with the in-memory cache. I've just created a ticket to integrate sqlite for the cache, should be much easier to use for self-hosting. Hopefully changing the subscriptionStatus will fix your issue
Want results from more Discord servers?
Add your server