Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
Current versions of the script put the log in /var/log/nextcloud/ for permissions reasons. To make this change, from inside the jail, run mkdir /var/log/nextcloud, chown www:www /var/log/nextcloud, then su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set logfile --value="/var/log/nextcloud/nextcloud.log"'.
hi mr.danb35,

ok, noted.
it's mean i have to type " iocage console nextcloud " from shell first ,and then i excecute the command from you , is it right sir ?

Regards,
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
[Ask] Nextcloud integrationn with OnlyOffice :how to prevent File changes lost (Edits and changes made in Onlyoffice are not synced into Nextcloud )

Hi ,
last week my domain name for onlyoffice expired, (we forgot to renewal) , so my NC server cannot connect to onlyoffice server.
i have a problem with 2 user account in this situation (both of them has the same problem) :

* Account A :

she has 12 files on NC server , one of them has a problem, because she can't open on only office so that file being downloaded to her laptop,
when she check the files, the last update on that file was on August, 22 2022, actually she always updated month by month, the last on September 2023.

She never opened the file from the desktop, only using Onlyoffice from our server. Seems like the data in the onlyoffice cache is never written to Nextcloud. The "Save as" function saves to cache, but the cache never gets written to Nextcloud. User gets false secure feeling about having backed up data while in real life it is stored in cache and lost.

but the other 11 files on her folder is updated normally.

Did anyone here has same problem like that ??

Noted: now my onlyoffice server has been reinstall. i know this problem after that.

my question : is there anyway to prevent nc server + onlyoffice doc server repeating the same problem ??

any help would be much appreciated,

Thanks & regards,
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
[Ask] Nextcloud integrationn with OnlyOffice :how to prevent File changes lost (Edits and changes made in Onlyoffice are not synced into Nextcloud )

Hi ,
last week my domain name for onlyoffice expired, (we forgot to renewal) , so my NC server cannot connect to onlyoffice server.
i have a problem with 2 user account in this situation (both of them has the same problem) :

* Account A :

she has 12 files on NC server , one of them has a problem, because she can't open on only office so that file being downloaded to her laptop,
when she check the files, the last update on that file was on August, 22 2022, actually she always updated month by month, the last on September 2023.

She never opened the file from the desktop, only using Onlyoffice from our server. Seems like the data in the onlyoffice cache is never written to Nextcloud. The "Save as" function saves to cache, but the cache never gets written to Nextcloud. User gets false secure feeling about having backed up data while in real life it is stored in cache and lost.

but the other 11 files on her folder is updated normally.

Did anyone here has same problem like that ??

Noted: now my onlyoffice server has been reinstall. i know this problem after that.

my question : is there anyway to prevent nc server + onlyoffice doc server repeating the same problem ??

any help would be much appreciated,

Thanks & regards,
You would be better off asking this in the OnlyOffice forums, or wherever they host their support. I use OnlyOffice and CollaboraOffice and have really never seen these issues.
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
[Ask]App store missing from my nc server,
my +App menu only show like below :

app nextcloud.JPG



it's been a long time, is there anyway for app store to be visible again on my NC server ?
in NC log , i found this warning :

Warning appstoreFetcher GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) 2023-11-24T12:16:00+0700
Warning appstoreFetcher GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) 2023-11-24T12:16:00+0700

is that related to my question about missing app store menu ?
please advice how to solve this problem ?

Thanks n regards,
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
Hi @All me again.
after a few month running Nextcloud like a charme with caddy and a self signed certificate to make it reachable from outside for personal purpose, it was time to extend my storages. While I thought I saved all necessary configurations of course I forgot to save the Caddyfile. The jail export / import function doesn’t work, by the way. Anyway after I setup nearly everything as it was before and I can rember Closely how the config was before, again I’m struggling with the redirecting in Caddyfile. Whatever I have tried I’m running in the same issue. As I guess since my last installation the caddy server seems to be a newer version so that also brings me in trouble because of the changing how the Caddyfile has to be configured. So my question is, is anyone out there who has the Nextcloud running with proxy reverse in caddy with a self signed certificate and reachable from outside? Oh, and before I forgot due to my router (Fritz box 7590) I can’t use the dedicated port 443 but I know that could solved by “https_port” in the global config of Caddyfile which was working for me before I messed up everything.
Any hint, idea, or a sample Caddyfile configuration would be appreciated. Kind regards, Sven
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hi @All me again.
after a few month running Nextcloud like a charme with caddy and a self signed certificate to make it reachable from outside for personal purpose, it was time to extend my storages. While I thought I saved all necessary configurations of course I forgot to save the Caddyfile. The jail export / import function doesn’t work, by the way. Anyway after I setup nearly everything as it was before and I can rember Closely how the config was before, again I’m struggling with the redirecting in Caddyfile. Whatever I have tried I’m running in the same issue. As I guess since my last installation the caddy server seems to be a newer version so that also brings me in trouble because of the changing how the Caddyfile has to be configured. So my question is, is anyone out there who has the Nextcloud running with proxy reverse in caddy with a self signed certificate and reachable from outside? Oh, and before I forgot due to my router (Fritz box 7590) I can’t use the dedicated port 443 but I know that could solved by “https_port” in the global config of Caddyfile which was working for me before I messed up everything.
Any hint, idea, or a sample Caddyfile configuration would be appreciated. Kind regards, Sven
I run multiple reverse proxies perfectly fine.

What is your setup?

What does your Caddyfile look like on the Nextcloud jail?
What does it look like on the proxy jail?
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
I run multiple reverse proxies perfectly fine.

What is your setup?

What does your Caddyfile look like on the Nextcloud jail?
What does it look like on the proxy
Wow that was fast. Thank you for the fast reply. Unfortunately I’m on my way to work. But here you can see my Config. With the Parts commentet out I could reach the nextcloud in my internal network. But as soon I put the reverse part in the caddyfile I can’t connect to my nextcloud. I would mentioned that the caddy and the nextcloud are in the same jail


Code:
Caddyfile
{
    # debug
    # default_sni nextcloud
    # https_port 442
}

192.168.178.XXX {
    root * /usr/local/www/nextcloud
    file_server
    tls internal
    # reverse_proxy 127.0.0.1:442
    log {
        output file /var/log/192.168.178.XXX.log
    }

    php_fastcgi 127.0.0.1:9000 {
        env front_controller_active true
    }

    tls /usr/local/etc/pki/tls/certs/fullchain.pem /usr/local/etc/pki/tls/private/privkey.pem

    header {
        # enable HSTS
        Strict-Transport-Security max-age=31536000;
    }

    # client support (e.g. os x calendar / contacts)
    redir /.well-known/carddav /remote.php/dav 301
    redir /.well-known/caldav /remote.php/dav 301
    redir /.well-known/webfinger /index.php/.well-known/webfinger 301
    redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301

    # .htaccess / data / config / ... shouldn't be accessible from outside
    @forbidden {
        path /.htaccess
        path /data/*
        path /config/*
        path /db_structure
        path /.xml
        path /README
        path /3rdparty/*
        path /lib/*
        path /templates/*
        path /occ
        path /console.php
    }

    respond @forbidden 404
}


Code:
Nextcloud
<?php
$CONFIG = array (
  'passwordsalt' => deleted
  'secret' => deleted
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.178.XXX',
    2 => 'example.com',
    3 => '127.0.0.1',
  ),
  'datadirectory' => '/mnt/files',
  'dbtype' => 'mysql',
  'version' => '27.1.4.1',
  'overwrite.cli.url' => 'https://192.168.178.XXX/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/var/run/mysql/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => deleted
  'installed' => true,
  'instanceid' => deleted
  'logtimezone' => 'Europe/Berlin',
  'default_phone_region' => 'DE',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'logrotate_size' => '104847600',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwritehost' => '192.168.178.XXX',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'trusted_proxies' =>
  array (
    1 => '192.168,178.XXX',
    2 => 'localhost',
  ),
);
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Wow that was fast. Thank you for the fast reply. Unfortunately I’m on my way to work. But here you can see my Config. With the Parts commentet out I could reach the nextcloud in my internal network. But as soon I put the reverse part in the caddyfile I can’t connect to my nextcloud. I would mentioned that the caddy and the nextcloud are in the same jail


Code:
Caddyfile
{
    # debug
    # default_sni nextcloud
    # https_port 442
}

192.168.178.XXX {
    root * /usr/local/www/nextcloud
    file_server
    tls internal
    # reverse_proxy 127.0.0.1:442
    log {
        output file /var/log/192.168.178.XXX.log
    }

    php_fastcgi 127.0.0.1:9000 {
        env front_controller_active true
    }

    tls /usr/local/etc/pki/tls/certs/fullchain.pem /usr/local/etc/pki/tls/private/privkey.pem

    header {
        # enable HSTS
        Strict-Transport-Security max-age=31536000;
    }

    # client support (e.g. os x calendar / contacts)
    redir /.well-known/carddav /remote.php/dav 301
    redir /.well-known/caldav /remote.php/dav 301
    redir /.well-known/webfinger /index.php/.well-known/webfinger 301
    redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301

    # .htaccess / data / config / ... shouldn't be accessible from outside
    @forbidden {
        path /.htaccess
        path /data/*
        path /config/*
        path /db_structure
        path /.xml
        path /README
        path /3rdparty/*
        path /lib/*
        path /templates/*
        path /occ
        path /console.php
    }

    respond @forbidden 404
}


Code:
Nextcloud
<?php
$CONFIG = array (
  'passwordsalt' => deleted
  'secret' => deleted
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.178.XXX',
    2 => 'example.com',
    3 => '127.0.0.1',
  ),
  'datadirectory' => '/mnt/files',
  'dbtype' => 'mysql',
  'version' => '27.1.4.1',
  'overwrite.cli.url' => 'https://192.168.178.XXX/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/var/run/mysql/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => deleted
  'installed' => true,
  'instanceid' => deleted
  'logtimezone' => 'Europe/Berlin',
  'default_phone_region' => 'DE',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'logrotate_size' => '104847600',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwritehost' => '192.168.178.XXX',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'trusted_proxies' =>
  array (
    1 => '192.168,178.XXX',
    2 => 'localhost',
  ),
);
I’m slightly confused as to what you are trying to achieve. You shouldn’t have to reverse proxy to the same instance.

Are you forwarding port 442 from your router to your Nextcloud jail?

Also when you access from the outside, do you have to append the port? Like nextcloud.example.com:442
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
I’m slightly confused as to what you are trying to achieve. You shouldn’t have to reverse proxy to the same instance.

Are you forwarding port 442 from your router to your Nextcloud jail?

Also when you access from the outside, do you have to append the port? Like nextcloud.example.com:442
Yes exactly, I have to use nextcloud.example.com:442. So as far as I can remember the old configuration was nearly like that, and I as far as I can remember I used the redirection part. The only thing which I had to change was the part in nextcloud for the 'overwrite.cli.url' => 'https://192.168.178.XXX/', which was in the old configuration http instead of https which was set by default in the newer version.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Yes exactly, I have to use nextcloud.example.com:442. So as far as I can remember the old configuration was nearly like that, and I as far as I can remember I used the redirection part. The only thing which I had to change was the part in nextcloud for the 'overwrite.cli.url' => 'https://192.168.178.XXX/', which was in the old configuration http instead of https which was set by default in the newer version.
In that case, the only thing you should need to change is the domain part in the Caddyfile.

192.168.178.XXX:442 {
}

Should do it. This will make caddy listen on port 442.
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
In that case, the only thing you should need to change is the domain part in the Caddyfile.

192.168.178.XXX:442 {
}

Should do it. This will make caddy listen on port 442.
I will give it a try if I’m back home. I think i did it once with no success but I’m not sure to be honest. Will come back if I tried it. Thank a lot for the hint.
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
In that case, the only thing you should need to change is the domain part in the Caddyfile.

192.168.178.XXX:442 {
}

Should do it. This will make caddy listen on port 442.
I’ve tried the recommended changes but also I have to change the config file from the nextcloud. The good thing is, I can reach the Nextcloud instance from outside of my private network. But if I type the internal IP I just got a blank page
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
I’ve tried the recommended changes but also I have to change the config file from the nextcloud. The good thing is, I can reach the Nextcloud instance from outside of my private network. But if I type the internal IP I just got a blank page
How are you accessing from the outside? By domain name?
Are you appending the port from the inside?

The recommended way is to use the domain name from the outside and also from the inside. You do this by configuring your dns server to point your domain to the proper IP. If you do this, you should change the domain part of your Caddyfile to read

nextcloud.domain.com:442 {
}

So that it will be listening for that domain name.
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
hello so i have using the nextcloud for a few week and loved it only problem is when i mount a dataset to nextcloud everything work but any childdataset does appear but with no files or folders inside of it even if it even if i add www to the child dataset does anyone know how to make child datasets readable in nextcloud, becuase currently what i am doing is adding another mount to the child dataset and then adding it into the external storage it appears int the root folder of nextcloud not inside the oringal dataset.
 

smoeschter

Explorer
Joined
Apr 11, 2013
Messages
67
How are you accessing from the outside? By domain name?
Are you appending the port from the inside?

The recommended way is to use the domain name from the outside and also from the inside. You do this by configuring your dns server to point your domain to the proper IP. If you do this, you should change the domain part of your Caddyfile to read

nextcloud.domain.com:442 {
}

So that it will be listening for that domain name.
Okay, as I understand it behaves as it should. Problem is solved.
Thanks a lot for your patience and your support. 50 thumbs
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
hello so i have using the nextcloud for a few week and loved it only problem is when i mount a dataset to nextcloud everything work but any childdataset does appear but with no files or folders inside of it even if it even if i add www to the child dataset does anyone know how to make child datasets readable in nextcloud, becuase currently what i am doing is adding another mount to the child dataset and then adding it into the external storage it appears int the root folder of nextcloud not inside the oringal dataset.
This is expected. You need to mount the child datasets as well.

What I do is mount the datasets in nextcloud in the same way as they appear in my pool. Then I only have to add the parent as an external storage.

To mount the “storage” dataset and have the children work properly I would do this

e.g. /mnt/pool/storage/dataset1 > /mnt/storage/dataset1

/mnt/pool/storage/dataset2 > /mnt/storage/dataset2

Then I would add the external storage “storage” as my mount point. This will then give me all the rest I mounted underneath as well.

The key is that you need to mount them in the same structure as on the pool.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
There's a PR that addresses this, and one user has reported it fixed the problem. I'd like to see a couple of tweaks before I merge it, but you can give it a try.
 
Top