A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)

gotify/server

Build Status codecov Go Report Card Matrix Docker Pulls latest release

Intro

We wanted a simple server for sending and receiving messages (in real time per WebSocket). For this, not many open source projects existed and most of the existing ones were abandoned. Also, a requirement was that it can be self-hosted. We know there are many free and commercial push services out there.

Features

Gotify UI screenshot

  • send messages via REST-API
  • receive messages via WebSocket
  • manage users, clients and applications
  • Plugins
  • Web-UI -> ./ui
  • CLI for sending messages -> gotify/cli
  • Android-App -> gotify/android

Get it on Google Play Get it on F-Droid

(Google Play and the Google Play logo are trademarks of Google LLC.)


Documentation

InstallConfigurationREST-APISetup Dev Environment

Contributing

We welcome all kinds of contribution, including bug reports, feature requests, documentation improvements, UI refinements, etc. Check out CONTRIBUTING.md for guidelines.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

Owner
Gotify
A self-hosted push notification service.
Gotify
Comments
  • Problem with Edge browser and reverse proxy configuration

    Problem with Edge browser and reverse proxy configuration

    I have a strange problem.

    I can "not" login with Edge (W10) and proxy configuration. I will be logged out after less than a second.

    On the same W10 machine i tested this:
    
    Firefox 65 accessing mydomain.com:8080 ok *1
    Firefox 65 accessing mydomain.com/gotify ok *2
    
    Edge (W10) accessing mydomain.com:8080 ok *1
    Edge (W10) accessing mydomain.com/gotify NOT ok *2
    

    For a very short moment you can see a login and than you are back in the login screen.

    *1 No proxy at all *2 Apache Reverseproxy configuration as advised.

    [GIN] 2019/03/11 - 14:32:10 | 200 |  165.006785ms |   195.111.111.111 | POST     /client
    [GIN] 2019/03/11 - 14:32:10 | 200 |     784.661µs |   195.111.111.111 | GET      /current/user
    [GIN] 2019/03/11 - 14:32:10 | 403 |     536.698µs |   195.111.111.111 | GET      /stream?token=CAXhS2a_6Njwnqt
    Error #01: websocket: request origin not allowed by Upgrader.CheckOrigin
    [GIN] 2019/03/11 - 14:32:10 | 200 |    1.225617ms |   195.111.111.111 | GET      /message?since=0
    [GIN] 2019/03/11 - 14:32:10 | 404 |      89.282µs |               ::1 | GET      /gotify/current/user
    [GIN] 2019/03/11 - 14:32:10 | 200 |    2.978808ms |   195.111.111.111 | GET      /application
    [GIN] 2019/03/11 - 14:32:10 | 404 |      53.934µs |               ::1 | GET      /gotify/client
    

    ge

    Any ideas?

  • Setup in Lamp Server

    Setup in Lamp Server

    Hi, I Just install this on Lamp server via Docker Image some live sites are there

    while running this below command

    docker run -p 8080:8080 -v /var/gotify/data:/app/data gotify/server
    

    I got this below errors

    docker: Error response from daemon: driver failed programming external connectivity on endpoint laughing_liskov 
    
     Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use.
    
  • Plugin Support

    Plugin Support

    This fixes #51 This fixes #69

    I will implement the proposal we discussed in #51 progressively. Here's a checklist:

    • [x] Backend Database Storage for Plugins
    • [x] Global Configuration Item
    • [x] Plugin base interface
    • [x] Plugin loader infrastructure && base plugin APIs
    • [x] Webhooker
    • [x] Configor
    • [x] MessageSender
    • [x] WebUI

    Before merge:

    • [x] Documentation gotify/website -> https://github.com/gotify/website/pull/2
  • Frequent Websocket and TCP Keep Alives keep LTE connection open and drain battery

    Frequent Websocket and TCP Keep Alives keep LTE connection open and drain battery

    Hi,

    I have installed Gotify on an Ubuntu 18.04 server VM, no docker, no proxy, straight forward. The server works well but I notice that there is frequent TCP traffic, around every 10 seconds between the server and the Android client. This keeps the LTE connection to the network constantly in RRC-Connected state and has a significant impact on battery use.

    I ran a Wireshark trace, see screenshot attach which shows that this is caused by two thing:

    WebSocket keep alives (ping/pong) TCP keepalives

    Both keepalives are always triggered from the servers side.

    Note: Other messaging systems such as Prosody/Conversations/XMPP only send tcp-keep alive messaging every 7-10 minutes. This is way more batter efficient.

    Are there any settings to adapt Gotify's keep alive messaging frequency?

    Thanks, Martin

    2020-07-28_13-50-Gotify-tcp-ack and websocket ping

  • Pluggable extensions

    Pluggable extensions

    It would be nice to have pluggable extensions for Gotify. This could f.ex. be used for polling the GitHub Notification API.

    • Golang Plugin API or some kind of JavaScript engine to enable pluggable code
    • ? Allow adding routes something like /plugin/:name/... (overkill ?!?)
      • Could be useful for webhooks
    • ? Users can enable plugins
    • ? Key-Value per user for configuration (f.ex authentication token)
  • Actionable notifications

    Actionable notifications

    This looks like a really cool project and something I've been looking for for a while.

    Please correct me if I'm wrong on this but from the documentation it doesn't look like you support actionable notifications i.e. notifications containing one or two buttons underneath which perform the respective action when clicked.

    An example use case of this is that my home automation system may send a notification telling me that I left my garage door open and provide a button to close the door.

    I think the simplest/most flexible way to implement the action part would be via a webhook, so the sending application would need to specify both the label text and a callback URL for when the action is clicked.

    Thanks again for the great project.

  • Error 401 when sending token through body or header key in lowercase

    Error 401 when sending token through body or header key in lowercase

    Can the issue be reproduced with the latest available release? (y/n) Yes

    Which one is the environment gotify server is running in?

    • [x] Docker
    • [ ] Linux machine
    • [ ] Windows machine
    Docker startup command or config file here (please mask sensitive information)

    Docker compose file

    version: "3"
    
    services:
      gotify:
        image: gotify/server
        ports:
          - 8087:80
        environment:
          - GOTIFY_DEFAULTUSER_PASS=password
          - TZ=Europe/Paris
        volumes:
          - "./data:/app/data"
        labels:
          com.centurylinklabs.watchtower.enable: "true"
    

    Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)

    • [ ] None
    • [ ] Apache
    • [x] Nginx
    • [ ] Caddy
    Reverse proxy configuration (please mask sensitive information)
    I use Nginx Proxy Manager
    

    On which client do you experience problems? (Select as many as you can see)

    • [ ] WebUI
    • [ ] gotify-cli
    • [ ] Android Client
    • [x] 3rd-party API call (Please include your code)

    What did you do?

    I try to send gotify message through the notification system of Synology. After many fails attempt, I have tested my request with Postman.

    When I'm sending the following request with Postman:

    {
      "token": "my-token",
      "title": "BlackBox",
      "priority": 5,
      "message": "Un nouvel événement système s'est produit sur votre BlackBox le 02/09/2021 à 10:36.\nMessage test de BlackBox"
    }
    

    I got the following error:

    {
        "error": "Unauthorized",
        "errorCode": 401,
        "errorDescription": "you need to provide a valid access token or user credentials to access this api"
    }
    

    If I use the header key instead (X-Gotify-Key), it works.

  • Fix websocket reconnect logic

    Fix websocket reconnect logic

    The code is obsolete now that there is the improved auto reconnect function

    It also did never actually work anyway. This will call listen with an undefined callback, thus leading to the following error and effectively preventing the client from reconnecting automatically.

    TypeError: e is not a function WebSocketStore.ts:33:33

  • Reverse proxy usage still not working with subpath in url (still static URL in code?)

    Reverse proxy usage still not working with subpath in url (still static URL in code?)

    Still the webinterface is not working (white page) in reverse proxy konfiguration when you use a SUBPATH in URL like "https://mydomain.com/gotify" Looks like "/static/..." and maybe some other pathes have still leading "/"

    --- apache
    ProxyPass        /gotify         http://localhost:86
    ProxyPassReverse /gotify         http://localhost:86
    
    [06/Mar/2019:14:04:05 +0100] "GET /gotify HTTP/1.1" 200 1071 "-"
    [06/Mar/2019:14:04:06 +0100] "GET /static/css/main.99a0ea00.css HTTP/1.1" 404 561 "https://mydomain.com/gotify"
    [06/Mar/2019:14:04:06 +0100] "GET /static/js/main.93537239.js HTTP/1.1" 404 559 "https://mydomain.com/gotify"
    
  • Connect MYSQL

    Connect MYSQL

    Hi I have little bit confusion in config.yml setup I want to connect MYSQL instead of SQLite I created a File on /etc/gotify/ location

    docker run -p 8080:80 -v "`pwd`:/etc/gotify/" -v /var/gotify/data:/app/data gotify/server
    

    Outptut

    panic: dial tcp 127.0.0.1:3306: connect: connection refused
    
    goroutine 1 [running]:
    main.main()
    	/proj/app.go:47 +0x4bb
    
    
    gotify:DBPASS@/gotifydb?charset=utf8&parseTime=True&loc=Local
    
  • Tables failed to initialize on MariaDB

    Tables failed to initialize on MariaDB

    Initial installation and configuration directions do not show that specific mysql configuration values need to be set for the following issue:

    (Error 1709: Index column size too large. The maximum column size is 767 bytes.) [2019-03-15 19:09:51]

    More details about how to fix the issue are in https://stackoverflow.com/questions/24853828/index-column-size-too-large-the-maximum-column-size-is-767-bytes-for-int-dat

  • Do not include platform name in executable filename

    Do not include platform name in executable filename

    Is your feature request related to a problem? Please describe. When using different hardware platforms, after unzipping a release, the filename of the executable needs to be renamed in order to match startup scripts.

    Describe the solution you'd like Release the server executables without a platform name in the filename.

    Describe alternatives you've considered n/a

    Additional context Actually, there is an even nicer way to create release files which is used by many other projects which save work and mistakes during installing and upgrading. Please consider releasing in this way:

    gotify-2.2.3-linux-arm7.zip
    - gotify-2.2.3 (directory)
      - gotify (executable for arm7)
      - LICENSE
      - ...
    gotify-2.2.3-linux-amd64.zip
    - gotify-2.2.3 (directory)
      - gotify (executable for amd64)
      - LICENSE
      - ...
    
  • [Question] Firewall configuration and android application

    [Question] Firewall configuration and android application

    Have you read the documentation?

    • [X] Yes, but it does not include related information regarding my question.
    • [ ] Yes, but the steps described in the documentation do not work on my machine.
    • [ ] Yes, but I am having difficulty understanding it and wants clarification.

    You are setting up gotify in

    • [X] Docker
    • [ ] Linux native platform
    • [ ] Windows native platform

    Hi

    I have a gotify configured in a docker and OPNSense on a router. I've added a port forwarding: image and rule was automatically created on WAN interface: image but I'm still getting errors in android application:

    Caused by: java.net.SocketTimeoutException. failed to connecto to /myWanIP (port appPort) from /myWanIp (port 37344)

    I've noticed that port 37344 is generated - sometimes is different. I'm having problem with connectivity - it takes few seconds, but the most irritating is pushing mesages. I have to try few times till it sends because "Oops something went wrong" appears. Can you provide what should be additionally configured in docker or firewall? Some additional ports has to be opened? Is there a possibility to reduce amount of generated ports? Thanks in advance.

  • Path normalisation/Stripping leading slashes

    Path normalisation/Stripping leading slashes

    Is your feature request related to a problem? Please describe. When working with a relatively naive setup of gotify, one may have a trailing slash when specifying the url of the host (http://localhost/ instead of http://localhost for example). To avoid any issues/ambiguity, the developer using this URL should append /message to the configured url to send a message regardless of the url specified by the customer to ensure that a slash is in there.

    This can lead to the fully formed looking like this http://localhost//mesage, unfortunately with the way gotify is currently built, the double slash is not normalised and a query at this URL will lead to a 404

    Describe the solution you'd like Gotify should normalise the URL it receives to deduplicate slashes when possible, those are not meant to have any bearing on the URL.

    Describe alternatives you've considered The alternative is to leave with misconfigurations and hope they are being detected early on by the API user.

  • feature request: Notifications actions

    feature request: Notifications actions

    Is your feature request related to a problem? Please describe. I miss the possibility to react directly from some notifications, from the notification itself, without the need to open the main gotify interface.

    Describe the solution you'd like I would be able to pass some "extras" parameters that add some actions directly in the notifcations, like copy a text, open a link, or share a text/link, even why not call/text a contact.

    Describe alternatives you've considered I tried a simple implementation of "share" and "open" a link here, its working but can be done better maybe, please take time to read this PR thread: https://github.com/gotify/android/pull/236 .

    Additional context Please see this link https://github.com/gotify/android/pull/236 where you can find an example of integration with hauk-snitch project for example. Another common example is the integration of gotify with a monitoring, on-call setup. You can receive some events/alert and want to add some actions, open a link, ack an alert, escalade to another guy through call or text, copy a code you receive to the clipboard.

  • Using large integers can lead to database corruption

    Using large integers can lead to database corruption

    Can the issue be reproduced with the latest available release? (y/n)

    Which one is the environment gotify server is running in?

    • [ ] Docker
    • [X] Linux machine
    • [ ] Windows machine
    Docker startup command or config file here (please mask sensitive information)
    export GOTIFY_SERVER_PORT=30080
    ./gotify-linux-amd64
    

    Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)

    • [X] None
    • [ ] Nginx
    • [ ] Apache
    • [ ] Caddy
    Reverse proxy configuration (please mask sensitive information)
    
    

    On which client do you experience problems? (Select as many as you can see)

    • [ ] WebUI
    • [ ] gotify-cli
    • [ ] Android Client
    • [X] 3rd-party API call (python w/ requests)
    
    import requests
    
    r = requests.post(
        "http://localhost:30080/application?token=Cxxx",
        json={"name": "TestApplication", "id": 9223372036854775808},
    )
    
    print(r.json())
    
    r = requests.get("http://localhost:30080/application?token=Cxxx")
    
    print(r.json())
    
    

    What did you do?

    I created an application with id 9223372036854775808 and tried to get the list of all applications.

    What did you expect to see?

    An error while creating the application because the value is too large or an error because of specifying the 'id' field (which is read-only according to the swagger configuration).

    What did you see instead? (Include screenshots, android logcat/request dumps if possible)

    The applications couldn't be listed anymore because the id overflowed and was stored as a negative value in the database.

    {'id': 9223372036854775808, 'token': 'A_pITbCDbj.7S1Y', 'name': 'TestApplication', 'description': '', 'internal': False, 'image': 'static/defaultapp.png'}
    {'error': 'Internal Server Error', 'errorCode': 500, 'errorDescription': 'sql: Scan error on column index 0, name "id": converting driver.Value type int64 ("-9223372036854775808") to a uint: invalid syntax'}
    

    I think it should also be clear if fields like 'id', 'image' etc. can be used by the client or not. If they are supported, they should be specified in the API documentation, otherwise you should get a 400 Bad Request response when using them.

command-line tool to publish, subscribe, and process messages for AMQP 0.9.1 compliant message brokers

Bunny A BSD licenced, go-powered CLI tool for publishing and subscribing to RabbitMQ

Sep 11, 2021
Open-IM-Server is open source instant messaging Server.Backend in Go.
Open-IM-Server is open source instant messaging Server.Backend in Go.

Open-IM-Server is open source instant messaging Server.Backend in Go.

Dec 31, 2022
Simple TCP-based chat server

hub-server Simple TCP-based chat server. Client can be found: https://github.com/alankritjoshi/hub-client Setup go run server.go 1234 How it works Use

Oct 25, 2021
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).

Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).

Dec 31, 2022
Self hosted live chat server written in Go

goch is a self-hosted live-chat server written in Go. It allows you to run a live-chat software on your own infrastructure. You can create multip

Dec 11, 2022
A Go package for sending and receiving ethernet frames. Currently supporting Linux, Freebsd, and OS X.

ether ether is a go package for sending and receiving ethernet frames. Currently supported platform: BPF based OS X FreeBSD AF_PACKET based Linux Docu

Sep 27, 2022
Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.

Quota Operator Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users. Instructi

Nov 9, 2022
Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ
Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Oct 27, 2022
Real-time Map displays real-time positions of public transport vehicles in Helsinki
Real-time Map displays real-time positions of public transport vehicles in Helsinki

Real-time Map Real-time Map displays real-time positions of public transport vehicles in Helsinki. It's a showcase for Proto.Actor - an ultra-fast dis

Nov 30, 2022
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.

LWN Simulator A LoRaWAN nodes' simulator to simulate a LoRaWAN Network. Table of Contents General Info Requirements Installation General Info LWN Simu

Nov 20, 2022
CLI for publishing/receiving CloudEvent messages through NATS

cenats CLI for publishing/receiving CloudEvent messages through NATS Use Case cenats is designed to make testing services that generate or consume eve

Nov 5, 2021
rtsp to webrtc proxy with websocket signaling, currently limited to single h264 stream per endpoint

rtp-to-webrtc rtp-to-webrtc demonstrates how to consume a RTP stream video UDP, and then send to a WebRTC client. With this example we have pre-made G

Aug 6, 2022
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Fortio Fortio (Φορτίο) started as, and is, Istio's load testing tool and now graduated to be its own project. Fortio is also used by, among others, Me

Jan 2, 2023
A simple way of sending messages from the CLI output to your Discord channel with webhook.
A simple way of sending messages from the CLI output to your Discord channel with webhook.

discat A simple way of sending messages from the CLI output to your Discord channel with webhook. Actually, this is a fork version of slackcat that I

Nov 15, 2022
A utility for sending and listening for OSC messages.

A simple utility to send and listen for OSC messages. It can also be used to send MIDI messages.

Mar 5, 2022
Cpu-profiling - Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

cpu-profiling Basic example of CPU Profiling in Golang which shows the bottlenec

Aug 2, 2022
A site displaying musical groups information by receiving a public API. The server was written in Go.
A site displaying musical groups information by receiving a public API. The server was written in Go.

A site displaying musical groups information by receiving a public API. The API consists of 4 parts with each represent a subset of the information. W

Dec 13, 2021
graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

Dec 5, 2022
Notify - Notification microservice for sending templated payloads as Slack messages

Notify Notify is a microservice that takes an event & payload from an applicatio

May 23, 2022