
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rn-environment
Advanced tools
A react native library to manage environment and configuration files for every server configuration eg. local, development, staging and production.
A react native library to manage environment and configuration files for every server configuration eg. local, development, staging and production.
No Dependencies so far.
package.json file. "rn-environment": "rn-environment"
.gitignore file # Environment files
app/src/config/environment.json
ios/GoogleService-Info.plist
android/app/google-services.json
# Secrets
.decrypted
*.dec.yaml
npm run rn-environment -- --setup
After running above command you can see that your project directory have a environment folder and inside the folder have some server environment folders local, development, staging and production. Inside each of these server environment folder you have some configurations files environment.json, google-services.json, and GoogleService-Info.plist .
Now you have to update all these files as per the server environment values or only those files which you are going to use. For example replace BaseUrl value in each environment.json file to choose different server base url in local, development, staging and production. You can also add other you own values in environment.json file. I have given some example there.
gpg --full-generate-key
gpg --fingerprint
export SOPS_GPG_EXEC="gpg"
export SOPS_PGP_FP="<fingerprint>"
export SOPS_GPG_KEYSERVER="keyserver.ubuntu.com"
Fill the secrets that you dont want to commit in environment/secrets.dec.yaml file
Then encryp the file using sops. The environment/secrets.yaml file can be commited.
sops --encrypt environment/secrets.dec.yaml > environment/secrets.yaml
Once all possible fields are filled out you can run following command to set current environment. Becore you can run this command you need to have following directory structure app/src/config so that you can place environment.json file in there.
npm run rn-environment -- --current $ENV
with $ENV be one of:
If this command gives following error.
Failed to get the data key required to decrypt the SOPS file.
Group 0: FAILED
<Random digist>: FAILED
- | could not decrypt data key with PGP key:
| golang.org/x/crypto/openpgp error: Could not load secring:
| open /Users/<username>/.gnupg/secring.gpg: no such file
| or directory; GPG binary error: exit status 2
Recovery failed because no master key was able to decrypt the file. In
order for SOPS to recover the file, at least one key has to be successful,
but none were.
Run below commands and then run current command again.
reset
GPG_TTY=$(tty)
export GPG_TTY
You can use the below command to run any script. Note that rn-environment should be added in script section of your package.json file before running any script.
npm run rn-environment -- --<script-name>
--setup this script is used to setup the environment files and configuration files in a react native project.--current this script is used to setup the current environment and replace all files. Available environments are local, development, staging and production.--help this script is used for displaying available scripts.FAQs
A react native library to manage environment and configuration files for every server configuration eg. local, development, staging and production.
The npm package rn-environment receives a total of 12 weekly downloads. As such, rn-environment popularity was classified as not popular.
We found that rn-environment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.