xBrowserSync 是一个开源的浏览器收藏夹同步工具,支持 Microsoft Edge、Google Chrome、Firefox 等浏览器,同时提供 Android APP。
下载对应的安装包,按提示安装即可
chrome://extensions/
开启开发者模式
将下载的 xBrowserSync chrome 插件包解压后拖动至 chrome 插件页面
配置同步服务器
第一次打开 xBrowserSync 插件时需要配置同步服务器,默认为 xBrowserSync 官方服务器,如需使用其他服务器,可自定义
服务器名称 | 服务器地址 | 最大同步大小 | 服务器所在地 |
---|---|---|---|
xBrowserSync | https://api.xbrowsersync.org | 1MB | United Kingdom |
nixnet | https://xsync.nixnet.services | 10MB | Germany |
Free Range Cloud | https://xbrowsersync.freerangecloud.com | 9.77MB | Canada |
需要牢记同步密码,忘记后无法找回,切回丢失同步至服务器的书签
vim xbrowsersync.yaml
---
# 创建 Namespace
apiVersion: v1
kind: Namespace
metadata:
name: hty1024-app
---
# 创建 StorageClass
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: storage-local-xbrowsersync
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: storageClass
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
---
# 创建 PersistentVolume
apiVersion: v1
kind: PersistentVolume
metadata:
name: hty1024-app-xbrowsersync-pv
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: persistentVolume
spec:
capacity:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: storage-local-xbrowsersync
local:
path: /opt/xbrowsersync/data/
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: node.k8s.hty1024.com/type
operator: In
values:
- app
---
# 创建 PersistentVolumeClaim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hty1024-app-xbrowsersync-pvc
namespace: hty1024-app
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: persistentVolumeClaim
spec:
resources:
requests:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
storageClassName: storage-local-xbrowsersync
---
# 创建 ConfigMap(自定义 mongoconfig.js 文件)
apiVersion: v1
kind: ConfigMap
metadata:
name: hty1024-app-xbrowsersync-mongoconfig
namespace: hty1024-app
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: configMap
data:
mongoconfig.js: |
db.newsynclogs.createIndex( { "expiresAt": 1 }, { expireAfterSeconds: 0 } );
db.newsynclogs.createIndex( { "ipAddress": 1 } );
db.bookmarks.createIndex( { "lastAccessed": 1 }, { expireAfterSeconds: 21*86400 } );
---
# 创建 Service
apiVersion: v1
kind: Service
metadata:
name: hty1024-app-xbrowsersync-service
namespace: hty1024-app
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: service
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
nodePort: 30000
selector:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: pod
---
# 创建 StatefulSet
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: hty1024-app-xbrowsersync-statefulset
namespace: hty1024-app
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: statefulSet
spec:
replicas: 1
minReadySeconds: 30
selector:
matchLabels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: pod
template:
metadata:
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: app
app.k8s.hty1024.com/name: xbrowsersync
app.k8s.hty1024.com/version: 1.1.13
app.k8s.hty1024.com/resources: pod
spec:
terminationGracePeriodSeconds: 60
volumes:
- name: localtime
hostPath:
path: /etc/localtime
- name: shanghai
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
- name: data
persistentVolumeClaim:
claimName: hty1024-app-xbrowsersync-pvc
- name: mongoconfig
configMap:
name: hty1024-app-xbrowsersync-mongoconfig
items:
- key: mongoconfig.js
path: mongoconfig.js
containers:
- name: mongo
image: mongo:7.0.12
ports:
- name: tcp
containerPort: 27017
volumeMounts:
- name: shanghai
mountPath: /etc/localtime
readOnly: true
- name: data
mountPath: /data/db
- name: mongoconfig
mountPath: /docker-entrypoint-initdb.d/mongoconfig.js
env:
- name: MONGO_INITDB_DATABASE
value: "xbrowsersync"
- name: MONGO_INITDB_ROOT_USERNAME
value: "xbrowsersync"
- name: MONGO_INITDB_ROOT_PASSWORD
value: "123456"
- name: XBS_DB_NAME
value: "xbrowsersync"
- name: XBS_DB_USERNAME
value: "xbrowsersync"
- name: XBS_DB_PASSWORD
value: "123456"
- name: xbrowsersync
image: xbrowsersync/api:1.1.13
ports:
- name: tcp
containerPort: 8080
env:
- name: XBROWSERSYNC_DB_USER
value: "xbrowsersync"
- name: XBROWSERSYNC_DB_PWD
value: "123456"
nodeSelector:
node.k8s.hty1024.com/type: app
kubectl apply -f xbrowsersync.yaml