1 /***************************************************************************
2 * Copyright (C) 2005-2020 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
23 #include "core-export.h"
35 #include "authenticator.h"
36 #include "bufferinfo.h"
37 #include "deferredptr.h"
38 #include "identserver.h"
40 #include "metricsserver.h"
41 #include "oidentdconfiggenerator.h"
42 #include "sessionthread.h"
43 #include "singleton.h"
44 #include "sslserver.h"
48 class CoreAuthHandler;
56 class AbstractSqlMigrationReader;
57 class AbstractSqlMigrationWriter;
59 class CORE_EXPORT Core : public QObject, public Singleton<Core>
70 * Shuts down active core sessions, saves state and emits the shutdownComplete() signal afterwards.
74 /*** Storage access ***/
75 // These methods are threadsafe.
79 * \param userName The user's login name
80 * \param password The user's uncrypted password
81 * \return The user's ID if valid; 0 otherwise
83 static inline UserId validateUser(const QString& userName, const QString& password)
85 return instance()->_storage->validateUser(userName, password);
88 //! Authenticate user against auth backend
90 * \param userName The user's login name
91 * \param password The user's uncrypted password
92 * \return The user's ID if valid; 0 otherwise
94 static inline UserId authenticateUser(const QString& userName, const QString& password)
96 return instance()->_authenticator->validateUser(userName, password);
99 //! Add a new user, exposed so auth providers can call this without being the storage.
101 * \param userName The user's login name
102 * \param password The user's uncrypted password
103 * \param authenticator The name of the auth provider service used to log the user in, defaults to "Database".
104 * \return The user's ID if valid; 0 otherwise
106 static inline UserId addUser(const QString& userName, const QString& password, const QString& authenticator = "Database")
108 return instance()->_storage->addUser(userName, password, authenticator);
111 //! Does a comparison test against the authenticator in the database and the authenticator currently in use for a UserID.
113 * \param userid The user's ID (note: not login name).
114 * \param authenticator The name of the auth provider service used to log the user in, defaults to "Database".
115 * \return True if the userid was configured with the passed authenticator, false otherwise.
117 static inline bool checkAuthProvider(const UserId userid, const QString& authenticator)
119 return instance()->_storage->getUserAuthenticator(userid) == authenticator;
122 //! Gets the authenticator configured for a user.
124 * \param userName The user's name as a QString.
125 * \return String value corresponding to the user's configure dauthenticator.
127 static inline QString getUserAuthenticator(const QString& userName)
129 return instance()->_storage->getUserAuthenticator(instance()->_storage->getUserId(userName));
132 //! Gets the user ID mapped to a username. This is necessary so that non-database auth methods can log in users properly.
134 * \param userName The user's name as a QString.
135 * \return userId The user's ID.
137 static inline UserId getUserId(const QString& userName)
139 return instance()->_storage->getUserId(userName);
142 //! Change a user's password
144 * \param userId The user's ID
145 * \param password The user's unencrypted new password
146 * \return true, if the password change was successful
148 static bool changeUserPassword(UserId userId, const QString& password);
150 //! Check if we can change a user password.
152 * \param userID The user's ID
153 * \return true, if we can change their password, false otherwise
155 static bool canChangeUserPassword(UserId userId);
157 //! Store a user setting persistently
159 * \param userId The users Id
160 * \param settingName The Name of the Setting
161 * \param data The Value
163 static inline void setUserSetting(UserId userId, const QString& settingName, const QVariant& data)
165 instance()->_storage->setUserSetting(userId, settingName, data);
168 //! Retrieve a persistent user setting
170 * \param userId The users Id
171 * \param settingName The Name of the Setting
172 * \param defaultValue Value to return in case it's unset.
173 * \return the Value of the Setting or the default value if it is unset.
175 static inline QVariant getUserSetting(UserId userId, const QString& settingName, const QVariant& defaultValue = QVariant())
177 return instance()->_storage->getUserSetting(userId, settingName, defaultValue);
180 /* Identity handling */
181 static inline IdentityId createIdentity(UserId user, CoreIdentity& identity)
183 return instance()->_storage->createIdentity(user, identity);
186 static bool updateIdentity(UserId user, const CoreIdentity& identity) { return instance()->_storage->updateIdentity(user, identity); }
188 static void removeIdentity(UserId user, IdentityId identityId) { instance()->_storage->removeIdentity(user, identityId); }
190 static std::vector<CoreIdentity> identities(UserId user) { return instance()->_storage->identities(user); }
192 //! Create a Network in the Storage and store it's Id in the given NetworkInfo
193 /** \note This method is thredsafe.
195 * \param user The core user
196 * \param networkInfo a NetworkInfo definition to store the newly created ID in
197 * \return true if successfull.
199 static bool createNetwork(UserId user, NetworkInfo& info);
201 //! Apply the changes to NetworkInfo info to the storage engine
202 /** \note This method is thredsafe.
204 * \param user The core user
205 * \param networkInfo The Updated NetworkInfo
206 * \return true if successfull.
208 static inline bool updateNetwork(UserId user, const NetworkInfo& info) { return instance()->_storage->updateNetwork(user, info); }
210 //! Permanently remove a Network and all the data associated with it.
211 /** \note This method is thredsafe.
213 * \param user The core user
214 * \param networkId The network to delete
215 * \return true if successfull.
217 static inline bool removeNetwork(UserId user, const NetworkId& networkId)
219 return instance()->_storage->removeNetwork(user, networkId);
222 //! Returns a list of all NetworkInfos for the given UserId user
223 /** \note This method is thredsafe.
225 * \param user The core user
226 * \return std::vector<NetworkInfo>.
228 static inline std::vector<NetworkInfo> networks(UserId user) { return instance()->_storage->networks(user); }
230 //! Get a list of Networks to restore
231 /** Return a list of networks the user was connected at the time of core shutdown
232 * \note This method is threadsafe.
234 * \param user The User Id in question
236 static inline std::vector<NetworkId> connectedNetworks(UserId user) { return instance()->_storage->connectedNetworks(user); }
238 //! Update the connected state of a network
239 /** \note This method is threadsafe
241 * \param user The Id of the networks owner
242 * \param networkId The Id of the network
243 * \param isConnected whether the network is connected or not
245 static inline void setNetworkConnected(UserId user, const NetworkId& networkId, bool isConnected)
247 return instance()->_storage->setNetworkConnected(user, networkId, isConnected);
250 //! Get a hash of channels with their channel keys for a given network
251 /** The keys are channel names and values are passwords (possibly empty)
252 * \note This method is threadsafe
254 * \param user The id of the networks owner
255 * \param networkId The Id of the network
257 static inline QHash<QString, QString> persistentChannels(UserId user, const NetworkId& networkId)
259 return instance()->_storage->persistentChannels(user, networkId);
262 //! Update the connected state of a channel
263 /** \note This method is threadsafe
265 * \param user The Id of the networks owner
266 * \param networkId The Id of the network
267 * \param channel The name of the channel
268 * \param isJoined whether the channel is connected or not
270 static inline void setChannelPersistent(UserId user, const NetworkId& networkId, const QString& channel, bool isJoined)
272 return instance()->_storage->setChannelPersistent(user, networkId, channel, isJoined);
275 //! Get a hash of buffers with their ciphers for a given network
276 /** The keys are channel names and values are ciphers (possibly empty)
277 * \note This method is threadsafe
279 * \param user The id of the networks owner
280 * \param networkId The Id of the network
282 static inline QHash<QString, QByteArray> bufferCiphers(UserId user, const NetworkId& networkId)
284 return instance()->_storage->bufferCiphers(user, networkId);
287 //! Update the cipher of a buffer
288 /** \note This method is threadsafe
290 * \param user The Id of the networks owner
291 * \param networkId The Id of the network
292 * \param bufferName The Cname of the buffer
293 * \param cipher The cipher for the buffer
295 static inline void setBufferCipher(UserId user, const NetworkId& networkId, const QString& bufferName, const QByteArray& cipher)
297 return instance()->_storage->setBufferCipher(user, networkId, bufferName, cipher);
300 //! Update the key of a channel
301 /** \note This method is threadsafe
303 * \param user The Id of the networks owner
304 * \param networkId The Id of the network
305 * \param channel The name of the channel
306 * \param key The key of the channel (possibly empty)
308 static inline void setPersistentChannelKey(UserId user, const NetworkId& networkId, const QString& channel, const QString& key)
310 return instance()->_storage->setPersistentChannelKey(user, networkId, channel, key);
313 //! retrieve last known away message for session restore
314 /** \note This method is threadsafe
316 * \param user The Id of the networks owner
317 * \param networkId The Id of the network
319 static inline QString awayMessage(UserId user, NetworkId networkId) { return instance()->_storage->awayMessage(user, networkId); }
321 //! Make away message persistent for session restore
322 /** \note This method is threadsafe
324 * \param user The Id of the networks owner
325 * \param networkId The Id of the network
326 * \param awayMsg The current away message of own user
328 static inline void setAwayMessage(UserId user, NetworkId networkId, const QString& awayMsg)
330 return instance()->_storage->setAwayMessage(user, networkId, awayMsg);
333 //! retrieve last known user mode for session restore
334 /** \note This method is threadsafe
336 * \param user The Id of the networks owner
337 * \param networkId The Id of the network
339 static inline QString userModes(UserId user, NetworkId networkId) { return instance()->_storage->userModes(user, networkId); }
341 //! Make our user modes persistent for session restore
342 /** \note This method is threadsafe
344 * \param user The Id of the networks owner
345 * \param networkId The Id of the network
346 * \param userModes The current user modes of own user
348 static inline void setUserModes(UserId user, NetworkId networkId, const QString& userModes)
350 return instance()->_storage->setUserModes(user, networkId, userModes);
353 //! Get the unique BufferInfo for the given combination of network and buffername for a user.
354 /** \note This method is threadsafe.
356 * \param user The core user who owns this buffername
357 * \param networkId The network id
358 * \param type The type of the buffer (StatusBuffer, Channel, etc.)
359 * \param buffer The buffer name (if empty, the net's status buffer is returned)
360 * \param create Whether or not the buffer should be created if it doesnt exist
361 * \return The BufferInfo corresponding to the given network and buffer name, or 0 if not found
363 static inline BufferInfo bufferInfo(
364 UserId user, const NetworkId& networkId, BufferInfo::Type type, const QString& buffer = "", bool create = true)
366 return instance()->_storage->bufferInfo(user, networkId, type, buffer, create);
369 //! Get the unique BufferInfo for a bufferId
370 /** \note This method is threadsafe
371 * \param user The core user who owns this buffername
372 * \param bufferId The id of the buffer
373 * \return The BufferInfo corresponding to the given buffer id, or an invalid BufferInfo if not found.
375 static inline BufferInfo getBufferInfo(UserId user, const BufferId& bufferId)
377 return instance()->_storage->getBufferInfo(user, bufferId);
380 //! Store a Message in the storage backend and set it's unique Id.
381 /** \note This method is threadsafe.
383 * \param message The message object to be stored
384 * \return true on success
386 static inline bool storeMessage(Message& message) { return instance()->_storage->logMessage(message); }
388 //! Store a list of Messages in the storage backend and set their unique Id.
389 /** \note This method is threadsafe.
391 * \param messages The list message objects to be stored
392 * \return true on success
394 static inline bool storeMessages(MessageList& messages) { return instance()->_storage->logMessages(messages); }
396 //! Request a certain number messages stored in a given buffer.
397 /** \param buffer The buffer we request messages from
398 * \param first if != -1 return only messages with a MsgId >= first
399 * \param last if != -1 return only messages with a MsgId < last
400 * \param limit if != -1 limit the returned list to a max of \limit entries
401 * \return The requested list of messages
403 static inline std::vector<Message> requestMsgs(UserId user, BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1)
405 return instance()->_storage->requestMsgs(user, bufferId, first, last, limit);
408 //! Request a certain number messages stored in a given buffer, matching certain filters
409 /** \param buffer The buffer we request messages from
410 * \param first if != -1 return only messages with a MsgId >= first
411 * \param last if != -1 return only messages with a MsgId < last
412 * \param limit if != -1 limit the returned list to a max of \limit entries
413 * \param type The Message::Types that should be returned
414 * \return The requested list of messages
416 static inline std::vector<Message> requestMsgsFiltered(UserId user,
421 Message::Types type = Message::Types{-1},
422 Message::Flags flags = Message::Flags{-1})
424 return instance()->_storage->requestMsgsFiltered(user, bufferId, first, last, limit, type, flags);
427 //! Request a certain number of messages across all buffers
428 /** \param first if != -1 return only messages with a MsgId >= first
429 * \param last if != -1 return only messages with a MsgId < last
430 * \param limit Max amount of messages
431 * \return The requested list of messages
433 static inline std::vector<Message> requestAllMsgs(UserId user, MsgId first = -1, MsgId last = -1, int limit = -1)
435 return instance()->_storage->requestAllMsgs(user, first, last, limit);
438 //! Request a certain number of messages across all buffers, matching certain filters
439 /** \param first if != -1 return only messages with a MsgId >= first
440 * \param last if != -1 return only messages with a MsgId < last
441 * \param limit Max amount of messages
442 * \param type The Message::Types that should be returned
443 * \return The requested list of messages
445 static inline std::vector<Message> requestAllMsgsFiltered(UserId user,
449 Message::Types type = Message::Types{-1},
450 Message::Flags flags = Message::Flags{-1})
452 return instance()->_storage->requestAllMsgsFiltered(user, first, last, limit, type, flags);
455 //! Request a list of all buffers known to a user.
456 /** This method is used to get a list of all buffers we have stored a backlog from.
457 * \note This method is threadsafe.
459 * \param user The user whose buffers we request
460 * \return A list of the BufferInfos for all buffers as requested
462 static inline std::vector<BufferInfo> requestBuffers(UserId user) { return instance()->_storage->requestBuffers(user); }
464 //! Request a list of BufferIds for a given NetworkId
465 /** \note This method is threadsafe.
467 * \param user The user whose buffers we request
468 * \param networkId The NetworkId of the network in question
469 * \return List of BufferIds belonging to the Network
471 static inline std::vector<BufferId> requestBufferIdsForNetwork(UserId user, NetworkId networkId)
473 return instance()->_storage->requestBufferIdsForNetwork(user, networkId);
476 //! Remove permanently a buffer and it's content from the storage backend
477 /** This call cannot be reverted!
478 * \note This method is threadsafe.
480 * \param user The user who is the owner of the buffer
481 * \param bufferId The bufferId
482 * \return true if successfull
484 static inline bool removeBuffer(const UserId& user, const BufferId& bufferId)
486 return instance()->_storage->removeBuffer(user, bufferId);
490 /** \note This method is threadsafe.
491 * \param user The id of the buffer owner
492 * \param bufferId The bufferId
493 * \param newName The new name of the buffer
494 * \return true if successfull
496 static inline bool renameBuffer(const UserId& user, const BufferId& bufferId, const QString& newName)
498 return instance()->_storage->renameBuffer(user, bufferId, newName);
501 //! Merge the content of two Buffers permanently. This cannot be reversed!
502 /** \note This method is threadsafe.
503 * \param user The id of the buffer owner
504 * \param bufferId1 The bufferId of the remaining buffer
505 * \param bufferId2 The buffer that is about to be removed
506 * \return true if successfulln
508 static inline bool mergeBuffersPermanently(const UserId& user, const BufferId& bufferId1, const BufferId& bufferId2)
510 return instance()->_storage->mergeBuffersPermanently(user, bufferId1, bufferId2);
513 //! Update the LastSeenDate for a Buffer
514 /** This Method is used to make the LastSeenDate of a Buffer persistent
515 * \note This method is threadsafe.
517 * \param user The Owner of that Buffer
518 * \param bufferId The buffer id
519 * \param MsgId The Message id of the message that has been just seen
521 static inline void setBufferLastSeenMsg(UserId user, const BufferId& bufferId, const MsgId& msgId)
523 return instance()->_storage->setBufferLastSeenMsg(user, bufferId, msgId);
526 //! Get a usable sysident for the given user in oidentd-strict mode
527 /** \param user The user to retrieve the sysident for
528 * \return The authusername
530 QString strictSysIdent(UserId user) const;
532 //! Get a Hash of all last message ids
533 /** This Method is called when the Quassel Core is started to restore the lastMsgIds
534 * \note This method is threadsafe.
536 * \param user The Owner of the buffers
538 static inline QHash<BufferId, MsgId> bufferLastMsgIds(UserId user) { return instance()->_storage->bufferLastMsgIds(user); }
540 //! Get a Hash of all last seen message ids
541 /** This Method is called when the Quassel Core is started to restore the lastSeenMsgIds
542 * \note This method is threadsafe.
544 * \param user The Owner of the buffers
546 static inline QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user) { return instance()->_storage->bufferLastSeenMsgIds(user); }
548 //! Update the MarkerLineMsgId for a Buffer
549 /** This Method is used to make the marker line position of a Buffer persistent
550 * \note This method is threadsafe.
552 * \param user The Owner of that Buffer
553 * \param bufferId The buffer id
554 * \param MsgId The Message id where the marker line should be placed
556 static inline void setBufferMarkerLineMsg(UserId user, const BufferId& bufferId, const MsgId& msgId)
558 return instance()->_storage->setBufferMarkerLineMsg(user, bufferId, msgId);
561 //! Get a Hash of all marker line message ids
562 /** This Method is called when the Quassel Core is started to restore the MarkerLineMsgIds
563 * \note This method is threadsafe.
565 * \param user The Owner of the buffers
567 static inline QHash<BufferId, MsgId> bufferMarkerLineMsgIds(UserId user) { return instance()->_storage->bufferMarkerLineMsgIds(user); }
569 //! Update the BufferActivity for a Buffer
570 /** This Method is used to make the activity state of a Buffer persistent
571 * \note This method is threadsafe.
573 * \param user The Owner of that Buffer
574 * \param bufferId The buffer id
575 * \param MsgId The Message id where the marker line should be placed
577 static inline void setBufferActivity(UserId user, BufferId bufferId, Message::Types activity)
579 return instance()->_storage->setBufferActivity(user, bufferId, activity);
582 //! Get a Hash of all buffer activity states
583 /** This Method is called when the Quassel Core is started to restore the BufferActivity
584 * \note This method is threadsafe.
586 * \param user The Owner of the buffers
588 static inline QHash<BufferId, Message::Types> bufferActivities(UserId user) { return instance()->_storage->bufferActivities(user); }
590 //! Get the bitset of buffer activity states for a buffer
591 /** This method is used to load the activity state of a buffer when its last seen message changes.
592 * \note This method is threadsafe.
594 * \param bufferId The buffer
595 * \param lastSeenMsgId The last seen message
597 static inline Message::Types bufferActivity(BufferId bufferId, MsgId lastSeenMsgId)
599 return instance()->_storage->bufferActivity(bufferId, lastSeenMsgId);
602 //! Update the highlight count for a Buffer
603 /** This Method is used to make the highlight count state of a Buffer persistent
604 * \note This method is threadsafe.
606 * \param user The Owner of that Buffer
607 * \param bufferId The buffer id
608 * \param MsgId The Message id where the marker line should be placed
610 static inline void setHighlightCount(UserId user, BufferId bufferId, int highlightCount)
612 return instance()->_storage->setHighlightCount(user, bufferId, highlightCount);
615 //! Get a Hash of all highlight count states
616 /** This Method is called when the Quassel Core is started to restore the highlight count
617 * \note This method is threadsafe.
619 * \param user The Owner of the buffers
621 static inline QHash<BufferId, int> highlightCounts(UserId user) { return instance()->_storage->highlightCounts(user); }
622 //! Get the highlight count states for a buffer
623 /** This method is used to load the highlight count of a buffer when its last seen message changes.
624 * \note This method is threadsafe.
626 * \param bufferId The buffer
627 * \param lastSeenMsgId The last seen message
629 static inline int highlightCount(BufferId bufferId, MsgId lastSeenMsgId)
631 return instance()->_storage->highlightCount(bufferId, lastSeenMsgId);
634 static inline QDateTime startTime() { return instance()->_startTime; }
635 static inline bool isConfigured() { return instance()->_configured; }
638 * Whether or not strict ident mode is enabled, locking users' idents to Quassel username
640 * @return True if strict mode enabled, otherwise false
642 static inline bool strictIdentEnabled() { return instance()->_strictIdentEnabled; }
644 static bool sslSupported();
646 static QVariantList backendInfo();
647 static QVariantList authenticatorInfo();
649 static QString setup(const QString& adminUser,
650 const QString& adminPassword,
651 const QString& backend,
652 const QVariantMap& setupData,
653 const QString& authenticator,
654 const QVariantMap& authSetupMap);
656 static inline QTimer* syncTimer() { return &instance()->_storageSyncTimer; }
658 inline OidentdConfigGenerator* oidentdConfigGenerator() const { return _oidentdConfigGenerator; }
659 inline IdentServer* identServer() const { return _identServer; }
660 inline MetricsServer* metricsServer() const { return _metricsServer; }
662 static const int AddClientEventId;
665 //! Sent when a BufferInfo is updated in storage.
666 void bufferInfoUpdated(UserId user, const BufferInfo& info);
668 //! Relay from CoreSession::sessionState(). Used for internal connection only
669 void sessionStateReceived(const Protocol::SessionState& sessionState);
671 //! Emitted when database schema upgrade starts or ends
672 void dbUpgradeInProgress(bool inProgress);
674 //! Emitted when a fatal error was encountered during async initialization
675 void exitRequested(int exitCode, const QString& reason);
677 //! Emitted once core shutdown is complete
678 void shutdownComplete();
685 * @note This method is threadsafe.
690 * Reload SSL certificates used for connection with clients.
692 * @return True if certificates reloaded successfully, otherwise false.
696 void cacheSysIdent();
698 QString setupCore(const QString& adminUser,
699 const QString& adminPassword,
700 const QString& backend,
701 const QVariantMap& setupData,
702 const QString& authenticator,
703 const QVariantMap& authSetupMap);
705 void connectInternalPeer(QPointer<InternalPeer> peer);
708 void customEvent(QEvent* event) override;
711 bool startListening();
712 void stopListening(const QString& msg = QString());
713 void incomingConnection();
714 void clientDisconnected();
716 bool initStorage(const QString& backend,
717 const QVariantMap& settings,
718 const QProcessEnvironment& environment,
719 bool loadFromEnvironment,
721 bool initAuthenticator(const QString& backend,
722 const QVariantMap& settings,
723 const QProcessEnvironment& environment,
724 bool loadFromEnvironment,
727 void socketError(QAbstractSocket::SocketError err, const QString& errorString);
728 void setupClientSession(RemotePeer*, UserId);
730 bool changeUserPass(const QString& username);
732 void onSessionShutdown(SessionThread* session);
735 SessionThread* sessionForUser(UserId userId, bool restoreState = false);
736 void addClientHelper(RemotePeer* peer, UserId uid);
737 // void processCoreSetup(QTcpSocket *socket, QVariantMap &msg);
738 QString setupCoreForInternalUsage();
739 void setupInternalClientSession(QPointer<InternalPeer> peer);
743 template<typename Storage>
744 void registerStorageBackend();
746 template<typename Authenticator>
747 void registerAuthenticator();
749 void registerStorageBackends();
750 void registerAuthenticators();
752 DeferredSharedPtr<Storage> storageBackend(const QString& backendId) const;
753 DeferredSharedPtr<Authenticator> authenticator(const QString& authenticatorId) const;
755 bool selectBackend(const QString& backend);
756 bool selectAuthenticator(const QString& backend);
758 bool saveBackendSettings(const QString& backend, const QVariantMap& settings);
759 void saveAuthenticatorSettings(const QString& backend, const QVariantMap& settings);
764 template<typename Backend>
765 QVariantMap promptForSettings(const Backend* backend);
768 static Core* _instance;
769 QSet<CoreAuthHandler*> _connectingClients;
770 QHash<UserId, SessionThread*> _sessions;
771 DeferredSharedPtr<Storage> _storage; ///< Active storage backend
772 DeferredSharedPtr<Authenticator> _authenticator; ///< Active authenticator
773 QMap<UserId, QString> _authUserNames;
775 QTimer _storageSyncTimer;
777 SslServer _server, _v6server;
779 OidentdConfigGenerator* _oidentdConfigGenerator{nullptr};
781 std::vector<DeferredSharedPtr<Storage>> _registeredStorageBackends;
782 std::vector<DeferredSharedPtr<Authenticator>> _registeredAuthenticators;
784 QDateTime _startTime;
786 IdentServer* _identServer{nullptr};
787 MetricsServer* _metricsServer{nullptr};
789 bool _initialized{false};
790 bool _configured{false};
792 QPointer<InternalPeer> _pendingInternalConnection;
794 /// Whether or not strict ident mode is enabled, locking users' idents to Quassel username
795 bool _strictIdentEnabled;
797 static std::unique_ptr<AbstractSqlMigrationReader> getMigrationReader(Storage* storage);
798 static std::unique_ptr<AbstractSqlMigrationWriter> getMigrationWriter(Storage* storage);
799 static void stdInEcho(bool on);
800 static inline void enableStdInEcho() { stdInEcho(true); }
801 static inline void disableStdInEcho() { stdInEcho(false); }