Page MenuHomePhabricator

Allow a domain other than the install domain to serve as a short Phurl domain
ClosedPublic

Authored by lpriestley on Nov 9 2015, 6:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 3:34 AM
Unknown Object (File)
Mon, Apr 29, 3:25 PM
Unknown Object (File)
Sat, Apr 27, 2:18 AM
Unknown Object (File)
Wed, Apr 24, 11:22 PM
Unknown Object (File)
Tue, Apr 16, 3:20 AM
Unknown Object (File)
Fri, Apr 12, 1:12 AM
Unknown Object (File)
Thu, Apr 11, 7:53 AM
Unknown Object (File)
Mar 24 2024, 4:19 PM
Subscribers

Details

Summary

Ref T8995, config option for Phurl short domain to share shortened URL's

Test Plan
  • Configure Phurl short domain to something like "zz.us"
  • Navigate to zz.us; get 404
  • Navigate to zz.us/u/3 or zz.us/u/alias where U3 is an existing Phurl; redirect to correct destination

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lpriestley retitled this revision from to Allow a domain other than the install domain to serve as a short Phurl domain.
lpriestley updated this object.
lpriestley edited the test plan for this revision. (Show Details)
lpriestley added a reviewer: epriestley.
src/applications/config/option/PhabricatorPhurlConfigOptions.php
28

Not sure what a good default here is.

32

Also not sure what's a useful example.

src/applications/phurl/controller/PhabricatorPhurlURLAccessController.php
39–42

Is this still necessary?

epriestley edited edge metadata.

This generally looks good to me.

For consistency, prefer put the access-modifying methods (shouldRequireLogin(), shouldAllowPublic()) at the top of the controllers rather than at the bottom.

src/aphront/site/PhabricatorShortSite.php
7

Plural of URL is probably just "URLs"?

11

This site should have a unique priority so its execution order is unambiguous. It currently shares the same priority with PhabricatorResourceSite.

You can use ConfigSites to see other sites.

2500 would be a reasonable priority for this site: it should be weaker than CDN configuration, but stronger than Phame blogs.

21

We should also have a check to make sure Phurl is installed. See PhameSite for an example of how to check if an app is installed (that one checks for Phame).

src/applications/config/option/PhabricatorPhurlConfigOptions.php
12

Maybe just "Options for Phurl.", the next thing we put here might not directly relate to short domains.

20

I think this should be phurl, as it will currently conflict with the existing core group.

The Config list should show a new config group for "Phurl".

25

Prefer null as the default, not false.

28

The default should just be null. You should be able to omit this call completely, I think.

32

Maybe https://some-very-short-domain.museum/

src/applications/phurl/application/PhabricatorPhurlApplication.php
56–57

Since you don't actually care which one matches, you could just use a single rule here and simplify the ShortURLController.

src/applications/phurl/controller/PhabricatorPhurlURLAccessController.php
39–42

It's not necessary for this change, but it's desirable so that the "Public" policy works.

Without this, public Phurls will prompt users to log in, even though they do not need to.

This revision now requires changes to proceed.Nov 9 2015, 6:51 PM
lpriestley edited edge metadata.

Simplifying routes, improve config defaults, check if Phurl is installed before redirecting to it.

epriestley edited edge metadata.
epriestley added inline comments.
src/applications/config/option/PhabricatorPhurlConfigOptions.php
27–30

Maybe "URLs".

This revision is now accepted and ready to land.Nov 9 2015, 7:29 PM
lpriestley edited edge metadata.

Learning to spell

This revision was automatically updated to reflect the committed changes.