Skip to main content

Bookstack 설정

기본 설정 변경

Bookstack 설정은 PV로 설정된 스토리지에 "/data/shared/common/bookstack/pv/php"의 

현재 수정값 -- 파일 업로드 사이즈 수정으로 인하여 override값 정의 

php-local.ini
; Edit this file to override php.ini directives

date.timezone = Asia/Seoul
upload_max_filesize = 10000M
post_max_size = 10000M
www2.conf
; Edit this file to override www.conf and php-fpm.conf directives and restart the container

; Pool name
[www]

PDF 출력하기 설정 

image.png

.env설정
#2025 01 27
SESSION_LIFETIME=12000
SESSION_COOKIE_NAME=common_bookstack_session
SESSION_SECURE_COOKIE=false

EXPORT_PDF_COMMAND_TIMEOUT=300
EXPORT_PDF_COMMAND="weasyprint {input_html_path} {output_pdf_path}"
폰트 업로드 

notosanskr.zip notosanskr.zip

/config 아래로 복사 

한글 전환 프로그램 설치 

weasyprint  

apk add weasyprint

Deployment Yaml에 반영 
    spec:
      containers:
      - name: bookstack
        image: linuxserver/bookstack:latest
        lifecycle:
          postStart:
             exec:
               command: ["/bin/sh", "-c", "/config/initBookStack.sh"]

/config/initBookStack.sh

#!/bin/bash

# copy fonts
/usr/bin/unzip /config/notosanskr.zip -d /usr/share/fonts/notosanskr/
# install fonts
/usr/bin/fc-cache -fv
# pdf convert programe install 
/sbin/apk add weasyprint
한글 설치 확인 
  • pod에 /usr/share/fonts 폴더에 notosanskr 폴더 확인 
  • 폰트 : fc-list | grep noto 확인 
  • weasyprint 실행 확인 
  • image.png  pdf 파일 확인 

전체 Deployment Yaml 

apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookstack
  namespace: common-apps
  labels:
    app: bookstack
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bookstack
  template:
    metadata:
      labels:
        app: bookstack
    spec:
      containers:
      - name: bookstack
        image: linuxserver/bookstack:latest
        lifecycle:
          postStart:
             exec:
               command: ["/bin/sh", "-c", "/config/initBookStack.sh"]
        ports:
        - containerPort: 80
        env:
        - name: PUID
          value: "1000"
        - name: PGID
          value: "1000"
        - name: APP_URL
          value: http://xxx.xxx.xxx:8084
        - name: APP_DEFAULT_DARK_MODE
          value: "true"
        - name: DB_HOST
          value: "192.168.0.xxx"
        - name: DB_PORT
          value: "xxxxx"
        - name: DB_USER
          value: "xxxxxxx"
        - name: DB_PASS
          value: "xxxxxxxxxxx"
        - name: DB_DATABASE
          value: "xxxxxx"
        - name: FILE_UPLOAD_SIZE_LIMIT
          value: "10240"
        - name: MAIL_FROM_NAME
          value: "BookStack"
        - name: MAIL_FROM
          value: "jframeworkxxxxx"
        - name: MAIL_HOST
          value: "xxxxxx.gmail.com"
        - name: MAIL_USERNAME
          value: "jfraxxxxxxx.com"
        - name: MAIL_PASSWORD
          value: "ezxxxxxxxxt"
        volumeMounts:
        - mountPath: "/config"
          name: bokstackvolume
      volumes:
      - name: bokstackvolume
        hostPath:
          path: /data/shared/common/bookstack/pv
          type: Directory
        #        persistentVolumeClaim:
        #  claimName: bookstack-pv-claim

---

apiVersion: v1
kind: Service
metadata:
  name: bookstack
  namespace: common-apps
  labels:
    app: bookstack
spec:
  type: LoadBalancer
  externalIPs:
   - 192.168.0.xxxx
  selector:
    app: bookstack
  ports:
  - protocol: TCP
    port: 8084
    targetPort: 80
  sessionAffinity: ClientIP

---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: bookstack-ingress
  namespace: common-apps
  annotations:
    nginx.ingress.kubernetes.io/affinity: cookie
    nginx.ingress.kubernetes.io/proxy-body-size: 500000m
    nginx.ingress.kubernetes.io/session-cookie-hash: sha1
    nginx.ingress.kubernetes.io/session-cookie-name: route
    nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
  rules:
    - host:
      http:
        paths:
          - pathType: Prefix
            path: /*
            backend:
              service:
                name: bookstack
                port:
                  number: 808x


---