0169.html 12 KB

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