Skip to content

Commit 63b58ce

Browse files
committed
Add email (OTP) credentials setup to init scripts
1 parent 795f29b commit 63b58ce

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

init.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,23 @@ while ($true) {
180180
}
181181
}
182182

183+
# appwrite push functions --with-variables
184+
Write-Host "Setting Up Email for OTP now ..."
185+
Write-Host "This email will be used to send OTP verification codes to users."
186+
$senderMail = Read-Host "Please provide sender email address (e.g., your-email@gmail.com)"
187+
$senderPassword = Read-Host "Please provide sender email app password" -AsSecureString
188+
$senderPasswordPlain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($senderPassword))
189+
190+
# Push Email credentials as env variables for functions to use
191+
Write-Host "Pushing Email credentials as env variables..."
192+
appwrite project create-variable --key SENDER_MAIL --value $senderMail
193+
appwrite project create-variable --key SENDER_PASSWORD --value $senderPasswordPlain
194+
Write-Host "Email credentials configured successfully!"
195+
183196
# Push Livekit credentials as env variables for functions to use
184197
Write-Host "Pushing Livekit credentials as env variables if you need any changes do them in your Appwrite Resonate project's Global Env variables"
185198
appwrite project create-variable --key LIVEKIT_HOST --value $livekitHostURL
186199
appwrite project create-variable --key LIVEKIT_SOCKET_URL --value $livekitSocketURL
187200
appwrite project create-variable --key LIVEKIT_API_KEY --value $livekitAPIKey
188201
appwrite project create-variable --key LIVEKIT_API_SECRET --value $livekitAPISecret
189-
appwrite push functions --with-variables
202+
appwrite push functions --with-variables

init.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,19 @@ echo "Pushing Meilisearch credentials as env variables if you need any changes d
127127
appwrite project create-variable --key MEILISEARCH_ENDPOINT --value "$meilisearchEndpoint"
128128
appwrite project create-variable --key MEILISEARCH_ADMIN_API_KEY --value "$meilisearchMasterKey"
129129

130+
## appwrite push functions --with-variables
131+
echo "Setting Up Email for OTP now ..."
132+
echo "This email will be used to send OTP verification codes to users."
133+
read -p "Please provide sender email address (e.g., your-email@gmail.com): " senderMail
134+
read -sp "Please provide sender email app password: " senderPassword
135+
echo ""
136+
137+
# Push Email credentials as env variables for functions to use
138+
echo "Pushing Email credentials as env variables..."
139+
appwrite project create-variable --key SENDER_MAIL --value "$senderMail"
140+
appwrite project create-variable --key SENDER_PASSWORD --value "$senderPassword"
141+
echo "Email credentials configured successfully!"
142+
130143

131144
echo "Setting Up Livekit now ..."
132145
while true; do

0 commit comments

Comments
 (0)