Skip to content

Instantly share code, notes, and snippets.

@come-maiz
Last active March 3, 2017 23:45
Show Gist options
  • Save come-maiz/735d995920ef5fb9d24eb6931f6686c0 to your computer and use it in GitHub Desktop.
Save come-maiz/735d995920ef5fb9d24eb6931f6686c0 to your computer and use it in GitHub Desktop.
Nextcloud snap testing

Smoke tests for the Nextcloud snap

First, install the snap:

$ sudo snap install nextcloud --edge

Check that it is running:

  • Open http://localhost in the browser.
    • Check that the Nextcloud page to create an admin account is opened.

To test the https setup with letsencrypt you need a server with a public IP, the ports 80 and 443 open and a domain name. If you don't have that, just keep using the self signed certificate and jump to the following test.

Set up https: (letsencrypt limits the number of certificates you can get in a week. If that can cause you troubles or you have already hit the limit, run the following command with -t to use the staging server and continue the testing using the untrusted certificate)

$ sudo nextcloud.enable-https
This snap ships Nextcloud already configured with a self-signed
certificate. This utility allows you to obtain a certificate via Let's
Encrypt.
[...]
3. Both ports 80 and 443 on the external IP address of this machine must
   point to this machine (e.g. port forwarding might need to be setup on
   your router).

Have you met these requirements? (y/n) y
Please enter an email address (for urgent notices or key recovery): $USER_EMAIL
Please enter your domain name(s) (space-separated): $USER_DOMAIN
Attempting to obtain certificates... done
Stopping apache... done
Starting apache... done

Check the letsencrypt certificate:

  • Open http://$USER_DOMAIN in the browser, again.
    • You are redirected to https://$USERD_DOMAIN.
    • Check that there is no warning about the site security and you are presented immediately with the page to create an admin account.

Create an admin account:

  • Enter the $ADMIN_USERNAME and $ADMIN_PASSWORD.
  • Click the Finish setup button.
    • The files page is opened, with a dialog to get applications to sync.
  • Close the dialog.

Create a group:

  • Open the admin dropdown from the top-right corner.
  • Select the Users option.
    • The Users page is opened.
  • Click the Add Group button.
  • Enter the $GROUP_NAME.
  • Click the + button.
    • The group is added to the list.

Create a user:

  • On the users page, enter the $USERNAME and $PASSWORD.
  • Select the $GROUP_NAME from the group drop down.
  • Click the Create button.
    • The user is added to the list.

Install an application:

  • Open the main dropdown from the top-right corner.
  • Select the Apps option.
    • The Apps page is opened.
  • Click the Not enabled option.
  • Click the Enable button of the Default encryption module.
    • The text of the button is now Disable.

Enable server-side encryption:

  • Log out and log in again to initialize the keys.
  • Open the admin dropdown from the top-right corner.
  • Select the Admin option.
    • The Admin page is opened.
  • Go to the Server-side encryption section.
  • Click the Enable encryption button.
    • The option has a check and the defaylt encryption module options are shown.

Send an email:

  • Open the admin dropdown from the top-right corner.
  • Select the Personal option.
    • The Personanl page is opened.
  • Enter your $USER_EMAIL.
  • Open again the admin dropdown.
  • Select the Admin option.
    • The Admin page is opened.
  • Go to the Email server section.
  • Enter the From address.
  • Click the Send email button.
  • Go to your email client and check the received email.

Log in as a user:

  • Log out and on the login page, enter the $USERNAME and $PASSWORD.
  • Click the button with right arrow.
    • The files page is opened, with a dialog to get applications to sync.
  • Close the dialog.

Create a text file:

  • On the files page, click the + button.

  • Click the Text file option.

  • Enter the $FILE_NAME.

    • A dialog is opened to edit the file.
  • Enter some text.

  • Wait for the file to be saved.

  • Close the dialog.

    • The file is added to the list.
  • Click the created file.

    • The dialog is open to edit the file. It contains the text written before.
  • Open a terminal to check that the file is encrypted:

    $ sudo cat /var/snap/nextcloud/common/nextcloud/data/testuser/files/test.txt

    • The contents displayed are encrypted.

Create a folder:

  • On the files page, click the + button.
  • Click the Folder option.
  • Enter the $FOLDER_NAME
  • Press enter.
    • The folder is added to the list.
  • Click the folder.
    • The folder contents are shown, it's empty.

Upload a file:

  • On the files page, click the + button.
  • Click the Upload option.
    • The file selection dialog is opened.
  • Select a file.
    • A progress bar is shown during the upload.
    • The file is added to the list.
  • Click the file and check that it's the same you uploaded.

Delete a file:

  • On the files page, click the ... button next to a file.
  • Click the Delete option.
    • The file is removed from the list.
  • Click the Deleted files button on the bottom-left corner.
    • The deleted file appears in the list.

Restore a file:

  • On the deleted files page, click the Restore button next to a file.
    • The file is removed from the list.
  • Go to All files.
  • Navigate to the folder that used to contain the file.
    • The restored file appears in the list.
@come-maiz
Copy link
Author

On the admin settings, there's an updater section which is confusing. How will this work with the snap update mechanism? Can it be hidden and disabled?

@come-maiz
Copy link
Author

come-maiz commented Aug 19, 2016

Sending email with the php mode doesn't work. It works with the smtp mode.

@kyrofa
Copy link

kyrofa commented Aug 23, 2016

Sending email with the php mode doesn't work. It works with the smtp mode.

Thank you! Logged as nextcloud-snap/nextcloud-snap#28.

@kyrofa
Copy link

kyrofa commented Mar 3, 2017

On the admin settings, there's an updater section which is confusing. How will this work with the snap update mechanism? Can it be hidden and disabled?

This was nextcloud-snap/nextcloud-snap#32. This is now disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment