NextCloud 3 - Guía de instalación - Ubuntu server + Snap


Índice:

      Información

      Enlaces

      Proceso

      Pruebas realizadas

      Dominios de confianza (Trusted domains)

      Configurar router

      Nota de instalación anterior




Información  ⮴  

Instalación y configuración de NextCloud.


Se instala sobre Ubuntu server 22.04 LTS con snap en RaspberryPI


NO FUNCIONA CON LET'S ENCRYPT


Versión : 1.00

Fecha   : 28 septiembre de 2023


Enlaces  ⮴  

Documentacion

Configure Nextcloud snap

Managing encryption


Proceso  ⮴  

.- Instalar:

sudo snap install nextcloud


.- Acceder desde navegador con la IP de la RaspberryPI


Cuenta administrativa:

Usuario     : juanpadmin

Contraseña  : pericoadmin


Instalar




Pruebas realizadas  ⮴  

.- Configuración trusted_domains

      sudo nextcloud.occ config:system:get trusted_domains

      192.168.0.137

      homebadajoz.ddns.net

      homebadajoz.es

      83.61.223.191


.- HTTPS desactivado (sudo nextcloud.disable-https)

..- WIFI:

...- OK:    http://192.168.0.137

...- OK:    http://homebadajoz.ddns.net

...- ERROR: http://homebadajoz.es/


..- WAN:

...- OK:    http://83.61.223.191

...- OK:    http://homebadajoz.ddns.net

...- ERROR: http://homebadajoz.es/


.- HTTPS activado (sudo nextcloud.disable-https lets-encrypt)

..- WIFI:

...- OK: https://192.168.0.137

Los sitios web prueban su identidad mediante certificados.

Firefox no confía en este sitio porque utiliza un certificado

que no es válido para 192.168.0.137. El certificado solo es

válido para homebadajoz.ddns.net.

Código de error: SSL_ERROR_BAD_CERT_DOMAIN

...- ERROR: https://homebadajoz.ddns.net

La conexión ha caducado

Ha ocurrido un error al conectar con homebadajoz.ddns.net.

El sitio podría estar no disponible temporalmente o dema-

siado ocupado. Vuelva a intentarlo en unos momentos.

Si no puede cargar ninguna página, compruebe la conexión

de red de su equipo.

Si su equipo o red están protegidos por un cortafuegos o

proxy, asegúrese de que Firefox tiene permiso para acceder

a la web.

...- ERROR: https://homebadajoz.es/

Conexión segura fallida.

Ha ocurrido un error al conectar con homebadajoz.es

PR_END_OF_FILE_ERROR


..- WAN:

...- ERROR: http://83.61.223.191


Alerta de modo solo HTTPS

Sitio seguro no disponible


Ha activado el modo solo HTTPS para mejorar la seguridad pero no está disponible una versión HTTPS de 83.61.223.191.


Saber más…

¿Qué podría estar causando esto?


Lo más probable es que el sitio web simplemente no sea compatible con HTTPS.

continuar al sitio HTTP -> La conexión ha caducado

...- ERROR: https://83.61.223.191

La conexión ha caducado

...- ERROR: http://homebadajoz.ddns.net

...- ERROR: https://homebadajoz.ddns.net

La conexión ha caducado



Dominios de confianza (Trusted domains)  ⮴  

Todas las URL utilizadas para acceder a su servidor Nextcloud deben estar en

la lista blanca de su archivo config.php, en la configuración trusted_domains.

A los usuarios se les permite iniciar sesión en Nextcloud sólo cuando apuntan

sus navegadores a una URL que aparece en la configuración trusted_domains. No

se trata de una lista de dominios o direcciones IP permitidos del lado del

cliente. Puedes utilizar direcciones IP y nombres de dominio. Una configura-

ción típica tiene este aspecto:


    'trusted_domains' =>

      array (

       0 => 'localhost',

       1 => 'server1.example.com',

       2 => '192.168.1.50',

       3 => '[fe80::1:50]',



Listar dominios de confianza:

    sudo nextcloud.occ config:system:get trusted_domains


Añadir:

  sudo nextcloud.occ config:system:set trusted_domains 6 --value=nc.jplj.tk



Configurar router  ⮴  


Al solicitar un certificado en lets-encrypt es necesario que los puertos 80 y

443 de la IP externa apunten a la IP del equipo.


    sudo nextcloud.enable-https lets-encrypt



AQUI




homebadajoz.ddns.net



.- Configurar una cuenta administrativa: 

   sudo nextcloud.manual-install user password

   sudo snap run nextcloud.manual-install user password



.- Ajustar los dominios de confianza

listar: sudo nextcloud.occ config:system:get trusted_domains

añadir: sudo nextcloud.occ config:system:set trusted_domains 6 --value=nc.jplj.tk


Incluir la ip del equipo servidor y la ip pública del router



.- Cambiar los puertos:


..- ver configuracion de puertos: sudo snap get nextcloud ports



..- cambiar puertos: 

http:  sudo snap set nextcloud ports.http=80

https:  sudo snap set nextcloud ports.https=443


..- Devolver valores por defecto:

sudo snap unset nextcloud ports.http

sudo snap unset nextcloud ports.https


(https://snapcraft.io/docs/configuration-in-snaps)




.- Habilitar / deshabilitar protocolos:


..- sudo snap run nextcloud.disable-https

..- sudo snap run nextcloud.enable-https (lets-encrypt - self-signed - custom) 



.- Configurar un SSL con un certificado autofirmado


..- sudo nextcloud.enable-https self-signed

..- sudo ufw allow 80,443/tcp  (los puertos que se hayan decidido)


.- Configurar ufw



..- Establece configuración predeterminada


     ...- sudo ufw default deny incoming

     ...- sudo ufw default allow outgoing


..- Crear reglas


..- sudo ufw allow ssh

..- sudo ufw allow 22

..- sudo ufw allow hhtps

..- sudo ufw allow 6000:6007/tcp

..- sudo ufw allow 6000:6007/udp



..- sudo ufw deny ...



..- Estado : 


...- sudo ufw status

...- sudo ufw status numbered verbose


.. Eliminar regla


...- sudo ufw delete x (x=numero de la regla)

...- sudo ufw delete allow http


..- Otras


...- sudo ufw enable

...- sudo ufw disable

...- sudo ufw reset





.- Otros


..- sudo nextcloud.occ

..- sudo nextcloud.occ config:list

..- sudo nextcloud.occ config:system:get datadirectory




EYy55922Wnbv7gcU

https://46.6.5.92:30443/index.php/login


https://my.freenom.com/clientarea.php

YRSTQr5AzBmtdJct







=> sudo nextcloud.occ


Usage:

  command [options] [arguments]


Options:

  -h, --help            Display this help message

  -q, --quiet           Do not output any message

  -V, --version         Display this application version

      --ansi            Force ANSI output

      --no-ansi         Disable ANSI output

  -n, --no-interaction  Do not ask any interactive question

      --no-warnings     Skip global warnings, show command output only

  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug


Available commands:

  check                                 check dependencies of the server environment

  help                                  Displays help for a command

  list                                  Lists commands

  status                                show some status information

  upgrade                               run upgrade routines after installation of a new release. The release has to be installed before.

 activity

  activity:send-mails                   Sends the activity notification mails

 app

  app:check-code                        check code to be compliant

  app:disable                           disable an app

  app:enable                            enable an app

  app:getpath                           Get an absolute path to the app directory

  app:install                           install an app

  app:list                              List all available apps

  app:remove                            remove an app

  app:update                            update an app or all apps

 background

  background:ajax                       Use ajax to run background jobs

  background:cron                       Use cron to run background jobs

  background:webcron                    Use webcron to run background jobs

 broadcast

  broadcast:test                        test the SSE broadcaster

 config

  config:app:delete                     Delete an app config value

  config:app:get                        Get an app config value

  config:app:set                        Set an app config value

  config:import                         Import a list of configs

  config:list                           List all configs

  config:system:delete                  Delete a system config value

  config:system:get                     Get a system config value

  config:system:set                     Set a system config value

 dav

  dav:create-addressbook                Create a dav addressbook

  dav:create-calendar                   Create a dav calendar

  dav:list-calendars                    List all calendars of a user

  dav:move-calendar                     Move a calendar from an user to another

  dav:remove-invalid-shares             Remove invalid dav shares

  dav:send-event-reminders              Sends event reminders

  dav:sync-birthday-calendar            Synchronizes the birthday calendar

  dav:sync-system-addressbook           Synchronizes users to the system addressbook

 db

  db:add-missing-columns                Add missing optional columns to the database tables

  db:add-missing-indices                Add missing indices to the database tables

  db:convert-filecache-bigint           Convert the ID columns of the filecache to BigInt

  db:convert-mysql-charset              Convert charset of MySQL/MariaDB to use utf8mb4

  db:convert-type                       Convert the Nextcloud database to the newly configured one

 encryption

  encryption:change-key-storage-root    Change key storage root

  encryption:decrypt-all                Disable server-side encryption and decrypt all files

  encryption:disable                    Disable encryption

  encryption:enable                     Enable encryption

  encryption:encrypt-all                Encrypt all files for all users

  encryption:list-modules               List all available encryption modules

  encryption:set-default-module         Set the encryption default module

  encryption:show-key-storage-root      Show current key storage root

  encryption:status                     Lists the current status of encryption

 federation

  federation:sync-addressbooks          Synchronizes addressbooks of all federated clouds

 files

  files:cleanup                         cleanup filecache

  files:recommendations:recommend       

  files:scan                            rescan filesystem

  files:scan-app-data                   rescan the AppData folder

  files:transfer-ownership              All files and folders are moved to another user - shares are moved as well.

 group

  group:add                             Add a group

  group:adduser                         add a user to a group

  group:delete                          Remove a group

  group:list                            list configured groups

  group:removeuser                      remove a user from a group

 integrity

  integrity:check-app                   Check integrity of an app using a signature.

  integrity:check-core                  Check integrity of core code using a signature.

  integrity:sign-app                    Signs an app using a private key.

  integrity:sign-core                   Sign core using a private key.

 l10n

  l10n:createjs                         Create javascript translation files for a given app

 log

  log:file                              manipulate logging backend

  log:manage                            manage logging configuration

  log:tail                              Tail the nextcloud logfile

  log:watch                             Watch the nextcloud logfile

 mail

  mail:account:create                   creates IMAP account

  mail:account:diagnose                 Diagnose a user's IMAP connection

  mail:account:export                   Exports a user's IMAP account(s)

  mail:account:sync                     Synchronize an IMAP account

  mail:account:train                    Train the classifier of new messages

  mail:clean-up                         clean up all orphaned data

 maintenance

  maintenance:data-fingerprint          update the systems data-fingerprint after a backup is restored

  maintenance:mimetype:update-db        Update database mimetypes and update filecache

  maintenance:mimetype:update-js        Update mimetypelist.js

  maintenance:mode                      set maintenance mode

  maintenance:repair                    repair this installation

  maintenance:theme:update              Apply custom theme changes

  maintenance:update:htaccess           Updates the .htaccess file

 migrations

  migrations:execute                    Execute a single migration version manually.

  migrations:generate                   

  migrations:generate-from-schema       

  migrations:migrate                    Execute a migration to a specified version or the latest available version.

  migrations:status                     View the status of a set of migrations.

 notification

  notification:generate                 Generate a notification for the given user

  notification:test-push                Generate a notification for the given user

 richdocuments

  richdocuments:update-empty-templates  Update empty template files

 security

  security:certificates                 list trusted certificates

  security:certificates:import          import trusted certificate

  security:certificates:remove          remove trusted certificate

 sharing

  sharing:cleanup-remote-storages       Cleanup shared storage entries that have no matching entry in the shares_external table

  sharing:expiration-notification       Notify share initiators when a share will expire the next day.

 talk

  talk:command:add                      Add a new command

  talk:command:add-samples              Adds some sample commands: /wiki, …

  talk:command:delete                   Remove an existing command

  talk:command:list                     List all available commands

  talk:command:update                   Add a new command

  talk:room:add                         Adds users to a room

  talk:room:create                      Create a new room

  talk:room:delete                      Deletes a room

  talk:room:demote                      Demotes participants of a room to regular users

  talk:room:promote                     Promotes participants of a room to moderators

  talk:room:remove                      Remove users from a room

  talk:room:update                      Updates a room

  talk:signaling:add                    Add an external signaling server.

  talk:signaling:delete                 Remove an existing signaling server.

  talk:signaling:list                   List external signaling servers.

  talk:stun:add                         Add a new STUN server.

  talk:stun:delete                      Remove an existing STUN server.

  talk:stun:list                        List STUN servers.

  talk:turn:add                         Add a TURN server.

  talk:turn:delete                      Remove an existing TURN server.

  talk:turn:list                        List TURN servers.

 text

  text:reset                            Reset a text document

 trashbin

  trashbin:cleanup                      Remove deleted files

  trashbin:expire                       Expires the users trashbin

 twofactorauth

  twofactorauth:cleanup                 Clean up the two-factor user-provider association of an uninstalled/removed provider

  twofactorauth:disable                 Disable two-factor authentication for a user

  twofactorauth:enable                  Enable two-factor authentication for a user

  twofactorauth:enforce                 Enabled/disable enforced two-factor authentication

  twofactorauth:state                   Get the two-factor authentication (2FA) state of a user

 user

  user:add                              adds a user

  user:delete                           deletes the specified user

  user:disable                          disables the specified user

  user:enable                           enables the specified user

  user:info                             show user info

  user:lastseen                         shows when the user was logged in last time

  user:list                             list configured users

  user:report                           shows how many users have access

  user:resetpassword                    Resets the password of the named user

  user:setting                          Read and modify user settings

 versions

  versions:cleanup                      Delete versions

  versions:expire                       Expires the users file versions

 workflows

  workflows:list                        Lists configured workflows



Nota de instalación anterior  ⮴  


Installation and server configuration

Configure Nextcloud snap


.- Instalar: 

   sudo snap install nextcloud


.- Configurar una cuenta administrativa: 

   sudo nextcloud.manual-install user password

   sudo snap run nextcloud.manual-install user password



.- Ajustar los dominios de confianza

listar: sudo nextcloud.occ config:system:get trusted_domains

añadir: sudo nextcloud.occ config:system:set trusted_domains 6 --value=nc.jplj.tk


Incluir la ip del equipo servidor y la ip pública del router



.- Cambiar los puertos:


..- ver configuracion de puertos: sudo snap get nextcloud ports



..- cambiar puertos: 

http:  sudo snap set nextcloud ports.http=80

https:  sudo snap set nextcloud ports.https=443


..- Devolver valores por defecto:

sudo snap unset nextcloud ports.http

sudo snap unset nextcloud ports.https


(https://snapcraft.io/docs/configuration-in-snaps)




.- Habilitar / deshabilitar protocolos:


..- sudo snap run nextcloud.disable-https

..- sudo snap run nextcloud.enable-https (lets-encrypt - self-signed - custom) 



.- Configurar un SSL con un certificado autofirmado


..- sudo nextcloud.enable-https self-signed

..- sudo ufw allow 80,443/tcp  (los puertos que se hayan decidido)


.- Configurar ufw



..- Establece configuración predeterminada


     ...- sudo ufw default deny incoming

     ...- sudo ufw default allow outgoing


..- Crear reglas


..- sudo ufw allow ssh

..- sudo ufw allow 22

..- sudo ufw allow hhtps

..- sudo ufw allow 6000:6007/tcp

..- sudo ufw allow 6000:6007/udp



..- sudo ufw deny ...



..- Estado : 


...- sudo ufw status

...- sudo ufw status numbered verbose


.. Eliminar regla


...- sudo ufw delete x (x=numero de la regla)

...- sudo ufw delete allow http


..- Otras


...- sudo ufw enable

...- sudo ufw disable

...- sudo ufw reset





.- Otros


..- sudo nextcloud.occ

..- sudo nextcloud.occ config:list

..- sudo nextcloud.occ config:system:get datadirectory




EYy55922Wnbv7gcU

https://46.6.5.92:30443/index.php/login


https://my.freenom.com/clientarea.php

YRSTQr5AzBmtdJct







=> sudo nextcloud.occ


Usage:

  command [options] [arguments]


Options:

  -h, --help            Display this help message

  -q, --quiet           Do not output any message

  -V, --version         Display this application version

      --ansi            Force ANSI output

      --no-ansi         Disable ANSI output

  -n, --no-interaction  Do not ask any interactive question

      --no-warnings     Skip global warnings, show command output only

  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug


Available commands:

  check                                 check dependencies of the server environment

  help                                  Displays help for a command

  list                                  Lists commands

  status                                show some status information

  upgrade                               run upgrade routines after installation of a new release. The release has to be installed before.

 activity

  activity:send-mails                   Sends the activity notification mails

 app

  app:check-code                        check code to be compliant

  app:disable                           disable an app

  app:enable                            enable an app

  app:getpath                           Get an absolute path to the app directory

  app:install                           install an app

  app:list                              List all available apps

  app:remove                            remove an app

  app:update                            update an app or all apps

 background

  background:ajax                       Use ajax to run background jobs

  background:cron                       Use cron to run background jobs

  background:webcron                    Use webcron to run background jobs

 broadcast

  broadcast:test                        test the SSE broadcaster

 config

  config:app:delete                     Delete an app config value

  config:app:get                        Get an app config value

  config:app:set                        Set an app config value

  config:import                         Import a list of configs

  config:list                           List all configs

  config:system:delete                  Delete a system config value

  config:system:get                     Get a system config value

  config:system:set                     Set a system config value

 dav

  dav:create-addressbook                Create a dav addressbook

  dav:create-calendar                   Create a dav calendar

  dav:list-calendars                    List all calendars of a user

  dav:move-calendar                     Move a calendar from an user to another

  dav:remove-invalid-shares             Remove invalid dav shares

  dav:send-event-reminders              Sends event reminders

  dav:sync-birthday-calendar            Synchronizes the birthday calendar

  dav:sync-system-addressbook           Synchronizes users to the system addressbook

 db

  db:add-missing-columns                Add missing optional columns to the database tables

  db:add-missing-indices                Add missing indices to the database tables

  db:convert-filecache-bigint           Convert the ID columns of the filecache to BigInt

  db:convert-mysql-charset              Convert charset of MySQL/MariaDB to use utf8mb4

  db:convert-type                       Convert the Nextcloud database to the newly configured one

 encryption

  encryption:change-key-storage-root    Change key storage root

  encryption:decrypt-all                Disable server-side encryption and decrypt all files

  encryption:disable                    Disable encryption

  encryption:enable                     Enable encryption

  encryption:encrypt-all                Encrypt all files for all users

  encryption:list-modules               List all available encryption modules

  encryption:set-default-module         Set the encryption default module

  encryption:show-key-storage-root      Show current key storage root

  encryption:status                     Lists the current status of encryption

 federation

  federation:sync-addressbooks          Synchronizes addressbooks of all federated clouds

 files

  files:cleanup                         cleanup filecache

  files:recommendations:recommend       

  files:scan                            rescan filesystem

  files:scan-app-data                   rescan the AppData folder

  files:transfer-ownership              All files and folders are moved to another user - shares are moved as well.

 group

  group:add                             Add a group

  group:adduser                         add a user to a group

  group:delete                          Remove a group

  group:list                            list configured groups

  group:removeuser                      remove a user from a group

 integrity

  integrity:check-app                   Check integrity of an app using a signature.

  integrity:check-core                  Check integrity of core code using a signature.

  integrity:sign-app                    Signs an app using a private key.

  integrity:sign-core                   Sign core using a private key.

 l10n

  l10n:createjs                         Create javascript translation files for a given app

 log

  log:file                              manipulate logging backend

  log:manage                            manage logging configuration

  log:tail                              Tail the nextcloud logfile

  log:watch                             Watch the nextcloud logfile

 mail

  mail:account:create                   creates IMAP account

  mail:account:diagnose                 Diagnose a user's IMAP connection

  mail:account:export                   Exports a user's IMAP account(s)

  mail:account:sync                     Synchronize an IMAP account

  mail:account:train                    Train the classifier of new messages

  mail:clean-up                         clean up all orphaned data

 maintenance

  maintenance:data-fingerprint          update the systems data-fingerprint after a backup is restored

  maintenance:mimetype:update-db        Update database mimetypes and update filecache

  maintenance:mimetype:update-js        Update mimetypelist.js

  maintenance:mode                      set maintenance mode

  maintenance:repair                    repair this installation

  maintenance:theme:update              Apply custom theme changes

  maintenance:update:htaccess           Updates the .htaccess file

 migrations

  migrations:execute                    Execute a single migration version manually.

  migrations:generate                   

  migrations:generate-from-schema       

  migrations:migrate                    Execute a migration to a specified version or the latest available version.

  migrations:status                     View the status of a set of migrations.

 notification

  notification:generate                 Generate a notification for the given user

  notification:test-push                Generate a notification for the given user

 richdocuments

  richdocuments:update-empty-templates  Update empty template files

 security

  security:certificates                 list trusted certificates

  security:certificates:import          import trusted certificate

  security:certificates:remove          remove trusted certificate

 sharing

  sharing:cleanup-remote-storages       Cleanup shared storage entries that have no matching entry in the shares_external table

  sharing:expiration-notification       Notify share initiators when a share will expire the next day.

 talk

  talk:command:add                      Add a new command

  talk:command:add-samples              Adds some sample commands: /wiki, …

  talk:command:delete                   Remove an existing command

  talk:command:list                     List all available commands

  talk:command:update                   Add a new command

  talk:room:add                         Adds users to a room

  talk:room:create                      Create a new room

  talk:room:delete                      Deletes a room

  talk:room:demote                      Demotes participants of a room to regular users

  talk:room:promote                     Promotes participants of a room to moderators

  talk:room:remove                      Remove users from a room

  talk:room:update                      Updates a room

  talk:signaling:add                    Add an external signaling server.

  talk:signaling:delete                 Remove an existing signaling server.

  talk:signaling:list                   List external signaling servers.

  talk:stun:add                         Add a new STUN server.

  talk:stun:delete                      Remove an existing STUN server.

  talk:stun:list                        List STUN servers.

  talk:turn:add                         Add a TURN server.

  talk:turn:delete                      Remove an existing TURN server.

  talk:turn:list                        List TURN servers.

 text

  text:reset                            Reset a text document

 trashbin

  trashbin:cleanup                      Remove deleted files

  trashbin:expire                       Expires the users trashbin

 twofactorauth

  twofactorauth:cleanup                 Clean up the two-factor user-provider association of an uninstalled/removed provider

  twofactorauth:disable                 Disable two-factor authentication for a user

  twofactorauth:enable                  Enable two-factor authentication for a user

  twofactorauth:enforce                 Enabled/disable enforced two-factor authentication

  twofactorauth:state                   Get the two-factor authentication (2FA) state of a user

 user

  user:add                              adds a user

  user:delete                           deletes the specified user

  user:disable                          disables the specified user

  user:enable                           enables the specified user

  user:info                             show user info

  user:lastseen                         shows when the user was logged in last time

  user:list                             list configured users

  user:report                           shows how many users have access

  user:resetpassword                    Resets the password of the named user

  user:setting                          Read and modify user settings

 versions

  versions:cleanup                      Delete versions

  versions:expire                       Expires the users file versions

 workflows

  workflows:list                        Lists configured workflows