Skip to content

Commit

Permalink
Site updated: 2024-10-13 09:37:36
Browse files Browse the repository at this point in the history
  • Loading branch information
ekyfig committed Oct 13, 2024
1 parent e865c42 commit ff866c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<meta property="og:description" content="可选方式运行Vaultwarden有两种方式:直接运行二进制和docker运行,显然后者更方便,前者也需要先pull docker镜像再从里面提取。配置有好几种方式:docker命令、docker compose、环境文件(.env)、管理面板(config.json),其中docker命令一长串改起来很麻烦,env文件包含了所有配置项,而docker compose可以只写与默认配置不同的项,所">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2024-10-12T14:34:05.000Z">
<meta property="article:modified_time" content="2024-10-12T16:18:58.969Z">
<meta property="article:modified_time" content="2024-10-13T01:36:59.618Z">
<meta property="article:author" content="Ekyfig">
<meta property="article:tag" content="Geek">
<meta name="twitter:card" content="summary">
Expand Down Expand Up @@ -77,7 +77,7 @@
<div class="content">
<div class="top bread-nav footnote"><div class="left"><div class="flex-row" id="breadcrumb"><a class="cap breadcrumb" href="/">主页</a>
<span class="sep"></span><a class="cap breadcrumb" href="/">文章</a><span class="sep"></span><a class="cap breadcrumb-link" href="/categories/Guide/">Guide</a></div>
<div class="flex-row" id="post-meta"><span class="text created">发布于:<time datetime="2024-10-12T14:34:05.000Z">2024-10-12</time></span><span class="sep updated"></span><span class="text updated">更新于:<time datetime="2024-10-12T16:18:58.969Z">2024-10-13</time></span></div></div></div>
<div class="flex-row" id="post-meta"><span class="text created">发布于:<time datetime="2024-10-12T14:34:05.000Z">2024-10-12</time></span><span class="sep updated"></span><span class="text updated">更新于:<time datetime="2024-10-13T01:36:59.618Z">2024-10-13</time></span></div></div></div>

<div class="bottom only-title">

Expand All @@ -93,7 +93,7 @@ <h2 id="编写docker-compose-yml"><a href="#编写docker-compose-yml" class="hea
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">services:</span><br><span class="line"> vaultwarden: </span><br><span class="line"> image: vaultwarden/server:latest</span><br><span class="line"> container_name: vaultwarden</span><br><span class="line"> restart: always</span><br><span class="line"> ports:</span><br><span class="line"> - 1701:80</span><br><span class="line"> volumes:</span><br><span class="line"> - ./vw-data:/data</span><br><span class="line"> - /etc/localtime:/etc/localtime:ro</span><br><span class="line"> - /etc/timezone:/etc/timezone:ro</span><br><span class="line"> environment:</span><br><span class="line"> DOMAIN: &quot;你的域名&quot;</span><br><span class="line"> WEBSOCKET_ENABLED: &quot;true&quot;</span><br><span class="line"> : &quot;true&quot;</span><br><span class="line"> WEB_VAULT_ENABLED: &quot;false&quot;</span><br><span class="line"> INVITATIONS_ALLOWED: &quot;false&quot;</span><br><span class="line"> TIME_ZONE: &quot;Asia/Shanghai&quot;</span><br><span class="line"> LOG_FILE: &quot;/data/vaultwarden.log&quot;</span><br></pre></td></tr></table></figure>
<p>在注册完要用的账号后建议把SIGNUPS_ALLOWED和INVITATIONS_ALLOWED改为false更加安全<br>接下来说说可以添加的配置</p>
<h3 id="邮件功能"><a href="#邮件功能" class="headerlink" title="邮件功能"></a>邮件功能</h3><p>Vaultwarden的邮箱功能可以用于双重验证,异常登录通知,账号激活。你需要有一个支持SMTP的邮箱用于发送这些邮件。Outlook可以参考<a target="_blank" rel="noopener" href="https://support.microsoft.com/zh-cn/office/outlook-com-%E7%9A%84-pop-imap-%E5%92%8C-smtp-%E8%AE%BE%E7%BD%AE-d088b986-291d-42b8-9564-9c414e2aa040">官方指南</a>,Gmail必须先启用双重验证然后添加一个应用密码才能使用SMTP。我用的阿里云新加坡轻量服务器,Outlook连不上,Google账号又只有一个,所以选择用自己的域名借助第三方服务搭建一个邮箱,这也是我比较推荐的方式。Vaultwarden官方wiki推荐的SMTP中sendgrid我审核没过,Brevo倒是搭建成功了但是发出的邮件一直被加入queue ,在仪表盘上queue又显示0,发ticket客服也不知道为什么。serv00自带一个开箱即用的邮箱但是就是因为免费又开箱即用所以被滥用了,已经被spamhaus标记了,发给Outlook直接拒收。。。绑定自己的域名倒是可以发出去,但是mailtester的分数也不太好看,而且不知道什么时候跑路(感觉要被薅秃了)。最后我选择了飞书国际版larksuite,教程可以参考<a target="_blank" rel="noopener" href="https://www.nanshi.dedyn.io/article/custom-domain-email">这篇</a>,搭好后需要在docker-compose.yml中添加以下内容</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">SMTP_HOST: &quot;SMTP服务器地址,larksuite的是这个:smtp.larksuite.com&quot;</span><br><span class="line"> SMTP_PORT: &quot;465&quot;</span><br><span class="line"> SMTP_SECURITY: &quot;force_tls&quot;</span><br><span class="line"> SMTP_FROM: &quot;你SMTP的邮箱地址&quot;</span><br><span class="line"> SMTP_USERNAME: &quot;同上&quot;</span><br><span class="line"> SMTP_PASSWORD: &quot;账户密码&quot;</span><br><span class="line"> SMTP_AUTH_MECHANISM: &quot;Login&quot;</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">SMTP_HOST: &quot;SMTP服务器地址,larksuite的是这个:smtp.larksuite.com&quot;</span><br><span class="line">SMTP_PORT: &quot;465&quot;</span><br><span class="line">SMTP_SECURITY: &quot;force_tls&quot;</span><br><span class="line">SMTP_FROM: &quot;你SMTP的邮箱地址&quot;</span><br><span class="line">SMTP_USERNAME: &quot;同上&quot;</span><br><span class="line">SMTP_PASSWORD: &quot;账户密码&quot;</span><br><span class="line">SMTP_AUTH_MECHANISM: &quot;Login&quot;</span><br></pre></td></tr></table></figure>
<p>对了,你可以在<a target="_blank" rel="noopener" href="https://www.mail-tester.com/">Mail-tester</a>查看你的邮箱得分,分数越高越不可能被标记为垃圾邮件</p>
<h3 id="启用Android-iOS的消息推送"><a href="#启用Android-iOS的消息推送" class="headerlink" title="启用Android&#x2F;iOS的消息推送"></a>启用Android&#x2F;iOS的消息推送</h3><p>vaultwarden兼容bitwarden的push,具体来说就是谷歌FCM和苹果APN。配置方法也不复杂,参考官方wiki的<a target="_blank" rel="noopener" href="https://rs.ppgg.in/configuration/enabling-mobile-client-push-notification">教程</a></p>
<h3 id="使用MySQL作为后端"><a href="#使用MySQL作为后端" class="headerlink" title="使用MySQL作为后端"></a>使用MySQL作为后端</h3><p>MySQL比sqlite3(vaultwarden自带且默认使用)性能更好,这里我们也运行在docker里面,在原来的yml下面加入以下内容:</p>
Expand Down
Loading

0 comments on commit ff866c7

Please sign in to comment.