Docker部署Chatwoot在线聊天客服

Chatwoot是一款聊天对话软件,支持Docker部署Chatwoot,详细过程如下 安装docker及docker compose # example in ubuntu apt-get update curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh apt install docker-compose-plugin 查看对应的版本 docker --version docker compose version 创建配置文件 mkdir chatwoot cd chatwoot wget -O .env https://raw.githubusercontent.com/chatwoot/chatwoot/develop/.env.example wget -O docker-compose.yaml https://raw.githubusercontent.com/chatwoot/chatwoot/develop/docker-compose.production.yaml 编辑修改,注意在.env和docker-compose.yaml二者中的POSTGRES_PASSWORD参数必须一致 nano .env SECRET_KEY_BASE值可以用以下命令生成,二选一即可 openssl rand -base64 32 head /dev/urandom | tr -dc A-Za-z0-9 | head -c 63 ; echo '' 我的自定义,示范如下 # Learn about the various environment variables at # https://www.chatwoot.com/docs/self-hosted/configuration/environment-variables/#rails-production-variables # Used to verify the integrity of signed cookies. so ensure a secure value is set # SECRET_KEY_BASE should be alphanumeric. Avoid special characters or symbols. # Use `rake secret` to generate this variable SECRET_KEY_BASE=ZoxaEZz7M/gviLx4iuLw6e141CBKPGkagPGplBgSyrA= # Replace with the URL you are planning to use for your app FRONTEND_URL=http://0.0.0.0:3000 # To use a dedicated URL for help center pages HELPCENTER_URL=http://0.0.0.0:3000 # If the variable is set, all non-authenticated pages would fallback to the default locale. # Whenever a new account is created, the default language will be DEFAULT_LOCALE instead of en # DEFAULT_LOCALE=en # If you plan to use CDN for your assets, set Asset CDN Host ASSET_CDN_HOST= # Force all access to the app over SSL, default is set to false FORCE_SSL=false # This lets you control new sign ups on your chatwoot installation # true : default option, allows sign ups # false : disables all the end points related to sign ups # api_only: disables the UI for signup, but you can create sign ups via the account apis ENABLE_ACCOUNT_SIGNUP=false # Redis config # specify the configs via single URL or individual variables # ref: https://www.iana.org/assignments/uri-schemes/prov/redis # You can also use the following format for the URL: redis://:password@host:port/db_number REDIS_URL=redis://redis:6379 # If you are using docker-compose, set this variable's value to be any string, # which will be the password for the redis service running inside the docker-compose # to make it secure REDIS_PASSWORD=ggt8AQE12vtgZPPq76AQx # Redis Sentinel can be used by passing list of sentinel host and ports e,g. sentinel_host1:port1,sentinel_host2:port2 REDIS_SENTINELS= # Redis sentinel master name is required when using sentinel, default value is "mymaster". # You can find list of master using "SENTINEL masters" command REDIS_SENTINEL_MASTER_NAME= # By default Chatwoot will pass REDIS_PASSWORD as the password value for sentinels # Use the following environment variable to customize passwords for sentinels. # Use empty string if sentinels are configured with out passwords # REDIS_SENTINEL_PASSWORD= # Redis premium breakage in heroku fix # enable the following configuration # ref: https://github.com/chatwoot/chatwoot/issues/2420 # REDIS_OPENSSL_VERIFY_MODE=none # Postgres Database config variables # You can leave POSTGRES_DATABASE blank. The default name of # the database in the production environment is chatwoot_production # POSTGRES_DATABASE= POSTGRES_HOST=postgres POSTGRES_USERNAME=postgres POSTGRES_PASSWORD=trrt75XS91MSFFcf32QPmn RAILS_ENV=development # Changes the Postgres query timeout limit. The default is 14 seconds. Modify only when required. # POSTGRES_STATEMENT_TIMEOUT=14s RAILS_MAX_THREADS=5 # The email from which all outgoing emails are sent # could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>` MAILER_SENDER_EMAIL=Chatwoot <accounts@chatwoot.com> #SMTP domain key is set up for HELO checking SMTP_DOMAIN=chatwoot.com # Set the value to "mailhog" if using docker-compose for development environments, # Set the value as "localhost" or your SMTP address in other environments # If SMTP_ADDRESS is empty, Chatwoot would try to use sendmail(postfix) SMTP_ADDRESS= SMTP_PORT=1025 SMTP_USERNAME= SMTP_PASSWORD= # plain,login,cram_md5 SMTP_AUTHENTICATION= SMTP_ENABLE_STARTTLS_AUTO=true # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html SMTP_OPENSSL_VERIFY_MODE=peer # Comment out the following environment variables if required by your SMTP server # SMTP_TLS= # SMTP_SSL= # SMTP_OPEN_TIMEOUT # SMTP_READ_TIMEOUT # Mail Incoming # This is the domain set for the reply emails when conversation continuity is enabled MAILER_INBOUND_EMAIL_DOMAIN= # Set this to the appropriate ingress channel with regards to incoming emails # Possible values are : # relay for Exim, Postfix, Qmail # mailgun for Mailgun # mandrill for Mandrill # postmark for Postmark # sendgrid for Sendgrid RAILS_INBOUND_EMAIL_SERVICE= # Use one of the following based on the email ingress service # Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html # Set this to a password of your choice and use it in the Inbound webhook RAILS_INBOUND_EMAIL_PASSWORD= MAILGUN_INGRESS_SIGNING_KEY= MANDRILL_INGRESS_API_KEY= # Creating Your Inbound Webhook Instructions for Postmark and Sendgrid: # Inbound webhook URL format: # https://actionmailbox:[YOUR_RAILS_INBOUND_EMAIL_PASSWORD]@[YOUR_CHATWOOT_DOMAIN.COM]/rails/action_mailbox/[RAILS_INBOUND_EMAIL_SERVICE]/inbound_emails # Note: Replace the values inside the brackets; do not include the brackets themselves. # Example: https://actionmailbox:mYRandomPassword3@chatwoot.example.com/rails/action_mailbox/postmark/inbound_emails # For Postmark # Ensure the 'Include raw email content in JSON payload' checkbox is selected in the inbound webhook section. # Storage ACTIVE_STORAGE_SERVICE=local # Amazon S3 # documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage S3_BUCKET_NAME= AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= # Log settings # Disable if you want to write logs to a file RAILS_LOG_TO_STDOUT=true LOG_LEVEL=info LOG_SIZE=500 # Configure this environment variable if you want to use lograge instead of rails logger #LOGRAGE_ENABLED=true ### This environment variables are only required if you are setting up social media channels # Facebook # documentation: https://www.chatwoot.com/docs/facebook-setup FB_VERIFY_TOKEN= FB_APP_SECRET= FB_APP_ID= # https://developers.facebook.com/docs/messenger-platform/instagram/get-started#app-dashboard IG_VERIFY_TOKEN= # Twitter # documentation: https://www.chatwoot.com/docs/twitter-app-setup TWITTER_APP_ID= TWITTER_CONSUMER_KEY= TWITTER_CONSUMER_SECRET= TWITTER_ENVIRONMENT= #slack integration SLACK_CLIENT_ID= SLACK_CLIENT_SECRET= # Google OAuth GOOGLE_OAUTH_CLIENT_ID= GOOGLE_OAUTH_CLIENT_SECRET= GOOGLE_OAUTH_CALLBACK_URL= ### Change this env variable only if you are using a custom build mobile app ## Mobile app env variables IOS_APP_ID=L7YLMN4634.com.chatwoot.app ANDROID_BUNDLE_ID=com.chatwoot.app # https://developers.google.com/android/guides/client-auth (use keytool to print the fingerprint in the first section) ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:D4:5D:D4:53:F8:3B:FB:D3:C6:28:64:1D:AA:08:1E:D8 ### Smart App Banner # https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html # You can find your app-id in https://itunesconnect.apple.com #IOS_APP_IDENTIFIER=1495796682 ## Push Notification ## generate a new key value here : https://d3v.one/vapid-key-generator/ # VAPID_PUBLIC_KEY= # VAPID_PRIVATE_KEY= # # for mobile apps # FCM_SERVER_KEY= ### APM and Error Monitoring configurations ## Elastic APM ## https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html # ELASTIC_APM_SERVER_URL= # ELASTIC_APM_SECRET_TOKEN= ## Sentry # SENTRY_DSN= ## Scout ## https://scoutapm.com/docs/ruby/configuration # SCOUT_KEY=YOURKEY # SCOUT_NAME=YOURAPPNAME (Production) # SCOUT_MONITOR=true ## NewRelic # https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/ # NEW_RELIC_LICENSE_KEY= # Set this to true to allow newrelic apm to send logs. # This is turned off by default. # NEW_RELIC_APPLICATION_LOGGING_ENABLED= ## Datadog ## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables # DD_TRACE_AGENT_URL= # MaxMindDB API key to download GeoLite2 City database # IP_LOOKUP_API_KEY= ## Rack Attack configuration ## To prevent and throttle abusive requests # ENABLE_RACK_ATTACK=true # RACK_ATTACK_LIMIT=300 # ENABLE_RACK_ATTACK_WIDGET_API=true # Comma-separated list of trusted IPs that bypass Rack Attack throttling rules # RACK_ATTACK_ALLOWED_IPS=127.0.0.1,::1,192.168.0.10 ## Running chatwoot as an API only server ## setting this value to true will disable the frontend dashboard endpoints # CW_API_ONLY_SERVER=false ## Development Only Config # if you want to use letter_opener for local emails # LETTER_OPENER=true # meant to be used in github codespaces # WEBPACKER_DEV_SERVER_PUBLIC= # If you want to use official mobile app, # the notifications would be relayed via a Chatwoot server ENABLE_PUSH_RELAY_SERVER=true # Stripe API key STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= # Set to true if you want to upload files to cloud storage using the signed url # Make sure to follow https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration on the cloud storage after setting this to true. DIRECT_UPLOADS_ENABLED= #MS OAUTH creds AZURE_APP_ID= AZURE_APP_SECRET= ## Advanced configurations ## Change these values to fine tune performance # control the concurrency setting of sidekiq SIDEKIQ_CONCURRENCY=5 # AI powered features ## OpenAI key # OPENAI_API_KEY= # Housekeeping/Performance related configurations # Set to true if you want to remove stale contact inboxes # contact_inboxes with no conversation older than 90 days will be removed # REMOVE_STALE_CONTACT_INBOX_JOB_STATUS=false 配置docker-compose.yaml文件 ...

八月 16, 2025 · admin

fly.io部署alist与vaultwarden版本的Bitwarden

现在注册fly.io账号需要绑定信用卡并验证(扣款10刀以下随机金额)后方可免费试用三个256MB内存的服务,每个1GB大小,最多3G的持久化存储 分类 限额 说明 VM: shared-cpu 每个月 2340 小时 可以全天候运行 3 个 256 MB 内存的共享 CPU 的 VM Volumes 3GB 提供 3GB 永久存储 Bandwidth 160 GB/每月 亚洲、印度30G,美国、欧洲100G的outbound流量 Anycast IPs 无限的 IPv6, 每个应用一个 IPv4 每一个额外的 IPv4 地址需要额外每个月 $2 Certificates 10 个活跃的证书 最多 10 个证书 资源定价 Fly.io 计费 获取FLY_API_TOKEN 或在本地执行flyctl auth token查看 Linux安装 curl -L https://fly.io/install.sh | sh 移动到/usr/bin目录下 cp /root/.fly/bin/flyctl /usr/bin 登陆fly.io flyctl auth login 复制提示里面的网址在浏览器中打开完成登陆 部署Bitwarden 使用 SQLite 数据库安装 Vaultwarden。但是您需要为数据库创建卷 flyctl volumes create vaultwarden_data -a APP_NAME -s 1 在 Fly 上启动创建应用 ...

八月 13, 2024 · admin

WSL2运行Ubuntu子系统并设置开机自动启动应用docker

去Microsoft官网下载 Windows 11版本要求23H2+ 打开启用或关闭Windows功能勾选适用于Linux的Windows子系统和Hyper-V重启系统生效 下载WSL2 Linux kernel update package for x64 machines安装。 WSL常用操作 查看WSL版本 wsl --version 可以在运行(win+R)或资源文件管理器的路径里直接输入\\wsl$进入Ubuntu的目录 更新 WSL: wsl --update --pre-release 关机、重启 wsl --shutdown wsl 其它 # 列出分发版本 wsl -l -v # 关闭指定版本 wsl -t Ubuntu # 启动指定版本 wsl -d Ubuntu 不能使用 systemctl 开启、停止或查看服务的运行,使用这些服务文件有许多功能 {start|stop|reload|force-reload|restart|try-restart|status},WSL可以使用service或/etc/init.d/,例如 service docker start /etc/init.d/nginx start WSL2+Docker 开机自启 WSL2子系统中的应用默认不会开机自动启动,这里以docker为例,安装docker wget -qO- get.docker.com | bash 可以手动启动docker service docker start 不过有时候我们希望它能开机自动启动,接下来使用 WSL2内操作 echo "#! /bin/sh service docker start" > /etc/init.wsl chmod +x /etc/init.wsl Windows内操作 使用 ...

一月 2, 2024 · admin

Cookie自动登陆签到、抓包提取制作HAR文件

通过自动签到(网页签到、APP签到),可以有效防止某些站点规则中的因长时间未登陆不活跃而导致封号,还可以赚积分、领金币薅羊毛… Docker安装签到 https://hub.docker.com/r/a76yyyy/qiandao https://github.com/qiandao-today/qiandao 安装、启用docker wget -qO- get.docker.com | bash systemctl enable docker systemctl start docker Docker部署a76yyyy/qiandao签到 docker run -d --name qiandao --restart=always --env PORT=8923 --net=host -v /root/qiandao:/usr/src/app/config a76yyyy/qiandao 然后就可以访问 http://localhost:8923 网页管理签到 8923端口可以随意,只要不被其它应用占用即可,/root/qiandao宿主机配置文件目录 备份数据库只需要备份/root/qiandao目录下的database.db这个文件即可; 还原数据库只需要先暂停docker stop qiandao然后将database.db复制替换掉原来/root/qiandao目录下的database.db这个文件。 启动容器 docker start qiandao 停止容器 docker stop qiandao 删除容器 docker rm qiandao 获取HAR文件 我们还可以使用Fiddler抓包软件来抓取,这里使用Chrome浏览器示范。 打开Chrome浏览器,新建隐身窗口(重要),登陆账号: 打开开发者工具(ctrl+shift+I,或者 鼠标右键 > 审查元素) 切换到 Network(网络)面板,勾选 Preserve log (非常重要) 直奔签到页,完成签到 找对签到链接(非常重要),导出HAR文件。 使用HAR模板文件签到 以PT站点为例,因为大部分PT站点都是使用NexusPHP,大同小异,我们只需要抓取https://example.com/attendance.php保留这个链接,其它统统删掉。然后利用cookie登陆签到。 注册、登陆到网页签到管理,上传导入HAR文件,编辑、删除多余的链接,只需要保留有效、正确的签到链接 编辑HAR模板文件 Request Headers全部勾选;cookie填写为{{cookie}};Cookies全部删除; 切换到测试/Test在Variables选项ADD中添加name为cookie ...

三月 11, 2022 · admin

docker创建删除使用容器或镜像

更多容器可以访问docker的Docker Hub 操作系统内核大于等于 3.10 的都可以安装最新版 Docker 查看内核版本 uname -r 安装docker wget -qO- get.docker.com | bash 安装完成后,运行下面的命令,验证是否安装成功。 docker version ...

七月 25, 2018 · admin