Change LONGTEXT cache column to BINARY

See T4898. As it turns out, `latin1` LONGTEXT is not approximately equivalent
to LONGBLOB.
Fix JIRA issue URI selection for JIRA installs which are not on the domain root

Summary: Fixes T4859. See that for details.

Test Plan:
  - Verified things still work on my local (domain root) install.
  - Added some unit tests.
  - Did not verify a non-root install since I don't have one handy, hopefully @salehe can help.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: salehe, epriestley

Maniphest Tasks: T4859

Differential Revision: https://secure.phabricator.com/D8836
Convert rest of SPRITE_STATUS to FontAwesome

Summary:
Updates policy, headers, typeaheads to FA over policy icons

Need advice - can't seem to place where icons come from on Typeahead? Wrong icons and wrong colors.... it is late

Test Plan:
- grepped for SPRITE_STATUS
- grepped for sprite-status
- grepped for setStatus for headers
- grepped individual icons names

Browsed numerous places, checked new dropdowns, see pudgy people.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4739

Differential Revision: https://secure.phabricator.com/D9179
Use the `ArcanistChmodLinter`.

Summary: Apply the `ArcanistChmodLinter` from D9187.

Test Plan: Removed all other linters from the `.arclint` file and executed `arc lint --everything`. Confirmed that there were no issues raised.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9188
Make tags not wrap in Chrome/Blink/Android

Summary: Object tags in Chrome/Blink on Android wrap randomly and horribly as if it's their job in life. Let's put an end to that, probably. Fixes T5103

Test Plan: Chrome 34 / Android. Tested Chrome Regular Flavor desktop and mobile.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5103

Differential Revision: https://secure.phabricator.com/D9191
Only apply force HTTPS check to code hostname
Allow Conduit to make tasks it can't edit
Send emails to subscribers when builds pass or fail

Summary:
Ref T1049.  This is a very basic implementation of sending emails to subscribers of build plans when the build passes or fails.  At the moment it doesn't embed any information other than a link to a build (e.g. it doesn't pull in the container, buildable or plan name).

It is probably also missing logic to check whether the subscriber can see the buildable / container that the email is about.  Since the only thing that's included right now is a link, it shouldn't be too harmful, but a policy check definitely needs to be added when the logic changes to pull in build information (such as plan and buildable).

Test Plan: Added a mailer implementation that writes the mail information to a Phabricator file and verified that the message arrives correctly (I can't send an actual email out from my development machine).

Reviewers: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D8609
Allow users to choose what types of buildables they want to publish fragments for

Summary:
Supersedes D7750.

Essentially the same thing but on the new field infrastructure.  I did want to make this work for all steps while I was at it, but since the fields are now drawn from the step configuration, I'm not sure what the right way to go about this (should I modify the steps to include a call to the parent for "global fields"?  Or should I modify the build step edit to forcefully include the field there?)

Test Plan: Tested against combinations of commits and revisions

Reviewers: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8641
Allow customization of page view and application name on Login / Register

Summary:
This allows for customization of the PageView class and the displayed application name on the Login and Register pages, via two GET parameters, `__pageview` and `__appname`.

The use case for this is having users authenticating through a website that's built on the Phabricator infrastructure, where the page view used on the site doesn't match the default Phabricator style.  In order to ensure users don't get confused logging in (before we can explain why we use Phabricator for our backend), we set the __pageview and __appname variables when Nginx performs URL rewriting.

I realise this might be a pretty unusual use case, but I do think this is something that will eventually need to be tackled in the very long term when people might be using the Phabricator infrastructure for building web applications.  I don't know whether allowing the user to set `__pageview` is a security issue; you can only change it to page view classes that are already defined.

`__appname` is so that the pages can show "MyApp Registration" instead of "Phabricator Registration".

Test Plan: Viewed the `/auth/login` and `/auth/register` pages with `__pageview` and `__appname` set.

Reviewers: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8642
Allow cookie setting on non-HTTPS domains
Support querying a specific snapshot on phragment.queryfragments

Summary: This allows a snapshot name to be specified when querying for Phragment fragments via Conduit.  It also adds the "size" field onto the reported results, which is the size of the file in bytes.

Test Plan: Specified snapshot, saw the data change.

Reviewers: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D8660
phragment.querysnapshots
Create preceding paths for fragments

Summary: This fixes an issue where you are publishing a file in Harbormaster to a path like "path/to/new/fragment.txt", and the preceding directories don't yet exist.  This ensures that whenever a fragment is created, the preceding directories are also created.

Test Plan: Tested on my server and it worked.

Reviewers: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D8671
Create file controller in Phragment

Summary:
This provides a controller similar to the ZIP controller, except that it's meant for us on fragments that you want to download as a file.  This controller provides a consistent URL (that can optionally contain a snapshot) which will be correct when and if a fragment gets updated, unlike the raw file link.

It also adds "Download Snapshot" on the snapshot controller, which links to the file controller with the snapshot name included.

Test Plan: Downloaded file-based fragments from the new controller.

Reviewers: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D8672
Allow Phabricator to redirect to Amazon S3 for file downloads

Summary: This allows users to configure Phabricator to redirect to Amazon S3 for file downloads.  This allows bandwidth costs to be mitigated to Amazon S3 and means that Phabricator doesn't need to download data from S3 to serve it back to the user.

Test Plan: Tested on https://code.redpointsoftware.com.au/.  Applied the patch, migrated all the file data, and played around with the configuration options (and tested both downloading files and requesting a Phragment list via getstate).

Reviewers: #blessed_reviewers, epriestley

Subscribers: hach-que, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8655

Conflicts:
	src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php
Use omnipotent user for scanning existing child fragments
Integrate GitHub pull requests as Differential reviews

Summary:
This uses Doorkeeper to import GitHub pull requests as Differential revisions.  For this to work, users need to do two things:

  * Create a GitHub service hook to point to https://my-phabricator-install.com/doorkeeper/github-hook/ for the repository they want to monitor, with the payload version "application/vnd.github.v3+form".  This can be done by going to "Settings" on the GitHub repository and selecting "Webhooks & Services".
  * Create a bot / service account with the username `github`.  Currently this is hardcoded, but it should really be a configurable option.  This is required because anyone can submit a PR on GitHub, including users which haven't connected Phabricator <-> GitHub accounts.  I don't know whether we want to auto-create accounts in this case instead of using a service account?

Test Plan:
Follow the instructions above, or submit a pull request to https://github.com/hach-que/test and then check https://code.redpointsoftware.com.au/differential/ to see if it appeared.

Also, an example:

**Pull Request:** https://github.com/hach-que/test/pull/2

**Differential Revision:** https://code.redpointsoftware.com.au/D269

Reviewers: #blessed_reviewers, epriestley

Subscribers: spicyj, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D8775
This is no longer needed because HTTPS is terminated by Nginx
Fix a crash when uploading a ZIP to Phragment

Summary:
This crash occurs when:

  * The ZIP contains a directory entry to abc/
  * The current Phragment contains an entry to abc/

It will attempt to call createFromFile (with a null file to indicate it's a directory), but the fragment actually already exists in the database, so this will crash.

Test Plan: TBD

Reviewers: #blessed_reviewers

Subscribers: epriestley, hach-que

Differential Revision: https://secure.phabricator.com/D9001