Skip to content
Snippets Groups Projects
Commit 80bc9ed2 authored by Quentin Rameau's avatar Quentin Rameau Committed by rinpatch
Browse files

Add a gopher url port config option

This lets the user advertise a different port in the gopher urls,
for example listening locally on port 7070 but telling clients to
connect to the regular port 70.
parent b92a16aa
Branches
No related tags found
No related merge requests found
......@@ -190,6 +190,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i
* `enabled`: Enables the gopher interface
* `ip`: IP address to bind to
* `port`: Port to bind to
* `dstport`: Port advertised in urls (optional, defaults to `port`)
## :activitypub
* ``accept_blocks``: Whether to accept incoming block activities from other instances
......
......@@ -66,7 +66,8 @@ defmodule Pleroma.Gopher.Server.ProtocolHandler do
def link(name, selector, type \\ 1) do
address = Pleroma.Web.Endpoint.host()
port = Pleroma.Config.get([:gopher, :port], 1234)
"#{type}#{name}\t#{selector}\t#{address}\t#{port}\r\n"
dstport = Pleroma.Config.get([:gopher, :dstport], port)
"#{type}#{name}\t#{selector}\t#{address}\t#{dstport}\r\n"
end
def render_activities(activities) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment