我正在使用 Algolia 搜索构建我的 Jekyll 网站。
关于 jekyll-algolia的文档说必须在 environment variable 中提供管理员密钥ALGOLIA_API_KEY
。
但是,关于 API 密钥安全性的另一页说
您的管理 API 密钥是最敏感的密钥:它提供对所有索引和数据的完全控制。管理 API 密钥应始终保持安全。不要将它发布给任何人或不要在任何应用程序中使用它,并且始终创建一个更具限制性的新密钥。此 API 密钥几乎应该专门用于生成其他更有限的 API 密钥,然后这些 API 密钥将用于搜索和执行索引操作。
阅读第二页,我正在尝试创建一个更具限制性的密钥,以便jekyll-algolia
在我的 Jekyll 网站的 CI 版本中使用:
但是我仍然收到以下投诉bundle exec jekyll algolia
:
ibug@ubuntu:~/iBug.github.io$ ALGOLIA_API_KEY="0123456789abcdef0123456789abcdef" bundle exec jekyll algolia
Configuration file: /home/wsl/iBug.github.io/_config.yml
Processing site...
AutoPages: Disabled/Not configured in site.config.
Pagination: Complete, processed 1 pagination page(s)
Jekyll Feed: Generating feed for posts
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
Extracting records...
Updating records in index iBug_website...
Records to delete: 428
Records to add: 420
[✗ Error] Invalid credentials
The jekyll-algolia plugin could not connect to your application ID using the
API key your provided.
Make sure your API key has access to your 14DZKASAEJ application.
You can find your API key in your Algolia dashboard here:
https://www.algolia.com/licensing
ibug@ubuntu:~/iBug.github.io$ echo $?
1
我该怎么做?或者我必须在 CI 环境中提供管理员密钥吗?