initial commit of file from CVS for smeserver-collabora on Sat Sep 7 20:14:51 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:14:51 +10:00
parent b0491cf203
commit 3baf8e4745
22 changed files with 667 additions and 2 deletions

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1,6 @@
{
my $loolwsd = $DB->get("loolwsd") or return;
my $coolwsd = $DB->get("coolwsd") || $DB->new_record("coolwsd", { type => "service" });
$coolwsd->merge_props($loolwsd->props);
$loolwsd->delete;
}

View File

@@ -0,0 +1,38 @@
#!/bin/bash
# Disable ssl
coolconfig set ssl.enable false
coolconfig set ssl.termination true
coolconfig set net.listen loopback
coolconfig set net.proto IPv4
#Generate a list of hosts that can access to the wopi storage
#Server FQDN
AllowWopiHosts=`hostname`
#Nextcloud virtualhost
if [[ -n `/sbin/e-smith/config getprop nextcloud VirtualHost` ]];then AllowWopiHosts+="|`/sbin/e-smith/config getprop nextcloud VirtualHost`";fi
if [[ -n `/sbin/e-smith/config getprop nextcloud CloudDomain` ]];then AllowWopiHosts+="|`/sbin/e-smith/config getprop nextcloud CloudDomain`";fi
#Additional external host
if [[ -n `/sbin/e-smith/config getprop coolwsd AllowWopiHost` ]];then AllowWopiHosts+="|`/sbin/e-smith/config getprop coolwsd AllowWopiHost |sed -e 's/,/|/g' `";fi
coolconfig set storage.wopi.host "$AllowWopiHosts"
if [[ -n `/sbin/e-smith/config getprop coolwsd VirtualHost` ]]; then
#Configure smeserver-Nextcloud
if [[ -x "/usr/bin/occ" ]]; then
/usr/bin/occ app:install richdocuments
/usr/bin/occ config:app:set richdocuments wopi_url --value=https://`/sbin/e-smith/config getprop coolwsd VirtualHost`
/usr/bin/occ app:enable richdocuments
/usr/bin/occ config:system:set allow_local_remote_servers --value true --type bool
fi
fi

View File

@@ -0,0 +1,10 @@
{
use esmith::DomainsDB;
# Convert the passed hash for the domain object back into an object.
$domain = bless \%domain, 'esmith::DB::db::Record';
# Make scalars from some of the properties of the domain
$virtualHost = $domain->key;
$virtualHostContent = $domain->prop('Content');
$OUT = "";
}

View File

@@ -0,0 +1,59 @@
{
if (($port eq "80") ){
$OUT .= " ServerName $virtualHost\n";
$OUT .= " Redirect permanent / https://$virtualHost/ \n";
$OUT .= "\n";
}
else {
$OUT .= " Options -Indexes\n";
$OUT .= " ServerName $virtualHost\n";
$OUT .= " SSLEngine on\n";
$OUT .= " # Encoded slashes need to be allowed\n";
$OUT .= " AllowEncodedSlashes NoDecode\n";
$OUT .= " # keep the host\n";
$OUT .= " ProxyPreserveHost On\n";
$OUT .= " # static html, js, images, etc. served from loolwsd\n";
$OUT .= " # loleaflet is the client part of LibreOffice Online\n";
$OUT .= " ProxyPass /loleaflet http://127.0.0.1:9980/loleaflet retry=0\n";
$OUT .= " ProxyPassReverse /loleaflet http://127.0.0.1:9980/loleaflet\n";
$OUT .= " # static html, js, images, etc. served from coolwsd\n";
$OUT .= " # browser is the client part of LibreOffice Online\n";
$OUT .= " ProxyPass /browser http://127.0.0.1:9980/browser retry=0\n";
$OUT .= " ProxyPassReverse /browser http://127.0.0.1:9980/browser\n";
$OUT .= " # WOPI discovery URL\n";
$OUT .= " ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0\n";
$OUT .= " ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery\n";
$OUT .= " # Main websocket\n";
$OUT .= " ProxyPassMatch \"/cool/(.*)/ws\$\" ws://127.0.0.1:9980/cool/\$1/ws nocanon\n";
$OUT .= " # Admin Console websocket\n";
$OUT .= " ProxyPass /cool/adminws ws://127.0.0.1:9980/cool/adminws\n";
$OUT .= " # Download as, Fullscreen presentation and Image upload operations\n";
$OUT .= " ProxyPass /cool http://127.0.0.1:9980/cool\n";
$OUT .= " ProxyPassReverse /cool http://127.0.0.1:9980/cool\n";
$OUT .= " # Compatibility with integrations that use the /lool/convert-to endpoint\n";
$OUT .= " ProxyPass /lool http://127.0.0.1:9980/cool\n";
$OUT .= " ProxyPassReverse /lool http://127.0.0.1:9980/cool\n";
$OUT .= " # Endpoint with information about availability of various features\n";
$OUT .= " ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0\n";
$OUT .= " ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities\n";
$OUT .= " # base\n";
$OUT .= " ProxyPass / http://127.0.0.1:9980/ retry=0\n";
$OUT .= " ProxyPassReverse / http://127.0.0.1:9980/\n";
}
}

View File

@@ -0,0 +1,2 @@
<VirtualHost {$ipAddress}:{$port}>

View File

@@ -0,0 +1,2 @@
</VirtualHost>

View File

@@ -0,0 +1,6 @@
# collabora
#first remove log noise
if $programname == "coolwsd" and $msg contains 'WRN Util::stringVectorToMap => record is misformed: #' then stop
:programname, isequal, "coolwsd" /var/log/coolwsd.log
& stop