diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 01dd75c901..f601b5cec3 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -10,7 +10,7 @@ return array( 'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.js' => '15191c65', 'core.pkg.css' => '2fa91e14', - 'core.pkg.js' => 'dc13d4b7', + 'core.pkg.js' => 'a3ceffdb', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '113e692c', 'differential.pkg.js' => 'f6d809c0', @@ -78,7 +78,7 @@ return array( 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948', 'rsrc/css/application/flag/flag.css' => 'bba8f811', - 'rsrc/css/application/harbormaster/harbormaster.css' => 'f491c9f4', + 'rsrc/css/application/harbormaster/harbormaster.css' => '730a4a3c', 'rsrc/css/application/herald/herald-test.css' => 'a52e323e', 'rsrc/css/application/herald/herald.css' => 'cd8d0134', 'rsrc/css/application/maniphest/report.css' => '9b9580b7', @@ -122,7 +122,7 @@ return array( 'rsrc/css/font/font-lato.css' => 'c7ccd872', 'rsrc/css/font/phui-font-icon-base.css' => '870a7360', 'rsrc/css/layout/phabricator-filetree-view.css' => 'b912ad97', - 'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829', + 'rsrc/css/layout/phabricator-source-code-view.css' => '926ced2d', 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', 'rsrc/css/phui/button/phui-button.css' => '1863cc6e', @@ -211,12 +211,12 @@ return array( 'rsrc/externals/font/lato/lato-regular.woff' => '13d39fe2', 'rsrc/externals/font/lato/lato-regular.woff2' => '57a9f742', 'rsrc/externals/javelin/core/Event.js' => '2ee659ce', - 'rsrc/externals/javelin/core/Stratcom.js' => '6ad39b6f', + 'rsrc/externals/javelin/core/Stratcom.js' => '327f418a', 'rsrc/externals/javelin/core/__tests__/event-stop-and-kill.js' => '717554e4', 'rsrc/externals/javelin/core/__tests__/install.js' => 'c432ee85', 'rsrc/externals/javelin/core/__tests__/stratcom.js' => '88bf7313', 'rsrc/externals/javelin/core/__tests__/util.js' => 'e251703d', - 'rsrc/externals/javelin/core/init.js' => '3010e992', + 'rsrc/externals/javelin/core/init.js' => '638a4e2b', 'rsrc/externals/javelin/core/init_node.js' => 'c234aded', 'rsrc/externals/javelin/core/install.js' => '05270951', 'rsrc/externals/javelin/core/util.js' => '93cc50d6', @@ -255,7 +255,7 @@ return array( 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 'rsrc/externals/javelin/lib/WebSocket.js' => '3ffe32d6', - 'rsrc/externals/javelin/lib/Workflow.js' => '1e911d0f', + 'rsrc/externals/javelin/lib/Workflow.js' => '0eb1db0c', 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8', 'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b', 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68', @@ -416,6 +416,7 @@ return array( 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', 'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', + 'rsrc/js/application/harbormaster/behavior-harbormaster-log.js' => '191b4909', 'rsrc/js/application/herald/HeraldRuleEditor.js' => 'dca75c0e', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', @@ -493,8 +494,8 @@ return array( 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', - 'rsrc/js/core/behavior-lightbox-attachments.js' => '560f41da', - 'rsrc/js/core/behavior-line-linker.js' => '1499a8cb', + 'rsrc/js/core/behavior-lightbox-attachments.js' => 'e31fad01', + 'rsrc/js/core/behavior-line-linker.js' => 'a9b946f8', 'rsrc/js/core/behavior-more.js' => 'a80d0378', 'rsrc/js/core/behavior-object-selector.js' => '77c1f0b0', 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', @@ -578,7 +579,7 @@ return array( 'font-fontawesome' => 'e838e088', 'font-lato' => 'c7ccd872', 'global-drag-and-drop-css' => 'b556a948', - 'harbormaster-css' => 'f491c9f4', + 'harbormaster-css' => '730a4a3c', 'herald-css' => 'cd8d0134', 'herald-rule-editor' => 'dca75c0e', 'herald-test-css' => 'a52e323e', @@ -635,12 +636,13 @@ return array( 'javelin-behavior-event-all-day' => 'b41537c9', 'javelin-behavior-fancy-datepicker' => 'ecf4e799', 'javelin-behavior-global-drag-and-drop' => '960f6a39', + 'javelin-behavior-harbormaster-log' => '191b4909', 'javelin-behavior-herald-rule-editor' => '7ebaeed3', 'javelin-behavior-high-security-warning' => 'a464fe03', 'javelin-behavior-history-install' => '7ee2b591', 'javelin-behavior-icon-composer' => '8499b6ab', 'javelin-behavior-launch-icon-composer' => '48086888', - 'javelin-behavior-lightbox-attachments' => '560f41da', + 'javelin-behavior-lightbox-attachments' => 'e31fad01', 'javelin-behavior-line-chart' => 'e4232876', 'javelin-behavior-load-blame' => '42126667', 'javelin-behavior-maniphest-batch-selector' => 'ad54037e', @@ -656,7 +658,7 @@ return array( 'javelin-behavior-phabricator-gesture-example' => '558829c2', 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0', - 'javelin-behavior-phabricator-line-linker' => '1499a8cb', + 'javelin-behavior-phabricator-line-linker' => 'a9b946f8', 'javelin-behavior-phabricator-nav' => '836f966d', 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 'javelin-behavior-phabricator-object-selector' => '77c1f0b0', @@ -720,7 +722,7 @@ return array( 'javelin-install' => '05270951', 'javelin-json' => '69adf288', 'javelin-leader' => '7f243deb', - 'javelin-magical-init' => '3010e992', + 'javelin-magical-init' => '638a4e2b', 'javelin-mask' => '8a41885b', 'javelin-quicksand' => '6b8ef10b', 'javelin-reactor' => '2b8de964', @@ -733,7 +735,7 @@ return array( 'javelin-router' => '29274e2b', 'javelin-scrollbar' => '9065f639', 'javelin-sound' => '949c0fe5', - 'javelin-stratcom' => '6ad39b6f', + 'javelin-stratcom' => '327f418a', 'javelin-tokenizer' => '8d3bc1b2', 'javelin-typeahead' => '70baed2f', 'javelin-typeahead-composite-source' => '503e17fd', @@ -755,7 +757,7 @@ return array( 'javelin-workboard-card' => 'c587b80f', 'javelin-workboard-column' => '758b4758', 'javelin-workboard-controller' => '26167537', - 'javelin-workflow' => '1e911d0f', + 'javelin-workflow' => '0eb1db0c', 'maniphest-report-css' => '9b9580b7', 'maniphest-task-edit-css' => 'fda62a9b', 'maniphest-task-summary-css' => '11cc5344', @@ -800,7 +802,7 @@ return array( 'phabricator-search-results-css' => '505dd8cf', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-slowvote-css' => 'a94b7230', - 'phabricator-source-code-view-css' => 'aea41829', + 'phabricator-source-code-view-css' => '926ced2d', 'phabricator-standard-page-view' => '34ee718b', 'phabricator-textareautils' => '320810c8', 'phabricator-title' => '485aaa6c', @@ -975,6 +977,17 @@ return array( 'javelin-dom', 'javelin-router', ), + '0eb1db0c' => array( + 'javelin-stratcom', + 'javelin-request', + 'javelin-dom', + 'javelin-vector', + 'javelin-install', + 'javelin-util', + 'javelin-mask', + 'javelin-uri', + 'javelin-routable', + ), '0f764c35' => array( 'javelin-install', 'javelin-util', @@ -985,12 +998,6 @@ return array( 'javelin-dom', 'javelin-typeahead-normalizer', ), - '1499a8cb' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-history', - ), '15d5ff71' => array( 'aphront-typeahead-control-css', 'phui-tag-view-css', @@ -1015,6 +1022,9 @@ return array( '185bbd53' => array( 'javelin-install', ), + '191b4909' => array( + 'javelin-behavior', + ), '1ad0a787' => array( 'javelin-install', 'javelin-reactor', @@ -1033,17 +1043,6 @@ return array( 'javelin-request', 'javelin-uri', ), - '1e911d0f' => array( - 'javelin-stratcom', - 'javelin-request', - 'javelin-dom', - 'javelin-vector', - 'javelin-install', - 'javelin-util', - 'javelin-mask', - 'javelin-uri', - 'javelin-routable', - ), '1f6794f6' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1129,6 +1128,12 @@ return array( 'javelin-dom', 'javelin-workflow', ), + '327f418a' => array( + 'javelin-install', + 'javelin-event', + 'javelin-util', + 'javelin-magical-init', + ), '358b8c04' => array( 'javelin-install', 'javelin-util', @@ -1351,15 +1356,6 @@ return array( 'javelin-vector', 'javelin-dom', ), - '560f41da' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-mask', - 'javelin-util', - 'phuix-icon-view', - 'phabricator-busy', - ), '58dea2fa' => array( 'javelin-install', 'javelin-util', @@ -1444,12 +1440,6 @@ return array( '69adf288' => array( 'javelin-install', ), - '6ad39b6f' => array( - 'javelin-install', - 'javelin-event', - 'javelin-util', - 'javelin-magical-init', - ), '6b8ef10b' => array( 'javelin-install', ), @@ -1756,6 +1746,12 @@ return array( 'javelin-uri', 'phabricator-keyboard-shortcut', ), + 'a9b946f8' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-history', + ), 'a9f88de2' => array( 'javelin-behavior', 'javelin-dom', @@ -2065,6 +2061,15 @@ return array( 'javelin-dom', 'phabricator-draggable-list', ), + 'e31fad01' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-mask', + 'javelin-util', + 'phuix-icon-view', + 'phabricator-busy', + ), 'e379b58e' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/resources/sql/autopatches/20180222.log.01.filephid.sql b/resources/sql/autopatches/20180222.log.01.filephid.sql new file mode 100644 index 0000000000..a7ef2f2b3e --- /dev/null +++ b/resources/sql/autopatches/20180222.log.01.filephid.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog + ADD filePHID VARBINARY(64); diff --git a/resources/sql/autopatches/20180223.log.01.bytelength.sql b/resources/sql/autopatches/20180223.log.01.bytelength.sql new file mode 100644 index 0000000000..a4c3505628 --- /dev/null +++ b/resources/sql/autopatches/20180223.log.01.bytelength.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog + ADD byteLength BIGINT UNSIGNED NOT NULL; diff --git a/resources/sql/autopatches/20180223.log.02.chunkformat.sql b/resources/sql/autopatches/20180223.log.02.chunkformat.sql new file mode 100644 index 0000000000..a15676a952 --- /dev/null +++ b/resources/sql/autopatches/20180223.log.02.chunkformat.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog + ADD chunkFormat VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT}; diff --git a/resources/sql/autopatches/20180223.log.03.chunkdefault.sql b/resources/sql/autopatches/20180223.log.03.chunkdefault.sql new file mode 100644 index 0000000000..2a1f2c812b --- /dev/null +++ b/resources/sql/autopatches/20180223.log.03.chunkdefault.sql @@ -0,0 +1,2 @@ +UPDATE {$NAMESPACE}_harbormaster.harbormaster_buildlog + SET chunkFormat = 'text' WHERE chunkFormat = ''; diff --git a/resources/sql/autopatches/20180223.log.04.linemap.sql b/resources/sql/autopatches/20180223.log.04.linemap.sql new file mode 100644 index 0000000000..75ed27cf7c --- /dev/null +++ b/resources/sql/autopatches/20180223.log.04.linemap.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlog + ADD lineMap LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT}; diff --git a/resources/sql/autopatches/20180223.log.05.linemapdefault.sql b/resources/sql/autopatches/20180223.log.05.linemapdefault.sql new file mode 100644 index 0000000000..59b4dc9a62 --- /dev/null +++ b/resources/sql/autopatches/20180223.log.05.linemapdefault.sql @@ -0,0 +1,2 @@ +UPDATE {$NAMESPACE}_harbormaster.harbormaster_buildlog + SET lineMap = '[]' WHERE lineMap = ''; diff --git a/resources/sql/autopatches/20180228.log.01.offset.sql b/resources/sql/autopatches/20180228.log.01.offset.sql new file mode 100644 index 0000000000..db20fc292e --- /dev/null +++ b/resources/sql/autopatches/20180228.log.01.offset.sql @@ -0,0 +1,5 @@ +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlogchunk + ADD headOffset BIGINT UNSIGNED NOT NULL; + +ALTER TABLE {$NAMESPACE}_harbormaster.harbormaster_buildlogchunk + ADD tailOffset BIGINT UNSIGNED NOT NULL; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4455ad139a..bb08685634 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -652,10 +652,12 @@ phutil_register_library_map(array( 'DiffusionCommitAuditorsHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuditorsHeraldField.php', 'DiffusionCommitAuditorsTransaction' => 'applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php', 'DiffusionCommitAuthorHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorHeraldField.php', + 'DiffusionCommitAuthorProjectsHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorProjectsHeraldField.php', 'DiffusionCommitAutocloseHeraldField' => 'applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php', 'DiffusionCommitBranchesController' => 'applications/diffusion/controller/DiffusionCommitBranchesController.php', 'DiffusionCommitBranchesHeraldField' => 'applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php', 'DiffusionCommitCommitterHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterHeraldField.php', + 'DiffusionCommitCommitterProjectsHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php', 'DiffusionCommitConcernTransaction' => 'applications/diffusion/xaction/DiffusionCommitConcernTransaction.php', 'DiffusionCommitController' => 'applications/diffusion/controller/DiffusionCommitController.php', 'DiffusionCommitDiffContentAddedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php', @@ -801,9 +803,11 @@ phutil_register_library_map(array( 'DiffusionPhpExternalSymbolsSource' => 'applications/diffusion/symbol/DiffusionPhpExternalSymbolsSource.php', 'DiffusionPreCommitContentAffectedFilesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php', 'DiffusionPreCommitContentAuthorHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorHeraldField.php', + 'DiffusionPreCommitContentAuthorProjectsHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorProjectsHeraldField.php', 'DiffusionPreCommitContentAuthorRawHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorRawHeraldField.php', 'DiffusionPreCommitContentBranchesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentBranchesHeraldField.php', 'DiffusionPreCommitContentCommitterHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterHeraldField.php', + 'DiffusionPreCommitContentCommitterProjectsHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterProjectsHeraldField.php', 'DiffusionPreCommitContentCommitterRawHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterRawHeraldField.php', 'DiffusionPreCommitContentDiffContentAddedHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php', 'DiffusionPreCommitContentDiffContentHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentDiffContentHeraldField.php', @@ -1227,8 +1231,15 @@ phutil_register_library_map(array( 'HarbormasterBuildLog' => 'applications/harbormaster/storage/build/HarbormasterBuildLog.php', 'HarbormasterBuildLogChunk' => 'applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php', 'HarbormasterBuildLogChunkIterator' => 'applications/harbormaster/storage/build/HarbormasterBuildLogChunkIterator.php', + 'HarbormasterBuildLogDownloadController' => 'applications/harbormaster/controller/HarbormasterBuildLogDownloadController.php', 'HarbormasterBuildLogPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildLogPHIDType.php', 'HarbormasterBuildLogQuery' => 'applications/harbormaster/query/HarbormasterBuildLogQuery.php', + 'HarbormasterBuildLogRenderController' => 'applications/harbormaster/controller/HarbormasterBuildLogRenderController.php', + 'HarbormasterBuildLogSearchConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildLogSearchConduitAPIMethod.php', + 'HarbormasterBuildLogSearchEngine' => 'applications/harbormaster/query/HarbormasterBuildLogSearchEngine.php', + 'HarbormasterBuildLogTestCase' => 'applications/harbormaster/__tests__/HarbormasterBuildLogTestCase.php', + 'HarbormasterBuildLogView' => 'applications/harbormaster/view/HarbormasterBuildLogView.php', + 'HarbormasterBuildLogViewController' => 'applications/harbormaster/controller/HarbormasterBuildLogViewController.php', 'HarbormasterBuildMessage' => 'applications/harbormaster/storage/HarbormasterBuildMessage.php', 'HarbormasterBuildMessageQuery' => 'applications/harbormaster/query/HarbormasterBuildMessageQuery.php', 'HarbormasterBuildPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildPHIDType.php', @@ -1306,11 +1317,14 @@ phutil_register_library_map(array( 'HarbormasterLeaseWorkingCopyBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php', 'HarbormasterLintMessagesController' => 'applications/harbormaster/controller/HarbormasterLintMessagesController.php', 'HarbormasterLintPropertyView' => 'applications/harbormaster/view/HarbormasterLintPropertyView.php', + 'HarbormasterLogWorker' => 'applications/harbormaster/worker/HarbormasterLogWorker.php', 'HarbormasterManagementArchiveLogsWorkflow' => 'applications/harbormaster/management/HarbormasterManagementArchiveLogsWorkflow.php', 'HarbormasterManagementBuildWorkflow' => 'applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php', + 'HarbormasterManagementRebuildLogWorkflow' => 'applications/harbormaster/management/HarbormasterManagementRebuildLogWorkflow.php', 'HarbormasterManagementRestartWorkflow' => 'applications/harbormaster/management/HarbormasterManagementRestartWorkflow.php', 'HarbormasterManagementUpdateWorkflow' => 'applications/harbormaster/management/HarbormasterManagementUpdateWorkflow.php', 'HarbormasterManagementWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWorkflow.php', + 'HarbormasterManagementWriteLogWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWriteLogWorkflow.php', 'HarbormasterMessageType' => 'applications/harbormaster/engine/HarbormasterMessageType.php', 'HarbormasterObject' => 'applications/harbormaster/storage/HarbormasterObject.php', 'HarbormasterOtherBuildStepGroup' => 'applications/harbormaster/stepgroup/HarbormasterOtherBuildStepGroup.php', @@ -3030,7 +3044,6 @@ phutil_register_library_map(array( 'PhabricatorFilesApplicationStorageEnginePanel' => 'applications/files/applicationpanel/PhabricatorFilesApplicationStorageEnginePanel.php', 'PhabricatorFilesBuiltinFile' => 'applications/files/builtin/PhabricatorFilesBuiltinFile.php', 'PhabricatorFilesComposeAvatarBuiltinFile' => 'applications/files/builtin/PhabricatorFilesComposeAvatarBuiltinFile.php', - 'PhabricatorFilesComposeAvatarExample' => 'applications/uiexample/examples/PhabricatorFilesComposeAvatarExample.php', 'PhabricatorFilesComposeIconBuiltinFile' => 'applications/files/builtin/PhabricatorFilesComposeIconBuiltinFile.php', 'PhabricatorFilesConfigOptions' => 'applications/files/config/PhabricatorFilesConfigOptions.php', 'PhabricatorFilesManagementCatWorkflow' => 'applications/files/management/PhabricatorFilesManagementCatWorkflow.php', @@ -5859,10 +5872,12 @@ phutil_register_library_map(array( 'DiffusionCommitAuditorsHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitAuditorsTransaction' => 'DiffusionCommitTransactionType', 'DiffusionCommitAuthorHeraldField' => 'DiffusionCommitHeraldField', + 'DiffusionCommitAuthorProjectsHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitAutocloseHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitBranchesController' => 'DiffusionController', 'DiffusionCommitBranchesHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitCommitterHeraldField' => 'DiffusionCommitHeraldField', + 'DiffusionCommitCommitterProjectsHeraldField' => 'DiffusionCommitHeraldField', 'DiffusionCommitConcernTransaction' => 'DiffusionCommitAuditTransaction', 'DiffusionCommitController' => 'DiffusionController', 'DiffusionCommitDiffContentAddedHeraldField' => 'DiffusionCommitHeraldField', @@ -6011,9 +6026,11 @@ phutil_register_library_map(array( 'DiffusionPhpExternalSymbolsSource' => 'DiffusionExternalSymbolsSource', 'DiffusionPreCommitContentAffectedFilesHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentAuthorHeraldField' => 'DiffusionPreCommitContentHeraldField', + 'DiffusionPreCommitContentAuthorProjectsHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentAuthorRawHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentBranchesHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentCommitterHeraldField' => 'DiffusionPreCommitContentHeraldField', + 'DiffusionPreCommitContentCommitterProjectsHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentCommitterRawHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentDiffContentAddedHeraldField' => 'DiffusionPreCommitContentHeraldField', 'DiffusionPreCommitContentDiffContentHeraldField' => 'DiffusionPreCommitContentHeraldField', @@ -6505,11 +6522,20 @@ phutil_register_library_map(array( 'HarbormasterBuildLog' => array( 'HarbormasterDAO', 'PhabricatorPolicyInterface', + 'PhabricatorDestructibleInterface', + 'PhabricatorConduitResultInterface', ), 'HarbormasterBuildLogChunk' => 'HarbormasterDAO', 'HarbormasterBuildLogChunkIterator' => 'PhutilBufferedIterator', + 'HarbormasterBuildLogDownloadController' => 'HarbormasterController', 'HarbormasterBuildLogPHIDType' => 'PhabricatorPHIDType', 'HarbormasterBuildLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'HarbormasterBuildLogRenderController' => 'HarbormasterController', + 'HarbormasterBuildLogSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', + 'HarbormasterBuildLogSearchEngine' => 'PhabricatorApplicationSearchEngine', + 'HarbormasterBuildLogTestCase' => 'PhabricatorTestCase', + 'HarbormasterBuildLogView' => 'AphrontView', + 'HarbormasterBuildLogViewController' => 'HarbormasterController', 'HarbormasterBuildMessage' => array( 'HarbormasterDAO', 'PhabricatorPolicyInterface', @@ -6609,11 +6635,14 @@ phutil_register_library_map(array( 'HarbormasterLeaseWorkingCopyBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterLintMessagesController' => 'HarbormasterController', 'HarbormasterLintPropertyView' => 'AphrontView', + 'HarbormasterLogWorker' => 'HarbormasterWorker', 'HarbormasterManagementArchiveLogsWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementBuildWorkflow' => 'HarbormasterManagementWorkflow', + 'HarbormasterManagementRebuildLogWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementRestartWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementUpdateWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow', + 'HarbormasterManagementWriteLogWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterMessageType' => 'Phobject', 'HarbormasterObject' => 'HarbormasterDAO', 'HarbormasterOtherBuildStepGroup' => 'HarbormasterBuildStepGroup', @@ -8598,7 +8627,6 @@ phutil_register_library_map(array( 'PhabricatorFilesApplicationStorageEnginePanel' => 'PhabricatorApplicationConfigurationPanel', 'PhabricatorFilesBuiltinFile' => 'Phobject', 'PhabricatorFilesComposeAvatarBuiltinFile' => 'PhabricatorFilesBuiltinFile', - 'PhabricatorFilesComposeAvatarExample' => 'PhabricatorUIExample', 'PhabricatorFilesComposeIconBuiltinFile' => 'PhabricatorFilesBuiltinFile', 'PhabricatorFilesConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorFilesManagementCatWorkflow' => 'PhabricatorFilesManagementWorkflow', diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php index 9d806a851d..c1dc0d1305 100644 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -49,6 +49,54 @@ final class AphrontRequest extends Phobject { return idx($this->uriData, $key, $default); } + /** + * Read line range parameter data from the request. + * + * Applications like Paste, Diffusion, and Harbormaster use "$12-14" in the + * URI to allow users to link to particular lines. + * + * @param string URI data key to pull line range information from. + * @param int|null Maximum length of the range. + * @return null|pair Null, or beginning and end of the range. + */ + public function getURILineRange($key, $limit) { + $range = $this->getURIData($key); + if (!strlen($range)) { + return null; + } + + $range = explode('-', $range, 2); + + foreach ($range as $key => $value) { + $value = (int)$value; + if (!$value) { + // If either value is "0", discard the range. + return null; + } + $range[$key] = $value; + } + + // If the range is like "$10", treat it like "$10-10". + if (count($range) == 1) { + $range[] = head($range); + } + + // If the range is "$7-5", treat it like "$5-7". + if ($range[1] < $range[0]) { + $range = array_reverse($range); + } + + // If the user specified something like "$1-999999999" and we have a limit, + // clamp it to a more reasonable range. + if ($limit !== null) { + if ($range[1] - $range[0] > $limit) { + $range[1] = $range[0] + $limit; + } + } + + return $range; + } + public function setApplicationConfiguration( $application_configuration) { $this->applicationConfiguration = $application_configuration; diff --git a/src/aphront/response/AphrontRedirectResponse.php b/src/aphront/response/AphrontRedirectResponse.php index 5b4b009796..390ad193c9 100644 --- a/src/aphront/response/AphrontRedirectResponse.php +++ b/src/aphront/response/AphrontRedirectResponse.php @@ -8,6 +8,7 @@ class AphrontRedirectResponse extends AphrontResponse { private $uri; private $stackWhenCreated; private $isExternal; + private $closeDialogBeforeRedirect; public function setIsExternal($external) { $this->isExternal = $external; @@ -37,6 +38,15 @@ class AphrontRedirectResponse extends AphrontResponse { return PhabricatorEnv::getEnvConfig('debug.stop-on-redirect'); } + public function setCloseDialogBeforeRedirect($close) { + $this->closeDialogBeforeRedirect = $close; + return $this; + } + + public function getCloseDialogBeforeRedirect() { + return $this->closeDialogBeforeRedirect; + } + public function getHeaders() { $headers = array(); if (!$this->shouldStopForDebugging()) { diff --git a/src/aphront/response/AphrontResponse.php b/src/aphront/response/AphrontResponse.php index 6c52e417e3..892417fcb1 100644 --- a/src/aphront/response/AphrontResponse.php +++ b/src/aphront/response/AphrontResponse.php @@ -7,9 +7,11 @@ abstract class AphrontResponse extends Phobject { private $canCDN; private $responseCode = 200; private $lastModified = null; - + private $contentSecurityPolicyURIs; + private $disableContentSecurityPolicy; protected $frameable; + public function setRequest($request) { $this->request = $request; return $this; @@ -19,6 +21,33 @@ abstract class AphrontResponse extends Phobject { return $this->request; } + final public function addContentSecurityPolicyURI($kind, $uri) { + if ($this->contentSecurityPolicyURIs === null) { + $this->contentSecurityPolicyURIs = array( + 'script-src' => array(), + 'connect-src' => array(), + 'frame-src' => array(), + 'form-action' => array(), + ); + } + + if (!isset($this->contentSecurityPolicyURIs[$kind])) { + throw new Exception( + pht( + 'Unknown Content-Security-Policy URI kind "%s".', + $kind)); + } + + $this->contentSecurityPolicyURIs[$kind][] = (string)$uri; + + return $this; + } + + final public function setDisableContentSecurityPolicy($disable) { + $this->disableContentSecurityPolicy = $disable; + return $this; + } + /* -( Content )------------------------------------------------------------ */ @@ -59,9 +88,128 @@ abstract class AphrontResponse extends Phobject { ); } + $csp = $this->newContentSecurityPolicyHeader(); + if ($csp !== null) { + $headers[] = array('Content-Security-Policy', $csp); + } + + $headers[] = array('Referrer-Policy', 'no-referrer'); + return $headers; } + private function newContentSecurityPolicyHeader() { + if ($this->disableContentSecurityPolicy) { + return null; + } + + $csp = array(); + + $cdn = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); + if ($cdn) { + $default = $this->newContentSecurityPolicySource($cdn); + } else { + // If an alternate file domain is not configured and the user is viewing + // a Phame blog on a custom domain or some other custom site, we'll still + // serve resources from the main site. Include the main site explicitly. + + $base_uri = PhabricatorEnv::getURI('/'); + $base_uri = $this->newContentSecurityPolicySource($base_uri); + + $default = "'self' {$base_uri}"; + } + + $csp[] = "default-src {$default}"; + + // We use "data:" URIs to inline small images into CSS. This policy allows + // "data:" URIs to be used anywhere, but there doesn't appear to be a way + // to say that "data:" URIs are okay in CSS files but not in the document. + $csp[] = "img-src {$default} data:"; + + // We use inline style="..." attributes in various places, many of which + // are legitimate. We also currently use a