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

Support FreeBSD #79

Open
oparoz opened this issue Feb 16, 2017 · 144 comments
Open

Support FreeBSD #79

oparoz opened this issue Feb 16, 2017 · 144 comments
Assignees
Labels
feature request Issues that request new features to be added to OnlyOffice

Comments

@oparoz
Copy link

oparoz commented Feb 16, 2017

Do you want to request a feature or report a bug?

FR

What is the current behavior?

Too many linuxisms is the scripts + compilation of unnecessary components which are already available via the ports system

What is the expected behavior?

Autodetection of the BSD platform and compilation of core

@beatgammit
Copy link

beatgammit commented May 8, 2017

I'm willing to do some work on this. @oparoz (or anyone else for that matter) have you put much time into getting this to build?

I personally only care about the server side, but getting the client to build would be awesome too.

@oparoz
Copy link
Author

oparoz commented May 8, 2017

That would be great @beatgammit !
I did not put any effort. I just looked at the build scripts and saw that this was not ready at all for the BSD platform.

@sachaz
Copy link

sachaz commented Nov 19, 2017

Some news on this ?

@ShockwaveNN ShockwaveNN added the feature request Issues that request new features to be added to OnlyOffice label Nov 20, 2017
@ideal2545
Copy link

Has there been any movement on this, everyone over at FreeNAS would be really happy.

@ShockwaveNN
Copy link
Contributor

@ideal2545 Sorry, currently this is not a high priority task, so no any major progress

@beatgammit
Copy link

I haven't had time to dig in, and I'll be using LibreOffice in the short term, so I'm likely not going to look at it anytime soon. I'm still interested though.

@Teetoow
Copy link

Teetoow commented Jan 29, 2020

I spent many hours trying to only compile the DocumentServer part of OnlyOffice.
It was nearly a success before I discovered that it needs some node.js packages which are obsolete, unmaintained and thus unavailable for FreeBSD. Before that I had to update tens and tens of source code files, Makefiles etc. in order to get it compiling. This work is really boring and can't be finished until OnlyOffice uses still maintained external packages.

I would very happy to try to get it fully compiling and working natively and to send patches if one of the author accepts to integrate this work..

@ShockwaveNN
Copy link
Contributor

@Teetoow Hi, you can create PR with patches and if our dev team will approved them we'll merge them

@Teetoow
Copy link

Teetoow commented Jan 29, 2020

@ShockwaveNN then I'll try to find some time to do the job as soon as possible.
I just expect that the latest document server stopped the use of the umaintained node.js packages. Otherwise i won't be able to get it working because of that.

@ShockwaveNN
Copy link
Contributor

@Teetoow Could you provide list of unmaintained packages or a way to know it?

@Teetoow
Copy link

Teetoow commented Jan 29, 2020

@ShockwaveNN I'll try to find it again. I was doing this work the last summer.. I didn't had time to continue the work.. In all cases I will retry the next summer (I won't have time before!)

@Teetoow
Copy link

Teetoow commented Jan 29, 2020

@ShockwaveNN I had trouble with PhantomJS (ariya/phantomjs#15344)

@ShockwaveNN
Copy link
Contributor

@Teetoow As far as I remember PhantomJS used only in testing

@ShockwaveNN
Copy link
Contributor

@Teetoow Also, latest commit in PhantomJS is 16 days ago, seems project is not unmaintained. Also I'm not sure how unmaintained nodejs project related with compilation on FreeBSD

@tuxillo
Copy link

tuxillo commented Jan 30, 2020

Does anybody have a full list of dependencies? It would be a good first step in order to determine what's actually needed.

@ShockwaveNN
Copy link
Contributor

@tuxillo You can look at Dockerfile to determine that

@Teetoow
Copy link

Teetoow commented Jan 31, 2020

@Teetoow Also, latest commit in PhantomJS is 16 days ago, seems project is not unmaintained. Also I'm not sure how unmaintained nodejs project related with compilation on FreeBSD

Ok so I tried to take some times to update my initial patch to the latest onlyoffice release. The core directory compiles without any trouble (I'll send the patch once everything will work).
Unfortunately I still have troubles with web-apps nodeJS modules: "grunt-mocha" requires phantomJS v 2.1.16. Unfortunately this release is not available in the npm repository for FreeBSD and I can't compile it since this version is not available in the phantomJS github (https://github.com/Medium/phantomjs/releases/). That's why it doesn't work.

Since I don't really understand whether these packages are really needed for production or are needed for testing, I don't know what to do.. Maybe you can give me some hints or a solution to skip that part if it's for testing only?

@Schueni1
Copy link

Schueni1 commented Feb 1, 2020

Has there been any movement on this, everyone over at FreeNAS would be really happy.

And everyone directly on FreeBSD :)

@tuxillo
Copy link

tuxillo commented Feb 1, 2020

Since the document server has 6 components (according to the README in the project root) I wonder if it would not be easier to bring each of those components together one by one, meaning one port, at least, for each one.

@tuxillo
Copy link

tuxillo commented Feb 1, 2020

Starting with core, the table below lists the common 3rd party software, although it will be outdated soon:

3rd party component Version in core Version in FreeBSD ports Observations
boost 1.58.0 1.72 Statically linked?
cef 3202 Port required No build, fetches a binary release
cryptopp 7.0.0 8.2.0 No build.sh, used later?
icu 58.2 65.1 No build, fetches a binary release
openssl master 1.1.1d .
pole n/a Port or source required No build.sh, used later?
v8 6.0 / 7.0 3.18.5 .

@Teetoow
Copy link

Teetoow commented Feb 1, 2020

ok so all the documentserver compiles without any error with my Makefile, scripts and preprocessor modifications. The only trouble is that the v8 version of FreeBSD is too old (as @tuxillo mentioned) and compiling v8 under FreeBSD is just definitely too hard (first of all gclient/synth don't support FreeBSD)!
This is the last piece of the puzzle which is missing. If someone has an idea about how to compile recent version of v8 under FreeBSD I would be really interested in!

The only idea I've got is to try to use the V8 version which comes with nodejs (which compiles perfectly under FreeBSD) and try to generate a shared library from it..

@Teetoow
Copy link

Teetoow commented Feb 1, 2020

@tuxillo in order to not destroy the onlyoffice architecture source I think the best thing to do is to use the third party components brought with DocumentServer (except for v8 which is too hard to compile... and ICU since they are linked).

@tuxillo
Copy link

tuxillo commented Feb 1, 2020

@Teetoow if the goal is to just build DocumentServer in FreeBSD so that people can build themselves, then I guess it's okay just to use whatever comes with DS. However if the goal is to bring DS to freebsd ports, the process is going to need to be properly defined and split in parts to have a chance for it to be accepted.

@Teetoow
Copy link

Teetoow commented Feb 1, 2020

@tuxillo I understand. For the moment my only goal is to get DocumentServer running natively on FreeBSD without having a virtual machine running for that purpose (I unfortunately don't have enough time and FreeBSD ports knowledges for something else).

But as I previously said this can only be achieved if a not-so-old v8 version can be compiled under FreeBSD.. As far as I understood and tried this is a VERY BIG deal.. (and managing an up-to-date v8 port for FreeBSD might be much harder than one for DocumentServer :s).
That's why if you have any ideas about how to achieve this goal I would be really interested in.

@Teetoow
Copy link

Teetoow commented Feb 4, 2020

Hi,

Just a little message in order to let you know that I found a nice solution for the libv8 under FreeBSD (thanks to Fedora ^^) and now DocumentServer is compiling well!
The only thing I had to remove is the dependance with grunt-mocha (but it seems that it's not used?!).
I'm trying to do some tests in order to check whether everything is working well. Then I'll submit to you the patch and a document which explains how to compile it under FreeBSD.
I hope you'll accept it.

@Teetoow
Copy link

Teetoow commented Feb 5, 2020

Almost everything is working well. I just encounter a bug in the x2t binary which returns 80 each time I finish to edit a file. Thus modifications cannot be submitted to nextcloud and are lost in the DocumentServer part somewhere..
I still understand what causes that problem.. When I trace its execution it seems that it succeed to uncompress the file, parse its content and stop, clean everything and returns 80 (AVS_FILEUTILS_ERROR_CONVERT ?)

Please find attached to this post the OnlyOffice DocumentServer patchs, a text file which describes the compilation and configuration steps for FreeBSD users and a patch of the FreeBSD www/node8 port in order to get the needed libv8.

FreeBSD.txt
core.patch.txt
sdkjs.patch.txt
server.patch.txt
web-apps.patch.txt
node8.patch.txt

@savegame
Copy link

savegame commented Feb 3, 2022

@ragametal

Then, it was time for rabbitmq. I was able to start the service but when i tried to add the user and password i got this:

root@onlyoffice:~ # rabbitmqctl add_user onlyoffice password Error: unable to perform an operation on node 'rabbit@onlyoffice'. Please see diagnostics information and suggestions below. `Most common reasons for this are:` * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues) * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server) * Target node is not running `In addition to the diagnostics info below:` * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more * Consult server logs on node rabbit@onlyoffice * If target node is configured to use long node names, don't forget to use --longnames with CLI tools `DIAGNOSTICS` `===========` attempted to contact: [rabbit@onlyoffice] `rabbit@onlyoffice:` ` * connected to epmd (port 4369) on onlyoffice` ` * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic` ` * TCP connection succeeded but Erlang distribution failed` ` * suggestion: check if the Erlang cookie is identical for all server nodes and CLI tools` ` * suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other` ` * suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that` ` * suggestion: see the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more` Current node details: * node name: 'rabbitmqcli-665-rabbit@onlyoffice' * effective user's home directory: /root * Erlang cookie hash: X3gB5P+9mUyTPINqdWzLYg==

I honestly don’t know what any of this means or how to solve it. Could you please throw some light as to how to overcome this error?

erlang hash different of your user (root) and rabbit , just need copy erlang hash from rabbit to root fokder /root
when i am at home, i wrote full answer ) sorry )

@savegame
Copy link

savegame commented Feb 3, 2022

@ragametal

rabbitmqctl add_user --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` user passwd 

with this its work, or just copy hash from rabbit to your /root/.erlang.cookie (or somewhere there )

@ragametal
Copy link

@savegame
Your suggestion worked like a charm. Thank you.

I had to indicate the erlang-cookie with all other rabbitmq commands in the instructions in order to make it work.

So, instead of using
rabbitmqctl add_user onlyoffice password
rabbitmqctl set_user_tags onlyoffice administrator
rabbitmqctl set_permissions -p / onlyoffice ".*" ".*" ".*"

I used
rabbitmqctl add_user --erlang-cookie cat /var/db/rabbitmq/.erlang.cookieonlyoffice passwd
rabbitmqctl set_user_tags --erlang-cookie cat /var/db/rabbitmq/.erlang.cookie onlyoffice administrator
rabbitmqctl set_permissions -p / --erlang-cookie cat /var/db/rabbitmq/.erlang.cookie onlyoffice ".*" ".*" ".*"

Now to learn how to setup Nginx as i only have experience with Apache.

@ragametal
Copy link

@MikaelUrankar
The default onlyoffice nginx conf file /usr/local/etc/onlyoffice/documentserver/nginx/ds.conf points to some other files using an invalid path (at least on my system).

Everything works if i manually change those lines to
include /usr/local/etc/onlyoffice/documentserver/nginx/includes/http-common.conf;
include /usr/local/etc/onlyoffice/documentserver/nginx/includes/ds-*.conf;

Is there any way to update the port to include these changes?
I ask because the instructions has a note about the nginx sample configuration files saying
"Do not edit them as they will be restored everytime the port is updated".

Also, i'm trying to switch the onlyoffice service to https per the instructions on https://helpcenter.onlyoffice.com/installation/docs-community-https-linux.aspx but the file /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl is missing. I assume that in FREEBSD that file should be in /usr/local/etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl but it's not there either.

Is there a way to include this file in the next version of the port?

In the meantime, do any of you know where can i find this ds-ssl.conf.tmpl file or what is the content of it?

@MikaelUrankar
Copy link

@MikaelUrankar The default onlyoffice nginx conf file /usr/local/etc/onlyoffice/documentserver/nginx/ds.conf points to some other files using an invalid path (at least on my system).
Everything works if i manually change those lines to include /usr/local/etc/onlyoffice/documentserver/nginx/includes/http-common.conf; include /usr/local/etc/onlyoffice/documentserver/nginx/includes/ds-*.conf;

Is there any way to update the port to include these changes? I ask because the instructions has a note about the nginx sample configuration files saying "Do not edit them as they will be restored everytime the port is updated".

I'll fix the path in the next port update. Keep in mind that the nginx conf files are installed as sample files and needs to be adjusted manually.

Also, i'm trying to switch the onlyoffice service to https per the instructions on https://helpcenter.onlyoffice.com/installation/docs-community-https-linux.aspx but the file /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl is missing. I assume that in FREEBSD that file should be in /usr/local/etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl but it's not there either.
Is there a way to include this file in the next version of the port?

I don't know why it's missing, will look into it and update the port if it has some value.

In the meantime, do any of you know where can i find this ds-ssl.conf.tmpl file or what is the content of it?

It's available here https://github.com/ONLYOFFICE/document-server-package/blob/master/common/documentserver/nginx/ds-ssl.conf.tmpl.m4 You'll need to adjust a few variables.

@ragametal
Copy link

@MikaelUrankar
Thank you sir. It is working great after slightly modifying the ds-ssl.conf.tmpl file you lined above.

@Schueni1
Copy link

@MikaelUrankar
Thanks a lot. It took me a day, but now I got it working!
I just noticed a few minor issues with the port on freshports.org.
The port states postgresql-server as a requirement, but I think only the postgresql-client should be a requirement. In my case the PostgreSQL server is running in a different jail.
I also noticed, that in the nginx files there is localhost/127.0.0.1 hardcoded. In my jail I don't have access to 127.0.0.1 as I am using a shared IP. I changed the IP in the nginx files to my local IP, but you stated, that these files will be overwritten on every update. Where should I configure this?
Thanks

@MikaelUrankar
Copy link

@MikaelUrankar Thanks a lot. It took me a day, but now I got it working! I just noticed a few minor issues with the port on freshports.org. The port states postgresql-server as a requirement, but I think only the postgresql-client should be a requirement. In my case the PostgreSQL server is running in a different jail. I also noticed, that in the nginx files there is localhost/127.0.0.1 hardcoded. In my jail I don't have access to 127.0.0.1 as I am using a shared IP. I changed the IP in the nginx files to my local IP, but you stated, that these files will be overwritten on every update. Where should I configure this? Thanks

Good points!
I'll remove postgresql-server as a mandatory dependency next time I update the port.
My bad for nginx, it's probably a leftover from a previous WIP. You can safely edit them as they are installed as sample files (and won't get deleted if you modify them, having a backup is still a good thing though). I'll fix the port at the next update.
Thanks for the remarks!

@regs01
Copy link

regs01 commented Apr 10, 2023

Thank you so much for this effrort. I installed the package from freshport in a truenas jail just fine pkg install onlyoffice-documentserver.

Can this be a little more explained? I'm can't see the package in jail.
pkg: No packages available to install matching 'onlyoffice-documentserver' have been found in the repositories

@MikaelUrankar
Copy link

I fixed a few issues in the port. It'll be available in the pkg repo in a few days.

@chilledfrogs
Copy link

Thank you so much for this effrort. I installed the package from freshport in a truenas jail just fine pkg install onlyoffice-documentserver.

Can this be a little more explained? I'm can't see the package in jail. pkg: No packages available to install matching 'onlyoffice-documentserver' have been found in the repositories

I think that it's currently only in the main ports tree and not the quarterly one which you might have, it should be possible to switch to the main one on FreeBSD-stable but I'm still new to FreeBSD myself and learning more about it

@Peter2121
Copy link

I suppose that there are some problems building the packages. Normally the logs of failed builds are sent to the port maintainer - [email protected]. The logs should be analyzed to determine the source of failures.

@MikaelUrankar
Copy link

I've merged my fix to the quarterly branch.

@Peter2121
Copy link

At https://www.freshports.org/www/onlyoffice-documentserver/ there are no builds...

@MikaelUrankar
Copy link

As I said, it'll take a few days for the package to be available.

@Ukhupacha
Copy link

@MikaelUrankar is the a guide on how to set the server running? I've tried the steps after the installation but couldn't make it work.

@MikaelUrankar
Copy link

Do you have an error or something?

@Ukhupacha
Copy link

It has to do more with the next steps after the installation, the addres only shows me the nginx welcome part and not the onlyoffice server.

@MikaelUrankar
Copy link

It has to do more with the next steps after the installation, the addres only shows me the nginx welcome part and not the onlyoffice server.

Can you send me your nginx configuration at my FreeBSD.org email address?

@regs01
Copy link

regs01 commented Dec 26, 2023

There seem to be no updates in freshports

@Schueni1
Copy link

Schueni1 commented Feb 1, 2024

It builds perfectly fine on my machine :)

@regs01
Copy link

regs01 commented Feb 2, 2024

Not there though, so package is no longer available. Judging by logs it seem to compile, but not linking.

@regs01
Copy link

regs01 commented Feb 7, 2024

Linking seem to be failing in FreeBSD 13 both AMD64 and Aarch64. But succeeding in FreeBSD 14 and 15.

@MikaelUrankar
Copy link

Linking seem to be failing in FreeBSD 13 both AMD64 and Aarch64. But succeeding in FreeBSD 14 and 15.

Even after https://cgit.freebsd.org/ports/commit/?id=81ddc72fda1f56d86dd0f4166edeb1ac8e331a6e ?

@regs01
Copy link

regs01 commented Feb 8, 2024

Probably no. Will see. Most recent build seem to take previous commit, although after new was committed.
https://lists.freebsd.org/archives/freebsd-pkg-fallout/2024-February/558734.html

I guess next attempt is on Saturday?

@regs01
Copy link

regs01 commented Feb 28, 2024

Are there any plans for 8.0+?

@regs01
Copy link

regs01 commented Aug 2, 2024

And are there any plans for 8.1?

@MikaelUrankar
Copy link

And are there any plans for 8.1?

It's on my todo list

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