Page MenuHomePhabricator

Allow uri.allowed-protocols to be configured in the Phacility cluster
Open, LowPublic

Description

It would be useful to have remarkup, at least in Phriction, be able to recognize and turn into links custom URL schemes. Example use cases:

  • iOS OTA install links: itms-services://?action=download-manifest&url=https://...
  • iOS app links:
    • <a href="fb://profile/23050834961">Facebook</a>
    • <a href="twitter://user?screen_name=NHLBruins">Twitter</a>
    • <a href="instagram://user?username=nhlbruins">Instagram</a>
  • Corporate intranet links

That or allow raw HTML link tags in remarkup i.e. <a href="foo://bar">My Link</a>.

Details

Commits
Restricted Differential Revision / Restricted Diffusion Commit
Restricted Differential Revision / Restricted Diffusion Commit
Restricted Differential Revision / Restricted Diffusion Commit

Event Timeline

swisspol created this task.Jan 14 2016, 7:36 PM
swisspol updated the task description. (Show Details)

See uri.allowed-protocols in Config.

Ah. I searched for something like this in config but forgot about the /config/all/ page.

Anyway, cannot be edited if hosted on Phacility :( Any chance you could add itms-services:// and hyper:// to the hyper instance? Thanks.

This task should be closed, no?

Oh, I'll make this editable in the cluster from the instances panel. Change will go out on Saturday morning (about 36 hours from now).

epriestley added a revision: Restricted Differential Revision.Jan 14 2016, 9:31 PM
swisspol added a comment.EditedJan 14 2016, 9:33 PM

I'm not sure what you mean by "from the instance panel"? Is it the instance's regular config page?

epriestley closed this task as Resolved by committing Restricted Diffusion Commit.Jan 14 2016, 9:36 PM
epriestley added a commit: Restricted Diffusion Commit.

What's the format for setting? I tried ["http","https","mailto","hyper"] but it didn't work and actually breaks all links.

{ "http": true, "https": true, "mailto": true, "tel": true }

Still doesn't seem to work: all links are broken in Phriction:

I changed that 10 mn ago.

Also the wiki page previews don't seem to render anymore:

It just hangs on this. There's no error in the Chrome console or any failing HTTP requests as far as I can tell.

Ah and when I attempt to save the doc, I get this error:

Unhandled Exception ("InvalidArgumentException")

Argument 1 passed to idx() must be of the type array, object given, called in /core/lib/libphutil/src/markup/engine/remarkup/markuprule/PhutilRemarkupHyperlinkRule.php on line 40 and defined

If I switch the setting to ["http","https","mailto","hyper","itms-services"], then the exception is gone. So I guess the format is a JSON array, not object. But like I said above, hyperlinks don't work at all.

epriestley reopened this task as Open.Jan 17 2016, 3:50 PM
epriestley renamed this task from Add config settings to define custom URL schemes for remarkup to Allow uri.allowed-protocols to be configured in the Phacility cluster.
epriestley triaged this task as Low priority.
epriestley added a project: Phacility.
epriestley added a revision: Restricted Differential Revision.Feb 25 2016, 4:42 PM
epriestley added a commit: Restricted Diffusion Commit.Feb 26 2016, 2:22 PM
epriestley moved this task from Backlog to Future on the Customer Impact board.
epriestley added a revision: Restricted Differential Revision.Nov 30 2017, 12:34 PM
epriestley added a commit: Restricted Diffusion Commit.Nov 30 2017, 7:04 PM