0277.html 12 KB

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