docmost 部署 (Kubernetes)

Docker 安装参考 https://docmost.com/docs/installation

环境变量配置参考 https://docmost.com/docs/self-hosting/environment-variables

包含了
应用配置
数据库(PG)配置
Redis 配置
Draw.io 镜像网站配置
S3 对象存储

不过多赘述.

推荐
PG + Redis + S3. 不走本地存储

下面给出一份 PG + Redis + S3 (Tencent Cloud OSS) 的 kubernetes yaml 配置

此处没有配置邮件配置, 如果忘记密码可能比较麻烦, 邀请人也比较费劲. 团队使用时建议配上

apiVersion: apps/v1
kind: Deployment
metadata:
  name: docmost
  namespace: tools

spec:
  selector:
    matchLabels:
      app: docmost
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 20
      maxUnavailable: 20
  replicas: 1
  template:
    metadata:
      labels:
        app: docmost
    spec:
      nodeSelector:
        worker: worker1
      containers:
        - name: docmost
          image: ccr.ccs.tencentyun.com/jansora/docmost:0.23.0
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000
          env:
            - name: APP_URL # 通过 ingress 映射之后的网站
              value: "https://wiki.jansora.com"
            - name: APP_SECRET # 随便写, 大于 32 个字符
              value: "a1224xxxxxx1xxcc2xxx!23345dfatgsgbzdxsvt3ea223sdegszdab"
            - name: DATABASE_URL # PG 链接
              value: 'postgresql://root:password@postgres-1-service.middleware.svc.cluster.local:5432/docmost'
            - name: REDIS_URL # Redis 链接
              value: "redis://:password@redis-1-service.middleware.svc.cluster.local:6379/8"
            - name: DISABLE_TELEMETRY # 禁用遥测, 建议开启
              value: "true"
            - name: JWT_TOKEN_EXPIRES_IN # 失效时间
              value: "3650d"
            - name: STORAGE_DRIVER # 启用 S3, 建议开启
              value: "s3"
            - name: AWS_S3_ACCESS_KEY_ID
              value: "YOUR_ACCESS_KEY_ID"
            - name: AWS_S3_SECRET_ACCESS_KEY
              value: "YOUR_ACCESS_KEY"
            - name: AWS_S3_REGION
              value: "false"
            - name: AWS_S3_BUCKET
              value: "docmost"
            - name: AWS_S3_ENDPOINT
              value: "https://storage-1253762749.cos.ap-shanghai.myqcloud.com"
            - name: AWS_S3_FORCE_PATH_STYLE
              value: "true"
            - name: DRAWIO_URL # 自托管的 draw.io 网站, 能用就行
              value: "https://draw.jansora.com"


---

apiVersion: v1
kind: Service
metadata:
  name: docmost
  namespace: tools
spec:
  selector:
    app: docmost
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
      name: http



---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: docmost-ingress
  namespace: tools

  annotations:
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true" # 3030 -> 443 http 强制跳转 https
    nginx.ingress.kubernetes.io/hsts: "false"
spec:
  ingressClassName: nginx
  tls:
    - secretName: wildcard.jansora.com # 视情况是否是否要开启 https
  rules:
    - host: wiki.jansora.com # 地址
      http:
        paths:
          - backend:
              service:
                name: docmost
                port:
                  number: 3000
            pathType: Prefix
            path: /

忘记密码

进入登录页

image.png

点击忘记密码

image.png

在数据库 user-tokens 表中根据时间找到该 token

image.png

拼接 url 打开重置密码页面

根据你的地址进行拼接

https://wiki.jansora.com/password-reset?token=1985kvkueur54jpg

点开即可重置密码

评论栏