Summary:
Expose an endpoint to retrieve server environment information.
We can use version information and process number to aid engineers with troubleshooting Flipper.
Reviewed By: antonk52
Differential Revision: D49537325
fbshipit-source-id: 511fe4441638f91cd35f13706ceeeb515051416b
Summary: Use the newly exposed HTTP shutdown API. It is simpler.
Reviewed By: antonk52
Differential Revision: D49499264
fbshipit-source-id: 2d81db1d1a66c0b7550ee1245e51d8f1a8671aa6
Summary: Generate auth token on whenever we load the secure server config, and add more logs.
Reviewed By: antonk52
Differential Revision: D49272857
fbshipit-source-id: 1e549a8bfd7926e9a44b9480432e92ee3c0162b2
Summary:
A few things need to be done which are on this change:
- Certificate generation should execute as an atomic operation, hence, it needs to be synchronised.
- Do not generate client token as part of certificate generation. This causes a deadlock now.
- Add more logs for troubleshooting
Reviewed By: aigoncharov
Differential Revision: D49269624
fbshipit-source-id: 071a8e5b895198730b7d914cc4622837e9094e2f
Summary: This should be a blocking call and done later as it depends on the FlipperServerConfig to be set.
Reviewed By: antonk52
Differential Revision: D49193650
fbshipit-source-id: 4f74ca5de30b7f992880bbb9032792fd713203b7
Summary: Don't log it, otherwise it may end up in Scuba, we don't want that.
Reviewed By: antonk52
Differential Revision: D49187133
fbshipit-source-id: 38d4ea0801a9abbc463c23340e23f8b55e0d22f3
Summary: Changelog: FLIPPER_DISABLE_KEYTAR env var can be used to force in-memory implementation
Reviewed By: lblasa
Differential Revision: D49183501
fbshipit-source-id: 4ce886303678485673750417b09f272dd3f66623
Summary:
Flipper Launcher downloads, unpacks, launches Flipper, and closes itself.
This is fine except for the fact that Flipper may be initiating and thus there's a gap of a few seconds until engineers see the main Flipper UI.
This change improves this by launching earlier, even if just showing a loading page until Flipper is actually ready.
Reviewed By: passy, aigoncharov
Differential Revision: D48824479
fbshipit-source-id: aa6147a09f313d80592c9b08d089660ba73773a4
Summary: Updating the remaining tsconfigs to build for an ES2021 target.
Reviewed By: antonk52
Differential Revision: D48687661
fbshipit-source-id: 2761704d251f701594ca5d362a17731f287088ed
Summary:
This change replaces the existing logging infra with the one defined and exposed in flipper-server-core.
Functionality remains the same with the addition of having support for Scribe.
Reviewed By: aigoncharov
Differential Revision: D48515246
fbshipit-source-id: 7970f6ad069821ee4f15136adc8da40d0b1fb0c7
Summary:
This updates minor and patch level dependencies. Frustratingly, I had to revert a bunch
of changes in that version range that still caused incompatibilities and test failures.
If I find time, I'll dig a bit deeper.
Reviewed By: ivanmisuno
Differential Revision: D48433210
fbshipit-source-id: 9ab12e774c1992d4f22cc1428d34f102ce820b75
Summary: As TCP is the only option, remove all branches.
Reviewed By: passy
Differential Revision: D48265093
fbshipit-source-id: 174527f05d8a841797fd95256e77fdeb9b2e6ad5
Summary: UDS will be removed. The first step would be to remove the TCP optionality.
Reviewed By: passy
Differential Revision: D48264741
fbshipit-source-id: ca9e1b68be61e99240e95bcd4f26f2db63a64005
Summary: To avoid the cases whereas Flipper opens up in engineer's default browser which may be different than Chrome.
Reviewed By: aigoncharov
Differential Revision: D46682220
fbshipit-source-id: 38d0ddefbc67989c5ec97a66e4a419318a66bc95
Summary:
^
In addition to logging to the console bootstrap performance metrics, track these events to scuba as well.
Reviewed By: aigoncharov
Differential Revision: D46648876
fbshipit-source-id: 191704c13158884bb8cfbca614a23f2a64f1fd93
Summary:
Add a few console logs as to highlight how long does it take for our server to start.
Additionally, do not wait until we are ready for client connections before attempting to launch. There's nothing else we do at this point. Instead, launch and wait until we are ready.
Reviewed By: passy
Differential Revision: D46639482
fbshipit-source-id: c098d229edc3cd52e5c876c509a7c81532635afa
Summary:
^
Token is no longer in the static directory. Also, we can now use a shared utility.
Reviewed By: aigoncharov
Differential Revision: D46516296
fbshipit-source-id: c38d024061653ac8b3fb587c8e3ad83dba0b151d
Summary:
^
There is an issue whereas when Flipper Server is launched NOT from the terminal, it doesn't inherit the user's terminal `$PATH` variable.
This causes a few different issues.
This change tries to address that.
Reviewed By: passy
Differential Revision: D46392435
fbshipit-source-id: 6201a1749134db8c50eca8751af149737dce57d7
Summary:
^
Basically, update Jest and fix any raised issues. Mainly:
- Update necessary dependencies
- Update snapshots
- `useFakeTimers` caused a few issues which meant that the way we hook into the performance object had to be tweaked. The main code change is: `//fbsource/xplat/sonar/desktop/scripts/jest-setup-after.tsx`
- `mocked` -> `jest.mocked`
Changelog: Update Jest to v29.5.1
Reviewed By: antonk52
Differential Revision: D46319818
fbshipit-source-id: d218ca8f7e43abac6b00844953ddeb7f4e1010a2
Summary:
Replace an existing running instance, if any.
This is useful for:
- Applying updates
- Ensuring freshness of server
Reviewed By: passy
Differential Revision: D46146814
fbshipit-source-id: bfb760f3ab26b7632510773609f1c6ca3a97c4ec
Summary:
Right now, this simply avoids trying to create a server instance if one appears to be already running.
In a future change, we may decide to kill the existing instance and replace it with a new one.
But, in this case, running this as is will be useful as it will provide the connection URL with the auth token.
Also remove flipper server dependency from finding installation. In this case, we don't need it and can use `os.getPlatform()` instead.
Reviewed By: antonk52
Differential Revision: D46144843
fbshipit-source-id: 2922843b916d37e0126e43ae65a622f87a6920ec
Summary:
Clean initialisation by passing down the environment info to start server.
(Also rename dir to path as that's the name used in other places)
Reviewed By: passy
Differential Revision: D45731751
fbshipit-source-id: a60fdd49c567fc312d1f8da72db3a46a0828c140
Summary: The isHeadlessBuild flag was not properly set.
Reviewed By: antonk52
Differential Revision: D45728435
fbshipit-source-id: 3616c4358114d4f3d96372766dabf48b27b44333
Summary:
Until now, launching flipper-server with TCP would accept any incoming connection as long as it comes from the same origin (localhost) using web socket host origin verification.
This is not entirely secure as origin can be spoofed with tools like curl.
Our team created a security review and a proposal was written:
https://docs.google.com/document/d/16iXypCQibPiner061SoaQUFUY9tLVAEpkKfV_hUXI7c/
Effectively, Flipper can generate a token which is then used by the client to authenticate.
This diff contains the changes required to generate, obtain, and validate authentication tokens from clients connecting to flipper over TCP connections.
The token itself is a JWT token. JWT was chosen because it is a simple industry standard which offers three features which can immediately benefit us:
- Expiration handling. No need for Flipper to store this information anywhere.
- Payload. Payload can be used to push any data we deem relevant i.e. unix username.
- Signing. Signed and verified using the same server key pair which is already in place for certificate exchange.
Additionally, the token is stored in the Flipper static folder. This ensures that the browser and PWA clients have access to it.
Reviewed By: mweststrate
Differential Revision: D45179654
fbshipit-source-id: 6761bcb24f4ba30b67d1511cde8fe875158d78af
Summary: Combining a bunch of individual tasks for dep upgrades into one diff.
Reviewed By: ivanmisuno
Differential Revision: D42706074
fbshipit-source-id: 054b2545ad1295699f47f4c6eb5065b7b9a1d6a0
Summary: Some plugins import from shared directories. These directories are not plugins themselves, therefore the current plugin root searching mechanism does nto work for them. To support plugin reloading for this scenario, we start re-building all plugins if we fail to find a plugin root.
Reviewed By: lblasa
Differential Revision: D39693820
fbshipit-source-id: 33dd7de4121bd5665a39b0ea96adce4603dc7df0
Summary: Now that we build all plugins at all times and it is super-fast, these options are redundant
Reviewed By: lblasa
Differential Revision: D39542723
fbshipit-source-id: 1b30ba384267ec4fd0c35b4dc14f0223ffe414c9
Summary: Watch source plugin folders and notify frontend that any of them changed. In subsequent diffs, we will start reloading plugins that changed.
Reviewed By: lblasa
Differential Revision: D39539443
fbshipit-source-id: 726916c0bce336a2c0179558526bcb1b74e35b93
Summary: Move flipper local deps to prod deps, so yarn installs them later when we build a bundle
Reviewed By: lblasa
Differential Revision: D39475545
fbshipit-source-id: 5b61d15b45ee315c3b35d8e6836c114b90503b1a
Summary: Flipper server itself requires no babel transforms. We applied extra transforms only for the bundled plugins. However, we pack and ship all plugins in the /static folder. They are always available on the FS. Therefore we could stop bundling any plugins into flipper-server's source code.
Reviewed By: lblasa
Differential Revision: D38910251
fbshipit-source-id: b3e9fe5ae2ab69ce5579b01b6793ebf7e88baf66
Summary:
flipper-server-companion depends on flipper-plugin. flipper-plugin includes dependencies that run only in a browser. Splitting flipper-plugin into core and browser packages helps to avoid including browser-only dependencies into flipper-server bundle.
As a result, bundle size could be cut in half. Subsequently, RSS usage drops as there is twice as less code to process for V8.
Note: it currently breaks external flipper-data-source package. It will be restored in subsequent diffs
Reviewed By: lblasa
Differential Revision: D38658285
fbshipit-source-id: 751b11fa9f3a2d938ce166687b8310ba8b059dee
Summary:
^
There may be cases whereas the process exits but leaks the socket descriptors.
There's already a hook to close flipper-server.
Reviewed By: passy
Differential Revision: D37550940
fbshipit-source-id: 35004969834bb92bb7cf0f56bda8d7b43c11d6bf
Summary:
CHANGELOG: Rotate flipper-server logs
Otherwise, they re going to eat up all space eventually in a one monstrous file
Reviewed By: passy
Differential Revision: D37516868
fbshipit-source-id: 478a61c56ec007e4a3d695f7e6df2a61cb33c33a
Summary:
Provide an option to enable/disable TCP connections on flipper-server.
The only change at this stage is that Flipper Desktop will use UDS to connect to flipper-server.
Reviewed By: passy
Differential Revision: D37519656
fbshipit-source-id: 3d02084666fde532ec76134edf8cf6a231060a48
Summary: CHANGELOG: Open Flipper Server at /
Reviewed By: lawrencelomax
Differential Revision: D37517406
fbshipit-source-id: 71043c3df75d9436020da477c937795671fa15a9
Summary:
^
This is an effort to capture and log these errors as to gain visibility when failures occur.
Reviewed By: passy
Differential Revision: D37412861
fbshipit-source-id: 09687a31797aac4c377aa98944ab0701bdf45466
Summary:
There's one setting: to enable or disable flipper-server.
However, I've added some current running state to it. If there's a better way of doing this, please do let me know.
Reviewed By: aigoncharov
Differential Revision: D37276670
fbshipit-source-id: f6c941cf0cfe55c267b9bcb9f799934fba1e28ef
Summary:
This change attaches our event handlers as soon as the ws is created.
As a consequence, we need to wait until the server has created any necessary instances required to process incoming requests.
To achieve this, I created a type called `Lazy`.
This type wraps around a value and a promise to that value. Callers can check if the value is set. If not, callers can wait for it.
Ultimately, the value can be set outside of the promise itself.
Reviewed By: passy
Differential Revision: D37284939
fbshipit-source-id: 17dec548d7155a3d65440c9584cec07cbb826c37
Summary:
This changes moves most of the functionality found in flipper-server to flipper-server-core.
flipper-server will mostly be a package that wraps around flipper-server-core. Staying in flipper-server:
- Command line args
- Orchestration to start the necessary servers
Reviewed By: aigoncharov
Differential Revision: D36807087
fbshipit-source-id: f29002c7cc5d08b8c5184fdaaa02ba22562a9f45
Summary:
This change extracts logging logic out from startFlipperServer.
Logs will also be written to disk.
Reviewed By: passy
Differential Revision: D36473768
fbshipit-source-id: b1df9df79b4aced0d3ba2e8c243aa8d44cf83703
Summary:
These are utility methods that are not specific to startServer.
They will be reused by other components needing to check if something is listening to a port.
Make socket path is also extracted.
Reviewed By: passy
Differential Revision: D36473641
fbshipit-source-id: 73ed67912052896696b59670cb757d22761eeaa1