0169.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Google Docs with Collabora On ownCloud</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  7. <script type="text/javascript">
  8. $(function(){
  9. $('textarea').each(function(i,e){
  10. theTextarea = $(this);
  11. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  12. });
  13. $('li').each(function(i,e){
  14. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  15. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  16. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  17. });
  18. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  19. theElement = $(this);
  20. var lines = theElement.html().split("\n");
  21. theElement.empty();
  22. for(l=0;l<lines.length;l++){
  23. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  24. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ lines[l].replace(/"/g, '&quot;') +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  25. } else {
  26. theElement.append(lines[l]);
  27. }
  28. }
  29. });
  30. $(document).on('click','input.copy-text',function(){
  31. theButton = $(this);
  32. $('input.copy-text').attr('src','images/clipboard.png');
  33. $('span.copy-animation').removeClass('copy-animation');
  34. try {
  35. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  36. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  37. theButton.attr('src','images/clipboard_active.png');
  38. } catch(err) {
  39. }
  40. return false;
  41. });
  42. $(document).on('click','input.completeBox',function(){
  43. theBox = $(this);
  44. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  45. theBox.prop('disabled',true);
  46. theBox.parent('li').prevAll().each(function(i,e){
  47. theLI = $(this);
  48. if(theLI.find('input[type=checkbox]').not(':checked')){
  49. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  50. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  51. }
  52. });
  53. });
  54. if(window.self !== window.top){
  55. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  56. }
  57. });
  58. </script>
  59. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  60. </head>
  61. <body>
  62. <div id="gridContainer">
  63. <div class="topMargin"></div>
  64. <div id="listName" class="topMargin">
  65. <h1>Roll Your Own Google Docs with Collabora On ownCloud</h1>
  66. </div>
  67. <div></div>
  68. <div id="content">
  69. <h2>Installing Collabora Office</h2>
  70. <ol>
  71. <li>Log into the Linux device</li>
  72. <li>Run the following commands in a terminal:
  73. <div class="codeBlock"># install signing key<br />
  74. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D<br />
  75. # add software repository<br />
  76. sudo echo &#39;deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./&#39; &gt;&gt; sudo /etc/apt/sources.list<br />
  77. # update software repositories<br />
  78. sudo apt update<br />
  79. # install loolwsd and code-brand<br />
  80. sudo apt install loolwsd code-brand<br />
  81. # enable required Apache modules<br />
  82. sudo a2enmod proxy&nbsp;proxy_wstunnel&nbsp;proxy_http ssl</div>
  83. </li>
  84. </ol>
  85. <h2>Creating SSL Certificates</h2>
  86. <ol>
  87. <li>Launch XCA</li>
  88. <li>Open the PKI database if it is not already (File &gt; Open DataBase), enter password</li>
  89. <li>Click on the Certificates tab, right click on your Intermediate CA certificate</li>
  90. <li>Select New</li>
  91. <li>On the Source tab, make sure Use this Certificate for signing is selected</li>
  92. <li>Verify your Intermediate CA certificate is selected from the drop down</li>
  93. <li>Click the Subject tab</li>
  94. <li>Complete the Distinguished Name section
  95. <p>internalName: nettools.i12bretro.local<br />
  96. countryName: US<br />
  97. stateOrProvinceName: Virginia<br />
  98. localityName: Northern<br />
  99. organizationName: i12bretro<br />
  100. organizationUnitName: i12bretro Certificate Authority<br />
  101. commonName: nettools.i12bretro.local</p>
  102. </li>
  103. <li>Click the Generate a New Key button</li>
  104. <li>Enter a name and set the key size to at least 2048</li>
  105. <li>Click Create</li>
  106. <li>Click on the Extensions tab</li>
  107. <li>Select End Entity from the type list</li>
  108. <li>Click Edit next to Subject Alternative Name</li>
  109. <li>Add any DNS or IP addresses that the certificate will identify</li>
  110. <li>Update the validity dates to fit your needs</li>
  111. <li>Click the Key Usage tab</li>
  112. <li>Under Key Usage select Digital Signature, Key Enchiperment</li>
  113. <li>Under Extended Key Usage select Web Server and Web Client Authentication</li>
  114. <li>Click the Netscape tab</li>
  115. <li>Select SSL Server</li>
  116. <li>Click OK to create the certificate</li>
  117. </ol>
  118. <h2>Exporting Required Files</h2>
  119. <ol>
  120. <li>In XCA, click on the Certificates tab</li>
  121. <li>Right click the Intermediate CA certificate &gt; Export &gt; File</li>
  122. <li>Set the file name CA.pem and verify the export format is PEM chain (*.pem)</li>
  123. <li>Click OK</li>
  124. <li>Right click the SSL certificate &gt; Export &gt; File</li>
  125. <li>Set the file name with a .crt extension and verify the export format is PEM (*.crt)</li>
  126. <li>Click OK</li>
  127. <li>Click the Private Keys tab</li>
  128. <li>Right click the private key generated for the SSL certificate &gt; Export &gt; File</li>
  129. <li>Set the file name with a .key extension and verify the export format is PEM private (*.pem)</li>
  130. <li>Click OK</li>
  131. </ol>
  132. <h2>Applying the Certificates</h2>
  133. <ol>
  134. <li>Download WinSCP <a href="https://winscp.net/eng/downloads.php" target="_blank">Download</a></li>
  135. <li>Extract WinSCP and run the executable</li>
  136. <li>Connect to the Collabora Online server via WinSCP</li>
  137. <li>Copy the created .crt, .key and .pem files to ~/</li>
  138. <li>On the&nbsp;Collabora Online server, run the following command in a terminal
  139. <div class="codeBlock">sudo cp ~/nettools.i12bretro.local.crt /etc/ssl/certs/<br />
  140. sudo cp ~/nettools.i12bretro.local.key /etc/ssl/certs/<br />
  141. sudo cp ~/CA.pem /etc/ssl/certs/<br />
  142. # edit the configuration file<br />
  143. sudo nano&nbsp;/etc/loolwsd/loolwsd.xml</div>
  144. </li>
  145. <li>Edit the loolwsd.xml file, find the SSL block and update the cert_file_path, key_file_path and ca_file_path values
  146. <p><cert_file_path desc="Path to the cert file" relative="false"></cert_file_path><cert_file_path desc="Path to the cert file" relative="false"></cert_file_path><cert_file_path desc="Path to the cert file" relative="false"></cert_file_path><cert_file_path desc="Path to the cert file" relative="false">/etc/ssl/certs/nettools.i12bretro.local.crt</cert_file_path><br />
  147. <key_file_path desc="Path to the key file" relative="false">/etc/ssl/certs/nettools.i12bretro.local.key</key_file_path><br />
  148. <ca_file_path desc="Path to the ca file" relative="false">/etc/ssl/certs/CA.pem</ca_file_path><ca_file_path desc="Path to the ca file" relative="false"></ca_file_path><ca_file_path desc="Path to the ca file" relative="false"></ca_file_path><ca_file_path desc="Path to the ca file" relative="false"></ca_file_path></p>
  149. </li>
  150. <li>Press CTRL+W and search for <wopi< li=""> </wopi<></li>
  151. <li>Add a new host for the DNS name of the ownCloud server<br />
  152. <host allow="true&quot;">nettools.i12bretro.local</host></li>
  153. <li>Press CTRL+O, Enter, CTRL+X</li>
  154. <li>Continue the configuration by running the following commands in terminal:
  155. <div class="codeBlock"># create CODE proxy configuration file<br />
  156. sudo nano /etc/apache2/conf-available/code.conf</div>
  157. </li>
  158. <li>Paste the following into code.conf
  159. <p>&nbsp;Options -Indexes</p>
  160. <p>&nbsp; #Encoded slashes need to be allowed<br />
  161. &nbsp; AllowEncodedSlashes NoDecode</p>
  162. <p>&nbsp; # Container uses a unique non-signed certificate<br />
  163. &nbsp; SSLProxyEngine On<br />
  164. &nbsp; SSLProxyVerify None<br />
  165. &nbsp; SSLProxyCheckPeerCN Off<br />
  166. &nbsp; SSLProxyCheckPeerName Off</p>
  167. <p>&nbsp; # keep the host<br />
  168. &nbsp; ProxyPreserveHost On</p>
  169. <p>&nbsp; # static html, js, images, etc. served from loolwsd<br />
  170. &nbsp; # loleaflet is the client part of Collabora Online<br />
  171. &nbsp; ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /loleaflet https://127.0.0.1:9980/loleaflet retry=0<br />
  172. &nbsp; ProxyPassReverse &nbsp; &nbsp;/loleaflet https://127.0.0.1:9980/loleaflet</p>
  173. <p>&nbsp; # WOPI discovery URL<br />
  174. &nbsp; ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0<br />
  175. &nbsp; ProxyPassReverse &nbsp; &nbsp;/hosting/discovery https://127.0.0.1:9980/hosting/discovery</p>
  176. <p>&nbsp; # Capabilities<br />
  177. &nbsp; ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /hosting/capabilities https://127.0.0.1:9980/hosting/capabilities retry=0<br />
  178. &nbsp; ProxyPassReverse &nbsp; &nbsp;/hosting/capabilities https://127.0.0.1:9980/hosting/capabilities</p>
  179. <p>&nbsp; # Main websocket<br />
  180. &nbsp; ProxyPassMatch &quot;/lool/(.*)/ws$&quot; wss://127.0.0.1:9980/lool/$1/ws nocanon</p>
  181. <p>&nbsp; # Admin Console websocket<br />
  182. &nbsp; ProxyPass &nbsp; /lool/adminws wss://127.0.0.1:9980/lool/adminws</p>
  183. <p>&nbsp; # Download as, Fullscreen presentation and Image upload operations<br />
  184. &nbsp; ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /lool https://127.0.0.1:9980/lool<br />
  185. &nbsp; ProxyPassReverse &nbsp; &nbsp;/lool https://127.0.0.1:9980/lool</p>
  186. </li>
  187. <li>Press CTRL+O, Enter, CTRL+X</li>
  188. <li>Continue the configuration by running the following commands in terminal:
  189. <div class="codeBlock"># edit default SSL configuration file<br />
  190. sudo nano /etc/apache2/sites-available/default-ssl.conf</div>
  191. </li>
  192. <li>Add the following line just above the /VirtualHost tag
  193. <p>Include /etc/apache2/conf-available/code.conf</p>
  194. </li>
  195. <li>Press CTRL+O, Enter, CTRL+X</li>
  196. <li>Continue the configuration by running the following commands in terminal:
  197. <div class="codeBlock"># edit ownCloud&nbsp;configuration file<br />
  198. sudo nano /var/www/owncloud/config/config.php</div>
  199. </li>
  200. <li>Find the trusted_domains array and add the DNS used for the SSL certificate</li>
  201. <li>Press CTRL+O, Enter, CTRL+X</li>
  202. <li>Continue with the following commands to restart loolwsd and apache2 to apply the changes:
  203. <div class="codeBlock">sudo systemctl restart loolwsd apache2</div>
  204. </li>
  205. <li>Open a web browser and navigate to https://DNS:9980</li>
  206. <li>If everything is working as expected the message OK should be shown</li>
  207. </ol>
  208. <h2>Adding Collabora Office to ownCloud</h2>
  209. <ol>
  210. <li>Log into ownCloud with an administrative user</li>
  211. <li>Click the hamburger menu in the top left corner &gt; Market</li>
  212. <li>Click Integration under the Categories heading</li>
  213. <li>Find and click on Collabora Online</li>
  214. <li>Click the Install button</li>
  215. <li>Once the installation completes, click the username dropdown &gt; Settings</li>
  216. <li>Select Admin &gt; Additional&nbsp;from the left navigation menu</li>
  217. <li>Enter the DNS name for the Collabora Online server URL</li>
  218. <li>Click Apply</li>
  219. <li>If the above option does not appear, you can complete the same terminal by running:
  220. <div class="codeBlock">cd /var/www/owncloud<br />
  221. sudo -u www-data php occ config:app:set --value https://nettools.i12bretro.local:9980 richdocuments wopi_url</div>
  222. </li>
  223. </ol>
  224. <p>Source:&nbsp;<a href="https://www.collaboraoffice.com/code/linux-packages/" target="_blank">https://www.collaboraoffice.com/code/linux-packages/</a></p>
  225. </div>
  226. </div>
  227. </body>
  228. </html>