Closed changchichung closed 4 years ago
what is the aim of your modifications?
sorry for late reply , I change the export to add IP , bcz if dont , then the expose port only works on ipv6 , i f I enable ipv6 interface. ( is that what you ask ?)
I pull another onlyoffice container from onlyoffice/documentserver https://hub.docker.com/r/onlyoffice/documentserver/ and follow the steps to make self-signed certification file then change to nextcloud settings , point onlyoffice url to the new onlyoffice container , and it works !
I will try to create a new VPS and try your playbook again , thanks !
I just create a new VPS run this playbook with letsencrypt , everything works like a charm , thanks ! I guess there`s still something to be adjusted when using self-signed certification , and I will try to keep working on this , any suggestions ?
@ReinerNippes Is it possible to run the playbook in such a way as it just adds the only office support? I would like to use the OnlyOffice Document server and integration and if it's possible to do so using a portion of your playbook that would be super useful for me on my already existing installation.
@jcklpe you may try to download https://github.com/ReinerNippes/nextcloud/blob/master/only_office.yml
into the directory of the nextcloud playbook.
and run
ansible-playbook only_office.yml
make a backup before. ;-)
@changchichung i know that my playbook is not creating the correct self signed certificates for onlyoffice. up to now i didn't have the time to correct this. sorry. it's in my backlog.
I had test for several times for make self signed certification work , here is what I changed
I will try to modify the playbook using lineinefile or copy or template module in ansible.
I exposed 8080 => 80 (i run it behind a proxy with SSL offload anyways) and i can confirm that there is a issue related to setting the secret (but when i removed secret from nextcloud/onlyoffice config page everything worked)
Update: rerun the setup an using exposed http - but secret from the script, everything worked
Hey just wanted to let ya'll know I installed OnlyOffice to an already existing NextCloud installation, and it worked wonderfully! Thank you Reiner for all this awesome work :D
Hey just wanted to let ya'll know I installed OnlyOffice to an already existing NextCloud installation, and it worked wonderfully! Thank you Reiner for all this awesome work :D
i would ask.... How you did it?
@jsanfe Through the instruction that Reiner gave here:
@jcklpe you may try to download https://github.com/ReinerNippes/nextcloud/blob/master
/only_office.yml into the directory of the nextcloud playbook. and run ansible-playbook only_office.yml make a backup before. ;-)
if you have any other questions let me know.
@jsanfe it only works if you have installed your nextcloud with my playbook before.
@jsanfe Through the instruction that Reiner gave here:
@jcklpe you may try to download https://github.com/ReinerNippes/nextcloud/blob/master
/only_office.yml into the directory of the nextcloud playbook. and run ansible-playbook only_office.yml make a backup before. ;-)
if you have any other questions let me know.
I did it, but now I think have to fill more info (onlyoffice conector), SSL and secret key...
@jsanfe it only works if you have installed your nextcloud with my playbook before.
I tryed your playbook, but I had a lot of issues, so I decided to install nextcloudPi then here's what I did next:
Install your
The playbook is meant to be executed on an empty, fresh linux installation. I can't foresee all eventuality and situation that could happen when another app/service is already installed.
What kind of issues did you encounter during first run?
What kind of issues did you encounter during first run?
fresh Debian 10
installing curl... ok installing prepare.sh--- Fail:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-TPXlix/python-apt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-TPXlix/python-apt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-TPXlix/python-apt/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-TPXlix/python-apt/setup.py", line 6, in <module>
from DistUtilsExtra.command import *
ImportError: No module named DistUtilsExtra.command
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Next steps...
git clone https://github.com/ReinerNippes/nextcloud
cd nextcloud
nano inventory (just add onlyoffice=true)
./nextcloud.yml
Error:
PLAY [install nextcloud] **************************************************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************************************************************
Tuesday 03 September 2019 22:26:52 +0200 (0:00:00.466) 0:00:00.467 *****
fatal: [localhost]: FAILED! => changed=false
ansible_facts: {}
failed_modules:
setup:
ansible_facts:
discovered_interpreter_python: /usr/bin/python
failed: true
module_stderr: |-
/bin/sh: 1: sudo: not found
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 127
warnings:
- Platform linux on host localhost is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.
msg: |-
The following modules failed to execute: setup
PLAY RECAP ****************************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Tuesday 03 September 2019 22:26:53 +0200 (0:00:01.108) 0:00:01.575 *****
===============================================================================
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.11s
Fresh Debian 9
Same error executing prepare.sh
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-XKIlM0/python-apt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-XKIlM0/python-apt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-XKIlM0/python-apt/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-XKIlM0/python-apt/setup.py", line 6, in <module>
from DistUtilsExtra.command import *
ImportError: No module named DistUtilsExtra.command
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Debian Sytem ready for nextcloud.
ansible 2.8.4
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
```root@debian:/home/sanfe# git clone https://github.com/ReinerNippes/nextcloud
git clone https://github.com/ReinerNippes/nextcloud
cd nextcloud
nano inventory (just add onlyoffice=true)
./nextcloud.yml -e fqdn=xxxx.serveftp.com -e ssl_certificate_type=selfsigned
working but when finished:
TASK [prep_postgres : create nextcloud db] ********************************************************************************************************************************************************************
Wednesday 04 September 2019 00:30:29 +0200 (0:00:00.649) 0:04:57.424 ***
fatal: [localhost]: FAILED! => changed=false
module_stderr: |-
/bin/sh: 1: sudo: not found
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 127
RUNNING HANDLER [prep_ufw : reload ufw] ***********************************************************************************************************************************************************************
Wednesday 04 September 2019 00:30:30 +0200 (0:00:00.684) 0:04:58.108 ***
RUNNING HANDLER [prep_nginx : restart nginx] ******************************************************************************************************************************************************************
Wednesday 04 September 2019 00:30:30 +0200 (0:00:00.000) 0:04:58.109 ***
RUNNING HANDLER [prep_redis : restart redis-server] ***********************************************************************************************************************************************************
Wednesday 04 September 2019 00:30:30 +0200 (0:00:00.000) 0:04:58.110 ***
RUNNING HANDLER [prep_php : restart php-fpm] ******************************************************************************************************************************************************************
Wednesday 04 September 2019 00:30:30 +0200 (0:00:00.000) 0:04:58.111 ***
PLAY RECAP ****************************************************************************************************************************************************************************************************
localhost : ok=58 changed=41 unreachable=0 failed=1 skipped=14 rescued=0 ignored=0
Wednesday 04 September 2019 00:30:30 +0200 (0:00:00.003) 0:04:58.114 ***
===============================================================================
prep_php : install additional packages ---------------------------------------------------------------------------------------------------------------------------------------------------------------- 54.73s
prep_nginx : install additional packages -------------------------------------------------------------------------------------------------------------------------------------------------------------- 44.54s
prep_postgres : apt install postgresql-client with Update --------------------------------------------------------------------------------------------------------------------------------------------- 34.82s
prep_os : install additional packages ----------------------------------------------------------------------------------------------------------------------------------------------------------------- 33.66s
prep_php : apt dist-upgrade --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 15.61s
prep_ufw : Installing ufw package --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14.31s
prep_nginx : add additional debian repos --------------------------------------------------------------------------------------------------------------------------------------------------------------- 9.75s
prep_redis : install additional packages --------------------------------------------------------------------------------------------------------------------------------------------------------------- 7.10s
prep_postgres : add postgresql to sources list --------------------------------------------------------------------------------------------------------------------------------------------------------- 5.94s
prep_ufw : Configuring port/protocol/network rules ----------------------------------------------------------------------------------------------------------------------------------------------------- 5.89s
prep_postgres : add postgres repo key ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 5.64s
prep_nginx : add nginx key ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.35s
prep_php : add additional repos ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 5.31s
prep_php : add sury.org/php key ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 4.92s
prep_postgres : install psycopg2 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.45s
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.13s
prep_ufw : Configuring service ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.46s
prep_os : apt dist-upgrade ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.28s
prep_nginx : apt dist-upgrade -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.27s
prep_nginx : copy some nginx config file --------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.25s
root@debian:/home/sanfe/nextcloud# [WARNING]: Updating cache and auto-installing missing dependency: python-apt
bash: [WARNING]:: no se encontró la orden
root@debian:/home/sanfe/nextcloud#
/bin/sh: 1: sudo: not found
is sudo installed and root in sudo allowed?
Ok ReinerNippes... First, i want to give you thanks for your pacience and support. Second. I had installed now sudo, (i didnt know i had to), until now, i ran all the commands as Super User. Third... Ive executed your script, and now i have 0 errors O_o. Nextcloud seems to works ok. (Thanks) Fourth, i tryed to test onlyoffice, but when i clic into new word document, one window says: ONLYOFFICE cannot be reached. Please contact admin. I will make more test this night. Thanks!!!!!
the default become method of ansible is 'sudo'. nevertheless you can define your own method by adding '--become-method=[ sudo | su | pbrun | pfexec | doas | dzdo | ksu ]' https://docs.ansible.com/ansible/2.3/become.html that might have been an option as well. i never tested it.
if you use selfsigned certificates this playbook don't work. the two playbook with docker do. it's still on my list to figure out how to configure nextcloud and onlyoffice.
Let me try this night or meaby tomorrow with lets encrypt. Every day is good to keep learning. Regards!
Morning! I have some problems with debian 10: I try with diferents ports, but i had the same issue...
it's not a problem of the port.
there is a problem with the command sudo /sbin/ufw status verbose
.
can you configure and open port 80/443 manully with ufw on this machine?
Now i have all working (nextcloud and onlyoffice) but with debian 9, and i upload a lot of data inside, so i will test in another machine.
I add this section to nextcloud config.php
docker status
I modify the playbook , change onlyoffice export port
But I can not connect to 192.168.11.35:8443
but if I expose onlyoffice port 80 , I can open that page .
docker logs onlyoffice
any suggestions ?