<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/rss/stylesheet/" type="text/xsl"?>
<rss xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:taxo='http://purl.org/rss/1.0/modules/taxonomy/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:itunes='http://www.itunes.com/dtds/podcast-1.0.dtd' xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:podbridge='http://www.podbridge.com/podbridge-ad.dtd' version='2.0'>
<channel>
  <title>自习室</title>
  <language>zh-cn</language>
  <generator>microfeed.org</generator>
  <itunes:type>episodic</itunes:type>
  <itunes:explicit>false</itunes:explicit>
  <atom:link rel="self" href="https://blog.daoluan.club/rss/" type="application/rss+xml"/>
  <link>https://daoluan.club</link>
  <description>
    <![CDATA[<p>玩儿</p><p>部分文章不公开列出，可在此查看：<a href="https://daoluan.club/i/unlisted-posts-SR9CmFP7QQ2/" rel="noopener noreferrer" target="_blank">不入列目录</a></p><p><br></p><p><a href="https://daoluan.club/i/pleroma-migrating-a-mastodon-account-aH8L7FWzxXY/" rel="noopener noreferrer" target="_blank">长毛象及Pleroma如何存档和搬家</a></p><p><a href="https://daoluan.club/i/wiremin-5AkmhSENocv/" rel="noopener noreferrer" target="_blank">推荐匿名点对点加密去中心化聊天工具WireMin</a></p><p><a href="https://daoluan.club/i/microfeed-blogging-platforms-comparison-h-Fl8bcGaSB/" rel="noopener noreferrer" target="_blank">博客平台比较和我的推荐Microfeed</a></p><p><a href="https://daoluan.club/i/microfeed-installation-123-fCBcsvQp63B/" rel="noopener noreferrer" target="_blank">Microfeed安装流程</a></p><p><a href="https://daoluan.club/i/zero-trust-access-settings-gXNrSMx3AlN/" rel="noopener noreferrer" target="_blank">Microfeed设置登录界面Zero Trust</a></p>]]>
  </description>
  <itunes:author>捣乱</itunes:author>
  <itunes:image href="https://pub.daoluan.club/daoluan/production/images/channel-00d01b804418cd4d55486aa804844c34.png"/>
  <image>
    <title>自习室</title>
    <url>https://pub.daoluan.club/daoluan/production/images/channel-00d01b804418cd4d55486aa804844c34.png</url>
    <link>https://daoluan.club</link>
  </image>
  <copyright>©2023</copyright>
  <item>
    <title>设置登录界面 Zero Trust Access Settings</title>
    <guid>gXNrSMx3AlN</guid>
    <pubDate>Mon, 17 Apr 2023 12:04:57 GMT</pubDate>
    <itunes:explicit>false</itunes:explicit>
    <description>
      <![CDATA[<p>这部分设置开发者写得比较简单。如果没有自己的域名，方法略有不同，如果有自己的域名，有些步骤不按开发者的顺序做更好。</p><p>另外，默认的登录方式只有给邮件发一次性PIN码，如果经常要登录就比较麻烦，设置一些其他登录方法会更方便。</p><p>这里就记录一下包括添加其他登录方法在内的整个设置过程。</p><p>对有自己的域名和没有的两种情况做出不同说明。</p><p><br></p><p><strong>一，添加和定义用户组</strong></p><p><br></p><p>添加Admin并设为默认组。按照开发者说明做就可以。</p><p>在cloudflare的管理面板 - zero trust - Access - Access Groups - Add a group - Group name命名 - set as default group打勾 - 在group configuration里添加规则。</p><p>Include - selector是email - value是加入这个组的成员的email地址，这个email可以用来接收一次性PIN码。</p><p><strong>如果要设置其它登录方式</strong>，比如google和github，用来登录google和github账号的email如果和接受PIN码的email不同，都要分别填在value里。</p><p>如需添加访客可以定义不同组，之后再对不同组设置不同的登录规则。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-6210a563e3c741ba3059a3904fbbd5db.png"></p><p><br></p><p><strong>二，添加其他登录方式。</strong></p><p><br></p><p>如果你想用其他登录方式，可以现在先添加好，这样方便后面一起设置。</p><p><br></p><p>1, 到zero trust - settings。其中的general - login page里可以自定义登录界面会显示的名字LOGO等。</p><p><br></p><p>2, 到zero trust - settings - authentication里，</p><ul><li>App Launcher，打开<strong>Accept all available identity providers</strong>。</li></ul><p class="ql-indent-1">Rules - Add a rule - Rule name (命名) - Rule Action (allow) - Assign a group勾选Admin。如有需要也可以用Include添加不在已定义的用户组里的其他用户，或添加其它定义。</p><ul><li>然后在Login Methods - add new - one-time PIN是默认的，另外有多种方式可选，</li></ul><p class="ql-indent-1">因为建microfeed时候都用了github，首选github，这个的设置也非常简单，点进去有详细说明，主要就是在github填写cloudaccess这边的两个网址，生成ID和密码后再填回authentication里。</p><p class="ql-indent-1">我同时设置了Google，但这并非必要。</p><p class="ql-indent-1">在authentication里对Google的设置说明和现在google实际的界面不完全一样。Google的界面看起来比github复杂，步骤也多一些，实际上只是需要多填个人主页信息和联系信息，其他一样。</p><p class="ql-indent-1">设好后回到authentication的首页测试，设置成功如下图所示。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-f3ea02baae8821613300d4983d96bb92.png"></p><p><br></p><p><strong>三，添加Self-hosted Application</strong></p><p><br></p><p>Zero trust - Access - Applications - Add an application</p><p><br></p><p><strong>如果有自己的域名</strong>，直接点self-hosted，进入设置页面。</p><p><strong>如果你没有自己的域名</strong>，使用cloudflare pages的默认域名{project-name}.pages.dev，那么这里self-hosted是灰的无法添加，会推你去买自定义域名。实际上有可以绕过的方法。讲完如何设置，<strong>最后再讲如何绕路</strong>。</p><p><strong>更新</strong>：cloudflare更改了规则，堵上了这个绕路的缺口。目前没有自定义域名默认只能对{project-name}.pages.dev进行设置，无法设置path添加admin。也就是说，只能对全站设置登录，无法仅设置后台管理页面的登录。除非你做一个全私密的、只有指定用户可以访问、一旦访问就暴露后台的博客，这个登录设置就失去意义。这等于还是在推大家去买域名。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-568b2161524f152f8a19414c03932a1b.png"></p><p><br></p><p><strong>以下依次设置Overview - Policies - Authentication - (Settings可以不管)</strong></p><p><br></p><p>1, 先在<strong>overview</strong>里按下图设置。Session Duration设置多久需要重新登录一次。要注意的是，<strong>先填写path里的admin</strong>，再填写domain。先填domain的话就无法填写后面的admin了。</p><p>在这个页面还可以自定义logo。Application name和Application Logo都会显示在你的登录页面上。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-121c805f37e4dc0479dae5a80aecb505.png"></p><p><br></p><p><strong>如果没有自己的域名</strong>，填好domain会显示红字提醒the zone does not exist，this domain is already taken，不用理它，可以继续设置。</p><p><br></p><p><strong>如果有自己的域名，</strong>可以另外设置好自定义域名和bulk redirects，这样只要设置自定义域名，不用再设置pages.dev的默认域名，不必按开发者的说明分别设置两个。</p><p>步骤是：</p><ul><li>在cloudflare dash - pages - 你的project name - custom domains里设置好自定义域名。</li><li>到左边栏最下面的bulk redirects - create bulk redirect list，把pages.dev的默认域名指向自定义域名。</li><li>再来设置zero trust access。</li></ul><p><br></p><p>2, 下一步设置<strong>Policies</strong>，按下图所示设置。</p><p><strong>如果只有你自己</strong>，assign好admin group就行，不用再设置其他。</p><p><strong>如果还需要设置访客</strong>，可以create additional rules，添加其他人的访问规则。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-9006f44c88f3bde48dd2cfd49765d0a6.png"></p><p><br></p><p>3, 下一步，<strong>Authentication</strong>&nbsp;- Accept all available identity providers</p><p><br></p><p>4, 然后就可以<strong>Save Application</strong>了。这时再去访问刷新admin page，应该就会出现下图所示的登录界面。整个microfeed安装中最复杂的一部分就设置<strong>完成了！</strong></p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-601925a0c6da972e6572cadda338e3b2.png"></p><p><br></p><p>另外，如果要设置Visitors group，先到Add Group里添加该组，然后在group configuration里添加用户emails，保存，然后到Applications里添加一条针对Visitor的policy，assign a group里勾选visitor group就可以了，这样访客用户填写email就会收到一次性的PIN。</p><p><br></p><p>开发者还提到，可以给整个blog设置登录，这种情况下要注意的是，admin界面无法分开登录，登录进入blog就可以进入admin。如果有这个需要，只要设置blog的登录就可以了，不必分别设置blog和admin。</p><p><br></p><p><strong>如果你用了自定义域名</strong>，后面的可以不用看了。</p><p><br></p><p><strong>最后讲一下没有自定义域名绕路的方法，以及会遇到的小坑。</strong></p><p><br></p><p><strong>更新：</strong>前面说了现在用默认域名已经无法单独设置后台管理界面，但还是可以对整个域名设置登录界面。保留下文作为参考。</p><p><br></p><p>到dash.cloudflare.com - pages - 点进project比如<u>daoluan</u>&nbsp;- settings -&nbsp;<strong>Enable Access Policy，</strong>之后enable会变成manage policies，点这个就带你回到设置app的页面。</p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-853378df668a639c02ea89ee55813718.png"></p><p><br></p><p>回到刚才Application（back to applications）的页面，已经自动生成了一个名为{project name} - cloudflare pages的application。</p><p>这时你点击app名 - 点右边出现的configuration，就可以进入设置页面按照前文所说编辑这个app了。</p><p>这种情况下，域名默认是空的，如前文所说，填进去时会出现zone does not exist，不用管它继续往下。</p><p>保存后这里又会变空，以后只要重新编辑都会提示没有域名，必须再次到overview把域名填好，再编辑，最后再save app。</p><p>最后显示在Application URL下的应该是{project-name}.pages.dev/admin，<strong>没有前面的星号</strong>。</p><p>这样就设置成功了！</p><p><br></p><p><strong>编辑前如下图</strong></p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-20c8bfe077ac0cb65289d8916332845c.png"></p><p><br></p><p><strong>编辑后如下图</strong></p><p><br></p><p><img src="https://pub.daoluan.club/daoluan/production/media/rich-editor/items/gXNrSMx3AlN/image-507370e9c711c887ad50586d3c9555ab.png"></p><p><br></p><p><strong>相关blogs：</strong></p><p><a href="https://daoluan.club/i/microfeed-blogging-platforms-comparison-h-Fl8bcGaSB/" rel="noopener noreferrer" target="_blank">我使用过的博客平台比较和我的推荐Microfeed</a></p><p><a href="https://daoluan.club/i/microfeed-installation-123-fCBcsvQp63B/" rel="noopener noreferrer" target="_blank">Microfeed安装流程123</a></p><p><br></p><p><strong>推荐blog</strong></p><p><a href="https://daoluan.club/i/wiremin-5AkmhSENocv/" rel="noopener noreferrer" target="_blank">推荐匿名点对点加密去中心化聊天工具WireMin</a></p><p><a href="https://daoluan.club/i/pleroma-migrating-a-mastodon-account-aH8L7FWzxXY/" rel="noopener noreferrer" target="_blank">长毛象和Pleroma如何存档和搬家</a></p>]]>
    </description>
    <link>https://daoluan.club/i/zero-trust-access-settings-gXNrSMx3AlN/</link>
    <itunes:episodeType>full</itunes:episodeType>
  </item>
</channel>
</rss>