# 安裝teedy文管軟體

# 推坑

#### <span style="color: rgb(53, 152, 219);">**此系統強調以<span style="color: rgb(224, 62, 45);">文件為本</span>，文件可包含很多檔案，且具唯一性，能綁定多個標籤。**</span>

#### <span style="color: rgb(53, 152, 219);">**開發團隊很奇才<span style="color: rgb(224, 62, 45);">利用標籤，就能模擬出不同目錄結構</span>，因此一個唯一性的文件，能出現在不同的目錄，本體只有一個，我們只要維護一次文件即可**。</span>

#### <span style="color: rgb(53, 152, 219);">**此舉可避免傳統檔案總管，相同文件若需要在不同目錄出現，就必須複製多份，一旦文件改版更新了，會造成檔案更新困難。**</span>

#### 標籤 V.S 檔案總管

<div drawio-diagram="126"><img src="https://book.kafeiou.pw/uploads/images/drawio/2025-01/drawing-1-1737389515.png" alt=""/></div>

#### <span style="color: rgb(224, 62, 45);">**另外teedy系統，也有送審功能，讓其他使用者提交文件，給文件管理員審查、上架**</span>

# docker安裝



# (1)官方安裝範本

<p class="callout info">根據官網建議，使用docker容器安裝最適合</p>

以下是docker-compose.yml

```
version: '3'
services:
# Teedy Application
  teedy-server:
    image: sismics/docs:latest
    restart: unless-stopped
    ports:
      # Map internal port to host
      - 8080:8080
    environment:
      # Base url to be used
      DOCS_BASE_URL: "https://docs.example.com"
      # Set the admin email
      DOCS_ADMIN_EMAIL_INIT: "admin@example.com"
      # Set the admin password (in this example: "superSecure")
      DOCS_ADMIN_PASSWORD_INIT: "$$2a$$05$$PcMNUbJvsk7QHFSfEIDaIOjk1VI9/E7IPjTKx.jkjPxkx2EOKSoPS"
      # Setup the database connection. "teedy-db" is the hostname
      # and "teedy" is the name of the database the application
      # will connect to.
      DATABASE_URL: "jdbc:postgresql://teedy-db:5432/teedy"
      DATABASE_USER: "teedy_db_user"
      DATABASE_PASSWORD: "teedy_db_password"
      DATABASE_POOL_SIZE: "10"
    volumes:
      - ./docs/data:/data
    networks:
      - docker-internal
      - internet
    depends_on:
      - teedy-db

# DB for Teedy
  teedy-db:
    image: postgres:13.1-alpine
    restart: unless-stopped
    expose:
      - 5432
    environment:
      POSTGRES_USER: "teedy_db_user"
      POSTGRES_PASSWORD: "teedy_db_password"
      POSTGRES_DB: "teedy"
    volumes:
      - ./docs/db:/var/lib/postgresql/data
    networks:
      - docker-internal

networks:
  # Network without internet access. The db does not need
  # access to the host network.
  docker-internal:
    driver: bridge
    internal: true
  internet:
    driver: bridge
```

# (2)本站建議的安裝

<p class="callout info">建議與OpenProject專案管理系統共用一個資料庫，拙認為OpenProject(追蹤進度)+teedy(文件管理) 可以解決公司很多內部文件管控問題</p>

<span style="color: rgb(224, 62, 45);">**以下範本，請注意ports、DOCS\_BASE\_URL、DOCS\_ADMIN\_EMAIL\_INIT、DATABASE\_URL、DATABASE\_USER、DATABASE\_PASSWORD**</span>

```
version: '3'
services:
  teedy-server:
    image: sismics/docs:latest
    restart: unless-stopped
    ports:
      - 8080:8080
    environment:
      # DOCS_BCRYPT_WORK: 5
      # Base url to be used
      DOCS_BASE_URL: "https://網站名稱"
      # Set the admin email
      DOCS_ADMIN_EMAIL_INIT: "電子郵件@xxx.xxx"
      # Set the admin password (in this example: "superSecure")
      DOCS_ADMIN_PASSWORD_INIT: "$$2a$$05$$PcMNUbJvsk7QHFSfEIDaIOjk1VI9/E7IPjTKx.jkjPxkx2EOKSoPS"
      # Setup the database connection. "teedy-db" is the hostname
      # and "teedy" is the name of the database the application
      # will connect to.
      DATABASE_URL: "jdbc:postgresql://資料庫IP:5432/teedy"
      DATABASE_USER: "資料庫帳號"
      DATABASE_PASSWORD: "資料庫密碼"
      DATABASE_POOL_SIZE: "10"
    volumes:
      - ./docs/data:/data
        #- ./webapps:/opt/jetty/webapps
    networks:
      - docker-internal
      - internet


networks:
  # Network without internet access. The db does not need
  # access to the host network.
  docker-internal:
    driver: bridge
    internal: true
  internet:
    driver: bridge

```

# (3) Teedy預設檔案加密，本站修改可選擇是否加密，方便掛載修改

#### Teedy預設檔案加密，這樣很安全，但這樣反而不方便直接修改檔案；<span style="color: rgb(224, 62, 45);">**有些文管人員，只知道檔案總管，因此有必要掛載讓文員直接修改**</span>，所以我改程式，讓系統可以不加密，直接掛載修改。

```

#一旦選擇加密或是不加密，就不可再改設定，請謹慎
https://github.com/WilliamFromTW/teedydocs/tree/EncryptFileOptional

# 本站編譯好的docker版本
https://hub.docker.com/r/inmethod/teedy/tags

```