This was my first attempt to manual jail on CORE and I am not an expert with linux nor FreeBSD so please be gentle.
I tool a stab at danb35’s script and here what i did:
Created /mnt/Tank/Nextcloud with the 4 directories.
Addred simple config with No_CERT=1 and the jail installed with some warnings about not able to find the paths but still completed. Now I noticed two issues and I am not able to use nextcloud.
The path /mnt/FarcryNAS/Nextcloud had folders with data from plugin jail that i wanted to retails. But as the installed failed to locate the path it created new directories /mnt/FarcryNAS/nextcloud instead of using /mnt/FarcryNAS/Nextcloud
I use NPM with cloudflare and it works perfectly without issues for another jail. So I wanted the new jail to use the same reverse proxy and get certificated from lets encrypt from NPM. But not I cant reach the GUI as it land to the cloudflare error 503 page (service not reachable). After some reading it feel it maybe due to caddy still takign command of the jail proxies and they are not playing with NPM. How should i have chnaged the config to avoid these two problems.
Ignore the space, i wasn’t able to remove the empty lines using vi.
the log files has some lines that correspond to the above issues
/mnt/FarcryNAS/temp/freenas-iocage-nextcloud/nextcloud-config: COUNTRY_CODE:US: not found
+ DB_PATH:/mnt/FarcryNAS/Nextcloud/db
/mnt/FarcryNAS/temp/freenas-iocage-nextcloud/nextcloud-config: DB_PATH:/mnt/FarcryNAS/Nextcloud/db: not found
+ FILES_PATH:/mnt/FarcryNAS/Nextcloud/files
/mnt/FarcryNAS/temp/freenas-iocage-nextcloud/nextcloud-config: FILES_PATH:/mnt/FarcryNAS/Nextcloud/files: not found
+ CONFIG_PATH:/mnt/FarcryNAS/Nextcloud/config
/mnt/FarcryNAS/temp/freenas-iocage-nextcloud/nextcloud-config: CONFIG_PATH:/mnt/FarcryNAS/Nextcloud/config: not found
+ THEMES_PATH:/mnt/FarcryNAS/Nextcloud/themes
/mnt/FarcryNAS/temp/freenas-iocage-nextcloud/nextcloud-config: THEMES_PATH:/mnt/FarcryNAS/Nextcloud/themes: not found
Warning: You have chosen to include SSL support. Applications/ports that use
the cclient library but do not support SSL may stop working or have problems
linking. Linking them explicitly with ssl (-lssl -lcrypto) may or may not help.
Is that all the logs you have? This doesn’t give us much to go on.
You should only have to set your POOL_PATH, and it will automatically pick up the datasets underneath. It isn’t really necessary to set all the other path variables.
Also you have a number of typos? Are you using /mnt/tank or /mnt/FarcryNAS?
I skimmed through the log and only added the ones where errors or warning appeared. The log file is very long with secure keys and other info,so didn’t want to paste two pages.
I followed the Config sample and added the path variables for the four directories. as /mnt/FarcryNAS. The /mnt/tank was just to match the documentation that i changed to show the correct name.
Existing data was moved in this structure that i want the script to pickup.
-/mnt/FarcryNAS/Nextcloud
-config
-themes
-files
-db
Also how do i pass on db password or other keys in the config to use existing db in the directory?
Do I have to use lowercase in the directory name as nextcloud instead? Are their any sample config files that i can refer to get an idea on the possible variations.
As long as the NPM connection is secure, then the backend can be over http. The connection will still be secure.
So I’m not exactly sure how you would go about using the existing db. The problem is that the plugin used postgres, and the script used mariadb by default. You can change this in the script config before running it though.
The plugin config is just so much different than what the script uses.
You can, however, run the script overtop your existing data IF the data was created using the script.
I would recommend just copying the files over and doing a occ files:scan --all to populate your db.
Other than that, all passwords are save in /root/ of your TrueNAS system.
You could try to copy the files, database, etc to the corresponding directories and see if it will work. Let me know if you attempt this…
The main data that i have on the last nextcloud are photos and as long as the occ files:scan all can pick up the right metadata to organize the memories. I am game.
So I think I will have to create the same users to populate the data directories and then move the corresponding data to each account directories and run occ scan?
Let me attempt moving the files to the directory.
2nd question I have is I have multiple account and the data directory for those users. does this method lose all those settings for user accounts, or any other apps within nextcloud?
3rd Is there a way to access the ui from internal IP instead of redirection from local ip:80 → sub.mydomain.com and failing if i want to disable public access?
Ran the db scan and all the files are imported and appear to be in order. Thanks very much @victor
The last thing i want to know is how to backup and restore the scripted jail to a regular nextcloud app on Truenas scale or docker install. Is it as simple as backup db, files and config directories.