Gotify

Gotify is “a simple server for sending and receiving messages”.

Requirements

  • A server to connect to. There is, at this moment, no server open for registration. But if you can’t self-host yours, come on matrix (or IRC) unifiedpush room to ask if someone can create an account for you. Maybe someone will!

Setting Up

  • Install the application.
  • Connect to the server.
  • You’re ready!

Self Hosting

If you are self-hosting the server, you will need to add a rewrite-proxy to the default configuration.

Nginx

It can be achieved with the following nginx rule (which uses lua):

location /UP {
    access_by_lua_block{
        local json=require("cjson")
        ngx.req.read_body()
        local req = ngx.req.get_body_data()
        local newreq = { ["message"] = req }
        local body = json.encode(newreq)
        ngx.req.set_body_data(body)
    }

    proxy_set_header        Content-Type application/json;
    proxy_pass            http://127.0.0.1:8080/message;
    proxy_set_header            Host $host;

    # Force https
    if ($scheme = http) {
        rewrite ^ https://$server_name$request_uri? permanent;
     }
}

Go

It can be achieved with Golang Rewrite Proxy, a program that can be installed to run as a rewrite proxy for Gotify.

Traffic from /UP on any reverse proxy running Gotify can be proxied to it. The following is an example for Nginx.

location  /UP {
        proxy_pass            http://127.0.0.1:5000;
}