OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Backup: Nextcloud configuration
« previous next »
  • Print
Pages: 1 [2] 3

Author Topic: Backup: Nextcloud configuration  (Read 12574 times)

Gauss23

  • Hero Member
  • *****
  • Posts: 735
  • Karma: 38
    • View Profile
    • BackendMedia
Re: Backup: Nextcloud configuration
« Reply #15 on: November 26, 2020, 09:42:29 am »
Just a guess but https://192.168.1.100 or whatever private IP address will never have a valid SSL certificate. Maybe it's failing because of that? Does it matter if you enter a correct or a wrong username/password combination?

I'm using NextCloud backup on multiple boxes. NextCloud instance has a valid SSL cert though and is reached by hostname instead of IP. No issues.
« Last Edit: November 26, 2020, 09:45:51 am by Gauss23 »
Logged
„The S in IoT stands for Security!“ :)

System 1: ESXi, i3-9100F (2 Cores), 4GB RAM, 4x NIC
System 2: ESXi, Xeon E3-1220 V2 (2 Cores), 4GB RAM, 4x NIC
System 3: KVM, Xeon Skylake (2 Cores), 4GB RAM, 2x NIC
System 4: KVM, AMD EPYC 7702P (2 Cores), 8GB RAM, 1x NIC (Datacenter VPN Hub)

fabian

  • Hero Member
  • *****
  • Posts: 2751
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Backup: Nextcloud configuration
« Reply #16 on: November 27, 2020, 07:53:38 pm »
In theory you can have an IP address in the SAN. But I guess this is not the case here.
Logged

qinohe

  • Full Member
  • ***
  • Posts: 160
  • Karma: 19
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #17 on: November 27, 2020, 10:44:12 pm »
Quote from: Gauss23 on November 26, 2020, 09:42:29 am
Just a guess but https://192.168.1.100 or whatever private IP address will never have a valid SSL certificate. Maybe it's failing because of that? Does it matter if you enter a correct or a wrong username/password combination?
Valid? Sure it's valid if it's a self signed cert. Using an IP just because it's a local, don't make it less valid, it's just local.
You're restriction is you can only use it locally.
I have no idea what you mean with 'wrong username/password combination'??
Quote
I'm using NextCloud backup on multiple boxes. NextCloud instance has a valid SSL cert though and is reached by hostname instead of IP. No issues.
I guess by valid you mean signed by a trusted third party{where trusted is what you believe) A locally signed cert. is just as valid and let me remind you, it's trust value not measurable higher ;)

Quote from: fabian
In theory you can have an IP address in the SAN. But I guess this is not the case here.
Not only in theory, it's no problem to sign the local cert. SAN with both local IP and local hostname or one of them.
Logged

Gauss23

  • Hero Member
  • *****
  • Posts: 735
  • Karma: 38
    • View Profile
    • BackendMedia
Re: Backup: Nextcloud configuration
« Reply #18 on: November 27, 2020, 11:17:35 pm »
Yes, with valid I mean trusted. For the curl request it makes a difference if self-signed or 3rd party (trusted) signed. Of course you can sign yourself a certificate on an ip address but will it be trusted by your OPNsense? Did you import your own CA to the OPNsense or is your OPNsense your main CA?

I wanted to know if the error message is the same if you enter a wrong username/password combination? This would show if the curl request is being completed or not.

Logged
„The S in IoT stands for Security!“ :)

System 1: ESXi, i3-9100F (2 Cores), 4GB RAM, 4x NIC
System 2: ESXi, Xeon E3-1220 V2 (2 Cores), 4GB RAM, 4x NIC
System 3: KVM, Xeon Skylake (2 Cores), 4GB RAM, 2x NIC
System 4: KVM, AMD EPYC 7702P (2 Cores), 8GB RAM, 1x NIC (Datacenter VPN Hub)

qinohe

  • Full Member
  • ***
  • Posts: 160
  • Karma: 19
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #19 on: November 27, 2020, 11:45:53 pm »
Valid and trusted are two very different things in the world of certificates.

Of course a wrong Uname/paswd would break the action.
Nextcloud has the app. paswd for that, you'd never need to worry the curl would work just fine also using self signed certs. no problem.
If you setup your local env. correctly using self signed certs there are no complaints by apps servers phones or whatever, just don't use them remotely unless you have a very good reason to do so, in fact better don't.

I looked for 'ssl_verify_result":1' ; no list seems to explain the meaning for ''1'
Later on in the line 'ssl_verifyresult":0' there seems nothing wrong.
Logged

lfirewall1243

  • Hero Member
  • *****
  • Posts: 1349
  • Karma: 45
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #20 on: November 28, 2020, 08:34:09 am »
Quote from: qinohe on November 27, 2020, 11:45:53 pm
Valid and trusted are two very different things in the world of certificates.

Of course a wrong Uname/paswd would break the action.
Nextcloud has the app. paswd for that, you'd never need to worry the curl would work just fine also using self signed certs. no problem.
If you setup your local env. correctly using self signed certs there are no complaints by apps servers phones or whatever, just don't use them remotely unless you have a very good reason to do so, in fact better don't.

I looked for 'ssl_verify_result":1' ; no list seems to explain the meaning for ''1'
Later on in the line 'ssl_verifyresult":0' there seems nothing wrong.
Just import your self signed cert into the OPNsense
Logged
OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

qinohe

  • Full Member
  • ***
  • Posts: 160
  • Karma: 19
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #21 on: November 28, 2020, 04:14:35 pm »
Quote from: lfirewall1243 on November 28, 2020, 08:34:09 am
Just import your self signed cert into the OPNsense
I'm not the one having problems  ;D
Logged

lfirewall1243

  • Hero Member
  • *****
  • Posts: 1349
  • Karma: 45
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #22 on: November 28, 2020, 06:37:41 pm »
Quote from: qinohe on November 28, 2020, 04:14:35 pm
Quote from: lfirewall1243 on November 28, 2020, 08:34:09 am
Just import your self signed cert into the OPNsense
I'm not the one having problems  ;D
Ooops! Then the original poster !
Logged
OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

Flyinace2000

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #23 on: March 12, 2021, 01:33:11 am »
I think I’m having the same issue.  I’ve tried w/ both my actual username/password and the application specific generated credentials.  Here are the relevant logs

2021-03-11T19:26:40   config[36701]   {"url":"https:\/\/nextcloud.willsisti.com\/ocs\/v1.php\/cloud\/user","content_type":null,"http_code":0,"header_size":0,"request_size":0,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":60.00686,"namelookup_time":0.000374,"connect_time":0,"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"","certinfo":[],"primary_port":0,"local_ip":"","local_port":0,"http_version":0,"protocol":0,"ssl_verifyresult":0,"scheme":"","appconnect_time_us":0,"connect_time_us":0,"namelookup_time_us":374,"pretransfer_time_us":0,"redirect_time_us":0,"starttransfer_time_us":0,"total_time_us":60006860}   
2021-03-11T19:26:40   config[36701]   Cannot get real username
Logged
Dell i5-4570, 8GB, Intel i350-T4

zibloon

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #24 on: March 24, 2021, 01:37:01 am »
Hello,
I can't get the Nextcloud backup feature to work either :(
  • version of Nextcloud = 20.0.1 (hanssonit appliance) with a self-signed certificate
  • version of OPNsense = 21.1-amd64

The log is:
Code: [Select]
Mar 23 21:55:27 OPNsense config[93546]: {"url":"https:\/\/192.168.8.13\/ocs\/v1.php\/cloud\/user","content_type":null,"http_code":0,"header_size":0,"request_size":0,"filetime":-1,"ssl_verify_result":18,"redirect_count":0,"total_time":0.024741,"namelookup_time":6.6e-5,"connect_time":0.000522,"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"192.168.8.13","certinfo":[],"primary_port":443,"local_ip":"192.168.8.1","local_port":62449,"http_version":0,"protocol":2,"ssl_verifyresult":0,"scheme":"HTTPS","appconnect_time_us":0,"connect_time_us":522,"namelookup_time_us":66,"pretransfer_time_us":0,"redirect_time_us":0,"starttransfer_time_us":0,"total_time_us":24741}
based on https://www.openssl.org/docs/man1.0.2/man1/verify.html "ssl_verify_result":18 means "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate"

I did create an exception in Firefox to accept my Nextcloud self signed certificate so I just exported the .pem certificate from Firefox and imported it in OPNsense (in System: Trust: Authorities). Now the log is:

Code: [Select]
Mar 23 23:41:26 OPNsense config[60343]: {"url":"https:\/\/192.168.8.13\/ocs\/v1.php\/cloud\/user","content_type":null,"http_code":0,"header_size":0,"request_size":0,"filetime":-1,"ssl_verify_result":1,"redirect_count":0,"total_time":0.023768,"namelookup_time":4.4e-5,"connect_time":0.00064,"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"192.168.8.13","certinfo":[],"primary_port":443,"local_ip":"192.168.8.1","local_port":34026,"http_version":0,"protocol":2,"ssl_verifyresult":0,"scheme":"HTTPS","appconnect_time_us":0,"connect_time_us":640,"namelookup_time_us":44,"pretransfer_time_us":0,"redirect_time_us":0,"starttransfer_time_us":0,"total_time_us":23768}  
"ssl_verify_result":1 looks like a generic error so I don't know where else to search...

I read the documentation at https://docs.opnsense.org/manual/how-tos/self-signed-chain.html#a-chain-for-your-local-nextcloud-server but if I understand correctly, I don't need that as my Nextcloud server already has its own self-signed certificate.

Do you have any idea of what is happening?
Logged

lfirewall1243

  • Hero Member
  • *****
  • Posts: 1349
  • Karma: 45
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #25 on: March 24, 2021, 09:27:13 pm »
Show your Backup config please.

Have you selected your NC IP address or FQND?
Logged
OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

pankaj

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 3
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #26 on: March 25, 2021, 03:20:50 am »
Quote from: Flyinace2000 on March 12, 2021, 01:33:11 am
I think I’m having the same issue.  I’ve tried w/ both my actual username/password and the application specific generated credentials.  Here are the relevant logs

2021-03-11T19:26:40   config[36701]   {"url":"https:\/\/nextcloud.willsisti.com\/ocs\/v1.php\/cloud\/user","content_type":null,"http_code":0,"header_size":0,"request_size":0,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":60.00686,"namelookup_time":0.000374,"connect_time":0,"pretransfer_time":0,"size_upload":0,"size_download":0,"speed_download":0,"speed_upload":0,"download_content_length":-1,"upload_content_length":-1,"starttransfer_time":0,"redirect_time":0,"redirect_url":"","primary_ip":"","certinfo":[],"primary_port":0,"local_ip":"","local_port":0,"http_version":0,"protocol":0,"ssl_verifyresult":0,"scheme":"","appconnect_time_us":0,"connect_time_us":0,"namelookup_time_us":374,"pretransfer_time_us":0,"redirect_time_us":0,"starttransfer_time_us":0,"total_time_us":60006860}   
2021-03-11T19:26:40   config[36701]   Cannot get real username

I was getting the same error and resolved it with following steps:
1. From profile icon (NextCloud account), under Security create an app specific password
2. In OPNSense add following items:
 a. Enable backup under NextCloud
 b. URL: https://nextcloud.willsisti.com  (mine is with linuxfabrik.io just in case you want to give it a try)
 c. Username: your email for NC account
 d. Password: generated in step 1)
 e. Encryption: leave it blank for now but change it later
 f. Directory name: leave blank for now to save at the root but you can change it later
3.Click on Setup/Test, and wait few seconds for backup to be created and uploaded to root directory of NC account

The above steps worked for me, hope it solves your problem.
« Last Edit: November 21, 2021, 06:38:47 am by pankaj »
Logged

zibloon

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #27 on: March 27, 2021, 06:22:03 pm »
Hello and thanks for your answers,

Quote from: lfirewall1243 on March 24, 2021, 09:27:13 pm
Show your Backup config please.

  • Enable = ticked
  • URL = https://192.168.8.13
  • User Name = <username>
  • Password = <app_generated_password_for_username>
  • Encryption Password = blank
  • Directory Name = opnsense_backup

Quote from: lfirewall1243 on March 24, 2021, 09:27:13 pm
Have you selected your NC IP address or FQND?

I have selected the IP (192.168.8.13) because my nextcloud is only accessible through LAN (not opened to the internet)

Quote from: pankaj on March 25, 2021, 03:20:50 am
I was getting the same error and resolved it with following steps:
1. From profile icon (NextCloud account), under Security create an app specific password
2. In OPNSense add following items:
 a. Enable backup under NextCloud
 b. URL: https://nextcloud.willsisti.com  (mine is with linuxfabrik.io just in case you want to give it a try)
 c. Username: your email for NC account
 d. Password: generated in step 1)
 e. Encryption: leave it blank for now but change it later
 f. Directory name: leave blank for now to save at the root but you can change it later
3.Click on Setup/Test, and wait few seconds for backup to be created and uploaded to root directory of NC account

The above steps worked for me, hope it solves your problem.

I did exactly the same except I am using the IP of Nextcloud (it has no FQDN) and the Directory Name which can't be left blank (or it generates the error "The Backup Directory can only consist of alphanumeric characters, dash, underscores and slash. No leading or trailing slash.")

I am pretty sure this is a certificate issue. Again, my Nextcloud is not accessible from the internet so I am using self-signed certificate which was generated during installation of Nextcloud (not corresponding to a FQDN). I had no problem to import this certificate in Firefox or Thunderbird though...

Any clue?

Thanks for any help!
« Last Edit: March 27, 2021, 06:26:34 pm by zibloon »
Logged

lfirewall1243

  • Hero Member
  • *****
  • Posts: 1349
  • Karma: 45
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #28 on: March 28, 2021, 08:40:48 pm »
Quote from: zibloon on March 27, 2021, 06:22:03 pm
Hello and thanks for your answers,

Quote from: lfirewall1243 on March 24, 2021, 09:27:13 pm
Show your Backup config please.

  • Enable = ticked
  • URL = https://192.168.8.13
  • User Name = <username>
  • Password = <app_generated_password_for_username>
  • Encryption Password = blank
  • Directory Name = opnsense_backup

Quote from: lfirewall1243 on March 24, 2021, 09:27:13 pm
Have you selected your NC IP address or FQND?

I have selected the IP (192.168.8.13) because my nextcloud is only accessible through LAN (not opened to the internet)

Quote from: pankaj on March 25, 2021, 03:20:50 am
I was getting the same error and resolved it with following steps:
1. From profile icon (NextCloud account), under Security create an app specific password
2. In OPNSense add following items:
 a. Enable backup under NextCloud
 b. URL: https://nextcloud.willsisti.com  (mine is with linuxfabrik.io just in case you want to give it a try)
 c. Username: your email for NC account
 d. Password: generated in step 1)
 e. Encryption: leave it blank for now but change it later
 f. Directory name: leave blank for now to save at the root but you can change it later
3.Click on Setup/Test, and wait few seconds for backup to be created and uploaded to root directory of NC account

The above steps worked for me, hope it solves your problem.

I did exactly the same except I am using the IP of Nextcloud (it has no FQDN) and the Directory Name which can't be left blank (or it generates the error "The Backup Directory can only consist of alphanumeric characters, dash, underscores and slash. No leading or trailing slash.")

I am pretty sure this is a certificate issue. Again, my Nextcloud is not accessible from the internet so I am using self-signed certificate which was generated during installation of Nextcloud (not corresponding to a FQDN). I had no problem to import this certificate in Firefox or Thunderbird though...

Any clue?

Thanks for any help!
You'll need to import your self signed cert on the OPNsense
Logged
OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

pankaj

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 3
    • View Profile
Re: Backup: Nextcloud configuration
« Reply #29 on: March 28, 2021, 08:58:13 pm »
Quote from: zibloon on March 27, 2021, 06:22:03 pm

I did exactly the same except I am using the IP of Nextcloud (it has no FQDN) and the Directory Name which can't be left blank (or it generates the error "The Backup Directory can only consist of alphanumeric characters, dash, underscores and slash. No leading or trailing slash.")

I am pretty sure this is a certificate issue. Again, my Nextcloud is not accessible from the internet so I am using self-signed certificate which was generated during installation of Nextcloud (not corresponding to a FQDN). I had no problem to import this certificate in Firefox or Thunderbird though...

Any clue?

Since this (Next Cloud) is a built in integration it will not surprise me if the developers leaned in favor of security in which case self signed certificates may not work. Here are few ways to try different things:
1. Use a service like "Let's Encrypt" to make a FQDN work just in case above premise is true - https://www.youtube.com/watch?v=IR41duTqN6Y
2. Since this is an internal LAN, there are other ways to make things reliable like isolating machines using VLANs and then you can use simple local archive or rsync to move configuration files between machines.

While I understand that https is more secure than http but overusing it on LAN is the equivalent of adding a bolted lock on each cabinet inside the house. But if there are legit reasons for you to use https for every service on LAN then you may want to rethink topology again.

In my house, I have few VLANs which provides such convenience:
- GuestWiFi is the most restrictive VLAN and does not have access to any other LAN/VLANs
- IoTs have some restricted services available (mostly on host basis)
- Working machines have most liberal access
- Management machines is also very restrictive and this VLAN is used for managing L2 switches and Idrac for server machines. On this VLAN, I collect all the logs centrally and do not feel the need to use https because it is isolated from other subnets using VLAN.

Hope this helps.
Logged

  • Print
Pages: 1 [2] 3
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Backup: Nextcloud configuration
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2022 All rights reserved
  • SMF 2.0.18 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2