I have a web server applications where friends and colleagues can upload jpg files, then an AI crops the uploaded file, and transcribe the handwriting in the jpg files. The user interacts with a webpage my server hosts to tweak the crops and transcriptions. The file management of my application sucks and so I would like to know if Nextcloud can be used to manage all files uploads, etc.
I have truenas core for storage of all files. Truenas claims to support NextCloud but it is not obvious that the next cloud on truenas can support multiple users.
Q1: can Nextcloud on truenas support multiple users? or any local install of nextcloud on my server?
Q2: Is there an API in Nextcloud to create user accounts? I’m guessing that users would create an account on my application collecting all the info i need for my application plus anything that Nextcloud needs then using the api configure the user account. Does this make sense?
Q3: When users upload files, or change location of files, is there an notificaiton my application can register for? My application creates indexes and table of contents, so it needs to know when applications change location.
Q4: I assume that my application after getting a notification of a new file, can open the file (ie: to crop and transcribe). Is this the case?
Q5: I assume my application can create files in the user account (ie: store the output of the cropping and transcription). Is this the case?
Q6: did i get the gist of Nextcloud or did I completely get it wrong? Any suggestions as to where I could find documentation for the above would be greatly appreciated.
Q7: are there any fees to Nextcloud or is this completely open source? what is the license for this sw?
Q8: my server already uses port 443, what port does nextcloud use?
I appreciate any guidance and suggestions. Please feel free to point out if I got something totaly wrong.
There is however the option to buy a subscription from the official company. This is mainly interesting for productive usage in e.g. enterprises. It is mainly about support as far as i know. If you are interested, someone from the sales department can help you way better.
The port 443 is no port of a dedicated application but the port all browsers expect https traffic by default. So, as long as you do not want to type a port with the URL, you will have to share the port between NC and all other apps. This is no big problem in general, you can use a folder prefix for NC. So, your NC would be installed in https://example.com/nextcloud.
You can also do it the other way around or register virtual hosts or, or, or. There are a dozen ways to do it. It depends a bit on the rest of your system and your experience.
Is the currently running application a PHP one or something different?
I would say, you got it partially right at least: you have to distinguish between the server of NC and the apps. The server is mainly an intelligent storage system that allows users via wenn frontend or desktop sync app access files. Some extensions are there pre-installed like WebDAV support etc.
Additionally, there are many apps available. Some are pre-installed (e.g. WebDAV itself is already an app or the calendar functionality). Others you can install as the admin of the NC server. There is the app store under apps.nextcloud.com where you can find most of the apps ready for installation.
Having said that, there is the page docs.nextcloud.com that contains links to use, admin and development documentation. The latter might be useful for you.
Currently there is a series of tutorials prepared to allow beginners of the NC ecosystem start programming their own apps.
According to this blog, it seems possible to install a full-sized NC server installation on TrueNAS. I do not know it, so a am a bit unsure about the implications.
In general, you can as an administrator of a NC instance add new users to the instance. There are instances with thousands of users. So, yes, it should be possible unless TrueNAS does nasty things.
Well, now we get into technical details. The question here is: should the application you are taking off be running parallel to the server or be part of it? Are you willing to create at least a small NC app for interfacing purposes?
Within the app, you could register an event handler and get notified of all files events you are interested in. You could then handle whatever is needed or delegate the task to some external service. This integration needs to be designed carefully but should be possible.
As far as i know there is no webhook or similar to get notified upon data updates. You could however do a polling approach using e.g. WebDAV. Then you would not need any NC code but just some for code in your external app.
There is the option again to use an app to create users. I would avoid that if possible as your username will most probably be fixed in size. But yes, you can in general.
You can as well use a CLI tool called OCC. See the documentation for details.
There is also an app that allows to register new users. I have never used it. So, i do not know what it is capable of.
The question was: does your app need accounts as well? If the storage and data handling is offloaded to the NC server, what is the point in having accounts in the external app?
I am thinking in the direction to have the functionality just loaded into an external service provider that supports an app of NC. But you know better, what you need to do.
Yes, in general. You have to decide on the structure (NC app or not). Then, you can find a way to access the data.
You must not alter the data within the server itself. This must be done through the server. So, either via WebDAV again, by means of a NC app or by using the client API.
But yes, CRUD operation on files are possible.
I hope, this have you done answers. Feel free to ask back
Thank you for the answers Christian. I’m starting to understand.
Are you familiar with draw.io ? It is like Microsoft draw but on a browser. The first thing this web app does is asked for login into storage like dropbox.com, github, etc.
Half of my application is like this in that it lets the user edit and manipulate work files and it has a web interface. This web app runs on a server somewhere not related to dropbox and needs to let the user select and retrieve files from dropbox that the user stored. It also can store and create files in dropbox server on behalf of the user.
What is the API or mechanism to do this in nextcloud assuming nextcloud is installed on one server and my web app is installed on another server?
what crudentials does a user provide to allow my server to communicate with the nextcloud server to retrieve files list and save files, etc?
does nextcloud have a crud interface to retrieve these files or someother interface?
does user have a way to disable access to his/her files from my application if they want to?
I want to add one option to what @tflidd suggested:
You could use whatever language and the OCS/WebDAV API to access the files.
Thanks for the hint with flow. i did not know this app was capable to this sort of things.
This would mean that you probably need to either use the external interface like WebDAV to access the files. Alternatively, you could add a stub app to handle the NC file IO and provide a custom API.
Yes, definitively. See WebDAV.
That depends on the way you access the server. When using the WebDAV interface that would for example be app tokens. For a custom solution you might implement a different authentication method with tokens if required.
Do you mean permanently and for all files or selectively? This could rule out the WebDAV interface, eventually. Please explain a bit more what your use case would be related to the revocation of access.
Each user using the WebDAV interface needs to use their own credentials (you must create each user in the NC server individually or via OCS interface). Then, each user can have their own storage area. When sharing comes into play, user A can access user B’s files/folders selectively.