{"id":6432,"date":"2023-01-18T17:16:28","date_gmt":"2023-01-18T09:16:28","guid":{"rendered":"https:\/\/i007.vip:15443\/wordpress\/?p=6432"},"modified":"2023-01-18T17:16:28","modified_gmt":"2023-01-18T09:16:28","slug":"%e5%be%ae%e4%bf%a1%e4%b8%ad%e4%bd%bf%e7%94%a8chatgpt","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/6432","title":{"rendered":"\u5fae\u4fe1\u4e2d\u4f7f\u7528ChatGPT"},"content":{"rendered":"<p><a href=\"https:\/\/blog.csdn.net\/qq_36306519\/article\/details\/128344232\">\u539f\u6587\u5730\u5740<\/a><\/p>\n<p>\u00a0<\/p>\n<p>\u81f3\u5c0a\u5b9dl<\/p>\n<p>\u4e8e 2022-12-16 16:09:22 \u53d1\u5e03<\/p>\n<p>502<br \/>\n\u6536\u85cf<br \/>\n\u5206\u7c7b\u4e13\u680f\uff1a ChatGPT \u6587\u7ae0\u6807\u7b7e\uff1a \u5fae\u4fe1 chatgpt docker<br \/>\n\u7248\u6743<\/p>\n<p>ChatGPT<br \/>\n\u4e13\u680f\u6536\u5f55\u8be5\u5185\u5bb9<br \/>\n2 \u7bc7\u6587\u7ae00 \u8ba2\u9605<br \/>\n\u8ba2\u9605\u4e13\u680f<br \/>\n\u5fae\u4fe1\u4e2d\u4f7f\u7528ChatGPT<br \/>\nChatGPT \u5fae\u4fe1 Bot<br \/>\n1. Ubuntu<br \/>\n2. \u5378\u8f7d\u65e7\u7248\u672c<br \/>\n3. apt \u5b89\u88c5<br \/>\n4. \u6dfb\u52a0\u8f6f\u4ef6\u6e90\u7684GPG\u5bc6\u94a5<br \/>\n5. \u6dfb\u52a0docker\u6e90\u5230sources.list<br \/>\n6. \u5b89\u88c5 docker<br \/>\n7. \u542f\u52a8 docker<br \/>\n8. \u5efa\u7acbdocker\u7528\u6237\u7ec4<br \/>\n9. \u6d4b\u8bd5<br \/>\n10. wechat-chatgpt \u642d\u5efa<br \/>\n11. \u83b7\u53d6 \u4f1a\u8bdd\u4ee4\u724c<br \/>\n12. \u8fd0\u884c<br \/>\n13. \u4f7f\u7528\u5fae\u4fe1\u5c0f\u53f7\u626b\u7801\u767b\u5f55<br \/>\n14. \u91cd\u65b0\u767b\u5f55<br \/>\n14.1 \u505c\u6b62\u8fd0\u884c\u5bb9\u5668<br \/>\n14.2 \u91cd\u65b0\u8fd0\u884c\u5bb9\u5668<br \/>\n15. \u4f7f\u7528<br \/>\n\u53c2\u8003<br \/>\n1. Ubuntu<br \/>\n\u7cfb\u7edf\u7248\u672c<br \/>\n# lsb_release -a<br \/>\nNo LSB modules are available.<br \/>\nDistributor ID: Ubuntu<br \/>\nDescription: Ubuntu 20.04 LTS<br \/>\nRelease: 20.04<br \/>\nCodename: focal<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n2. \u5378\u8f7d\u65e7\u7248\u672c<br \/>\napt-get remove docker docker-engine docker.io<br \/>\n1<br \/>\n3. apt \u5b89\u88c5<br \/>\napt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release<br \/>\n1<br \/>\n4. \u6dfb\u52a0\u8f6f\u4ef6\u6e90\u7684GPG\u5bc6\u94a5<br \/>\ncurl -fsSL https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu\/gpg | gpg &#8211;dearmor -o \/usr\/share\/keyrings\/docker-archive-keyring.gpg<br \/>\n1<br \/>\n5. \u6dfb\u52a0docker\u6e90\u5230sources.list<br \/>\necho &#8220;deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/docker-archive-keyring.gpg] https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/ubuntu $(lsb_release -cs) stable&#8221; | tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null<br \/>\n1<br \/>\n6. \u5b89\u88c5 docker<br \/>\napt update<\/p>\n<p>apt-get install -y docker-ce docker-ce-cli containerd.io<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n7. \u542f\u52a8 docker<br \/>\nsystemctl enable docker<br \/>\nsystemctl start docker<br \/>\n1<br \/>\n2<br \/>\n8. \u5efa\u7acbdocker\u7528\u6237\u7ec4<br \/>\ngroupadd docker<br \/>\nusermod -aG docker $USER<br \/>\n1<br \/>\n2<br \/>\n9. \u6d4b\u8bd5<br \/>\n# docker run &#8211;rm hello-world<br \/>\nUnable to find image &#8216;hello-world:latest&#8217; locally<br \/>\nlatest: Pulling from library\/hello-world<br \/>\n2db29710123e: Pull complete<br \/>\nDigest: sha256:faa03e786c97f07ef34423fccceeec2398ec8a5759259f94d99078f264e9d7af<br \/>\nStatus: Downloaded newer image for hello-world:latest<\/p>\n<p>Hello from Docker!<br \/>\nThis message shows that your installation appears to be working correctly.<\/p>\n<p>To generate this message, Docker took the following steps:<br \/>\n1. The Docker client contacted the Docker daemon.<br \/>\n2. The Docker daemon pulled the &#8220;hello-world&#8221; image from the Docker Hub.<br \/>\n(amd64)<br \/>\n3. The Docker daemon created a new container from that image which runs the<br \/>\nexecutable that produces the output you are currently reading.<br \/>\n4. The Docker daemon streamed that output to the Docker client, which sent it<br \/>\nto your terminal.<\/p>\n<p>To try something more ambitious, you can run an Ubuntu container with:<br \/>\n$ docker run -it ubuntu bash<\/p>\n<p>Share images, automate workflows, and more with a free Docker ID:<br \/>\nhttps:\/\/hub.docker.com\/<\/p>\n<p>For more examples and ideas, visit:<br \/>\nhttps:\/\/docs.docker.com\/get-started\/<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n10<br \/>\n11<br \/>\n12<br \/>\n13<br \/>\n14<br \/>\n15<br \/>\n16<br \/>\n17<br \/>\n18<br \/>\n19<br \/>\n20<br \/>\n21<br \/>\n22<br \/>\n23<br \/>\n24<br \/>\n25<br \/>\n26<br \/>\n27<br \/>\n10. wechat-chatgpt \u642d\u5efa<br \/>\n# git clone https:\/\/github.com\/fuergaosi233\/wechat-chatgpt.git<br \/>\n# cd wechat-chatgpt\/<br \/>\n1<br \/>\n2<br \/>\n11. \u83b7\u53d6 \u4f1a\u8bdd\u4ee4\u724c<br \/>\n1. https:\/\/chat.openai.com\/chat\u767b\u5f55<br \/>\n2. \u6d4f\u89c8\u5668\u6253\u5f00\u66f4\u591a\u5de5\u5177>\u5f00\u53d1\u8005\u5de5\u5177\u3002<br \/>\n3. \u6253\u5f00\u5e94\u7528\u7a0b\u5e8f > Cookies\u3002<br \/>\n4. \u590d\u5236 __Secure-next-auth.session-token \u7684\u503c\uff0c\u914d\u7f6econfig.yaml<br \/>\nhttps:\/\/chat.openai.com\/api\/auth\/session<\/p>\n<p>chatGPTAccountPool:<br \/>\n&#8211; session_token: <your session_token><\/p>\n<p>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<br \/>\n9<br \/>\n12. \u8fd0\u884c<br \/>\n# cd wechat-chatgpt\/<\/p>\n<p>1<br \/>\n2<br \/>\n\u4fee\u6539config.yaml<br \/>\ncp config.yaml.example config.yaml<\/p>\n<p>chatGPTAccountPool:<br \/>\n&#8211; session_token: eyJh&#8230;&#8230;<br \/>\nchatPrivateTiggerKeyword: &#8220;&#8221;<\/p>\n<p>docker run -d &#8211;name wechat-chatgpt -v $(pwd)\/config.yaml:\/app\/config.yaml holegots\/wechat-chatgpt:latest<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n13. \u4f7f\u7528\u5fae\u4fe1\u5c0f\u53f7\u626b\u7801\u767b\u5f55<br \/>\ndocker logs -f wechat-chatgpt<br \/>\n1<br \/>\n14. \u91cd\u65b0\u767b\u5f55<br \/>\n\u83b7\u53d6\u6700\u65b0\u7684Cookies __Secure-next-auth.session-token \u503c\uff0c\u4fee\u6539config.yaml<br \/>\n14.1 \u505c\u6b62\u8fd0\u884c\u5bb9\u5668<br \/>\n# docker ps<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\nfd62d8c0451b holegots\/wechat-chatgpt:latest &#8220;npm run dev&#8221; 50 minutes ago Up 50 minutes wechat-chatgpt<br \/>\n# docker stop fd62d8c0451b<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n14.2 \u91cd\u65b0\u8fd0\u884c\u5bb9\u5668<br \/>\n\u5220\u9664\u4e4b\u524d\u5bb9\u5668<br \/>\ndocker container rm wechat-chatgpt<br \/>\n1<br \/>\ndocker run -d &#8211;name wechat-chatgpt -v $(pwd)\/config.yaml:\/app\/config.yaml holegots\/wechat-chatgpt:latest<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n15. \u4f7f\u7528<br \/>\n\u53d1\u9001\u79c1\u4fe1\u6216\u8005\u7fa4@ \u89e6\u53d1<\/p>\n<p>\u6d88\u606f\u56de\u590d\u6162\uff0cvps\u5ef6\u8fdf\u9ad8\uff0c\u53ef\u4ee5\u6362\u5ef6\u8fdf\u4f4e\u7684vps<br \/>\n# ping openai.com<br \/>\nPING openai.com (184.27.123.193) 56(84) bytes of data.<br \/>\n64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=1 ttl=47 time=385 ms<br \/>\n64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=2 ttl=47 time=377 ms<br \/>\n64 bytes from a184-27-123-193.deploy.static.akamaitechnologies.com (184.27.123.193): icmp_seq=3 ttl=47 time=377 ms<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n\u53c2\u8003<br \/>\nwechat-chatgpt<br \/>\ndocker-\u4ece\u5165\u95e8\u5230\u5b9e\u8df5<br \/>\n\u53c2\u8003\u94fe\u63a5\uff1a<br \/>\ngithub\u4ed3\u5e93<br \/>\n\u51c6\u5907\u670d\u52a1\u5668<br \/>\n\u8fdb\u5165\u817e\u8baf\u4e91\u670d\u52a1\u5668\u5b98\u7f51\uff0c\u641c\u7d22\u201c\u8f7b\u91cf\u5e94\u7528\u670d\u52a1\u5668\u201d<br \/>\n\u7acb\u5373\u9009\u8d2d<\/p>\n<p>\u6ce8\u610f\uff0c\u5730\u533a\u8981\u9009\u6d77\u5916\uff0c\u955c\u50cf\u9009Docker\u955c\u50cf<\/p>\n<p>\u8d2d\u4e70\u4e4b\u540e\uff0c\u5c31\u8fdb\u5165\u63a7\u5236\u53f0<\/p>\n<p>\u7136\u540e\u767b\u9646\u5230shell<\/p>\n<p>\u5b89\u88c5\u90e8\u7f72<br \/>\n\u67e5\u770b\u4e00\u4e0bdocker\uff0c\u662f\u5426\u5b89\u88c5\u597d<br \/>\nlighthouse@VM-0-12-ubuntu:~$ docker -v<br \/>\nDocker version 20.10.5, build 55c4c88<br \/>\n1<br \/>\n2<br \/>\n\u514b\u9686\u4ed3\u5e93<br \/>\n# git clone https:\/\/github.com\/fuergaosi233\/wechat-chatgpt.git<br \/>\n1<br \/>\n\u67e5\u770bopenai\u7684token\uff0c\u5e76\u590d\u5236\u51fa\u6765<\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<br \/>\ncp config.yaml.example config.yaml<br \/>\nvim config.yaml<br \/>\n1<br \/>\n2<br \/>\n\u628a\u4e0a\u4e00\u6b65\u83b7\u5f97\u7684token\uff0c\u586b\u5728token\u4f4d\u7f6e<\/p>\n<p>\u62c9\u53d6docker\u4ed3\u5e93\uff0c\u5e76\u8fd0\u884c<br \/>\ndocker run -d &#8211;name wechat-chatgpt -v $(pwd)\/config.yaml:\/app\/config.yaml holegots\/wechat-chatgpt:latest<br \/>\n1<br \/>\n\u67e5\u770b\u8fd0\u884c\u72b6\u6001<br \/>\nsudo docker logs -f wechat-chatgpt<br \/>\n1<br \/>\n\u6709\u4e00\u4e2a\u4e8c\u7ef4\u7801\u51fa\u6765\uff0c\u7136\u540e\u7528\u81ea\u5df1\u7684\u6d4b\u8bd5\u53f7\u626b\u7801\u767b\u9646<br \/>\n\u767b\u9646\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u7528\u81ea\u5df1\u7684\u5927\u53f7\u4e0e\u4ed6\u804a\u5929\u6d4b\u8bd5\u4e86<\/p>\n<p>\u00a0<\/p>\n<p>\u5176\u4ed6\u547d\u4ee4<br \/>\n\u67e5\u770b\u8fd0\u884c\u7684docker\u5373contarin\u7684\u72b6\u6001<\/p>\n<p>lighthouse@VM-0-12-ubuntu:~$ sudo docker container ls<br \/>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>\n8f511d18643a holegots\/wechat-chatgpt &#8220;npm run dev&#8221; 2 hours ago Up 29 minutes wechat-chatgpt<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n\u91cd\u542f<\/p>\n<p>sudo docker restart wechat-chatgpt<br \/>\n1<br \/>\n\u505c\u6b62<\/p>\n<p>sudo docker stop wechat-chatgpt<br \/>\n1<br \/>\n\u83b7\u5f97container id<\/p>\n<p>sudo docker container ls -al<br \/>\n1<br \/>\n\u5220\u9664container<\/p>\n<p>sudo docker container rm cd59<br \/>\n1<br \/>\n\u518d\u91cd\u65b0\u8fd0\u884c<\/p>\n<p>sudo docker run -d &#8211;name wechat-chatgpt -v $(pwd)\/config.yaml:\/app\/config.yaml holegots\/wechat-chatgpt<br \/>\n1<br \/>\n\u6587\u7ae0\u77e5\u8bc6\u70b9\u4e0e\u5b98\u65b9\u77e5\u8bc6\u6863\u6848\u5339\u914d\uff0c\u53ef\u8fdb\u4e00\u6b65\u5b66\u4e60\u76f8\u5173\u77e5\u8bc6<br \/>\n\u4e91\u539f\u751f\u5165\u95e8\u6280\u80fd\u6811\u9996\u9875\u6982\u89c89001 \u4eba\u6b63\u5728\u7cfb\u7edf\u5b66\u4e60\u4e2d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 \u00a0 \u81f3\u5c0a\u5b9dl \u4e8e 2022-1<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[24],"tags":[121],"class_list":["post-6432","post","type-post","status-publish","format-standard","hentry","category-value_docs","tag-05-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/6432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=6432"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/6432\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=6432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=6432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=6432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}