Merge branch 'feature/gopher-dstport' into 'develop'
authorrinpatch <rinpatch@sdf.org>
Thu, 21 Mar 2019 17:08:40 +0000 (17:08 +0000)
committerrinpatch <rinpatch@sdf.org>
Thu, 21 Mar 2019 17:08:40 +0000 (17:08 +0000)
Add a gopher url port config option

See merge request pleroma/pleroma!959

docs/config.md
lib/pleroma/gopher/server.ex

index 20118037359c7f9a2a00d64b127e25b2fe1a1d05..4fa6bd62df3600f5211362f6f29f0a4571ca250a 100644 (file)
@@ -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
index 6baacc5661ffbb4e3bec9dd4250cd469d1f53416..3b9629d77643a4fa3e3f9f817af76626aa4bb542 100644 (file)
@@ -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