Pandora能做什么
- 本地部署ChatGPT,Pandora绕过 Cloudflare,可以把ChatGPT部署在自己的电脑上,使用127.0.0.1即可使用官方的GPT(仅需登陆一次,即可正常使用14天左右)
- 服务器部署ChatGPT,我们可以使用同样的方法,将Pandora程序安装在vps上,甚至可以使用自己的域名,无需设置网络即可使用,也不必担心IP问题
- 我们可以使用Pandora,用多种方式使用GPT,例如命令行模式,web模式,其中web页面使用方法与官网一致,还能保存记录,非常完美
Docker部署
1 2 3 4 5 6 7 8 9 10
|
docker pull pengzhile/pandora
docker run -e PANDORA_CLOUD=cloud -e PANDORA_SERVER=0.0.0.0:8899 -p 8899:8899 -d pengzhile/pandora
|
vps部署
1 2 3 4 5 6 7 8 9 10 11 12
|
apt update && apt install docker.io -y
docker pull pengzhile/pandora
docker run -it --rm pengzhile/pandora
docker run -e PANDORA_CLOUD=cloud -e PANDORA_SERVER=0.0.0.0:8899 -p 8899:8899 -d pengzhile/pandora
|
绑定域名的方式
使用nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| vi /etc/nginx/nginx.conf
events {}
http { server { listen 80; server_name fboth.pp.ua;
location / { proxy_pass http://127.0.0.1:8899; } } }
https://github.com/pengzhile/pandora/issues/81
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; } http { sendfile on; tcp_nopush on; types_hash_max_size 2048; proxy_headers_hash_bucket_size 1024; include /etc/nginx/mime.types; default_type application/octet-stream; server { listen 443 ssl; server_name www.xxxxxx.com; root html; index index.html index.htm index.jsp index.ftl; ssl_certificate cert/www.xxxx.cn.pem; ssl_certificate_key cert/www.xxxx.cn.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location ^~ / { proxy_pass http://127.0.0.1:8899/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-Proto $scheme; add_header X-Cache $upstream_cache_status; proxy_http_version 1.1; } } server { listen 80; server_name www.xxxxx.cn; rewrite ^(.*)$ https://$host$1 permanent; } ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; }
|
或者使用其他工具: caddy
1 2 3 4 5 6 7 8 9
| vi /etc/caddy/Caddyfile
xx.com encode gzip reverse_proxy 127.0.0.1:8899
|
Pandora不愧是一个优秀的项目,除了docker安装,还可以pip,解决了GPT使用上的诸多问题,而且速度比官网还快;很方便
扩展: docker启动命令
``PANDORA_ACCESS_TOKEN 指定Access Token字符串
1 2
| docker run -d --name my-pandora-token --restart always -e PANDORA_SERVER=0.0.0.0:8899 -e PANDORA_ACCESS_TOKEN=xxxx -p 8899:8899 pengzhile/pandora
|
``PANDORA_TOKENS_FILE 指定一个存放多Access Token的文件路径
1
| docker run -d --name my-pandora-tokens --restart always -e PANDORA_SERVER=0.0.0.0:8899 -e PANDORA_TOKENS_FILE=/home/access_token.json -p 8899:8899 -v /home/access_token.json:/home/access_token.json pengzhile/pandora
|
access_token.json内容如何,key自定义
这样就可以通过xxx.com?token=key的方式访问