Integrasi OnlyOffice Server dengan OwnCloud memungkinkan kolaborasi dokumen secara real-time dengan fitur pengeditan yang kaya, memastikan keamanan dan kenyamanan dalam satu platform. Solusi ini ideal untuk tim yang memerlukan akses mudah dan kontrol penuh atas dokumen mereka di lingkungan yang aman dan terkelola.
Membuat directory untuk data onlyoffice
root@cloud-one:~# mkdir -p /data/docker-data/onlyoffice root@cloud-one:~# root@cloud-one:~# cd /data/docker-data/onlyoffice/ root@cloud-one:/data/docker-data/onlyoffice# ls -l total 0 root@cloud-one:/data/docker-data/onlyoffice#
Mendownload source code dari git
root@cloud-one:/data/docker-data/onlyoffice# git clone https://github.com/ONLYOFFICE/Docker-DocumentServer Cloning into 'Docker-DocumentServer'... remote: Enumerating objects: 1747, done. remote: Counting objects: 100% (92/92), done. remote: Compressing objects: 100% (77/77), done. remote: Total 1747 (delta 42), reused 56 (delta 13), pack-reused 1655 Receiving objects: 100% (1747/1747), 525.50 KiB | 15.46 MiB/s, done. Resolving deltas: 100% (987/987), done. root@cloud-dev:/data/docker-data/onlyoffice# ls -aslh total 12K 4.0K drwxr-xr-x 3 root root 4.0K Jul 18 00:16 . 4.0K drwxr-xr-x 3 root root 4.0K Jul 18 00:16 .. 4.0K drwxr-xr-x 7 root root 4.0K Jul 18 00:16 Docker-DocumentServer root@cloud-one:/data/docker-data/onlyoffice#
Edit port pada docker compose agar tidak bentrok dengan server owncloud, misal http di port 8080 dan https di 9443
sudo nano docker-compose.yml
root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# nano docker-compose.yml root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer#
Menjalankan compose up
root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# docker compose up -d WARN[0000] /data/docker-data/onlyoffice/Docker-DocumentServer/docker-compose.yml: `version` is obsolete Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# systemctl start docker root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# docker compose up -d WARN[0000] /data/docker-data/onlyoffice/Docker-DocumentServer/docker-compose.yml: `version` is obsolete [+] Running 25/25 ✔ onlyoffice-postgresql Pulled 24.9s ✔ f11c1adaa26e Pull complete 6.1s ✔ 11d2a01831db Pull complete 6.4s ✔ fa447fe1d1e0 Pull complete 7.1s ✔ 55dfde07a6e2 Pull complete 7.5s ✔ 6e2f390664fe Pull complete 9.4s ✔ 4a83e9d155a5 Pull complete 9.8s ✔ b0c78f8d445e Pull complete 10.1s ✔ 78c00a725bfb Pull complete 10.4s ✔ 3e550db355aa Pull complete 18.7s ✔ 7f17fea255df Pull complete 19.1s ✔ 81e4556ced8e Pull complete 19.3s ✔ 74fabc3fa2b5 Pull complete 19.5s ✔ c643770cc740 Pull complete 19.7s ✔ ee6f27a9034c Pull complete 20.0s ✔ onlyoffice-rabbitmq Pulled 23.8s ✔ 3713021b0277 Pull complete 11.7s ✔ b14cec4262f4 Pull complete 14.2s ✔ bd0f227bac51 Pull complete 15.1s ✔ a10de74f6eee Pull complete 15.3s ✔ 4ee12d51ba41 Pull complete 17.7s ✔ 51c1ad8a4edb Pull complete 17.9s ✔ d019e3c1ad7a Pull complete 18.1s ✔ 4f7eb43494cd Pull complete 18.5s ✔ b17c4cbcb5a3 Pull complete 18.9s [+] Building 23.4s (5/11) docker:default => [onlyoffice-documentserver internal] load build definition from Dockerfile 1.3s => => transferring dockerfile: 5.33kB 0.0s => [onlyoffice-documentserver internal] load metadata for docker.io/library/ubuntu:22.04 3.5s => [onlyoffice-documentserver internal] load .dockerignore 0.8s => => transferring context: 2B 0.0s => [onlyoffice-documentserver 1/7] FROM docker.io/library/ubuntu:22.04@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221 1.4s => => resolve docker.io/library/ubuntu:22.04@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221 0.3s => => sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221 1.13kB / 1.13kB 0.0s => => sha256:0eb0f877e1c869a300c442c41120e778db7161419244ee5cbc6fa5f134e74736 424B / 424B 0.0s => => sha256:8a3cdc4d1ad3e314a91f76b7b99eed443f2152e3a9bf33e46669b31d094be443 2.30kB / 2.30kB 0.0s => [onlyoffice-documentserver internal] load build context 1.0s => => transferring context: 33.62kB 0.0s => [onlyoffice-documentserver 2/7] RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && apt-get -y update && apt-get -yq install wget apt-transport-https gnupg locales lsb-release && 16.2s => => # Selecting previously unselected package readline-common. => => # Preparing to unpack .../3-readline-common_8.1.2-1_all.deb ... => => # Unpacking readline-common (8.1.2-1) ... => => # Selecting previously unselected package libreadline8:amd64. => => # Preparing to unpack .../4-libreadline8_8.1.2-1_amd64.deb ... => => # Unpacking libreadline8:amd64 (8.1.2-1) ... .. .. => [onlyoffice-documentserver] exporting to image 85.2s => => exporting layers 84.7s => => writing image sha256:ba9f0e730791848c875d9499bec5a723a6f29631b1a1fe56429ce2574dc1ac5b 0.1s => => naming to docker.io/library/docker-documentserver-onlyoffice-documentserver 0.1s [+] Running 5/5 ✔ Network docker-documentserver_default Created 0.1s ✔ Volume "docker-documentserver_postgresql_data" Created 0.0s ✔ Container onlyoffice-postgresql Started 5.0s ✔ Container onlyoffice-rabbitmq Started 5.0s ✔ Container onlyoffice-documentserver Started 5.0s root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer#
root@cloud-one:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ec399d070658 docker-documentserver-onlyoffice-documentserver "/app/ds/run-documen…" About an hour ago Up About an hour 0.0.0.0:8080->80/tcp, :::8080->80/tcp, 0.0.0.0:9443->443/tcp, :::9443->443/tcp onlyoffice-documentserver 8fabb1a309af rabbitmq "docker-entrypoint.s…" About an hour ago Up About an hour 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp onlyoffice-rabbitmq 7fb2ceeb802e postgres:12 "docker-entrypoint.s…" About an hour ago Up About an hour 5432/tcp onlyoffice-postgresql root@cloud-one:~#
Integrasi dengan owncloud
Mendownload aplikasi onlyoffice konektor untuk owncloud pada alamat berikut : https://marketplace.owncloud.com/apps/onlyoffice
Selanjudnya adalah proses Install app onlyoffice pada owncloud, yaitu
Mengupload app onlyoffice pada owncloud dan extact ke folder apps pada owncloud
root@cloud-one:/home/cloud-dev# ls -l total 2232 -rw-r--r-- 1 cloud-dev cloud-dev 2281706 Jul 18 00:43 onlyoffice-9.3.1.tar.gz root@cloud-one:/home/cloud-dev# root@cloud-one:/home/cloud-dev# tar -xzf onlyoffice-9.3.1.tar.gz -C /var/www/html/owncloud/apps/ root@cloud-one:/home/cloud-dev#
Melakukan pengecekan app onlyoffice pada folder
root@cloud-one:/home/cloud-dev# cd /var/www/html/owncloud/apps/ root@cloud-one:/var/www/html/owncloud/apps# ls -aslh total 244K 4.0K drwxr-xr-x 59 www-data www-data 4.0K Jul 18 01:13 . 4.0K drwxr-xr-x 14 www-data www-data 4.0K Jul 17 23:39 .. 4.0K drwxr-xr-x 9 www-data www-data 4.0K Aug 11 2023 activity 4.0K drwxr-xr-x 5 www-data www-data 4.0K Jul 14 2023 admin_audit 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jun 18 2021 announcementcenter 4.0K drwxr-xr-x 7 www-data www-data 4.0K Feb 26 17:52 comments 4.0K drwxr-xr-x 6 www-data www-data 4.0K Aug 8 2023 configreport 4.0K drwxr-xr-x 9 www-data www-data 4.0K Feb 21 11:07 customgroups 4.0K drwxr-xr-x 6 www-data www-data 4.0K Feb 26 17:52 dav 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jul 14 2023 diagnostics 4.0K drwxr-xr-x 9 www-data www-data 4.0K Aug 21 2023 drawio 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jul 14 2023 encryption 4.0K drwxr-xr-x 4 www-data www-data 4.0K Jul 23 2020 enterprise_key 4.0K drwxr-xr-x 10 www-data www-data 4.0K Apr 16 2019 external 4.0K drwxr-xr-x 9 www-data www-data 4.0K Feb 26 17:52 federatedfilesharing 4.0K drwxr-xr-x 9 www-data www-data 4.0K Feb 26 17:52 federation 4.0K drwxr-xr-x 10 www-data www-data 4.0K Feb 26 17:52 files 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jun 14 2023 files_antivirus 4.0K drwxr-xr-x 9 www-data www-data 4.0K Feb 23 11:59 files_classifier 4.0K drwxr-xr-x 10 www-data www-data 4.0K Feb 26 17:52 files_external 4.0K drwxr-xr-x 7 www-data www-data 4.0K Nov 17 2022 files_external_dropbox 4.0K drwxr-xr-x 5 www-data www-data 4.0K Dec 11 2018 files_external_ftp 4.0K drwxr-xr-x 10 www-data www-data 4.0K Jun 8 2020 files_ldap_home 4.0K drwxr-xr-x 10 www-data www-data 4.0K Jan 31 16:41 files_lifecycle 4.0K drwxr-xr-x 6 www-data www-data 4.0K Nov 9 2021 files_mediaviewer 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jan 15 2024 files_pdfviewer 4.0K drwxr-xr-x 9 www-data www-data 4.0K Oct 25 2023 files_primary_s3 4.0K drwxr-xr-x 10 www-data www-data 4.0K Feb 26 17:52 files_sharing 4.0K drwxr-xr-x 9 www-data www-data 4.0K Nov 16 2023 files_texteditor 4.0K drwxr-xr-x 10 www-data www-data 4.0K Feb 26 17:52 files_trashbin 4.0K drwxr-xr-x 8 www-data www-data 4.0K Feb 26 17:52 files_versions 4.0K drwxr-xr-x 12 www-data www-data 4.0K Jun 23 2021 firewall 4.0K drwxr-xr-x 10 www-data www-data 4.0K Jul 14 2023 firstrunwizard 4.0K drwxr-xr-x 6 www-data www-data 4.0K Aug 31 2023 graphapi 4.0K drwxr-xr-x 7 www-data www-data 4.0K Jan 23 17:21 guests 4.0K drwxr-xr-x 10 www-data www-data 4.0K Dec 13 2023 impersonate 4.0K drwxr-xr-x 9 www-data www-data 4.0K Nov 15 2023 kerberos 4.0K drwxr-xr-x 8 www-data www-data 4.0K Aug 11 2023 market 4.0K drwxr-xr-x 9 www-data www-data 4.0K Aug 11 2023 metrics 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jul 14 2023 notifications 4.0K drwxr-xr-x 10 www-data www-data 4.0K Aug 31 2023 oauth2 4.0K drwxr-xr-x 13 1001 docker 4.0K Jul 1 12:27 onlyoffice 4.0K drwxr-xr-x 7 www-data www-data 4.0K Dec 21 2022 openidconnect 4.0K drwxr-xr-x 9 www-data www-data 4.0K Oct 3 2023 password_policy 4.0K drwxr-xr-x 5 www-data www-data 4.0K Feb 26 17:52 provisioning_api 4.0K drwxr-xr-x 8 www-data www-data 4.0K Jul 14 2023 ransomware_protection 4.0K drwxr-xr-x 11 www-data www-data 4.0K Jun 5 2020 sharepoint 4.0K drwxr-xr-x 9 www-data www-data 4.0K Feb 26 17:52 systemtags 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jul 7 2020 systemtags_management 4.0K drwxr-xr-x 4 www-data www-data 4.0K Jan 10 2024 templateeditor 4.0K drwxr-xr-x 5 www-data www-data 4.0K Jun 21 2022 theme-enterprise 4.0K drwxr-xr-x 7 www-data www-data 4.0K Feb 26 17:52 updatenotification 4.0K drwxr-xr-x 5 www-data www-data 4.0K Nov 28 2019 user_external 4.0K drwxr-xr-x 10 www-data www-data 4.0K Dec 7 2023 user_ldap 4.0K drwxr-xr-x 12 www-data www-data 4.0K Jul 13 2023 user_shibboleth 4.0K drwxr-xr-x 10 www-data www-data 4.0K Aug 9 2023 web 4.0K -rw-r--r-- 1 root root 467 Jul 18 00:42 wget-log 4.0K -rw-r--r-- 1 root root 467 Jul 18 00:43 wget-log.1 4.0K drwxr-xr-x 10 www-data www-data 4.0K Jan 8 2024 windows_network_drive 4.0K drwxr-xr-x 10 www-data www-data 4.0K Sep 26 2023 wopi 4.0K drwxr-xr-x 9 www-data www-data 4.0K Jul 13 2023 workflow root@cloud-one:/var/www/html/owncloud/apps# chown -R www-data: onlyoffice root@cloud-one:/var/www/html/owncloud/apps#
Men-enable app only office melalui command line
root@cloud-one:~# sudo -u www-data php /var/www/html/owncloud/occ app:enable onlyoffice onlyoffice enabled root@cloud-one:~#
Konfigurasi app onlyoffice pada owncloud agar bisa terkoneksi dengan app onlyoffice server
root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES be92e5ced52d docker-documentserver-onlyoffice-documentserver "/app/ds/run-documen…" 2 minutes ago Up 2 minutes 0.0.0.0:8080->80/tcp, :::8080->80/tcp, 0.0.0.0:9443->443/tcp, :::9443->443/tcp onlyoffice-documentserver 882f803e344d postgres:12 "docker-entrypoint.s…" 16 minutes ago Up 16 minutes 5432/tcp onlyoffice-postgresql 2b765c90cda0 rabbitmq "docker-entrypoint.s…" 16 minutes ago Up 16 minutes 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp onlyoffice-rabbitmq root@cloud-one:/data/docker-data/onlyoffice/Docker-DocumentServer#
Konfigurasi owncloud dengan beberapa parameter only office
Untuk mengetahui kode tokennya
sudo docker exec onlyoffice-documentserver /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'
root@cloud-one:~# sudo docker exec onlyoffice-documentserver /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string' EP4dArTgYWozNiFGRPBeBasIniTokenSekretnya root@cloud-one:~# root@cloud-one:~# sudo -u www-data php /var/www/html/owncloud/occ config:app:set onlyoffice DocumentServerUrl --value="http://10.20.30.221:8080/" Config value DocumentServerUrl for app onlyoffice set to http://10.20.30.221:8080/ root@cloud-one:~# root@cloud-one:~# sudo -u www-data php /var/www/html/owncloud/occ config:app:set onlyoffice jwt_secret --value="yGbfwszNerNeDeE8GjNbnijKfnqGYchF" Config value jwt_secret for app onlyoffice set to EP4dArTgYWozNiFGRPBeBasIniTokenSekretnya root@cloud-one:~# root@cloud-one:~# sudo -u www-data php /var/www/html/owncloud/occ onlyoffice:documentserver --check Document server http://10.20.30.221:8080/ version 8.1.1.26 is successfully connected root@cloud-one:~#
Pengujian pembukaan dokument ms word pada web owncloud
Dokumen bisa terbuka pada aplikasi onlyoffice di dalam web owncloud
Catatan :
version: '2' services: onlyoffice-documentserver: build: context: . container_name: onlyoffice-documentserver depends_on: - onlyoffice-postgresql - onlyoffice-rabbitmq environment: - DB_TYPE=postgres - DB_HOST=onlyoffice-postgresql - DB_PORT=5432 - DB_NAME=onlyoffice - DB_USER=onlyoffice - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq # Uncomment strings below to enable the JSON Web Token validation. #- JWT_ENABLED=true #- JWT_SECRET=secret #- JWT_HEADER=Authorization #- JWT_IN_BODY=true # Uncomment strings below to enable the JSON Web Token validation. # Jika ingin token permanent, tidak berubah ketika recreate container, isikan informasi berikut - JWT_ENABLED=true - JWT_SECRET=EP4dArTgYWozNiFGRPBeBasIniTokenSekretnya - JWT_HEADER=Authorization #- JWT_IN_BODY=true ports: - '8080:80' - '9443:443' stdin_open: true restart: always stop_grace_period: 60s volumes: - /var/www/onlyoffice/Data - /var/log/onlyoffice - /var/lib/onlyoffice/documentserver/App_Data/cache/files - /var/www/onlyoffice/documentserver-example/public/files - /usr/share/fonts onlyoffice-rabbitmq: container_name: onlyoffice-rabbitmq image: rabbitmq restart: always expose: - '5672' onlyoffice-postgresql: container_name: onlyoffice-postgresql image: postgres:12 environment: - POSTGRES_DB=onlyoffice - POSTGRES_USER=onlyoffice - POSTGRES_HOST_AUTH_METHOD=trust restart: always expose: - '5432' volumes: - postgresql_data:/var/lib/postgresql volumes: postgresql_data: