Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Allow base64 for GitHub private key #7732

Open
2 tasks done
byawitz opened this issue Mar 6, 2024 · 3 comments
Open
2 tasks done

🚀 Feature: Allow base64 for GitHub private key #7732

byawitz opened this issue Mar 6, 2024 · 3 comments
Labels
enhancement New feature or request product / platform Fixes and upgrades for the Appwrite Platform.

Comments

@byawitz
Copy link
Member

byawitz commented Mar 6, 2024

🔖 Feature description

Give the option to provide the GitHub private key in base 64 format, which could be in some extra env variable.

_APP_VCS_GITHUB_PRIVATE_KEY=
_APP_VCS_GITHUB_PRIVATE_KEY_BASE64=YWZhZWZhZWFmYWVmYWVhZmFlZmFlYWZ.....

🎤 Pitch

This will make it easy to enter that key in one line.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@EVDOG4LIFE EVDOG4LIFE added enhancement New feature or request good first issue Good for newcomers product / platform Fixes and upgrades for the Appwrite Platform. labels Mar 20, 2024
@mthirumalai2905
Copy link

Whats the issue here should we have to add Base64 encryption?

@byawitz
Copy link
Member Author

byawitz commented Mar 25, 2024

Adding a private key in .env files can be annoying as it requires you to remove all new lines, and change it to \n. This way it can be easier.

@mthirumalai2905
Copy link

Please Have a look into this @byawitz

//Import atob
const atob = require('atob');

// Read the base64 encoded private key from the environment variable
const githubPrivateKeyBase64 = process.env._APP_VCS_GITHUB_PRIVATE_KEY_BASE64;

// Decode the base64 encoded string to get the original GitHub private key
const githubPrivateKey = atob(githubPrivateKeyBase64);

//ready to use
console.log('GitHub Private Key:', githubPrivateKey);

@stnguyen90 stnguyen90 removed the good first issue Good for newcomers label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / platform Fixes and upgrades for the Appwrite Platform.
Projects
None yet
Development

No branches or pull requests

4 participants