comparison OrthancServer/main.cpp @ 1949:d90f737f2dde

warn about the use of privileged ports
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Apr 2016 10:30:17 +0200
parents b1291df2f780
children 45c4387a379c
comparison
equal deleted inserted replaced
1948:326fdda31b42 1949:d90f737f2dde
539 PrintErrorCode(ErrorCode_SQLiteTransactionCommit, "SQLite: Failure when committing the transaction"); 539 PrintErrorCode(ErrorCode_SQLiteTransactionCommit, "SQLite: Failure when committing the transaction");
540 PrintErrorCode(ErrorCode_SQLiteTransactionBegin, "SQLite: Cannot start a transaction"); 540 PrintErrorCode(ErrorCode_SQLiteTransactionBegin, "SQLite: Cannot start a transaction");
541 PrintErrorCode(ErrorCode_DirectoryOverFile, "The directory to be created is already occupied by a regular file"); 541 PrintErrorCode(ErrorCode_DirectoryOverFile, "The directory to be created is already occupied by a regular file");
542 PrintErrorCode(ErrorCode_FileStorageCannotWrite, "Unable to create a subdirectory or a file in the file storage"); 542 PrintErrorCode(ErrorCode_FileStorageCannotWrite, "Unable to create a subdirectory or a file in the file storage");
543 PrintErrorCode(ErrorCode_DirectoryExpected, "The specified path does not point to a directory"); 543 PrintErrorCode(ErrorCode_DirectoryExpected, "The specified path does not point to a directory");
544 PrintErrorCode(ErrorCode_HttpPortInUse, "The TCP port of the HTTP server is already in use"); 544 PrintErrorCode(ErrorCode_HttpPortInUse, "The TCP port of the HTTP server is privileged or already in use");
545 PrintErrorCode(ErrorCode_DicomPortInUse, "The TCP port of the DICOM server is already in use"); 545 PrintErrorCode(ErrorCode_DicomPortInUse, "The TCP port of the DICOM server is privileged or already in use");
546 PrintErrorCode(ErrorCode_BadHttpStatusInRest, "This HTTP status is not allowed in a REST API"); 546 PrintErrorCode(ErrorCode_BadHttpStatusInRest, "This HTTP status is not allowed in a REST API");
547 PrintErrorCode(ErrorCode_RegularFileExpected, "The specified path does not point to a regular file"); 547 PrintErrorCode(ErrorCode_RegularFileExpected, "The specified path does not point to a regular file");
548 PrintErrorCode(ErrorCode_PathToExecutable, "Unable to get the path to the executable"); 548 PrintErrorCode(ErrorCode_PathToExecutable, "Unable to get the path to the executable");
549 PrintErrorCode(ErrorCode_MakeDirectory, "Cannot create a directory"); 549 PrintErrorCode(ErrorCode_MakeDirectory, "Cannot create a directory");
550 PrintErrorCode(ErrorCode_BadApplicationEntityTitle, "An application entity title (AET) cannot be empty or be longer than 16 characters"); 550 PrintErrorCode(ErrorCode_BadApplicationEntityTitle, "An application entity title (AET) cannot be empty or be longer than 16 characters");
701 httpServer.SetSslEnabled(false); 701 httpServer.SetSslEnabled(false);
702 } 702 }
703 703
704 httpServer.Register(context.GetHttpHandler()); 704 httpServer.Register(context.GetHttpHandler());
705 705
706 if (httpServer.GetPortNumber() < 1024)
707 {
708 LOG(WARNING) << "The HTTP port is privileged ("
709 << httpServer.GetPortNumber() << " is below 1024), "
710 << "make sure you run Orthanc as root/administrator";
711 }
712
706 httpServer.Start(); 713 httpServer.Start();
707 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber(); 714 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber();
708 715
709 bool restart = WaitForExit(context, restApi); 716 bool restart = WaitForExit(context, restApi);
710 717
744 #endif 751 #endif
745 752
746 dicomServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("DicomPort", 4242)); 753 dicomServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("DicomPort", 4242));
747 dicomServer.SetApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); 754 dicomServer.SetApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"));
748 dicomServer.SetApplicationEntityFilter(dicomFilter); 755 dicomServer.SetApplicationEntityFilter(dicomFilter);
756
757 if (dicomServer.GetPortNumber() < 1024)
758 {
759 LOG(WARNING) << "The DICOM port is privileged ("
760 << dicomServer.GetPortNumber() << " is below 1024), "
761 << "make sure you run Orthanc as root/administrator";
762 }
749 763
750 dicomServer.Start(); 764 dicomServer.Start();
751 LOG(WARNING) << "DICOM server listening with AET " << dicomServer.GetApplicationEntityTitle() 765 LOG(WARNING) << "DICOM server listening with AET " << dicomServer.GetApplicationEntityTitle()
752 << " on port: " << dicomServer.GetPortNumber(); 766 << " on port: " << dicomServer.GetPortNumber();
753 767