ONLYOFFICE / Docker-DocumentServer

ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
GNU Affero General Public License v3.0
1.43k stars 494 forks source link

Callback url contains localhost in docker #653

Closed pengpengno closed 1 year ago

pengpengno commented 1 year ago

Do you want to request a feature or report a bug? Question What is the current behavior? i build the project with docker compose and define two service , one of them is a office storage server and the other one is only-office which is depoy in docker

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Following is a track from only-server , the major question i wondering is that only-office make a callback with some args which contains url , but the url is start with localhost and as i previous said i deploy service in docker , so the other one service could not get the correct result via localhost

    "actions":[
        {
            "type":0,
            "userid":"uid-1691401064460"
        }
    ],
    "changesurl":"http://localhost/cache/files/data/-990938696_2421/changes.zip/changes.zip?md5=goLFkETCdceHc8JwhmvH0g&expires=1691571578&filename=changes.zip",
    "filetype":"docxf",
    "history":{
        "changes":[
            {
                "created":"2023-08-09 08:44:29",
                "user":{
                    "id":"uid-1691401064460",
                    "name":"guest"
                }
            }
        ],
        "serverVersion":"7.4.1"
    },
    "key":"-990938696",
    "lastsave":"2023-08-09T08:44:29.000Z",
    "notmodified":false,
    "status":2,
    "token":"******",
    "url":"http://localhost/cache/files/data/-990938696_2421/output.docxf/output.docxf?md5=jk_JNmHHljw8Bz5W5lvm6Q&expires=1691571578&filename=output.docxf",
    "users":[
        "uid-1691401064460"
    ]
 } 

What is the expected behavior?

Did this work in previous versions of DocumentServer?

DocumentServer Docker tag:

following is mine docker compose yaml


version: '3'
services:
  elsbiz-office:

    depends_on:
      - only-office
    container_name: elsbiz-office
    build:
      context: ./elsbiz-office-service
      dockerfile: Dockerfile
      args:
        IMAGE_NAME: elsbiz-office
        TAG: 1.0.0

    image: ******
    volumes:
      - ./documents:/app/service/elsbiz-office-service/documents
    networks:
      - office-network
    ports:
      - 8090:8090

    environment:
      OFFICE_SERVER_HOST: http://only-office/   
      SERVER: http://elsbiz-office:8090
      PORT: 8090
      JWT_ENABLED: true
      JWT_SECRET: ELS_BIZ_ONLY_OFFICE_JWT_TOKEN

  only-office:
    container_name: onlyoffice
    image: onlyoffice/documentserver
    ports:
      - 80:80
      - 443:443
    environment:
      JWT_ENABLED: true
      JWT_SECRET: ELS_BIZ_ONLY_OFFICE_JWT_TOKEN
      JWT_HEADER: Authorization

    networks:
      - office-network
    volumes:
      -   ./logs:/var/log/onlyoffice
      -   ./data:/var/www/onlyoffice/Data
      -   ./lib:/var/lib/onlyoffice
      -   ./redis:/var/lib/redis
      -   ./rabbitmq:/var/lib/rabbitmq
      -   ./postgresql:/var/lib/postgresql
      -   ./logs:/var/lib/onlyoffice

networks:
  office-network:
    driver: bridge

Host Operating System:

windows

major question

Is there some config that used to define the callback url instead of localhost ,?

pengpengno commented 1 year ago

well i replace only-office which is in docker host name with internal ip which is in deply host , it worked . close this issue