Ref T8995, config option for Phurl short domain to share shortened URL's
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T8995: Allow a domain other than the install domain to serve as the "short" Phurl domain
- Commits
- Restricted Diffusion Commit
rPd8111f828f4d: Allow a domain other than the install domain to serve as a short Phurl domain
- 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
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 Config → Sites 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. |
Simplifying routes, improve config defaults, check if Phurl is installed before redirecting to it.
src/applications/config/option/PhabricatorPhurlConfigOptions.php | ||
---|---|---|
27–30 | Maybe "URLs". |