This commit is contained in:
sevichecc 2022-12-20 00:12:20 +08:00
parent acdd20d4a8
commit 51e83043c2
12 changed files with 209 additions and 11 deletions

View file

@ -86,6 +86,6 @@
"workbox-window": "^6.5.4"
},
"dependencies": {
"netlify-cli": "^12.3.0"
"netlify-cli": "^12.4.0"
}
}

View file

@ -34,7 +34,7 @@ specifiers:
github-slugger: ^2.0.0
mdast-util-to-string: ^3.1.0
mdsvex: ^0.10.6
netlify-cli: ^12.3.0
netlify-cli: ^12.4.0
npm-run-all: ^4.1.5
postcss: ^8.4.20
prettier: ^2.8.1
@ -63,7 +63,7 @@ specifiers:
workbox-window: ^6.5.4
dependencies:
netlify-cli: 12.3.0_@types+node@18.11.15
netlify-cli: 12.4.0_@types+node@18.11.15
devDependencies:
'@iconify-json/heroicons-outline': 1.1.5
@ -451,7 +451,6 @@ packages:
hasBin: true
dependencies:
'@babel/types': 7.20.5
dev: true
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.20.5:
resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==}
@ -8984,8 +8983,8 @@ packages:
resolution: {integrity: sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==}
dev: false
/netlify-cli/12.3.0_@types+node@18.11.15:
resolution: {integrity: sha512-CPg1hi/21qwZP+pnyHIXOEzWgNRFAvFQ4uMvH/k2vPIS1LOAdFn31Y8J8ISOKLF1zUArbTawanpEhDjqMutCfg==}
/netlify-cli/12.4.0_@types+node@18.11.15:
resolution: {integrity: sha512-psSL2L548C7bBr4JJQjmnqWQIuu/O2ZeL9FIrJd7dm6VTt3vKDMM1/eQluwUuXcBqVmYKNFh4UeMnVC/gqh4qg==}
engines: {node: ^14.16.0 || >=16.0.0}
hasBin: true
requiresBuild: true
@ -9213,14 +9212,14 @@ packages:
resolution: {integrity: sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==}
engines: {node: '>=6.0'}
dependencies:
'@babel/parser': 7.16.8
'@babel/parser': 7.20.5
dev: false
/node-source-walk/5.0.0:
resolution: {integrity: sha512-58APXoMXpmmU+oVBJFajhTCoD8d/OGtngnVAWzIo2A8yn0IXwBzvIVIsTzoie/SrA37u+1hnpNz2HMWx/VIqlw==}
engines: {node: '>=12'}
dependencies:
'@babel/parser': 7.16.8
'@babel/parser': 7.20.5
dev: false
/node-stream-zip/1.15.0:

View file

@ -3,8 +3,8 @@
</script>
<script lang="ts">
export let user = undefined
export let repo = undefined
export let user = ''
export let repo = ''
let info: {
html_url: string
description: string

View file

@ -117,7 +117,7 @@ sudo systemctl reload nginx
```conf
server {
listen 443 ssl;
server_name 域名
server_name 域名;
location / {
proxy_pass http://127.0.0.1:反代端口;
proxy_set_header HOST $host;

View file

@ -0,0 +1,132 @@
---
title: VPS · 搭建轻量便捷的书签应用 Linkding
created: 2022-12-18
summary: linkding is a simple bookmark service that you can host yourself. It's designed be to be minimal, fast, and easy to set up using Docker.
cover: https://github.com/sissbruecker/linkding/blob/master/docs/linkding-screenshot.png?raw=true
tags:
- VPS
---
## 前言
在前文[Airtable · 网页剪藏](/2022-03-06-airtable/) 中提到了我是如何使用[Airtable](https://airtable.com/)它来剪切网页的,虽然 Airtable 剪切时可以同时保留网页截图,但没办法自动 Archive 网页,有些内容时间久了还是一样在风里消散。于是某天我决定试试[Miniflux](https://miniflux.app/)最近支持的开源书签应用 [Linkding](https://github.com/sissbruecker/linkding)
<script lang="ts">
import Github from '$lib/components/extra/github.svelte'
</script>
<Github user='sissbruecker' repo='linkding'/>
## 功能介绍
Linkding 是一款极简、高效、容易使用的自建书签应用,官方文档写的主要特点有:
- Organize bookmarks with tags——用标签来管理书签
- Read it later functionality——稍后读功能
- Share bookmarks with other users——和他人分享书签
- Bulk editing——批量管理书签
- Bookmark archive——书签 Archive 功能
- Automatically provides titles and descriptions of bookmarked websites——自动获取书签网页的标题和描述
- Automatically creates snapshots of bookmarked websites on the Internet Archive Wayback Machine——自动创建网页快照上传到[Internet Archive Wayback Machine](https://web.archive.org/).
- Import and export bookmarks in Netscape HTML format——以 Netscape HTML 的格式导入和导出书签
- Extensions for Firefox and Chrome, as well as a bookmarklet——有支持 Firefox 和 Chrome 的浏览器插件,以及 bookmarklet
- Light and dark themes——明亮和黑暗模式
- REST API for developing 3rd party apps——用于开发第三方应用的 REST API
- Admin panel for user self-service and raw data access——用户自助服务和原始数据访问的管理面板
- Easy setup using Docker, uses SQLite as database——使用 Docker 轻松设置,使用 SQLite 作为数据库
里面没有提到的比较吸引人的几个比较吸引人的功能:
- 联合 Miniflux 同步收藏
- 书签 List 可以自动生成 RSS 源
- 使用浏览器插件[Linkding-injector](https://github.com/Fivefold/linkding-injector)可以在搜索引擎搜索时显示书签内相符的内容
## 搭建
我采用 `docker-compose` 的方式来部署 Linkidng下面是具体搭建步骤
### 1.创建配置文件夹
```bash
sudo mkdir /opt/linkding && cd /opt/linkding
```
也可以放在别的地方,这个位置并不影响
### 2.修改配置
```bash
sudo nano docker-compose.yml
```
复制 [linkding/docker-compose.yml](https://github.com/sissbruecker/linkding/blob/master/docker-compose.yml),粘贴进去,也就是:
```yaml
version: '3'
services:
linkding:
container_name: '${LD_CONTAINER_NAME:-linkding}'
image: sissbruecker/linkding:latest
ports:
- '${LD_HOST_PORT:-9090}:9090'
volumes:
- '${LD_HOST_DATA_DIR:-./data}:/etc/linkding/data'
env_file:
- .env
restart: unless-stopped
```
然后修改环境变量`.env`
```bash
sudo nano .env
```
将[`.env.example`](https://github.com/sissbruecker/linkding/blob/master/.env.sample) 下面的内容 copy 进去,按照[文档](https://github.com/sissbruecker/linkding/blob/master/docs/Options.md)调整自己的配置,下面是我的配置:
```bash title=".env" {9,12}
# Docker container name
LD_CONTAINER_NAME=linkding
# Port on the host system that the application should be published on
# 端口号默认9090
LD_HOST_PORT=9090
# Directory on the host system that should be mounted as data dir into the Docker container
LD_HOST_DATA_DIR=./data
# Username of the initial superuser to create, leave empty to not create one
# 设置管理员用户名
LD_SUPERUSER_NAME=test
# Password for the initial superuser, leave empty to disable credentials authentication and rely on proxy authentication instead
# 设置管理员密码
LD_SUPERUSER_PASSWORD=1234
# Option to disable background tasks
LD_DISABLE_BACKGROUND_TASKS=False
# Option to disable URL validation for bookmarks completely
LD_DISABLE_URL_VALIDATION=False
# Enables support for authentication proxies such as Authelia
LD_ENABLE_AUTH_PROXY=False
```
注意修改用户名和用户密码,保存后`sudo docker compose up -d`上线 docker然后就可以在`http://ip:9090`预览 Linkding 页面了,
### 3.配置反代
nginx 配置(和往常一样,没有什么特别的)
```conf
server {
listen 443 ssl;
server_name 域名;
location / {
proxy_pass http://127.0.0.1:9090;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
这一步具体可以参考[VPS · 配置 Cloudflare 的免费 SSL 证书-Nginx 配置](/2022-06-12-cloudflare/#3-%E4%BF%AE%E6%94%B9-nginx-%E9%85%8D%E7%BD%AE)部分内容,在此不再赘述,`nginx -t` 和 `systemctl reload nginx` 一套操作下来之后就可以在相应的域名访问 Linkding 了,然后用上面设置的用户名和密码登录

View file

@ -0,0 +1,67 @@
---
title: Miniflux Injector · 构建自己的搜索引擎
created: 2022-12-19
summary: Build your own search engine by Miniflux&Linkidng injector
image: /2022-12-19-search-injectors/cover.png
---
在前文 [搭建可一键 Archive 的书签应用-Linkding](/2022-12-18-linkding-intro) 中我里面提到了 [Linkding-Injector](https://github.com/Fivefold/linkding-injector) 这个插件,在用了一段时间后我特别喜欢,因为这样在某些程度上可以避免「稍后读」=>「永远不读」的困境,但是 Linkding 里面的内容又总是太少了,常常搜不到什么内容,然后……
面对 [Miniflux](https://miniflux.app/)中五万多条未读,我决定做些什么。
## 关于 Miniflux-Injector
<script lang="ts">
import Github from '$lib/components/extra/github.svelte'
</script>
<Github user='sevichecc' repo='miniflux-injector'/>
Miniflux Injector 是 Fork 自 Linkding-injector 的一个浏览器插件,它可以将 Miniflux 的搜索结果注入到 Google 和 Duckduckgo 等搜索页面。
使用效果:
![duckduckgo](https://github.com/Sevichecc/miniflux-injector/raw/main/docs/duckduckgo.png)
![google](https://github.com/Sevichecc/miniflux-injector/raw/main/docs/google.png)
## 安装
### FireFox
从 [Mozilla Addon Store](https://addons.mozilla.org/zh-CN/firefox/addon/miniflux-injector/)中添加
### Chrome
1. 下载最新 [release](https://github.com/Sevichecc/miniflux-injector/releases/tag/v1.0.1)中的`miniflux_injector-1.0.1.zip`压缩包并解压
2. 在浏览器拓展管理页面中打开`开发者模式`
3. 点击`加载已解压的扩展程序`选取刚刚解压的文件夹,如图就是加载好了:
![](/2022-12-19-search-injectors/setting.png)
Brave 浏览器同理
## 配置
### 1. 生成 Miniflux API Token
在`https://你的miniflux域名/keys` 下,点击`Create a new API Key` 创建,`API Key Label`可以随意填,创建完后复制 Token
### 2. 填入 Token
打开扩展配置页面,填入刚才复制的 Token 和其他内容:
![](/2022-12-19-search-injectors/config.png)
点击右下角的`Save` 保存配置,如果配置成功,则会出现`Connection successful` 的字样
### 3. 关于默认配置
- Max Search result默认展示的条目数
- Open Link in a New Tab在新页面打开链接
- Open in Miniflux可以选择在 Miniflux 中打开链接,需要注意的是此设置打开后搜索会变慢
配置完成之后就可以在 DuckDuckGo 和 Google 中搜索看看啦~
## 后记
我目前的 RSS Feed 有 951 条,未读 53460 条……不过有了 Miniflux-injector 我相信不会积灰了,还看到有人在开发[shiori-injector](https://github.com/tezlm/shiori-injector)[shiori](https://github.com/go-shiori/shiori) 跟 linkding 一样,也是一个书签管理器,和和 linkding 不一样的是shiori 还保存了源网页的内容,类似 Pocket 的感觉,我之前试过,功能还不是很完善,所以没有用下去,未来还会不会再次尝试呢?暂不清楚
- 发现更多的 RSS 源,我推荐 [RSS+](https://greasyfork.org/zh-CN/scripts/373252-rss-show-site-all-rss)
- 推荐阅读:[Use RSS for privacy and efficiency](https://rsapkf.org/weblog/q2z)

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB