FLIPPER_DISABLE_KEYTAR env var to use in-memory impl
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b60a8537ff
commit
cd392929e0
@@ -56,9 +56,17 @@ import {Module} from 'module';
|
|||||||
Module.prototype.require = wrapRequire(Module.prototype.require);
|
Module.prototype.require = wrapRequire(Module.prototype.require);
|
||||||
enableMapSet();
|
enableMapSet();
|
||||||
|
|
||||||
async function getKeytarModule(staticPath: string): Promise<KeytarModule> {
|
async function getKeytarModule(
|
||||||
|
staticPath: string,
|
||||||
|
): Promise<KeytarModule | undefined> {
|
||||||
let keytar: any = undefined;
|
let keytar: any = undefined;
|
||||||
try {
|
try {
|
||||||
|
if (process.env.FLIPPER_DISABLE_KEYTAR) {
|
||||||
|
console.log(
|
||||||
|
'Using keytar in-memory implementation as per FLIPPER_DISABLE_KEYTAR env var.',
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
if (!isTest()) {
|
if (!isTest()) {
|
||||||
const keytarPath = path.join(
|
const keytarPath = path.join(
|
||||||
staticPath,
|
staticPath,
|
||||||
@@ -112,7 +120,7 @@ async function getFlipperServer(
|
|||||||
isProduction,
|
isProduction,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
const keytar: KeytarModule = await getKeytarModule(staticPath);
|
const keytar: KeytarModule | undefined = await getKeytarModule(staticPath);
|
||||||
const gatekeepers = getGatekeepers(environmentInfo.os.unixname);
|
const gatekeepers = getGatekeepers(environmentInfo.os.unixname);
|
||||||
|
|
||||||
const serverUsageEnabled = gatekeepers['flipper_desktop_use_server'];
|
const serverUsageEnabled = gatekeepers['flipper_desktop_use_server'];
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export async function startFlipperServer(
|
|||||||
staticPath: string,
|
staticPath: string,
|
||||||
settingsString: string,
|
settingsString: string,
|
||||||
enableLauncherSettings: boolean,
|
enableLauncherSettings: boolean,
|
||||||
keytarModule: KeytarModule,
|
keytarModule: KeytarModule | undefined,
|
||||||
type: FlipperServerType,
|
type: FlipperServerType,
|
||||||
environmentInfo: EnvironmentInfo,
|
environmentInfo: EnvironmentInfo,
|
||||||
): Promise<FlipperServerImpl> {
|
): Promise<FlipperServerImpl> {
|
||||||
|
|||||||
@@ -164,7 +164,11 @@ async function start() {
|
|||||||
|
|
||||||
let keytar: any = undefined;
|
let keytar: any = undefined;
|
||||||
try {
|
try {
|
||||||
if (!isTest()) {
|
if (process.env.FLIPPER_DISABLE_KEYTAR) {
|
||||||
|
console.log(
|
||||||
|
'[flipper-server][bootstrap] Using keytar in-memory implementation as per FLIPPER_DISABLE_KEYTAR env var.',
|
||||||
|
);
|
||||||
|
} else if (!isTest()) {
|
||||||
const keytarPath = path.join(
|
const keytarPath = path.join(
|
||||||
staticPath,
|
staticPath,
|
||||||
'native-modules',
|
'native-modules',
|
||||||
|
|||||||
Reference in New Issue
Block a user