@@ -294,7 +294,7 @@ docker run -d --name gcli2api --network host -e API_PASSWORD=api_pwd -e PANEL_PA
294
294
295
295
# ## 🌟 Storage Backend Priority
296
296
297
- gcli2api supports multiple storage backends, automatically selecting by priority : **Redis > MongoDB > Local Files**
297
+ gcli2api supports multiple storage backends, automatically selecting by priority : **Redis > Postgres > MongoDB > Local Files**
298
298
299
299
# ## ⚡ Redis Distributed Storage Mode
300
300
@@ -324,6 +324,24 @@ export REDIS_DATABASE="1"
324
324
python web.py
325
325
` ` `
326
326
327
+ # ## 🐘 Postgres Distributed Storage Mode
328
+
329
+ If Redis is not configured, or you prefer a relational database, gcli2api also supports Postgres (it is checked after Redis and before MongoDB).
330
+
331
+ ⚙️ Enable Postgres Mode
332
+
333
+ Step 1 : Configure Postgres DSN
334
+ ` ` ` bash
335
+ # Example DSN:
336
+ export POSTGRES_DSN="postgresql://user:password@localhost:5432/gcli2api"
337
+ ` ` `
338
+
339
+ Step 2 : Start Application
340
+ ` ` ` bash
341
+ # Application will detect POSTGRES_DSN and use Postgres when Redis is not available
342
+ python web.py
343
+ ` ` `
344
+
327
345
# ## 🍃 MongoDB Distributed Storage Mode
328
346
329
347
# ## 🌟 Alternative Storage Solution
@@ -814,4 +832,4 @@ This project is for learning and research purposes only. Using this project indi
814
832
- Bear all risks and responsibilities of using this project
815
833
- Comply with relevant terms of service and legal regulations
816
834
817
- The project authors are not responsible for any direct or indirect losses arising from the use of this project.
835
+ The project authors are not responsible for any direct or indirect losses arising from the use of this project.
0 commit comments