{"id":1110,"date":"2021-02-04T15:22:52","date_gmt":"2021-02-04T20:22:52","guid":{"rendered":"https:\/\/increasec.com\/?p=1110"},"modified":"2022-04-04T13:58:25","modified_gmt":"2022-04-04T17:58:25","slug":"nextcloud-work-from-home","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=1110","title":{"rendered":"NextCloud Work from Home"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">NextCloud is a great application that was originally designed to be a DropBox alternative but quickly grew to much more.  It has a single pane integration of Files, Email, Contacts, Calendar, Chat, Audio\/Video Conf +more.  Functionality is extended through Plugins<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pros:<br>Single pane = works on anything with a modern browser<br>Apps for Android and iPhone<br>Onsite = control of my files, in my country where I know the laws<br>LDAP integration, or local accounts<br>Plugins for 2FA, Hardware token etc<br>GeoFilter via plugin (if your firewall doesn&#8217;t support it)<br>Fail2ban via plugin<br>External storage on SMB\/CIFS , S3, FTP, OpenStackOS, SFTP, WebDav, More via Plugins  DropBox, GoogleDrive, OneDrive&#8230; etc<br>Installs on Raspberry Pi 4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cons:<br>Takes some work to setup<br>Connection to SMB is finicky<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My Install Notes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I installed on VmWare 6.7 (4cpu,8gb,200gbThin), Ubuntu20.04LTS<br>Don&#8217;t install NextCloud via <strong>Snap<\/strong> (the checkbox when installing Ubuntu), smbclient is super difficult to add to Snap!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.itzgeek.com\/post\/how-to-install-nextcloud-on-ubuntu-20-04\/\">https:\/\/www.itzgeek.com\/post\/how-to-install-nextcloud-on-ubuntu-20-04\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.server-world.info\/en\/note?os=Ubuntu_20.04&amp;p=nextcloud&amp;f=8\">https:\/\/www.server-world.info\/en\/note?os=Ubuntu_20.04&amp;p=nextcloud&amp;f=8<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.itzgeek.com\/post\/how-to-install-nextcloud-on-ubuntu-20-04\/https:\/\/www.server-world.info\/en\/note?os=Ubuntu_20.04&amp;p=nextcloud&amp;f=8https:\/\/help.nextcloud.com\/t\/ldap-user-and-group-backend-the-library-ldap-is-not-available\/57484\">https:\/\/help.nextcloud.com\/t\/ldap-user-and-group-backend-the-library-ldap-is-not-available\/57484<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Modifications to the links above for php-smbclient\/External Storages:<br>sudo apt -y install smbclient cifs-utils libsmbclient-dev php-dev make php-fpm php-ldap<br>sudo pecl install smbclient<br>sudo echo &#8216;extension=smbclient.so&#8217; &gt;&gt; \/etc\/php\/7.4\/fpm\/php.ini<br>(above didn&#8217;t work, need to use sudo nano \/etc\/php\/7.4\/fpm\/php.ini  then add extension=smbclient.so      anywhere, doesn&#8217;t matter)<br>sudo systemctl restart php7.4-fpm<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the default Apache webpage is still visible run this:<br>sudo a2dissite 000-default.conf<br>sudo service apache2 reload<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Top right user initial menu<br>Apps<br>Disabled Apps<br>External Storage support = Enable   (if u wanna use existing file shares)<br>LDAP Users Backend = Enable    (if u have a Microsoft Domain Controller)<br>Menu, Settings, Administration section<br>External storages,<br>Add Storage = smb\/cifs<br>Add app Group folders<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Work-around for finicky SMB:<br>I could not add external storage to a share named Projects, different shares worked on this server, tried changing ownership and permissions, local authentication, nothing worked<br>eventually I connected to the default windows share G$ and added the path to the folder i wanted to be the root.  <br>BUT that didn&#8217;t work with the account that had read-only permissions, I used a privileged account, and checked the &#8220;read only&#8221; box hidden in the extended menus.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"413\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1-1024x413.png\" alt=\"\" class=\"wp-image-1111\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1-1024x413.png 1024w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1-300x121.png 300w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1-768x310.png 768w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1-710x287.png 710w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-1.png 1370w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Get an SSL certificate from ZeroSSL if TCP ports 80+443 are in use.  ZeroSSL lets you confirm with an email address.  but their renewal process is stooopid.    Update; ZeroSSL counts a renewal as a new certificate, so you quickly run out of &#8220;free&#8221; certificates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Turn off IPv6:<br>nano \/etc\/sysctl.conf<br>add to end:net.ipv6.conf.all.disable_ipv6 = 1<br>net.ipv6.conf.default.disable_ipv6 = 1<br>net.ipv6.conf.lo.disable_ipv6 = 1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Error:  Access through untrusted domain<br>nano \/opt\/nextcloud\/config\/config.php<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8216;trusted_domains&#8217; =&gt;<br>array (<br>0 =&gt; &#8216;10.3.1.102&#8217;,&#8217;remote.tc.ca&#8217;<br>),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8216;overwrite.cli.url&#8217; =&gt; &#8216;http:\/\/remote.tc.ca\/nextcloud&#8217;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apachectl configtest<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl reload apache2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">how to remove \/netcloud from URL???<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">setup fail2ban;  requires path to nextcloud.log<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"455\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image.jpeg\" alt=\"\" class=\"wp-image-1146\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image.jpeg 800w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-300x171.jpeg 300w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-768x437.jpeg 768w, https:\/\/increasec.com\/wp-content\/uploads\/2021\/02\/image-710x404.jpeg 710w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Renew Certificate:<br>letsencrypt renew<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lets put that in the scheduler so it gets done auto-magically<br>nano \/etc\/cron.weekly\/cert_renew.sh<br>#!\/bin\/bash<br>letsencrypt renew<br>Ctrl+O<br>Ctrl+X<br>chmod +x \/etc\/cron.weekly\/cert_renew.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreupdates:<br>if you only have a few users, don&#8217;t use LDAP integration, the Kerberos ticket expires and its difficult to renew.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">if you get this error when trying to update Nextcloud &#8220;<a href=\"https:\/\/help.nextcloud.com\/t\/the-php-memory-limit-is-below-the-recommended-value-of-512mb\/42719\">The PHP memory limit is below the recommended value of 512MB<\/a>&#8221;  <br>nano <strong>\/etc\/php\/7.2\/apache2\/php.ini<\/strong> <br>search for and increase memory_limit to 512M<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> if the updater gets stuck try this:<br>sudo -u www-data php \/var\/www\/nextcloud\/occ maintenance:repair<br>OR<br>sudo -u www-data php \/var\/www\/<strong>html\/<\/strong>nextcloud\/occ maintenance:repair<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NextCloud is a great application that was originally designed to be a DropBox alternative but quickly grew to much more. It has a single pane integration of Files, Email, Contacts,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,113,151],"class_list":["post-1110","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-smb","tag-telework","tag-workfromhome"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1110"}],"version-history":[{"count":20,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions"}],"predecessor-version":[{"id":1929,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1110\/revisions\/1929"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}