Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix socket for onlyoffice #764

Closed
etibamecus opened this issue Jan 28, 2020 · 11 comments
Closed

Unix socket for onlyoffice #764

etibamecus opened this issue Jan 28, 2020 · 11 comments
Assignees
Labels
feature request Issues that request new features to be added to OnlyOffice

Comments

@etibamecus
Copy link

etibamecus commented Jan 28, 2020

If you are already using postgresql and redis unix socket with other services on the same host (like nextcloud for example) and you want to use those unix socket

based on #227

you have to modify pubsubRedis.js

sudo -u ds nano /var/www/onlyoffice/documentserver/server/DocService/sources/pubsubRedis.js

and change text :

function createClientRedis() {
var redisClient = redis.createClient(cfgRedisPort, cfgRedisHost, {});
redisClient.on('error', function(err) {
logger.error('redisClient error %s', err.toString());
});
return redisClient;
}

to (would be actually nice to implement it directly when installing onlyoffice)

function createClientRedis() {
var redisClient = null;
if (cfgRedisPort == 0) {
redisClient = redis.createClient(cfgRedisHost, {});
} else {
redisClient = redis.createClient(cfgRedisPort, cfgRedisHost, {});
}
redisClient.on('error', function(err) {
logger.error('redisClient error %s', err.toString());
});
return redisClient;
}

then edit file default.json:

nano /etc/onlyoffice/documentserver/default.json

look for this part and apply according to this (just verify that the path for socket are good but this works on centos 7) :

                    "sql": {
                            "type": "postgres",
                            "tableChanges": "doc_changes",
                            "tableResult": "task_result",
                            "dbHost": "/var/run/postgresql",
                            "dbPort": 5432,
                            "dbName": "onlyoffice",
                            "dbUser": "onlyoffice",
                            "dbPass": "onlyoffice",
                            "charset": "utf8",
                            "connectionlimit": 10,
                            "max_allowed_packet": 1048575
                    },
                    "redis": {
                            "name": "redis",
                            "prefix": "ds:",
                            "host": "/var/run/redis/redis.sock",
                            "port": 0
                    },

now edit local.json :

nano /etc/onlyoffice/documentserver/local.json

according to this (verify paths are also good) :

{
"services": {
"CoAuthoring": {
"sql": {
"dbHost": "/var/run/postgresql",
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice",
"type": "postgres",
"dbPort": "5432"
},
"redis": {
"host": "/var/run/redis/redis.sock"
},

enable ds user to use redis socket :

usermod -aG redis ds

restart all services :

supervisorctl restart all

let me know if i forgot something

@bidouapp
Copy link

bidouapp commented Apr 8, 2020

Hi, Since a last update 5.5 when i want to change my files in /var/www/onlyoffice/documentserver/server/DocService/ i find nothing. Is it possible that this update does not work?

@ShockwaveNN
Copy link
Contributor

@bidouapp Since v5.5.0 we use compiled binaries of nodejs code (to remove dependency of nodejs), so source files are not aviables

@konovalovsergey Could you take a look at original issue? Is there any way to set socket via config files, I think you added some support of sending options to redis, buy I may be wrong

@Walterfilms
Copy link

Walterfilms commented Apr 18, 2020

Hello,

I haven't upgraded my instance to 5.5 yet because i don't want to break anything during quarantine and my company really needs it.

Is there any way to make this easily configurable in the future ? maybe in the original install script ?

I know you are working hard, and also that you recommend to install on 2 different servers onlyoffice and nextcloud, but i guess the reality is that a lot of people install in on the same host and thus using Unix socket leads to better performance.

thanks for everythind and have a nice day !

@ShockwaveNN
Copy link
Contributor

@Walterfilms Hi, we just take a look into this problem and currently there is no way to set sockets via config.
We'll look into this problem and try to figure out solution

@ShockwaveNN ShockwaveNN added the feature request Issues that request new features to be added to OnlyOffice label Apr 20, 2020
@warnerbryce
Copy link

Yeah Redis Socket is really essential in my case.
OnlyOffice runs on the same host as Nextcloud who use redis on unix socket for better performances.

@bidouapp
Copy link

bidouapp commented Jun 3, 2020

Hi, Is there any news on this subject?

@ShockwaveNN
Copy link
Contributor

We are working on solution, but currently got troubles make it right

Also please note, that since 5.5 redis is not required for OpenSource version of DocumentServer

@agolybev
Copy link
Contributor

agolybev commented Jun 4, 2020

In addition to @ShockwaveNN comment, in a commercial version, you can also use in-process data storage. To do it, you have to change the "editorDataStorage" value in the config, from "editorDataRedis" to "editorDataMemory".

@Jieiku
Copy link

Jieiku commented Nov 19, 2020

I noticed this was closed, how do I specify for onlyoffice to connect to postgresql using the socket "/run/postgresql"

sudo apt install onlyoffice-documentserver

results in

adduser: Warning: The home directory `/var/www/onlyoffice/documentserver' does not belong to the user you are currently creating.
Adding user www-data to group ds
psql: error: FATAL:  password authentication failed for user "onlyoffice"
FATAL:  password authentication failed for user "onlyoffice"
psql: error: FATAL:  password authentication failed for user "onlyoffice"
FATAL:  password authentication failed for user "onlyoffice"
dpkg: error processing package onlyoffice-documentserver (--configure):
 installed onlyoffice-documentserver package post-installation script subprocess returned error exit status 1
Setting up libgtk-3-bin (3.24.20-0ubuntu1) ...
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3) ...
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
 onlyoffice-documentserver
E: Sub-process /usr/bin/dpkg returned an error code (1)

@ShockwaveNN
Copy link
Contributor

@Xekon This issue cover only socket usage for redis, please create a new one for socket usage for postgre

@Jieiku
Copy link

Jieiku commented Nov 19, 2020

@ShockwaveNN I found this thread through google, because the opening post of this thread specifically talks about getting sockets to work for both redis and postgresql, it was not specific to redis only.

you will see he lists:

nano /etc/onlyoffice/documentserver/default.json

and add:

"dbHost": "/var/run/postgresql"

I actually initially tried installing Collabora Office, and ran into a lot of trouble getting it working. So I decided to try OnlyOffice, however when I ran into just as much trouble with OnlyOffice I ended up giving Collabora another shot, several hours later and I now have Collabora working.

I won't be making an issue report for postgresql since I now have Collabora working.
I do however appreciate the response. Best Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to OnlyOffice
Projects
None yet
Development

No branches or pull requests

8 participants