#[SOLVED] Custom SMTP Server in Console

28 messages · Page 1 of 1 (latest)

woeful pasture
#

Hi guys,

I want to setup custom smtp settings at my console in appwrite. I enter all the data and click on update - but somehow it won't save the data and when I switch to another tab and go back again - the Custom SMTP Server is disabled again.

I do not know what to do about this - anyone had experience with this issue?

Best regards

unkempt raven
woeful pasture
#

Hi Steven - thanks for answer 🙂

I am running on version 1.4.8

I found this on the network analysis:

GET
wss://MYAPI/v1/realtime?project=console&channels[]=project&channels[]=console

Firefox got no connection to wss://MYAPI/v1/realtime?project=console&channels%5B%5D=project&channels%5B%5D=console sdk.7f58ece9.js:1:12112
Realtime got disconnected. Reconnect will be attempted in 1 seconds. <empty string> 0.1306363b.js:15:191
GET
wss://MYAPI/v1/realtime?project=console&channels[]=project&channels[]=console

Firefox got no connection to wss://MYAPI/v1/realtime?project=console&channels%5B%5D=project&channels%5B%5D=console sdk.7f58ece9.js:1:12112
Realtime got disconnected. Reconnect will be attempted in 1 seconds. <empty string>

Also note that this logs didn't come up when i clicked the "Update" Button - it just came before....

#

I also found some additional error:

unkempt raven
woeful pasture
#

i do not have an active filter

unkempt raven
#

would you please enable XHR?

woeful pasture
#

I also got now this notification at the top right corner of appwrite console

unkempt raven
unkempt raven
woeful pasture
#

yeah I have a proxy error:

Status
502
Proxy Error
VersionHTTP/1.1
Übertragen716 B (433 B Größe)
Referrer Policystrict-origin-when-cross-origin
Anfrage-PrioritätHighest
DNS-AuflösungSystem

woeful pasture
#

message "The requested route was not found. Please refer to the API docs and try again."
code 404
type "general_route_not_found"
version "1.4.8"
file "/usr/src/code/app/controllers/general.php"
line 854
trace
0
file "/usr/src/code/vendor/utopia-php/framework/src/App.php"
line 508
function "{closure}"
args []
1
file "/usr/src/code/vendor/utopia-php/framework/src/App.php"
line 673
function "execute"
class "Utopia\App"
type "->"
args
0 {}
1 {}
2 {}
2
file "/usr/src/code/app/http.php"
line 253
function "run"
class "Utopia\App"
type "->"
args
0 {}
1 {}

woeful pasture
#
message    "The requested route was not found. Please refer to the API docs and try again."
code    404
type    "general_route_not_found"
version    "1.4.8"
file    "/usr/src/code/app/controllers/general.php"
line    854
trace    
0    
file    "/usr/src/code/vendor/utopia-php/framework/src/App.php"
line    508
function    "{closure}"
args    []
1    
file    "/usr/src/code/vendor/utopia-php/framework/src/App.php"
line    673
function    "execute"
class    "Utopia\\App"
type    "->"
args    
0    {}
1    {}
2    {}
2    
file    "/usr/src/code/app/http.php"
line    253
function    "run"
class    "Utopia\\App"
type    "->"
args    
0    {}
1    {}

ok so what does that mean?

woeful pasture
unkempt raven
#

maybe this problem is due to your reverse proxy too 🤷🏼‍♂️

woeful pasture
#

you mean the traefik wright?

woeful pasture
#

I now found a solution and fixed it 🙂

#

The fault was in the apache config of the server.

#

This was my api.conf file before changes:


<Macro APICertsPaths>
    SSLCertificateFile /etc/ssl/api-example.example/cert.pem
    SSLCertificateKeyFile /etc/ssl/api-example.example/key.pem
    SSLCertificateChainFile /etc/ssl/api-example.example/fullchain.pem
    SSLCACertificatePath /etc/ssl/api-example.example
    SSLCACertificateFile /etc/ssl/api-example.example/fullchain.pem
</Macro>

<VirtualHost *:80>
    ServerName api-example.example

    ServerAdmin [email protected]

    Alias /robots.txt /var/www/html/robots.txt

    #für lets encrypt
    Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
    <Directory "/var/www/acme/.well-known/acme-challenge">
        AllowOverride None
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        Require method GET POST OPTIONS
    </Directory>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC]
    RewriteCond %{REQUEST_URI} !^/robots.txt [NC]
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:443>
    ServerName api-example.example

    SSLEngine On
    Use APICertsPaths

    ProxyAddHeaders On
    #Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
    #Header set X-Frame-Options: "SAMEORIGIN"
    RequestHeader set X-FORWARDED-PROTOCOL https
    RequestHeader set X-Forwarded-Ssl on

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    RewriteEngine on
    RewriteCond ${HTTP:Upgrade} websocket [NC]
    RewriteCond ${HTTP:Connection} upgrade [NC]
    RewriteRule .* "wss:/localhost:1080/$1" [P,L]

    ProxyPreserveHost On
    ProxyPass / http://localhost:1080/
    ProxyPassReverse / http://localhost:1080/

</VirtualHost>
#

and this is the fixed api.conf file:

<Macro APICertsPaths>
    SSLCertificateFile /etc/ssl/api-example.example/cert.pem
    SSLCertificateKeyFile /etc/ssl/api-example.example/key.pem
    SSLCertificateChainFile /etc/ssl/api-example.example/fullchain.pem
    SSLCACertificatePath /etc/ssl/api-example.example
    SSLCACertificateFile /etc/ssl/api-example.example/fullchain.pem
</Macro>

<VirtualHost *:80>
    ServerName api-example.example

    ServerAdmin [email protected]

    Alias /robots.txt /var/www/html/robots.txt

    #für lets encrypt
    Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
    <Directory "/var/www/acme/.well-known/acme-challenge">
        AllowOverride None
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        Require method GET POST OPTIONS
    </Directory>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC]
    RewriteCond %{REQUEST_URI} !^/robots.txt [NC]
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:443>
    ServerName api-example.example

    SSLEngine On
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    Use APICertsPaths

    ProxyAddHeaders On

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


    ProxyPassReverseCookieDomain  "localhost:10443"  "api-example.example"
    ProxyPreserveHost On
    ProxyPass / https://localhost:10443/ upgrade=websocket
    ProxyPassReverse / https://localhost:10443/

</VirtualHost>
#

I have to say in my case there was not just this fault, also another service was running on same port and sometimes the API request got to this different service - just FYI.

Best regards