Giter Club home page Giter Club logo

Comments (15)

jmattheis avatar jmattheis commented on May 11, 2024

Hey @monsieurpouet

is there any gotify/server log when you try to connect to gotify/server through the apache2 proxy?
This serverfault answer suggests adding Keepalive=On to the ProxyPass parameters could you try this?

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

I'm sorry, I had forgot some logs.
My Gotify Logs:

Starting Gotify version 1.2.1@2018-12-12-21:08:19
Started Listening on port 443
Started Listening on port 80
http: TLS handshake error from 172.24.0.1:34828: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:34832: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:34856: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:34860: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:34866: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:39092: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:39288: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:41954: tls: first record does not look like a TLS handshake
http: TLS handshake error from 172.24.0.1:41958: tls: first record does not look like a TLS handshake

I put a KeepAlive directive in my conf file. But, I've same error.

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Looks like Apache send a plain HTTP request to the gotify TLS endpoint. Make sure you have set GOTIFY_SERVER_PORT to 2083 as shown on you apache configuration and set GOTIFY_SERVER_SSL_ENABLED=false

It would be good to post both your gotify config and apache config so that we can have a better overview of your configuration:)

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

Ok ok ! It'll be more simple :)

version: '3'

services:
    gotify:
        image: gotify/server
        ports:
                - '127.0.0.1:2083:443'
        volumes:
                - /etc/gotify:/app/data
        environment:
                - GOTIFY_SERVER_PORT=2083
                - GOTIFY_SERVER_SSL_ENABLED=false
                - GOTIFY_SERVER_SSL_REDIRECTTOHTTPS=true
                - GOTIFY_SERVER_SSL_PORT=443
                - GOTIFY_SERVER_SSL_LETSENCRYPT_ENABLED=true
                - GOTIFY_SERVER_SSL_LETSENCRYPT_ACCEPTTOS=false
                - GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE=certs
                - GOTIFY_SERVER_SSL_LETSENCRYPT_HOSTS=- push.blabla.fr
                - GOTIFY_DATABASE_DIALECT=sqlite3
                - GOTIFY_DATABASE_CONNECTION=gotify.db
                - GOTIFY_DEFAULTUSER_NAME=admin
                - GOTIFY_DEFAULTUSER_PASS=pass
                - GOTIFY_UPLOADEDIMAGESDIR=images
				
	<VirtualHost *:80>                                                              
            ServerName push.blabla.fr                                             
            Redirect / https://push.blabla.fr/                                    
            ServerSignature Off                                                     
            #RewriteEngine on                                                       
            #RewriteCond %{SERVER_NAME} =push.blabla.fr                           
            #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    </VirtualHost>                                                                  
                                                                                    
    <VirtualHost *:443>                                                             
            ServerName push.blabla.fr                                             
                                                                                    
            SSLEngine On                                                            
            ProxyPass "/" http://127.0.0.1:2083/ retry=0 timeout=5                  
            ProxyPassReverse / http://127.0.0.1:2083/                               
            ServerSignature Off                                                     
            Keepalive On                                                            
            CustomLog /var/log/apache2/push_access.log combined                     
            ErrorLog /var/log/apache2/push_error.log                                
                                                                                    
            Include /etc/letsencrypt/options-ssl-apache.conf                        
            Include /etc/letsencrypt/options-ssl-apache.conf                        
            SSLCertificateFile /etc/letsencrypt/live/push.blabla.fr/fullchain.pem 
            SSLCertificateKeyFile /etc/letsencrypt/live/push.blabla.fr/privkey.pem
    </VirtualHost>      

Thanks you for your help !

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

The ports should be 127.0.0.1:2083:2083, as you should be connecting to port 2083 instead of 443 in your container.

Your docker-compose in whole should be:

version: '3'

services:
    gotify:
        image: gotify/server
        ports:
                - '127.0.0.1:2083:2083'
        volumes:
                - /etc/gotify:/app/data
        environment:
                - GOTIFY_SERVER_PORT=2083
                - GOTIFY_SERVER_SSL_ENABLED=false
                - GOTIFY_SERVER_SSL_REDIRECTTOHTTPS=true
                - GOTIFY_SERVER_SSL_PORT=443
                - GOTIFY_SERVER_SSL_LETSENCRYPT_ENABLED=true
                - GOTIFY_SERVER_SSL_LETSENCRYPT_ACCEPTTOS=false
                - GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE=certs
                - GOTIFY_SERVER_SSL_LETSENCRYPT_HOSTS=- push.blabla.fr
                - GOTIFY_DATABASE_DIALECT=sqlite3
                - GOTIFY_DATABASE_CONNECTION=gotify.db
                - GOTIFY_DEFAULTUSER_NAME=admin
                - GOTIFY_DEFAULTUSER_PASS=pass
                - GOTIFY_UPLOADEDIMAGESDIR=images

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Starting Gotify version 1.2.1@2018-12-12-21:08:19
Started Listening on port 443
Started Listening on port 80

Also, according to your log, gotify is not listening on 2083 as your specified in environments. Maybe is there a config.yml file on /etc/gotify in your host system present that overrides the configuration?

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

I wasn't far away ^^
It works now with your correction :D I'll test that with Android now (maybe, i'll be back :p)

image

The update works just with docker pull ?

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Glad to hear you are up and running:)

Yeah it should work just by updating the container:)

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

Android app work fine ! Bit i've some error "Bad request" in the app, and I have to refresh in the app to show the messages like my mail ahah :p

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Does websocket work well on WebUi? You might need to tell Apache to proxy websocket requests too. See https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Sorry I'm not very familiar with Apache but according to the documentation I guess this is what you need:

ProxyPass "/stream"  "ws://127.0.0.1:2083/"

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

Ohh, nice IndexOf hihi ^^
image

And the push doesn't work now :/
Maybe, I need 2 lines about ProxyPass. One with stream and One with /

from server.

eternal-flame-AD avatar eternal-flame-AD commented on May 11, 2024

Yeah you need both lines, one for proxying HTTP and another for websocket.

from server.

monsieurpouet avatar monsieurpouet commented on May 11, 2024

Everything work great now !
Thanks you. I've make a pull request for the configuration for apache2 =)
(my first pull request.. i assume^^)

from server.

JialuZhang avatar JialuZhang commented on May 11, 2024

@monsieurpouet

In your configuration, there is a silent misconfiguration. These three lines is a silent misconfiguration. This means adding it to your system will not change any system behavior.

<VirtualHost *:80>                                                                
...                                                  
        #RewriteEngine on                                                         
        #RewriteCond %{SERVER_NAME} =push.blabla.fr                             
        #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] 
...
</VirtualHost>   

"RewriteEngine Off" is introduced by Apache to explicitly disable all "RewriteRule" and "RewriteCond".
That is to say, if you include multiple "RewriteRule" and "RewriteCond" parameters in your configuration, then instead of commenting them all, you can explicitly set “RewriteEngine Off” to disable all "RewriteRule".
More importantly, the default value of “RewriteEngine" is already an "off", so adding “RewriteEngine off" is quite unnecessary and it may cause confusion to users.

Related Apache source code snippet:

run_rewritemap_programs(server_rec *s , apr_pool_t *p){
if (conf->state == ENGINE_DISABLED) { // usage of "RewriteEngine"
  return APR_SUCCESS; // early return
rewritemap_program(...); // usage of "RewriteRule" 
}

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.