1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-10-18 22:58:49 +02:00
Commit graph

17057 commits

Author SHA1 Message Date
epriestley
7fd8263185 Remove product literal strings in "pht()", part 22
Summary: Ref T13658.

Test Plan: Static checks only.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21788
2022-04-25 16:46:26 -07:00
epriestley
b1079b79e5 Remove product literal strings in "pht()", part 21
Summary: Ref T13658.

Test Plan: Static checks only.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21787
2022-04-25 16:46:26 -07:00
epriestley
07723b4627 Remove product literal strings in "pht()", part 20
Summary: Ref T13658.

Test Plan: Static checks only.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21786
2022-04-25 16:46:25 -07:00
epriestley
2f4ac2a804 Remove product literal strings in "pht()", part 19
Summary: Ref T13658.

Test Plan: Static checks only.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21785
2022-04-25 16:46:25 -07:00
epriestley
2f95330c5a Remove product literal strings in "pht()", part 18
Summary: Ref T13658.

Test Plan: Static checks only.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21784
2022-04-25 16:46:25 -07:00
epriestley
55770a2ca8 Remove product literal strings in "pht()", part 17
Summary: Ref T13658.

Test Plan:
This is non-exhaustive.

  - Viewed "diffusion.looksoon" Conduit API method page.
  - Viewed config settings.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21783
2022-04-25 16:46:25 -07:00
epriestley
9df1bbd31d Remove product literal strings in "pht()", part 16
Summary: Ref T13658.

Test Plan:
This plan is non-exhaustive.

  - Looked at config options.
  - Ran `bin/phd`.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21782
2022-04-25 16:46:25 -07:00
epriestley
ce1972bfae Remove product literal strings in "pht()", part 15
Summary: Ref T13658.

Test Plan: Static checks only, these are all reachable only by breaking your install in weird ways.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21781
2022-04-25 16:46:24 -07:00
epriestley
67e580be65 Remove product literal strings in "pht()", part 14
Summary: Ref T13658.

Test Plan: Static checks only, these are mostly obscure or require breaking the install in unusual ways.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21780
2022-04-25 16:46:24 -07:00
epriestley
0eddc1a62c Remove product literal strings in "pht()", part 13
Summary: Ref T13658.

Test Plan:
This is non-exhaustive.

  - Started a JIRA auth provider creation workflow.
  - Same for LDAP.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21779
2022-04-25 16:46:24 -07:00
epriestley
4d70e9d400 Remove product literal strings in "pht()", part 12
Summary: Ref T13658.

Test Plan:
This is non-exhuastive.

  - Poked around "Auth": edited a provider, toggled a provider.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21778
2022-04-25 16:46:24 -07:00
epriestley
039cbec155 Remove product literal strings in "pht()", part 11
Summary: Ref T13658.

Test Plan: Static checks only, none of these looked easily reachable.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21777
2022-04-25 16:46:24 -07:00
epriestley
adcc063242 Fix a PHP 8.1 string strictness issue in repositories
Summary: Ref T13588. This is a little too strict, as `$line` may be an integer.

Test Plan: Will deploy

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21775
2022-04-25 12:30:45 -07:00
epriestley
297c0bbfcf Remove product literal strings in "pht()", part 10
Summary: Ref T13658. This one is a little silly since I used `split` to divide the list of files up, and only ended up with one file in the last partition.

Test Plan: Viewed Phabricator.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21774
2022-04-25 12:22:30 -07:00
epriestley
57469db22e Remove product literal strings in "pht()", part 9
Summary: Ref T13658.

Test Plan:
This test plan is non-exhaustive.

  - Ran `bin/storage databases`.
  - Viewed Badges UI exmaples page.
  - Used eval rule for `strings.platform.server.name`, got "Phabricator".

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21773
2022-04-25 12:22:29 -07:00
epriestley
4d3f0dc7c7 Remove product literal strings in "pht()", part 8
Summary: Ref T13658.

Test Plan:
This test plan is non-exhaustive.

  - Viewed "remarkup.process" Conduit method API page.
  - Viewed URIs in a Diffusion repository.
  - Viewed editor protocol configuration in Settings.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21772
2022-04-25 12:22:29 -07:00
epriestley
67795a46eb Remove product literal strings in "pht()", part 7
Summary: Ref T13658.

Test Plan: None of these strings look trivially testable, just relied on static tools.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21771
2022-04-25 12:22:28 -07:00
epriestley
b3557796fe Remove product literal strings in "pht()", part 6
Summary: Ref T13658.

Test Plan:
This test plan is non-exhaustive.

  - Ran `bin/mail`.
  - Uninstalled and reinstalled an application.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21770
2022-04-25 12:22:28 -07:00
epriestley
ad880491e8 Remove product literal strings in "pht()", part 5
Summary: Ref T13658

Test Plan:
This test plan is non-exhaustive.

  - Looked at some of the config.
  - Looked at guides.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21769
2022-04-25 12:22:27 -07:00
epriestley
d69da878d2 Remove product literal strings in "pht()", part 4
Summary: Ref T13658.

Test Plan:
This is non-exhaustive.

  - Looked at some (most?) of the config values in Config.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21768
2022-04-25 12:22:27 -07:00
epriestley
b1b3fe0ff0 Remove product literal strings in "pht()", part 3
Summary: Ref T13658.

Test Plan:
This is non-exhaustive.

  - Ran all setup checks.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21767
2022-04-25 12:22:26 -07:00
epriestley
b8b392481f Remove product literal strings in "pht()", part 2
Summary: Ref T13658.

Test Plan:
This test plan is non-exhaustive.

  - Used Auth to start an "another copy of Phabricator" OAuth server workflow.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21766
2022-04-25 12:22:26 -07:00
epriestley
3e82ab5adb Remove product literal strings in "pht()", part 1
Summary: Ref T13658. I used the linter in D21763 to identify these and `split` them into arbitrary groups of 10 files.

Test Plan:
This test plan is non-exhaustive, because some of these strings are difficult to reach.

  - Looked at "Create Service" in Almanac.
  - Used "bin/auth" to go through a one-time auth workflow (not all related strings can be hit on a single workflow).
  - Started the "Generate Keypair" worfklow in "SSH Public Keys".

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21765
2022-04-25 12:22:25 -07:00
epriestley
de980cc54e Fix an issue where Herald may fail to extract content from an empty commit
Summary:
Ref T13667. The Herald "content added" rule (and other similar rules) do not correctly extract content from empty commits.

When we load an empty raw diff, return an empty changed content map.

Ref T13588. Also fix some PHP8.1 null/string stuff

Test Plan:
  - Ran "bin/repository reparse --publish <commit>", with an empty commit hash and a nonempty commit hash.
  - Reviewed Herald transcripts for general sanity.

Maniphest Tasks: T13667, T13588

Differential Revision: https://secure.phabricator.com/D21761
2022-04-20 13:04:00 -07:00
epriestley
2188473fa7 Fix an issue where we may "min()" an empty array when viewing a revision with no changesets
Summary:
Ref T13667. When a revision's diff has no changesets (usually because Diffusion performed an automatic update with an empty commit), the UI currently tries to "min()" an empty array and fatals.

Handle this case properly.

Test Plan:
  - Created a revision with a diff with no changesets ("git commit --allow-empty" + copy-paste into web UI).
  - Viewed revision.
    - Before: "min()" fatal.
    - After: UI isn't perfect, but works without fataling.

Subscribers: cspeckmim

Maniphest Tasks: T13667

Differential Revision: https://secure.phabricator.com/D21760
2022-04-20 13:03:59 -07:00
epriestley
52df4ff515 Fix an issue where "git" may be unable to read a temporary file in Diffusion
Summary:
Ref T13673. After the changes in that task, we may execute "git config -l ..." as a user other than the user we used to write this temporary file.

Use "--file -" to pass the data instead, avoiding use of temporary files. This makes us agnostic to filesystem permissions.

Test Plan: Viewed a Git repository with submodules in Diffusion with "ssh.user" configured as a user relatively isolated from the webserver user.

Maniphest Tasks: T13673

Differential Revision: https://secure.phabricator.com/D21759
2022-04-20 13:03:59 -07:00
epriestley
21b1a304b6 Improve some PHP 8.1 behavior in "bin/auth recover"
Summary: Ref T13588. Fix a couple of argument parsing issues here.

Test Plan: Ran "bin/auth recover" under PHP 8.1.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21757
2022-04-19 14:55:19 -07:00
epriestley
3125d7a5f4 In Git, always "sudo" to the daemon user if a daemon user is configured
Summary:
See T13673. Recent versions of Git (and older versions with backported security patches) now refuse to run Git commands if the top-level repository directory is not owned by the user running the command.

Currently, we "sudo" to that user only when performing writes, so upgrading Git can aggressively break a Phabricator system by knocking out essentially all Diffusion/Conduit read pathways.

As an immediate mitigation, just "sudo" in all cases where a daemon user is available. This fixes the problem, and seems like the least-bad approach. The downside is that the web user may theoretically have fewer privileges than the daemon user and this could reduce the number of layers an attacker armed with some other Git vulnerability might have to get through to do something dangerous (e.g., perform a write on a pathway where only reads are expected), but any separation between the web and daemon accounts is essentially theoretical and has never been enforced.

Test Plan: Applied patch to impacted Phacility shard, saw Diffusion work properly again.

Differential Revision: https://secure.phabricator.com/D21756
2022-04-13 11:23:55 -07:00
epriestley
4dae3e7e1f Improve some UI/language for Phame posts when viewer doesn't have CAN_INTERACT
Summary: Ref T13661. Fix up some UI and language so it's more clear that this is about disabling blog comments.

Test Plan: Viewed UIs, saw some more usable strings.

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21755
2022-04-01 12:52:58 -07:00
epriestley
aae23f0204 Give Phame blog posts configurable interact policies, with a default policy of "Same as Blog"
Summary: Ref T13661. This allows posts to have comments disabled (or restricted) on a per-post basis, and makes them inherit the containing blog policy by default.

Test Plan: Locked a post by editing its policy explicitly; locked a post by editing the containing blog policy.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21754
2022-04-01 12:52:58 -07:00
epriestley
f555fbcb50 Remove unused "MARKUP_FIELD_SUMMARY" for Phame posts
Summary: Ref T13661. This ancient "RemarkupInterface" constant has no references.

Test Plan: Grepped for references, found none. Viewed a blog, viewed a post.

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21753
2022-04-01 12:52:57 -07:00
epriestley
a9822a37aa Fix a PHP 8.1 unit test failure in Projects
Summary: Ref T13588. This field may be "null" (and is probably never the empty string, but that's a more ambitious fix).

Test Plan: Ran unit tests, got a pass.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21752
2022-04-01 12:52:57 -07:00
epriestley
c25595417f Give Phame blogs mutable interact policies
Summary:
Ref T13661.

I'm fairly sure these policies don't actually do anything (you can't "interact" with a blog) but the primarily support a Phame Post object policy of "Same as Parent Blog", which is the "natural" interact policy for a post.

Most of this is infrastructure support for mutable interact policies: today, only Maniphest has interact mutability and only via indirect effects (locking tasks), not through a directly mutable "Can Interact" policy.

Test Plan:
Ran storage upgrade, edited interact policy of a blog, saw appropriate persistence and transactions.

Created and edited a task to make sure there's no weird fallout from increasing what can be done with interact policies.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21751
2022-04-01 12:52:56 -07:00
epriestley
5ce7f803f9 Fix double-bordered breadcrumbs in Phame blogs
Summary: Ref T13661. The Phame blog main page has a double breadcrumb border in non-live mode.

Test Plan: Viewed a blog page in internal and live modes, saw single border in both cases (previously: double border for internal mode).

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21750
2022-04-01 12:52:56 -07:00
epriestley
6c2c80a373 Remove ancient Remarkup constants from Phame and Maniphest
Summary: Ref T13661. These constants are no longer used.

Test Plan:
For a blog with a nonempty description, viewed the "Manage" page and the home page; saw properly rendered description.

Grepped for removed constants, no hits.

Maniphest Tasks: T13661

Differential Revision: https://secure.phabricator.com/D21749
2022-04-01 12:52:55 -07:00
epriestley
28b12fb3cd Make Phame blog policies non-nullable
Summary: Ref T6203. Ref T13661. These policies are incorrectly nullable, although it's likely that no pathway exists in the application to write NULL into them. Fix the schema.

Test Plan: Ran `bin/storage upgrade`.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13661, T6203

Differential Revision: https://secure.phabricator.com/D21748
2022-04-01 12:52:55 -07:00
epriestley
dec95228a2 Add a "--database <name> ..." flag to "bin/storage dump"
Summary: Ref T13671. Allow "bin/storage dump" to dump a subset of databases, primarily to support merging previously-partitioned databases.

Test Plan: Ran `bin/storage dump` with and without `--database ...` flags. Ran `--database invalid`, `--database a --database a` to hit error cases.

Maniphest Tasks: T13671

Differential Revision: https://secure.phabricator.com/D21745
2021-12-18 11:11:09 -08:00
epriestley
6136964093 Fix a PHP 8.1 strlen() issue with "mysql.pass" configuration
Summary:
Ref T13588. This configuration value may not be set.

Also fix an issue in `bin/storage` and whatever else I hit between now and this diff actually uploading.

Also fix a MySQLi report mode difference, beginning in PHP 8.1.

Also update a bunch of "static" property usage in Lisk.

Test Plan: Ran `bin/files ...` locally under PHP 8.1.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21744
2021-12-16 15:24:21 -08:00
epriestley
dc705cea7f Document Mailgun as discouraged, and update Postmark remote address blocks
Summary:
Ref T13669. See that task for discussion. Based on a disheartening interaction in June 2020, discourage use of Mailgun.

Also update the default Postmark inbound address list, since they've added a new address.

Test Plan: Read documentation, grepped for "mailgun".

Maniphest Tasks: T13669

Differential Revision: https://secure.phabricator.com/D21738
2021-12-02 14:56:36 -08:00
epriestley
8103d36177 Remove "bin/celerity" dependency on database setup
Summary: Ref PHI2157. Like other low-level tools, "bin/celerity" does not need databases configured in order to execute.

Test Plan: Ran `bin/celerity map` with and without the database available.

Differential Revision: https://secure.phabricator.com/D21730
2021-11-19 10:11:06 -08:00
epriestley
c7b04170fe Provide missing "AlmanacInterfaceTransactionQuery"
Summary:
Ref PHI2149. This provides the trivial Query class required for the daemons to publish Almanac Interface transactions.

(Publishing these doesn't do anything interesting, but currently leaves an error in the daemon logs.)

Test Plan:
  - Stopped the daemons.
  - Edited the port of an Interface in Almanac.
  - Ran `bin/worker execute --active --class PhabricatorApplicationTransactionPublishWorker` to publish the transaction.
    - Before: fatal on missing class, "Unable to load query for transaction object...".
    - After: transaction publishes cleanly.

Differential Revision: https://secure.phabricator.com/D21726
2021-11-16 11:48:25 -08:00
epriestley
b9ba0418ed Correct a parameter order swap in "diffusion.historyquery" for Mercurial
Summary: Ref T13666. See T13666#256253. The order of these parameters is incorrect (introduced in D18817, which was trying to turn the revset "A or B" into "B or A"), but when "commit" is the single head of "branch" (which is common), the revset is functionally equivalent.

Test Plan:
An easy reproduction case is to make a "diffusion.historyquery" call manually against a Mercurial repository, with a valid "branch" name and some non-head "commit".

  - Before patch, queried "head^" (by commit hash, not by symbol) of "default" and got "head" too (wrong).
  - Applied patch to `secure001.phacility.net` (my local `hg` web environment is iffy right now).
  - Re-ran the same query, saw "head^" as the first result rather than "head" (all hashes rather than symbols, as above), which is desired.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21722
2021-09-04 18:16:32 -07:00
Christopher Speck
3b2868e155 Fix searching legalpad documents by contributors
Summary:
Found in a change submitted to Phorge (https://we.phorge.it/D25018#inline-231), this fixes a typo in populating search the `contributorPHIDs` constraint in the Legalpad search engine.

Currently when trying to search legalpad documents by contributor an error is encountered:
```lang=console
Array for %Ls conversion is empty. Query: contributor.dst IN (%Ls)
```

Test Plan: I searched for legalpad documents based on a contributor and got back correct results.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D21719
2021-09-04 20:37:29 -04:00
Christopher Speck
09c3c7d879 Add support to marking commits as UNREACHABLE for Mercurial
Summary:
When previously known commits have been destroyed in a Mercurial repository, Phabricator does not end up marking the commits as unreachable. This results in daemon tasks which continuously fail and retry.

This updates `PhabricatorRepositoryDiscoveryEngine` and `PhabricatorManagementRepositoryMarkReachableWorkflow` to include support of marking commits as unreachable for Mercurial repositories.

The `PhabricatorMercurialGraphStream` also needed updated to support a stream with no starting commit.

Refs T13634

Test Plan:
1. I set up a hosted Mercurial repository.
2. I removed the head commit from the on-disk repository state.
3. I attempted to load the repository page and saw an exception due to a missing commit.
4. I went to `/manage` for the repository and scheduled an update of the repository.
5. After an updated performed, I went to the repository main page and saw there was no exception and the history view properly did not have the commit I had removed.
6. I checked the phd logs and verified there were no exceptions related to the repository.
7. I ran the `./bin/repository mark-reachable` command on the Mercurial repository and it reported that it marked the commit as unreachable.
8. I pushed the same commit back upstream and verified that the commit was found and displayed in the history view of the repository page and `mark-unreachable` did not identify it as being unreachable.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13634

Differential Revision: https://secure.phabricator.com/D21715
2021-09-04 19:05:08 -04:00
Christopher Speck
458ad4a861 Remove history query from DiffusionRepositoryController as it is unused
Summary:
The history query for the repository page isn't actually used to display any content. It looks like it was previously used to display the last user which modified a file however this looks to be removed in D21404. This removes the history query from happening as well as updates `DiffusionBrowseTableView` to remove the parameters for passing this information in, resulting in also updating `DiffusionBrowseController` to no longer need to put this information together.

Refs T13666

Test Plan:
1. I removed commits from a repository on the local state.
2. I navigated to the repository's landing page and saw that the landing page attempted to render content and only failed to load the browse files section.
3. I navigated to the history tab and verified that it showed an exception about failing to query commit information.
4. I restored the repository working state to function properly.
5. I navigated to a repository's landing page and verified it loaded properly, including showing the last modified date for each file.
6. I navigated to the Code, Branches, Tags, and History tabs to verify each tab page loaded properly.
7. I verified on the Code tab that the last modified date for each file displayed properly.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21717
2021-09-04 18:50:46 -04:00
epriestley
b757e5c302 Use "MethodCallFuture" to move Diffusion Conduit exceptions to resolution time
Summary:
Depends on D21720. Ref T13666. See D21720 for additional discussion.

Use "MethodCallFuture", introduced in D21720, so that exceptions raised in "execute()" are thrown when the future is resolved, not when the future is created.

This makes exception behavior for clustered and non-clustered setups consistent, and chooses the intended (clustered) behavior in both cases, which currently deals with errors better.

Test Plan:
  - Applied both parts of the patch in T13666 (break history queries, force immediate futures) to reproduce the issue in T13666.
    - Loaded a Diffusion landing page, reproduced the error described in that task.
  - Applied this patch, verified landing page works again.
  - Removed the "break history queries" change, verified landing page works in forced-immediate mode.
  - Removed the "force immediate" change, verified landing page works in "actual future" mode.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21721
2021-09-04 14:36:41 -07:00
Dmitri Iouchtchenko
1965b78b34 Fix subtype extension support check
Summary: Fixes T13663. `supportsSubtypes` tries to create an editable object, but this isn't always valid for `PhabricatorCalendarImport`. Use `instanceof` instead.

Test Plan:
  - Edited calendar import, tasks (2 different subtypes), and projects (2 different subtypes).
  - Changed task subtypes using {nav Change Subtype} action and batch editor.
  - Changed task and project subtypes using Conduit.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T13663

Differential Revision: https://secure.phabricator.com/D21714
2021-08-20 18:49:35 -04:00
epriestley
8daaf5ef21 Pass a real context object to Phriction previews, fixing mentions
Summary:
Fixes T13662. Phriction currently passes a map as a "context object", but this code is ancient and predates the modern meaning of a "context object". In modern code, context objects should be real objects.

Provide a real object as a context object. We do this by either loading the actual document or constructing a synthetic version of it.

Test Plan:
  - Edited an existing document, observing the preview:
    - Used a mention rule, saw a preview.
    - Used `[[ a ]]` and `[[ ./a ]]` absolute and relative reference rules, saw accurate previews.
  - Edited a new document, observing the preview:
    - Used a mention rule, saw a preview.
    - Used absolute/relative references, saw accurate previews.
  - Grepped for other references to the removed properties (`phriction.isPreview` and `phriction.slug`), found none remaining.

Reviewers: 0

Reviewed By: 0

Maniphest Tasks: T13662

Differential Revision: https://secure.phabricator.com/D21709
2021-08-02 08:36:15 -07:00
epriestley
c7550dbee9 Fix Phriction document previews for the root document ("/") with Apache option "MergeSlashes On"
Summary:
Ref T13662. I ran into this while trying to reproduce the mention issue discussed there.

Currently, the root document (with slug "/") attempts to preview using the URI `/phriction/preview//` (with two `//` at the end). This is collapsed into "/phriction/preview/" by Apache if "MergeSlashes On" is configured, which is the default behavior. The route then 404s.

Instead, just use "/phriction/preview/?slug=/" so this endpoint functions properly regardless of the "MergeSlashes" configuration.

Test Plan:
  - Configured Apache with "MergeSlashes On" (which is the default behavior).
  - Tried to preview a content edit of the root document in Phriction, which didn't work and generated 404s for "/phriction/preview//" in the console log.
  - Applied patch.
  - Previwed content in Phriction (which now worked properly).
  - Accessed `/a//b///c////` and similar with "MergeSlashes On" and "MergeSlashes Off", confirmed that this option controls whether PHP receives a URI with or without merged slashes in "__path__" after rewriting.

Reviewers: 0

Reviewed By: 0

Maniphest Tasks: T13662

Differential Revision: https://secure.phabricator.com/D21708
2021-08-02 08:36:15 -07:00
epriestley
dbe2fb466f Add an "eval" rule to Remarkup
Summary:
Ref T13658. This adds a simple expression evaluator to Remarkup and supports platform name expressions. The syntax is:

```
${{{strings.platform.server.name}}}
```

Note that this won't work inside code blocks (or literal blocks, or other block-level literal elements) right now, although it could be made to selectively (the ".path" expressions might be useful in documentation codeblocks).

Test Plan: {F9391006}

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21713
2021-07-29 16:46:50 -07:00