File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import random
3
+ import string
2
4
import subprocess
5
+ import tempfile
3
6
from uuid import uuid4
4
7
5
8
from dotenv import load_dotenv
@@ -154,6 +157,17 @@ def get_abs_path(file_path: str):
154
157
os .environ .get ("WORDS_FILE_PATH" , "local_data/words_alpha.txt" )
155
158
)
156
159
160
+ # Used to generate random email
161
+ if os .environ .get ("GNUPGHOME" ):
162
+ GNUPGHOME = get_abs_path (os .environ .get ("GNUPGHOME" ))
163
+ else :
164
+ letters = string .ascii_lowercase
165
+ random_dir_name = "" .join (random .choice (letters ) for _ in range (20 ))
166
+ GNUPGHOME = f"/tmp/{ random_dir_name } "
167
+ if not os .path .exists (GNUPGHOME ):
168
+ os .mkdir (GNUPGHOME , mode = 0o700 )
169
+
170
+ print ("WARNING: Use a temp directory for GNUPGHOME" , GNUPGHOME )
157
171
158
172
# Github, Google, Facebook client id and secrets
159
173
GITHUB_CLIENT_ID = os .environ .get ("GITHUB_CLIENT_ID" )
Original file line number Diff line number Diff line change @@ -108,4 +108,7 @@ FACEBOOK_CLIENT_SECRET=to_fill
108
108
109
109
# Flask profiler
110
110
# FLASK_PROFILER_PATH=/tmp/flask-profiler.sql
111
- # FLASK_PROFILER_PASSWORD=password
111
+ # FLASK_PROFILER_PASSWORD=password
112
+
113
+ # Where to store GPG Keyring
114
+ # GNUPGHOME=/tmp/gnupg
You can’t perform that action at this time.
0 commit comments