Configuration file and CI #4

Merged
bartfaik04 merged 29 commits from configuration into main 2025-06-07 15:33:06 +02:00
3 changed files with 20 additions and 1 deletions
Showing only changes of commit 4dc9ea3acb - Show all commits

View File

@@ -1,2 +1,3 @@
NEXTCLOUD_CONTAINER_NAME=nextcloud
NEXTCLOUD_USERS=username1 username2 username3
NEXTCLOUD_GROUPFOLDER_IDS=1 2 3 4

View File

@@ -107,6 +107,7 @@ void scannerThreadFunc()
int main()
{
manager.tryAddUsersFromConfig(cfm);
manager.tryAddGroupIDsFromConfig(cfm);
std::thread readingThread(readingThreadFunc);
std::thread scannerThread(scannerThreadFunc);

View File

@@ -136,6 +136,23 @@ public:
std::cerr << "No user added from configuration file" << std::endl;
}
}
void tryAddGroupIDsFromConfig(configfilemanager &cfm)
{
try
{
std::vector<std::string> allids = splitString(cfm.at("NEXTCLOUD_GROUPFOLDER_IDS"), ' ');
for (const std::string& id : allids)
{
addUser("__groupfolder/" + id);
}
}
catch (std::exception e)
{
std::cerr << "No groupfolder added from configuration file" << std::endl;
}
}
};
#endif // _USERMAN_H