Repository: YiChat/IM_Server_YiChat Branch: master Commit: bc3e64cc5228 Files: 1306 Total size: 7.1 MB Directory structure: gitextract_m7d9fno2/ ├── README.md ├── tigase-server 7.1.0/ │ ├── License.html │ ├── certs/ │ │ ├── keystore │ │ ├── rsa-keystore │ │ └── truststore │ ├── conf/ │ │ └── config.properties │ ├── database/ │ │ ├── derby-installer-create-db.sql │ │ ├── derby-installer-post.sql │ │ ├── derby-schema-4-props.sql │ │ ├── derby-schema-4-schema.sql │ │ ├── derby-schema-4-sp.sql │ │ ├── derby-schema-4.sql │ │ ├── derby-schema-5-1-props.sql │ │ ├── derby-schema-5-1-schema.sql │ │ ├── derby-schema-5-1-sp.sql │ │ ├── derby-schema-5-1.sql │ │ ├── derby-schema-5.sql │ │ ├── derby-schema-7-1-props.sql │ │ ├── derby-schema-7-1-schema.sql │ │ ├── derby-schema-7-1-sp.sql │ │ ├── derby-schema-7-1.sql │ │ ├── derby-schema-upgrade-to-5-1.sql │ │ ├── derby-schema-upgrade-to-7-1.sql │ │ ├── mysql-installer-create-db.sql │ │ ├── mysql-installer-post.sql │ │ ├── mysql-schema-3.sql │ │ ├── mysql-schema-4-props.sql │ │ ├── mysql-schema-4-schema.sql │ │ ├── mysql-schema-4-sp.sql │ │ ├── mysql-schema-4-test.sql │ │ ├── mysql-schema-4.sql │ │ ├── mysql-schema-5-1-props.sql │ │ ├── mysql-schema-5-1-schema.sql │ │ ├── mysql-schema-5-1-sp.sql │ │ ├── mysql-schema-5-1.sql │ │ ├── mysql-schema-5.sql │ │ ├── mysql-schema-7-1-props.sql │ │ ├── mysql-schema-7-1-schema.sql │ │ ├── mysql-schema-7-1-sp.sql │ │ ├── mysql-schema-7-1.sql │ │ ├── mysql-schema-upgrade-to-4.sql │ │ ├── mysql-schema-upgrade-to-5-1.sql │ │ ├── mysql-schema-upgrade-to-7-1.sql │ │ ├── postgresql-installer-create-db.sql │ │ ├── postgresql-installer-post.sql │ │ ├── postgresql-schema-3.sql │ │ ├── postgresql-schema-4-props.sql │ │ ├── postgresql-schema-4-schema.sql │ │ ├── postgresql-schema-4-sp.sql │ │ ├── postgresql-schema-4.sql │ │ ├── postgresql-schema-5-1-props.sql │ │ ├── postgresql-schema-5-1-schema.sql │ │ ├── postgresql-schema-5-1-sp.sql │ │ ├── postgresql-schema-5-1.sql │ │ ├── postgresql-schema-5.sql │ │ ├── postgresql-schema-7-1-props.sql │ │ ├── postgresql-schema-7-1-schema.sql │ │ ├── postgresql-schema-7-1-sp.sql │ │ ├── postgresql-schema-7-1.sql │ │ ├── postgresql-schema-upgrade-to-4.sql │ │ ├── postgresql-schema-upgrade-to-5-1.sql │ │ ├── postgresql-schema-upgrade-to-7-1.sql │ │ ├── sqlserver-create_database.sql │ │ ├── sqlserver-installer-create-db.sql │ │ ├── sqlserver-installer-post.sql │ │ ├── sqlserver-schema-4.sql │ │ ├── sqlserver-schema-5-1-props.sql │ │ ├── sqlserver-schema-5-1-schema.sql │ │ ├── sqlserver-schema-5-1-sp.sql │ │ ├── sqlserver-schema-5-1.sql │ │ ├── sqlserver-schema-7-1-props.sql │ │ ├── sqlserver-schema-7-1-schema.sql │ │ ├── sqlserver-schema-7-1-sp.sql │ │ ├── sqlserver-schema-7-1.sql │ │ ├── sqlserver-schema-upgrade-to-7-1.sql │ │ └── sqlserver-schema.sql │ ├── debian/ │ │ ├── README.Debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── init.properties │ │ ├── rules │ │ ├── std-logger.sh │ │ ├── tigase-server.default │ │ ├── tigase-server.dirs │ │ ├── tigase-server.init │ │ ├── tigase-server.install │ │ ├── tigase-server.postinst │ │ ├── tigase-server.postrm │ │ └── watch │ ├── etc/ │ │ ├── APNs_HTMessage_Dev.p12 │ │ ├── APNs_HTMessage_Dev.pem │ │ ├── HTMessage_Dev_APNs.p12 │ │ ├── HTMessage_Dev_APNs.pem │ │ ├── bosh-extra-headers.txt │ │ ├── client-access-policy.xml │ │ ├── config-dump.properties │ │ ├── cross-domain-policy.xml │ │ ├── htmessage_production_APNs.p12 │ │ ├── htmessage_production_APNs.pem │ │ ├── init-apns.properties │ │ ├── init.properties │ │ ├── jmx.access │ │ ├── jmx.password │ │ ├── logback.xml │ │ ├── snmp.acl │ │ ├── tigase-http-context.xml │ │ └── tigase.conf │ ├── jars/ │ │ ├── apns-1.0.0.jar │ │ ├── commons-beanutils-1.9.2.jar │ │ ├── commons-collections-3.2.1.jar │ │ ├── commons-lang-2.6.jar │ │ ├── commons-logging-1.2.jar │ │ ├── commons-pool2-2.4.1.jar │ │ ├── derby.jar │ │ ├── derbytools.jar │ │ ├── groovy-all-2.3.7.jar │ │ ├── hamcrest-core.jar │ │ ├── jackson-annotations-2.7.3.jar │ │ ├── jackson-core-2.7.0.jar │ │ ├── jackson-databind-2.1.4.jar │ │ ├── javax.servlet-api.jar │ │ ├── jdmkrt.jar │ │ ├── jedis-2.7.2.jar │ │ ├── jetty-http.jar │ │ ├── jetty-io.jar │ │ ├── jetty-security.jar │ │ ├── jetty-server.jar │ │ ├── jetty-servlet.jar │ │ ├── jetty-util.jar │ │ ├── json.jar │ │ ├── jstun.jar │ │ ├── jtds.jar │ │ ├── jul-to-slf4j.jar │ │ ├── licence-lib.jar │ │ ├── logback-classic.jar │ │ ├── logback-core.jar │ │ ├── mongo-java-driver.jar │ │ ├── mysql-connector-java.jar │ │ ├── postgresql.jar │ │ ├── tigase-extras.jar │ │ ├── tigase-http-api.jar │ │ ├── tigase-message-archiving.jar │ │ └── tigase-web-ui.war │ ├── logs/ │ │ └── server-info.html │ ├── modules/ │ │ ├── distribution/ │ │ │ ├── pom.xml │ │ │ ├── scripts/ │ │ │ │ ├── genChangeLog.sh │ │ │ │ └── git2cl │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── assembly/ │ │ │ │ ├── dist-max.xml │ │ │ │ └── dist.xml │ │ │ └── resources/ │ │ │ └── META-INF/ │ │ │ └── java.security.Provider │ │ ├── documentation/ │ │ │ ├── .gitignore │ │ │ ├── adminguide/ │ │ │ │ ├── asciidoc/ │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── docbook-xsl.css │ │ │ │ │ ├── files/ │ │ │ │ │ │ └── StatsDumper.groovy │ │ │ │ │ ├── index.asciidoc │ │ │ │ │ └── text/ │ │ │ │ │ ├── Admin_Guide_01_-_About_Tigase_Jabber_XMPP_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_02_-_Quick_Start.asciidoc │ │ │ │ │ ├── Admin_Guide_03_-_Quick_Start_-_A_-_Installation_Using_GUI_Installer.asciidoc │ │ │ │ │ ├── Admin_Guide_04_-_Quick_Start_-_B_-_Installation_Using_Web_Installer.asciidoc │ │ │ │ │ ├── Admin_Guide_05_-_Quick_Start_-_C_-_Installing_Using_Console_Installer.asciidoc │ │ │ │ │ ├── Admin_Guide_06_-_Quick_Start_-_D_-_Manual_Installation_in_Console_Mode.asciidoc │ │ │ │ │ ├── Admin_Guide_07_-_Quick_Start_-_E_-_Windows_Installation.asciidoc │ │ │ │ │ ├── Admin_Guide_07_-_Quick_Start_-_F_-_Setting_Up_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_08_-_Latest_and_Nightly_Builds.asciidoc │ │ │ │ │ ├── Admin_Guide_09_-_Configuration.asciidoc │ │ │ │ │ ├── Admin_Guide_100_-_Using_Tigase_-_O_-_Licensing.asciidoc │ │ │ │ │ ├── Admin_Guide_101_-_Using_Tigase_-_P_-_Advanced_Options.asciidoc │ │ │ │ │ ├── Admin_Guide_102_-_Statistics_Descriptions.asciidoc │ │ │ │ │ ├── Admin_Guide_103_-_Components_-_K_-_C2S.asciidoc │ │ │ │ │ ├── Admin_Guide_104_-_Using_Tigase_-_Q_-_Clustering.asciidoc │ │ │ │ │ ├── Admin_Guide_105_-_Configuration_-_F_-_Sess-man.asciidoc │ │ │ │ │ ├── Admin_Guide_106_-_Components_-_L_-_Socks5.asciidoc │ │ │ │ │ ├── Admin_Guide_10_-_Configuration_-_A_-_Tigase_XMPP_Server_init.properties_Configuration.asciidoc │ │ │ │ │ ├── Admin_Guide_11_-_Configuration_-_B_-_Startup_Files_tigase.sh_and_tigase.asciidoc │ │ │ │ │ ├── Admin_Guide_12_-_Configuration_-_C_-_Linux_Settings_for_High_Load_Systems.asciidoc │ │ │ │ │ ├── Admin_Guide_13_-_Configuration_-_D_-_Configuration_Storage_Options.asciidoc │ │ │ │ │ ├── Admin_Guide_13_-_Configuration_-_E_-_JVM_settings.asciidoc │ │ │ │ │ ├── Admin_Guide_14_-_Security.asciidoc │ │ │ │ │ ├── Admin_Guide_15_-_Security_-_A_-_Server_Certificates.asciidoc │ │ │ │ │ ├── Admin_Guide_16_-_Security_-_A_-_Server_Certificates_-_1_-_Creating_and_Loading_the_Server_Certificate_in_PEM_Files.asciidoc │ │ │ │ │ ├── Admin_Guide_17_-_Security_-_A_-_Server_Certificates_-_2_-_Installing_StartCom_Certificate_in_your_Linux_System.asciidoc │ │ │ │ │ ├── Admin_Guide_18_-_Security_-_A_-_Server_Certificates_-_3_-_Server_Certificate_Using_Keytool_and_Keystore.asciidoc │ │ │ │ │ ├── Admin_Guide_19_-_Security_-_B_-_Authentication_Connectors.asciidoc │ │ │ │ │ ├── Admin_Guide_20_-_Security_-_B_-_Authentication_Connectors_-_1_-_Tigase_Auth_Connector.asciidoc │ │ │ │ │ ├── Admin_Guide_21_-_Security_-_B_-_Authentication_Connectors_-_2_-_Tigase_Custom_Auth_Connector.asciidoc │ │ │ │ │ ├── Admin_Guide_22_-_Security_-_B_-_Authentication_Connectors_-_3_-_Drupal_Authentication_Added.asciidoc │ │ │ │ │ ├── Admin_Guide_23_-_Security_-_B_-_Authentication_Connectors_-_4_-_LDAP_Authentication_Connector.asciidoc │ │ │ │ │ ├── Admin_Guide_24_-_Security_-_B_-_Authentication_Connectors_-_5_-_Configuration_of_SASL_EXTERNAL.asciidoc │ │ │ │ │ ├── Admin_Guide_25_-_Security_-_C_-_Packet_Filtering.asciidoc │ │ │ │ │ ├── Admin_Guide_26_-_Security_-_C_-_Packet_Filtering_-_1_-_Domain_Based_Packet_Filtering.asciidoc │ │ │ │ │ ├── Admin_Guide_27_-_Security_-_D_-_Access_Control_List.asciidoc │ │ │ │ │ ├── Admin_Guide_28_-_Database_Management.asciidoc │ │ │ │ │ ├── Admin_Guide_29_-_Database_Management_-_A_-_Database_Preparation.asciidoc │ │ │ │ │ ├── Admin_Guide_29_-_Database_Management_-_A_-_Database_Preperation_-_1_-_DbSchemaLoader.asciidoc │ │ │ │ │ ├── Admin_Guide_30_-_Database_Management_-_A_-_Database_Preparation_-_1_-_Prepare_the_MySQL_Database_for_Tigase_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_31_-_Database_Management_-_A_-_Database_Preparation_-_2_-_Prepare_the_Derby_Database_for_Tigase_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_32_-_Database_Management_-_A_-_Database_Preparation_-_3_-_Prepare_the_MS_SQL_Server_Database_for_Tigase_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_33_-_Database_Management_-_A_-_Database_Preparation_-_4_-_Prepare_the_PostgreSQL_Database_for_Tigase_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_34_-_Database_Management_-_A_-_Database_Preperation_-_5_-_Prepare_Tigase_for_MongoDB.asciidoc │ │ │ │ │ ├── Admin_Guide_35_-_Database_Management_-_B_-_Hashed_User_Passwords_in_Database.asciidoc │ │ │ │ │ ├── Admin_Guide_36_-_Database_Management_-_C_-_Tigase_Server_and_Multiple_Databases.asciidoc │ │ │ │ │ ├── Admin_Guide_37_-_Database_Management_-_D_-_Importing_User_Data.asciidoc │ │ │ │ │ ├── Admin_Guide_38_-_Database_Management_-_E_-_Integrating_Existing_Databases.asciidoc │ │ │ │ │ ├── Admin_Guide_39_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_1_-_Connecting_Tigase_Server_to_MySQL_Database.asciidoc │ │ │ │ │ ├── Admin_Guide_40_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_2_-_Integrating_Tigase_Server_with_Drupal.asciidoc │ │ │ │ │ ├── Admin_Guide_41_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_3_-_Integrating_Tigase_Server_with_LibreSource.asciidoc │ │ │ │ │ ├── Admin_Guide_42_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_4_-_MySQL_Database_Use.asciidoc │ │ │ │ │ ├── Admin_Guide_43_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_5_-_PostgreSQL_Database.asciidoc │ │ │ │ │ ├── Admin_Guide_44_-_Database_Management_-_F_-_Schema_Updates.asciidoc │ │ │ │ │ ├── Admin_Guide_45_-_Database_Managament_-_F_-_Schema_Updates_-_A_-_Tigase_Server_7.1.asciidoc │ │ │ │ │ ├── Admin_Guide_46_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x.asciidoc │ │ │ │ │ ├── Admin_Guide_47_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_1_-_Derby.asciidoc │ │ │ │ │ ├── Admin_Guide_48_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_2_-_MySQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc │ │ │ │ │ ├── Admin_Guide_49_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_3_-_PostgreSQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc │ │ │ │ │ ├── Admin_Guide_51_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x.asciidoc │ │ │ │ │ ├── Admin_Guide_52_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x_-_1_-_MySQL_Database_Schema_Upgrade_for_Tigase_4.0.asciidoc │ │ │ │ │ ├── Admin_Guide_53_-_Components.asciidoc │ │ │ │ │ ├── Admin_Guide_54_-_Components_-_A_-_StanzaSender.asciidoc │ │ │ │ │ ├── Admin_Guide_55_-_Components_-_B_-_Tigase_HTTP_API.asciidoc │ │ │ │ │ ├── Admin_Guide_56_-_Components_-_B_-_Tigase_HTTP_API_-_1_-_REST_API_Guide.asciidoc │ │ │ │ │ ├── Admin_Guide_57_-_Components_-_B_-_Tigase_HTTP_API_-_2_-_Admin_UI.asciidoc │ │ │ │ │ ├── Admin_Guide_58_-_Components_-_B_-_Tigase_HTTP_API_-_3_-_Web_Client.asciidoc │ │ │ │ │ ├── Admin_Guide_59_-_Components_-_C_-_Message_Archiving.asciidoc │ │ │ │ │ ├── Admin_Guide_60_-_Components_-_D_-_Advanced_Message_Processing_-_AMP_XEP-0079.asciidoc │ │ │ │ │ ├── Admin_Guide_61_-_Components_-_E_-_PubSub.asciidoc │ │ │ │ │ ├── Admin_Guide_62_-_Components_-_E_-_PubSub_-_1_-_Offline_Message_Sink.asciidoc │ │ │ │ │ ├── Admin_Guide_63_-_Components_-_E_-_PubSub_-_2_-_PubSub_Schema_Changes.asciidoc │ │ │ │ │ ├── Admin_Guide_64_-_Components_-_F_-_Server_Monitoring.asciidoc │ │ │ │ │ ├── Admin_Guide_65_-_Components_-_F_-_Server_Monitoring_-_1_-_Setting_up_Remote_Monitoring_in_the_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_66_-_Components_-_F_-_Server_Monitoring_-_2_-_Retrieving_statistics.asciidoc │ │ │ │ │ ├── Admin_Guide_67_-_Components_-_F_-_Server_Monitoring_-_3_-_EventBus.asciidoc │ │ │ │ │ ├── Admin_Guide_68_-_Components_-_G_-_Server_to_Server_Protocol.asciidoc │ │ │ │ │ ├── Admin_Guide_69_-_Components_-_H_-_MUC.asciidoc │ │ │ │ │ ├── Admin_Guide_70_-_Components_-_I_-_Tigase_Load_Balancing.asciidoc │ │ │ │ │ ├── Admin_Guide_71_-_Components_-_J_-_External_Component_Configuration.asciidoc │ │ │ │ │ ├── Admin_Guide_72_-_Components_-_J_-_External_Component_Configuration_-_1_-_Basic_Configuration_Options_(external_component).asciidoc │ │ │ │ │ ├── Admin_Guide_73_-_Components_-_J_-_External_Component_Configuration_-_2_-_Tigase_as_External_Component.asciidoc │ │ │ │ │ ├── Admin_Guide_74_-_Components_-_J_-_External_Component_Configuration_-_3_-_Load_Balancing_External_Components_in_Cluster_Mode.asciidoc │ │ │ │ │ ├── Admin_Guide_75_-_Virtual_Hosts_in_the_Tigase_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_76_-_Virtual_Hosts_in_the_Tigase_Server_-_A_-_Specification_for_ad-hoc_Commands_Used_to_Manage_Virtual_Domains.asciidoc │ │ │ │ │ ├── Admin_Guide_77_-_Virtual_Hosts_in_the_Tigase_Server_-_B_-_Virtual_Components_for_Cluster_Mode.asciidoc │ │ │ │ │ ├── Admin_Guide_78_-_Using_Tigase.asciidoc │ │ │ │ │ ├── Admin_Guide_79_-_Using_Tigase_-_A_-_Log_Guide.asciidoc │ │ │ │ │ ├── Admin_Guide_80_-_Using_Tigase_-_B_-_Debugging_Tigase.asciidoc │ │ │ │ │ ├── Admin_Guide_81_-_Using_Tigase_-_C_-_Basic_System_Checks.asciidoc │ │ │ │ │ ├── Admin_Guide_82_-_Using_Tigase_-_D_-_Add_and_Manage_Virtual_Domains.asciidoc │ │ │ │ │ ├── Admin_Guide_83_-_Using_Tigase_-_E_-_Presence_Forwarding.asciidoc │ │ │ │ │ ├── Admin_Guide_84_-_Using_Tigase_-_F_-_Register_Own_XMPP_Domain.asciidoc │ │ │ │ │ ├── Admin_Guide_85_-_Using_Tigase_-_G_-_Tigase_and_PyMSN-t_Transport.asciidoc │ │ │ │ │ ├── Admin_Guide_86_-_Using_Tigase_-_H_-_Two_or_more_SessionManagers.asciidoc │ │ │ │ │ ├── Admin_Guide_87_-_Using_Tigase_-_I_-_Watchdog.asciidoc │ │ │ │ │ ├── Admin_Guide_88_-_Using_Tigase_-_J_-_Tips_and_Tricks.asciidoc │ │ │ │ │ ├── Admin_Guide_89_-_Using_Tigase_-_J_-_Tips_and_Tricks_-_1_-_Tigase_Tip_Checking_the_Runtime_Environment.asciidoc │ │ │ │ │ ├── Admin_Guide_91_-_Using_Tigase_-_J_-_Tips_and_Tricks_-_3_-_Best_Practices_for_Connecting_From_Web_Browser_to_Tigase_XMPP_Server.asciidoc │ │ │ │ │ ├── Admin_Guide_92_-_Using_Tigase_-_K_-_Command_Line_Tools.asciidoc │ │ │ │ │ ├── Admin_Guide_93_-_Using_Tigase_-_K_-_Command_Line_Tools_-_1_-_Configuration_Managament_Tool.asciidoc │ │ │ │ │ ├── Admin_Guide_94_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase.asciidoc │ │ │ │ │ ├── Admin_Guide_95_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_1_-_Scripting_Introduction_-_Hello_World.asciidoc │ │ │ │ │ ├── Admin_Guide_96_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_2_-_Tigase_Scripting_Version_4.4.x_Update_for_Administrators.asciidoc │ │ │ │ │ ├── Admin_Guide_97_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_3_-_Tigase_and_Python.asciidoc │ │ │ │ │ ├── Admin_Guide_98_-_Using_Tigase_-_M_-_Configuration_Wizards.asciidoc │ │ │ │ │ ├── Admin_Guide_99_-_Using_Tigase_-_N_-_Offline_Messages.asciidoc │ │ │ │ │ └── Tigase_v7.1.0.asciidoc │ │ │ │ └── pom.xml │ │ │ ├── devguide/ │ │ │ │ ├── asciidoc/ │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── docbook-xsl.css │ │ │ │ │ ├── files/ │ │ │ │ │ │ └── tigase-server.psf │ │ │ │ │ ├── index.asciidoc │ │ │ │ │ └── text/ │ │ │ │ │ ├── Development_Guide_01_-_Basic_Information.asciidoc │ │ │ │ │ ├── Development_Guide_02_-_Hack_Tigase_Jabber-XMPP_Server_in_Eclipse.asciidoc │ │ │ │ │ ├── Development_Guide_03_-_API_Changes_in_Tigase_Server_5.x.asciidoc │ │ │ │ │ ├── Development_Guide_04_-_Server_Compilation.asciidoc │ │ │ │ │ ├── Development_Guide_05_-_Tigase_XMPP_Server_5.2.0_and_Later_-_Compilation_and_Generating_Distribution_Packages.asciidoc │ │ │ │ │ ├── Development_Guide_06_-_Tigase_Packages_Dependency_Change_-_Server_Compilation_Version_4.x_or_Later.asciidoc │ │ │ │ │ ├── Development_Guide_07_-_Server_Compilation_-_Version_2.x_and_3.x.asciidoc │ │ │ │ │ ├── Development_Guide_08_-_Component_Development.asciidoc │ │ │ │ │ ├── Development_Guide_09_-_Component_Implementation_-_Lesson_1_-_Basics.asciidoc │ │ │ │ │ ├── Development_Guide_10_-_Component_Implementation_-_Lesson_2_-_Configuration.asciidoc │ │ │ │ │ ├── Development_Guide_11_-_Component_Implementation_-_Lesson_3_-_Multi-threading.asciidoc │ │ │ │ │ ├── Development_Guide_12_-_Component_Implementation_-_Lesson_4_-_Service_Discovery.asciidoc │ │ │ │ │ ├── Development_Guide_13_-_Component_Implementation_-_Lesson_5_-_Statistics.asciidoc │ │ │ │ │ ├── Development_Guide_14_-_Component_Implementation_-_Lesson_6_-_Scripting_Support.asciidoc │ │ │ │ │ ├── Development_Guide_15_-_Component_Implementation_-_Lesson_7_-_Data_Repository.asciidoc │ │ │ │ │ ├── Development_Guide_16_-_Component_Implementation_-_Lesson_8_-_Startup_Time.asciidoc │ │ │ │ │ ├── Development_Guide_17_-_Configuration_API.asciidoc │ │ │ │ │ ├── Development_Guide_18_-_Packet_Filtering_in_Component.asciidoc │ │ │ │ │ ├── Development_Guide_19_-_Plugin_Development.asciidoc │ │ │ │ │ ├── Development_Guide_20_-_Writing_Plugin_Code.asciidoc │ │ │ │ │ ├── Development_Guide_21_-_Plugin_Configuration.asciidoc │ │ │ │ │ ├── Development_Guide_22_-_How_Packets_are_Processed_by_the_SM_and_Plugins.asciidoc │ │ │ │ │ ├── Development_Guide_23_-_SASL_Custom_Mechanisms_and_Configuration.asciidoc │ │ │ │ │ ├── Development_Guide_24_-_Using_Maven.asciidoc │ │ │ │ │ ├── Development_Guide_25_-_Setting_Up_Maven_In_Windows.asciidoc │ │ │ │ │ ├── Development_Guide_26_-_A_Very_Short_Maven_Guide.asciidoc │ │ │ │ │ ├── Development_Guide_27_-_Maven_2.x_Support.asciidoc │ │ │ │ │ ├── Development_Guide_28_-_Tests.asciidoc │ │ │ │ │ ├── Development_Guide_29_-_Tigase_Test_Suite.asciidoc │ │ │ │ │ ├── Development_Guide_30_-_Test_Suite_Scripting_Language.asciidoc │ │ │ │ │ ├── Development_Guide_31_-_Writing_Tests_for_Plugins.asciidoc │ │ │ │ │ ├── Development_Guide_32_-_Test_Case_Parameters_Description.asciidoc │ │ │ │ │ ├── Development_Guide_33_-_Experimental.asciidoc │ │ │ │ │ ├── Development_Guide_34_-_Dynamic_Rosters.asciidoc │ │ │ │ │ ├── Development_Guide_35_-_Mobile_Optimizations.asciidoc │ │ │ │ │ ├── Development_Guide_36_-_Bosh_Session_Cache.asciidoc │ │ │ │ │ ├── Development_Guide_37_-_Old_Stuff.asciidoc │ │ │ │ │ ├── Development_Guide_38_-_Tigase_DB_Schema_Explained.asciidoc │ │ │ │ │ ├── Development_Guide_39_-_Why_the_Most_Recent_JDK.asciidoc │ │ │ │ │ ├── Development_Guide_40_-_Generating_Tigase_Installer.asciidoc │ │ │ │ │ ├── Development_Guide_41_-_API_Description_for_Virtual_Domains_Management_in_the_Tigase_Server.asciidoc │ │ │ │ │ ├── Development_Guide_42_-_Cluster_Map_Interface.asciidoc │ │ │ │ │ ├── Development_Guide_43_-_EventBus_API.asciidoc │ │ │ │ │ ├── Development_Guide_44_-_Stanza_Limitations.asciidoc │ │ │ │ │ └── Development_Guide_XX_-_Hack_Tigase_Jabber-XMPP_Server_in_Eclipse.asciidoc │ │ │ │ └── pom.xml │ │ │ ├── pom.xml │ │ │ ├── propertiesguide/ │ │ │ │ ├── asciidoc/ │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── docbook-xsl.css │ │ │ │ │ ├── files/ │ │ │ │ │ │ └── .gitignore │ │ │ │ │ ├── images/ │ │ │ │ │ │ └── .gitignore │ │ │ │ │ ├── index.asciidoc │ │ │ │ │ └── text/ │ │ │ │ │ ├── Properties_Guide_01_-_--admins.asciidoc │ │ │ │ │ ├── Properties_Guide_02_-_--auth-db.asciidoc │ │ │ │ │ ├── Properties_Guide_03_-_--auth-db-uri.asciidoc │ │ │ │ │ ├── Properties_Guide_04_-_--auth-domain-repo-pool.asciidoc │ │ │ │ │ ├── Properties_Guide_05_-_--auth-repo-pool.asciidoc │ │ │ │ │ ├── Properties_Guide_06_-_--auth-repo-pool-size.asciidoc │ │ │ │ │ ├── Properties_Guide_07_-_--bind-ext-hostnames.asciidoc │ │ │ │ │ ├── Properties_Guide_08_-_--bosh-close-connection.asciidoc │ │ │ │ │ ├── Properties_Guide_09_-_--bosh-extra-headers-file.asciidoc │ │ │ │ │ ├── Properties_Guide_10_-_--cl-conn-repo-class.asciidoc │ │ │ │ │ ├── Properties_Guide_11_-_--client-access-policy-file.asciidoc │ │ │ │ │ ├── Properties_Guide_12_-_--cluster-connect-all.asciidoc │ │ │ │ │ ├── Properties_Guide_13_-_--cluster-mode.asciidoc │ │ │ │ │ ├── Properties_Guide_14_-_--cluster-nodes.asciidoc │ │ │ │ │ ├── Properties_Guide_15_-_--cm-ht-traffic-throttling.asciidoc │ │ │ │ │ ├── Properties_Guide_16_-_--cm-see-other-host.asciidoc │ │ │ │ │ ├── Properties_Guide_17_-_--cm-traffic-throttling.asciidoc │ │ │ │ │ ├── Properties_Guide_18_-_--cmpname-ports.asciidoc │ │ │ │ │ ├── Properties_Guide_19_-_--comp-class.asciidoc │ │ │ │ │ ├── Properties_Guide_20_-_--comp-name.asciidoc │ │ │ │ │ ├── Properties_Guide_21_-_--cross-domain-policy-file.asciidoc │ │ │ │ │ ├── Properties_Guide_22_-_--data-repo-pool-size.asciidoc │ │ │ │ │ ├── Properties_Guide_23_-_--debug.asciidoc │ │ │ │ │ ├── Properties_Guide_24_-_--debug-packages.asciidoc │ │ │ │ │ ├── Properties_Guide_25_-_--domain-filter-policy.asciidoc │ │ │ │ │ ├── Properties_Guide_26_-_--elements-number-limit.asciidoc │ │ │ │ │ ├── Properties_Guide_27_-_--ext-comp.asciidoc │ │ │ │ │ ├── Properties_Guide_28_-_--extcomp-repo-class.asciidoc │ │ │ │ │ ├── Properties_Guide_29_-_--external.asciidoc │ │ │ │ │ ├── Properties_Guide_30_-_--hardened-mode.asciidoc │ │ │ │ │ ├── Properties_Guide_31_-_--max-queue-size.asciidoc │ │ │ │ │ ├── Properties_Guide_32_-_--monitoring.asciidoc │ │ │ │ │ ├── Properties_Guide_33_-_--net-buff-high-throughput.asciidoc │ │ │ │ │ ├── Properties_Guide_34_-_--net-buff-standard.asciidoc │ │ │ │ │ ├── Properties_Guide_35_-_--new-connections-throttling.asciidoc │ │ │ │ │ ├── Properties_Guide_36_-_--nonpriority-queue.asciidoc │ │ │ │ │ ├── Properties_Guide_37_-_--queue-implementation.asciidoc │ │ │ │ │ ├── Properties_Guide_38_-_--roster-implementation.asciidoc │ │ │ │ │ ├── Properties_Guide_39_-_--s2s-ejabberd-bug-workaround-active.asciidoc │ │ │ │ │ ├── Properties_Guide_40_-_--s2s-secret.asciidoc │ │ │ │ │ ├── Properties_Guide_41_-_--s2s-skip-tls-hostnames.asciidoc │ │ │ │ │ ├── Properties_Guide_42_-_--script-dir.asciidoc │ │ │ │ │ ├── Properties_Guide_43_-_--sm-cluster-strategy-class.asciidoc │ │ │ │ │ ├── Properties_Guide_44_-_--sm-plugins.asciidoc │ │ │ │ │ ├── Properties_Guide_45_-_--sm-threads-pool.asciidoc │ │ │ │ │ ├── Properties_Guide_46_-_--ssl-certs-location.asciidoc │ │ │ │ │ ├── Properties_Guide_47_-_--ssl-container-class.asciidoc │ │ │ │ │ ├── Properties_Guide_48_-_--ssl-def-cert-domain.asciidoc │ │ │ │ │ ├── Properties_Guide_49_-_--stats-archiv.asciidoc │ │ │ │ │ ├── Properties_Guide_50_-_--stats-history.asciidoc │ │ │ │ │ ├── Properties_Guide_51_-_--stringprep-processor.asciidoc │ │ │ │ │ ├── Properties_Guide_52_-_--test.asciidoc │ │ │ │ │ ├── Properties_Guide_53_-_--tigase-config-repo-class.asciidoc │ │ │ │ │ ├── Properties_Guide_54_-_--tigase-config-repo-uri.asciidoc │ │ │ │ │ ├── Properties_Guide_55_-_--tls-jdk-nss-bug-workaround-active.asciidoc │ │ │ │ │ ├── Properties_Guide_56_-_--trusted.asciidoc │ │ │ │ │ ├── Properties_Guide_57_-_--user-db.asciidoc │ │ │ │ │ ├── Properties_Guide_58_-_--user-db-uri.asciidoc │ │ │ │ │ ├── Properties_Guide_59_-_--user-domain-repo-pool.asciidoc │ │ │ │ │ ├── Properties_Guide_60_-_--user-repo-pool.asciidoc │ │ │ │ │ ├── Properties_Guide_61_-_--user-repo-pool-size.asciidoc │ │ │ │ │ ├── Properties_Guide_62_-_--vhost-anonymous-enabled.asciidoc │ │ │ │ │ ├── Properties_Guide_63_-_--vhost-disable-dns-check.asciidoc │ │ │ │ │ ├── Properties_Guide_64_-_--vhost-max-users.asciidoc │ │ │ │ │ ├── Properties_Guide_65_-_--vhost-message-forward-jid.asciidoc │ │ │ │ │ ├── Properties_Guide_66_-_--vhost-presence-forward-jid.asciidoc │ │ │ │ │ ├── Properties_Guide_67_-_--vhost-register-enabled.asciidoc │ │ │ │ │ ├── Properties_Guide_68_-_--vhost-tls-required.asciidoc │ │ │ │ │ ├── Properties_Guide_69_-_--virt-hosts.asciidoc │ │ │ │ │ ├── Properties_Guide_70_-_--watchdog_delay.asciidoc │ │ │ │ │ ├── Properties_Guide_71_-_--watchdog_ping_type.asciidoc │ │ │ │ │ ├── Properties_Guide_72_-_--watchdog_timeout.asciidoc │ │ │ │ │ ├── Properties_Guide_73_-_-config-type.asciidoc │ │ │ │ │ └── Properties_Guide_74_-_--ws-allow-unmasked-frames.asciidoc │ │ │ │ └── pom.xml │ │ │ └── userguide/ │ │ │ ├── asciidoc/ │ │ │ │ ├── css/ │ │ │ │ │ └── docbook-xsl.css │ │ │ │ ├── files/ │ │ │ │ │ └── .gitignore │ │ │ │ ├── images/ │ │ │ │ │ └── tigase-register-2-s.png.1 │ │ │ │ ├── index.asciidoc │ │ │ │ └── text/ │ │ │ │ ├── UserGuide.asciidoc │ │ │ │ ├── User_Guide_01_Jabber_XMPP_Introduction.asciidoc │ │ │ │ ├── User_Guide_02_Installing_Minichat_on_your_Website.asciidoc │ │ │ │ ├── User_Guide_03_How_to_use_Tigase_Service.asciidoc │ │ │ │ ├── User_Guide_04_Psi_Initial_Configuration.asciidoc │ │ │ │ ├── User_Guide_05_Tigase_Service_and_MSN_Transport_from_Client_Side.asciidoc │ │ │ │ └── User_Guide_06_Jeti_and_MSN_Transport_on_tigase.org.asciidoc │ │ │ └── pom.xml │ │ └── master/ │ │ └── pom.xml │ ├── package-list/ │ │ └── package-list │ ├── package.html │ ├── pom.xml │ ├── scripts/ │ │ ├── admin/ │ │ │ ├── AddUser.groovy │ │ │ ├── AddUserTracker.groovy │ │ │ ├── BoshPreBindSession.groovy │ │ │ ├── BroadcastToOnline.groovy │ │ │ ├── ChangeUserPassword.groovy │ │ │ ├── CompManager.groovy │ │ │ ├── CompRepoItemAdd.groovy │ │ │ ├── CompRepoItemRemove.groovy │ │ │ ├── CompRepoItemUpdate.groovy │ │ │ ├── CompRepoReload.groovy │ │ │ ├── ConfigList.groovy │ │ │ ├── ConnectionTime.groovy │ │ │ ├── CreateNode.groovy │ │ │ ├── DNSQuery.groovy │ │ │ ├── DeleteNode.groovy │ │ │ ├── DeleteUser.groovy │ │ │ ├── ForceStopServiceForKey.groovy │ │ │ ├── GetAnyFile.groovy │ │ │ ├── GetConfigFile.groovy │ │ │ ├── GetInitPropertiesFromMemory.groovy │ │ │ ├── GetListOfActiveUsers.groovy │ │ │ ├── GetListOfClusterNodes.groovy │ │ │ ├── GetListOfIdleUsers.groovy │ │ │ ├── GetListOfOnlineUsers.groovy │ │ │ ├── GetNumberOfActiveUsers.groovy │ │ │ ├── GetNumberOfIdleUsers.groovy │ │ │ ├── GetRegisteredUserList.groovy │ │ │ ├── GetTopActiveUsers.groovy │ │ │ ├── GetUserRoster.groovy │ │ │ ├── ListCommands.groovy │ │ │ ├── ListServiceKeys.groovy │ │ │ ├── LoadErrors.groovy │ │ │ ├── OAuthCredentials.groovy │ │ │ ├── PluginManager.groovy │ │ │ ├── PublishItem.groovy │ │ │ ├── RemoveUserTracker.groovy │ │ │ ├── RosterFixer.groovy │ │ │ ├── RosterFixerCluster.groovy │ │ │ ├── S2SBadConnectionStates.groovy │ │ │ ├── S2SCIDState.groovy │ │ │ ├── S2SResetBadConnections.groovy │ │ │ ├── SSLCertificateAdd.groovy │ │ │ ├── SimServiceStopped.groovy │ │ │ ├── SubscribeNode.groovy │ │ │ ├── UnsubscribeNode.groovy │ │ │ ├── UserDomainFilter.groovy │ │ │ ├── UserRosterManagement.groovy │ │ │ ├── UserRosterManagementExt.groovy │ │ │ ├── UserStatistics.groovy │ │ │ ├── example_HelloWorld.groovy │ │ │ └── example_TigaseScriptingGuide.groovy │ │ ├── config.sh │ │ ├── db-create-derby.cmd │ │ ├── db-create-derby.sh │ │ ├── db-create-mysql.sh │ │ ├── db-create-postgresql.sh │ │ ├── db-create-sqlserver.cmd │ │ ├── db-create.sh │ │ ├── debian/ │ │ │ ├── changelog │ │ │ ├── compat │ │ │ ├── control │ │ │ ├── copyright │ │ │ ├── init-debian.properties │ │ │ ├── rules │ │ │ ├── tigase-debian.conf │ │ │ ├── tigase-install.sh │ │ │ ├── tigase.default │ │ │ ├── tigase.dirs │ │ │ ├── tigase.init.d │ │ │ ├── tigase.postinst │ │ │ └── tigase.postrm │ │ ├── gentoo/ │ │ │ ├── conf.d/ │ │ │ │ └── tigase │ │ │ └── init.d/ │ │ │ └── tigase │ │ ├── installer-generate.sh │ │ ├── installer-prepare.sh │ │ ├── machine-check.sh │ │ ├── mandriva/ │ │ │ └── init.d/ │ │ │ └── tigase │ │ ├── pubsub/ │ │ │ └── repository_migrator.groovy │ │ ├── redhat/ │ │ │ └── init.d/ │ │ │ └── tigase │ │ ├── repo.sh │ │ ├── rest/ │ │ │ ├── adhoc/ │ │ │ │ └── AdHoc.groovy │ │ │ ├── avatar/ │ │ │ │ ├── AvatarGet.groovy │ │ │ │ └── AvatarPutNoAuth.groovy │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── index.html │ │ │ ├── static/ │ │ │ │ └── chart_legend_templates.js │ │ │ ├── stats/ │ │ │ │ ├── ComponentStats.groovy │ │ │ │ ├── ComponentStatsGet.html │ │ │ │ ├── ServerStats.groovy │ │ │ │ └── ServerStatsGet.html │ │ │ ├── stream/ │ │ │ │ └── Stream.groovy │ │ │ ├── user/ │ │ │ │ ├── UserAdmin.groovy │ │ │ │ ├── UserAdminGet.html │ │ │ │ ├── UserUser.groovy │ │ │ │ └── UserUserGet.html │ │ │ └── users/ │ │ │ ├── UsersDomainList.groovy │ │ │ ├── UsersDomainListGet.html │ │ │ ├── UsersList.groovy │ │ │ └── UsersListGet.html │ │ ├── restart-all-servers.sh │ │ ├── stop-all-servers.sh │ │ ├── tigase.sh │ │ ├── update-all-servers.sh │ │ ├── update-code-functions.sh │ │ ├── update-code.sh │ │ └── user_roster.sh │ ├── src/ │ │ ├── main/ │ │ │ ├── bash/ │ │ │ │ ├── cron-dnotify-check.sh │ │ │ │ └── users-list-moitor.sh │ │ │ ├── groovy/ │ │ │ │ └── tigase/ │ │ │ │ ├── admin/ │ │ │ │ │ ├── AddUser.groovy │ │ │ │ │ ├── AddUserTracker.groovy │ │ │ │ │ ├── BoshPreBindSession.groovy │ │ │ │ │ ├── BroadcastToOnline.groovy │ │ │ │ │ ├── ChangeUserPassword.groovy │ │ │ │ │ ├── CompManager.groovy │ │ │ │ │ ├── CompRepoItemAdd.groovy │ │ │ │ │ ├── CompRepoItemRemove.groovy │ │ │ │ │ ├── CompRepoItemUpdate.groovy │ │ │ │ │ ├── CompRepoReload.groovy │ │ │ │ │ ├── ConfigList.groovy │ │ │ │ │ ├── ConnectionTime.groovy │ │ │ │ │ ├── DNSQuery.groovy │ │ │ │ │ ├── DeleteUser.groovy │ │ │ │ │ ├── EditUser.groovy │ │ │ │ │ ├── EndUserSession.groovy │ │ │ │ │ ├── ForceStopServiceForKey.groovy │ │ │ │ │ ├── GetAnyFile.groovy │ │ │ │ │ ├── GetConfigFile.groovy │ │ │ │ │ ├── GetInitPropertiesFromMemory.groovy │ │ │ │ │ ├── GetListOfActiveUsers.groovy │ │ │ │ │ ├── GetListOfClusterNodes.groovy │ │ │ │ │ ├── GetListOfIdleUsers.groovy │ │ │ │ │ ├── GetListOfOnlineUsers.groovy │ │ │ │ │ ├── GetNumberOfActiveUsers.groovy │ │ │ │ │ ├── GetNumberOfIdleUsers.groovy │ │ │ │ │ ├── GetRegisteredUserList.groovy │ │ │ │ │ ├── GetTopActiveUsers.groovy │ │ │ │ │ ├── GetUserInfo.groovy │ │ │ │ │ ├── GetUserRoster.groovy │ │ │ │ │ ├── ListCommands.groovy │ │ │ │ │ ├── ListServiceKeys.groovy │ │ │ │ │ ├── LoadErrors.groovy │ │ │ │ │ ├── OAuthCredentials.groovy │ │ │ │ │ ├── PluginManager.groovy │ │ │ │ │ ├── RemoveUserTracker.groovy │ │ │ │ │ ├── RosterFixer.groovy │ │ │ │ │ ├── RosterFixerCluster.groovy │ │ │ │ │ ├── S2SBadConnectionStates.groovy │ │ │ │ │ ├── S2SCIDState.groovy │ │ │ │ │ ├── S2SResetBadConnections.groovy │ │ │ │ │ ├── SSLCertificateAdd.groovy │ │ │ │ │ ├── SimServiceStopped.groovy │ │ │ │ │ ├── UserDomainFilter.groovy │ │ │ │ │ ├── UserRosterManagement.groovy │ │ │ │ │ ├── UserRosterManagementExt.groovy │ │ │ │ │ ├── UserStatistics.groovy │ │ │ │ │ ├── example_HelloWorld.groovy │ │ │ │ │ ├── example_TigaseScriptingGuide.groovy │ │ │ │ │ └── template.html │ │ │ │ └── converter/ │ │ │ │ ├── Feeder.groovy │ │ │ │ ├── OpenFire.groovy │ │ │ │ ├── README │ │ │ │ ├── converter.groovy │ │ │ │ ├── converter.sh │ │ │ │ ├── ejabberd.groovy │ │ │ │ └── jabberd2.groovy │ │ │ ├── izpack/ │ │ │ │ ├── README.txt │ │ │ │ ├── RegistrySpec.xml │ │ │ │ ├── Unix_shortcutSpec.xml │ │ │ │ ├── changes.patch │ │ │ │ ├── install.xml │ │ │ │ ├── java/ │ │ │ │ │ ├── DerbyPathPanel.java │ │ │ │ │ ├── DerbyPathPanelConsoleHelper.java │ │ │ │ │ ├── TigaseCheckPanelConsoleHelper.java │ │ │ │ │ ├── TigaseConfigConst.java │ │ │ │ │ ├── TigaseConfigLoadPanel.java │ │ │ │ │ ├── TigaseConfigLoadPanelConsoleHelper.java │ │ │ │ │ ├── TigaseConfigSavePanel.java │ │ │ │ │ ├── TigaseConfigSavePanelConsoleHelper.java │ │ │ │ │ ├── TigaseDBCheckPanel.java │ │ │ │ │ ├── TigaseDBCheckPanelConsoleHelper.java │ │ │ │ │ ├── TigaseInstallerCommon.java │ │ │ │ │ ├── TigaseInstallerDBHelper.java │ │ │ │ │ ├── TigaseInstallerDbHelperFunctionalTest.java │ │ │ │ │ ├── TigaseJDKPathPanel.java │ │ │ │ │ └── TigaseJDKPathPanelConsoleHelper.java │ │ │ │ ├── resources/ │ │ │ │ │ ├── packsLang.xml │ │ │ │ │ ├── panelsLangPack.xml │ │ │ │ │ └── target_windows.dir │ │ │ │ ├── shortcutSpec.xml │ │ │ │ └── userInputSpec.xml │ │ │ ├── java/ │ │ │ │ └── tigase/ │ │ │ │ ├── annotations/ │ │ │ │ │ ├── TODO.java │ │ │ │ │ └── TigaseDeprecatedComponent.java │ │ │ │ ├── apns/ │ │ │ │ │ ├── APNSDBFactory.java │ │ │ │ │ ├── APNSDBProvider.java │ │ │ │ │ ├── APNSManager.java │ │ │ │ │ └── MySqlAPNSProvider.java │ │ │ │ ├── auth/ │ │ │ │ │ ├── AuthRepositoryAware.java │ │ │ │ │ ├── Aware.java │ │ │ │ │ ├── CallbackHandlerFactory.java │ │ │ │ │ ├── DefaultMechanismSelector.java │ │ │ │ │ ├── DomainAware.java │ │ │ │ │ ├── MechanismSelector.java │ │ │ │ │ ├── MechanismSelectorFactory.java │ │ │ │ │ ├── NonAuthUserRepositoryAware.java │ │ │ │ │ ├── PluginSettingsAware.java │ │ │ │ │ ├── SessionAware.java │ │ │ │ │ ├── TigaseSaslProvider.java │ │ │ │ │ ├── XmppSaslException.java │ │ │ │ │ ├── callbacks/ │ │ │ │ │ │ ├── ChannelBindingCallback.java │ │ │ │ │ │ ├── PBKDIterationsCallback.java │ │ │ │ │ │ ├── SaltCallback.java │ │ │ │ │ │ ├── SaltedPasswordCallback.java │ │ │ │ │ │ ├── ValidateCertificateData.java │ │ │ │ │ │ ├── VerifyPasswordCallback.java │ │ │ │ │ │ └── XMPPSessionCallback.java │ │ │ │ │ ├── impl/ │ │ │ │ │ │ ├── AuthRepoPlainCallbackHandler.java │ │ │ │ │ │ ├── CertBasedCallbackHandler.java │ │ │ │ │ │ ├── PlainSPCallbackHandler.java │ │ │ │ │ │ ├── ScramCallbackHandler.java │ │ │ │ │ │ └── ScramSPCallbackHandler.java │ │ │ │ │ └── mechanisms/ │ │ │ │ │ ├── AbstractSasl.java │ │ │ │ │ ├── AbstractSaslSCRAM.java │ │ │ │ │ ├── SaslANONYMOUS.java │ │ │ │ │ ├── SaslEXTERNAL.java │ │ │ │ │ ├── SaslPLAIN.java │ │ │ │ │ ├── SaslSCRAM.java │ │ │ │ │ ├── SaslSCRAMPlus.java │ │ │ │ │ └── TigaseSaslServerFactory.java │ │ │ │ ├── cluster/ │ │ │ │ │ ├── AmpComponentClustered.java │ │ │ │ │ ├── BoshConnectionClustered.java │ │ │ │ │ ├── ClientConnectionClustered.java │ │ │ │ │ ├── ClusterConnection.java │ │ │ │ │ ├── ClusterConnectionManager.java │ │ │ │ │ ├── ClusterConnectionSelector.java │ │ │ │ │ ├── ClusterConnectionSelectorOld.java │ │ │ │ │ ├── ClusterController.java │ │ │ │ │ ├── MonitorClustered.java │ │ │ │ │ ├── SessionManagerClustered.java │ │ │ │ │ ├── VirtualComponent.java │ │ │ │ │ ├── WebSocketClientConnectionClustered.java │ │ │ │ │ ├── api/ │ │ │ │ │ │ ├── ClusterCommandException.java │ │ │ │ │ │ ├── ClusterConnectionHandler.java │ │ │ │ │ │ ├── ClusterConnectionSelectorIfc.java │ │ │ │ │ │ ├── ClusterControllerIfc.java │ │ │ │ │ │ ├── ClusterElement.java │ │ │ │ │ │ ├── ClusteredComponentIfc.java │ │ │ │ │ │ ├── CommandListener.java │ │ │ │ │ │ ├── CommandListenerAbstract.java │ │ │ │ │ │ └── SessionManagerClusteredIfc.java │ │ │ │ │ ├── repo/ │ │ │ │ │ │ ├── ClConConfigRepository.java │ │ │ │ │ │ ├── ClConDirRepository.java │ │ │ │ │ │ ├── ClConRepoDefaults.java │ │ │ │ │ │ ├── ClConSQLRepository.java │ │ │ │ │ │ ├── ClusterRepoConstants.java │ │ │ │ │ │ └── ClusterRepoItem.java │ │ │ │ │ └── strategy/ │ │ │ │ │ ├── ClusteringStrategyIfc.java │ │ │ │ │ ├── ConnectionRecord.java │ │ │ │ │ ├── ConnectionRecordIfc.java │ │ │ │ │ ├── DefaultClusteringStrategy.java │ │ │ │ │ ├── DefaultClusteringStrategyAbstract.java │ │ │ │ │ ├── SMNonCachingAllNodes.java │ │ │ │ │ └── cmd/ │ │ │ │ │ └── PacketForwardCmd.java │ │ │ │ ├── component/ │ │ │ │ │ ├── AbstractComponent.java │ │ │ │ │ ├── AbstractContext.java │ │ │ │ │ ├── Context.java │ │ │ │ │ ├── PacketWriter.java │ │ │ │ │ ├── adhoc/ │ │ │ │ │ │ ├── AdHocCommand.java │ │ │ │ │ │ ├── AdHocCommandException.java │ │ │ │ │ │ ├── AdHocCommandManager.java │ │ │ │ │ │ ├── AdHocResponse.java │ │ │ │ │ │ ├── AdHocScriptCommandManager.java │ │ │ │ │ │ ├── AdHocSession.java │ │ │ │ │ │ └── AdhHocRequest.java │ │ │ │ │ ├── exceptions/ │ │ │ │ │ │ ├── ComponentException.java │ │ │ │ │ │ └── RepositoryException.java │ │ │ │ │ ├── modules/ │ │ │ │ │ │ ├── AbstractModule.java │ │ │ │ │ │ ├── ContextAware.java │ │ │ │ │ │ ├── InitializingModule.java │ │ │ │ │ │ ├── Module.java │ │ │ │ │ │ ├── ModuleProvider.java │ │ │ │ │ │ ├── ModulesManager.java │ │ │ │ │ │ └── impl/ │ │ │ │ │ │ ├── AdHocCommandModule.java │ │ │ │ │ │ ├── DiscoveryModule.java │ │ │ │ │ │ ├── JabberVersionModule.java │ │ │ │ │ │ └── XmppPingModule.java │ │ │ │ │ └── responses/ │ │ │ │ │ ├── AsyncCallback.java │ │ │ │ │ ├── DefaultResponseHandler.java │ │ │ │ │ └── ResponseManager.java │ │ │ │ ├── conf/ │ │ │ │ │ ├── ConfigItem.java │ │ │ │ │ ├── ConfigRepositoryIfc.java │ │ │ │ │ ├── ConfigSQLRepository.java │ │ │ │ │ ├── ConfigXMLRepository.java │ │ │ │ │ ├── Configurable.java │ │ │ │ │ ├── ConfigurationCache.java │ │ │ │ │ ├── ConfigurationException.java │ │ │ │ │ ├── Configurator.java │ │ │ │ │ ├── ConfiguratorAbstract.java │ │ │ │ │ ├── ConfiguratorOld.java │ │ │ │ │ └── MonitoringSetupIfc.java │ │ │ │ ├── db/ │ │ │ │ │ ├── AuthRepository.java │ │ │ │ │ ├── AuthRepositoryImpl.java │ │ │ │ │ ├── AuthRepositoryMDImpl.java │ │ │ │ │ ├── AuthRepositoryPool.java │ │ │ │ │ ├── AuthorizationException.java │ │ │ │ │ ├── DBInitException.java │ │ │ │ │ ├── DataOverwriteException.java │ │ │ │ │ ├── DataRepository.java │ │ │ │ │ ├── DataRepositoryPool.java │ │ │ │ │ ├── DummyRepository.java │ │ │ │ │ ├── MsgRepositoryIfc.java │ │ │ │ │ ├── NonAuthUserRepository.java │ │ │ │ │ ├── NonAuthUserRepositoryImpl.java │ │ │ │ │ ├── Repository.java │ │ │ │ │ ├── RepositoryFactory.java │ │ │ │ │ ├── TigaseDBException.java │ │ │ │ │ ├── UserExistsException.java │ │ │ │ │ ├── UserNotFoundException.java │ │ │ │ │ ├── UserRepository.java │ │ │ │ │ ├── UserRepositoryMDImpl.java │ │ │ │ │ ├── UserRepositoryPool.java │ │ │ │ │ ├── comp/ │ │ │ │ │ │ ├── ComponentRepository.java │ │ │ │ │ │ ├── ConfigRepository.java │ │ │ │ │ │ ├── RepositoryChangeListenerIfc.java │ │ │ │ │ │ ├── RepositoryItem.java │ │ │ │ │ │ ├── RepositoryItemAbstract.java │ │ │ │ │ │ └── UserRepoRepository.java │ │ │ │ │ ├── derby/ │ │ │ │ │ │ └── StoredProcedures.java │ │ │ │ │ ├── jdbc/ │ │ │ │ │ │ ├── DataRepositoryImpl.java │ │ │ │ │ │ ├── DrupalWPAuth.java │ │ │ │ │ │ ├── JDBCRepository.java │ │ │ │ │ │ ├── TigaseAuth.java │ │ │ │ │ │ ├── TigaseCustomAuth.java │ │ │ │ │ │ └── TigaseSPAuth.java │ │ │ │ │ ├── ldap/ │ │ │ │ │ │ └── LdapAuthProvider.java │ │ │ │ │ └── xml/ │ │ │ │ │ └── XMLRepository.java │ │ │ │ ├── disco/ │ │ │ │ │ ├── ServiceEntity.java │ │ │ │ │ ├── ServiceIdentity.java │ │ │ │ │ ├── XMPPService.java │ │ │ │ │ └── XMPPServiceCollector.java │ │ │ │ ├── disteventbus/ │ │ │ │ │ ├── DistEventBusException.java │ │ │ │ │ ├── EventBus.java │ │ │ │ │ ├── EventBusFactory.java │ │ │ │ │ ├── EventHandler.java │ │ │ │ │ ├── FireEventException.java │ │ │ │ │ ├── component/ │ │ │ │ │ │ ├── AbstractEventBusModule.java │ │ │ │ │ │ ├── AddListenerScriptCommand.java │ │ │ │ │ │ ├── ElemPathCriteria.java │ │ │ │ │ │ ├── EventBusComponent.java │ │ │ │ │ │ ├── EventBusContext.java │ │ │ │ │ │ ├── EventPublisherModule.java │ │ │ │ │ │ ├── EventReceiverModule.java │ │ │ │ │ │ ├── ListenerScript.java │ │ │ │ │ │ ├── ListenerScriptRegistrar.java │ │ │ │ │ │ ├── NodeNameUtil.java │ │ │ │ │ │ ├── RemoveListenerScriptCommand.java │ │ │ │ │ │ ├── SubscribeModule.java │ │ │ │ │ │ ├── UnsubscribeModule.java │ │ │ │ │ │ └── stores/ │ │ │ │ │ │ ├── Affiliation.java │ │ │ │ │ │ ├── AffiliationStore.java │ │ │ │ │ │ ├── Subscription.java │ │ │ │ │ │ └── SubscriptionStore.java │ │ │ │ │ └── impl/ │ │ │ │ │ ├── EventName.java │ │ │ │ │ ├── EventsNameMap.java │ │ │ │ │ └── LocalEventBus.java │ │ │ │ ├── io/ │ │ │ │ │ ├── BufferUnderflowException.java │ │ │ │ │ ├── CertFilesTrustManager.java │ │ │ │ │ ├── IOInterface.java │ │ │ │ │ ├── SSLContextContainer.java │ │ │ │ │ ├── SSLContextContainerIfc.java │ │ │ │ │ ├── SampleSocketThread.java │ │ │ │ │ ├── SocketIO.java │ │ │ │ │ ├── TLSEventHandler.java │ │ │ │ │ ├── TLSIO.java │ │ │ │ │ ├── TLSStatus.java │ │ │ │ │ ├── TLSUtil.java │ │ │ │ │ ├── TLSWrapper.java │ │ │ │ │ ├── TelnetClient.java │ │ │ │ │ ├── TelnetServer.java │ │ │ │ │ ├── ZLibIO.java │ │ │ │ │ └── jdk18/ │ │ │ │ │ └── SNISSLContextContainer.java │ │ │ │ ├── jdk18/ │ │ │ │ │ └── Activator.java │ │ │ │ ├── kernel/ │ │ │ │ │ ├── AnnotationConfigurator.java │ │ │ │ │ ├── BeanUtils.java │ │ │ │ │ ├── KernelException.java │ │ │ │ │ ├── Registrar.java │ │ │ │ │ ├── beans/ │ │ │ │ │ │ ├── Bean.java │ │ │ │ │ │ ├── BeanFactory.java │ │ │ │ │ │ ├── Initializable.java │ │ │ │ │ │ ├── Inject.java │ │ │ │ │ │ ├── UnregisterAware.java │ │ │ │ │ │ └── config/ │ │ │ │ │ │ ├── AbstractBeanConfigurator.java │ │ │ │ │ │ ├── BeanConfigurator.java │ │ │ │ │ │ └── ConfigField.java │ │ │ │ │ └── core/ │ │ │ │ │ ├── BeanConfig.java │ │ │ │ │ ├── BeanConfigBuilder.java │ │ │ │ │ ├── Dependency.java │ │ │ │ │ ├── DependencyGrapher.java │ │ │ │ │ ├── DependencyManager.java │ │ │ │ │ ├── Kernel.java │ │ │ │ │ └── RegistrarKernel.java │ │ │ │ ├── monitor/ │ │ │ │ │ ├── AdHocTask.java │ │ │ │ │ ├── BeanConfigurator.java │ │ │ │ │ ├── ConfigurableTask.java │ │ │ │ │ ├── InfoTask.java │ │ │ │ │ ├── MonitorComponent.java │ │ │ │ │ ├── MonitorContext.java │ │ │ │ │ ├── MonitorExtension.java │ │ │ │ │ ├── MonitorTask.java │ │ │ │ │ ├── TaskConfigItem.java │ │ │ │ │ ├── TaskConfigItemJDBCRepository.java │ │ │ │ │ ├── TasksScriptRegistrar.java │ │ │ │ │ ├── TimerTaskService.java │ │ │ │ │ ├── modules/ │ │ │ │ │ │ ├── AdHocCommandMonitorModule.java │ │ │ │ │ │ ├── AddScriptTaskCommand.java │ │ │ │ │ │ ├── AddTimerScriptTaskCommand.java │ │ │ │ │ │ ├── ConfigureTaskCommand.java │ │ │ │ │ │ ├── DeleteScriptTaskCommand.java │ │ │ │ │ │ ├── DiscoveryMonitorModule.java │ │ │ │ │ │ └── InfoTaskCommand.java │ │ │ │ │ └── tasks/ │ │ │ │ │ ├── AbstractConfigurableTask.java │ │ │ │ │ ├── AbstractConfigurableTimerTask.java │ │ │ │ │ ├── ConnectionsTask.java │ │ │ │ │ ├── CpuTempTask.java │ │ │ │ │ ├── DiskTask.java │ │ │ │ │ ├── LoadCheckerTask.java │ │ │ │ │ ├── LoggerTask.java │ │ │ │ │ ├── MemoryCheckerTask.java │ │ │ │ │ ├── SampleTask.java │ │ │ │ │ ├── ScriptTask.java │ │ │ │ │ └── ScriptTimerTask.java │ │ │ │ ├── net/ │ │ │ │ │ ├── Accept.java │ │ │ │ │ ├── ConnectionOpenListener.java │ │ │ │ │ ├── ConnectionOpenThread.java │ │ │ │ │ ├── ConnectionType.java │ │ │ │ │ ├── IOService.java │ │ │ │ │ ├── IOServiceListener.java │ │ │ │ │ ├── IOUtil.java │ │ │ │ │ ├── ServiceCommand.java │ │ │ │ │ ├── SocketThread.java │ │ │ │ │ └── SocketType.java │ │ │ │ ├── osgi/ │ │ │ │ │ ├── Activator.java │ │ │ │ │ ├── ModulesManager.java │ │ │ │ │ ├── ModulesManagerImpl.java │ │ │ │ │ ├── OSGiScriptEngine.java │ │ │ │ │ ├── OSGiScriptEngineFactory.java │ │ │ │ │ ├── OSGiScriptEngineManager.java │ │ │ │ │ └── util/ │ │ │ │ │ └── ClassUtil.java │ │ │ │ ├── receipt/ │ │ │ │ │ ├── BufferedMessageReceiptsStore.java │ │ │ │ │ ├── MessageReceiptsStore.java │ │ │ │ │ └── MessageReceiptsStoreFactory.java │ │ │ │ ├── server/ │ │ │ │ │ ├── AbstractComponentRegistrator.java │ │ │ │ │ ├── AbstractMessageReceiver.java │ │ │ │ │ ├── BasicComponent.java │ │ │ │ │ ├── CmdAcl.java │ │ │ │ │ ├── Command.java │ │ │ │ │ ├── ComponentInfo.java │ │ │ │ │ ├── ComponentRegistrator.java │ │ │ │ │ ├── ConnectionManager.java │ │ │ │ │ ├── DataForm.java │ │ │ │ │ ├── DisableDisco.java │ │ │ │ │ ├── Iq.java │ │ │ │ │ ├── Message.java │ │ │ │ │ ├── MessageReceiver.java │ │ │ │ │ ├── MessageRouter.java │ │ │ │ │ ├── MessageRouterConfig.java │ │ │ │ │ ├── MessageRouterIfc.java │ │ │ │ │ ├── Packet.java │ │ │ │ │ ├── PacketFilterIfc.java │ │ │ │ │ ├── Permissions.java │ │ │ │ │ ├── PolicyViolationException.java │ │ │ │ │ ├── Presence.java │ │ │ │ │ ├── Priority.java │ │ │ │ │ ├── QueueType.java │ │ │ │ │ ├── ReceiverTimeoutHandler.java │ │ │ │ │ ├── ServerComponent.java │ │ │ │ │ ├── ServiceChecker.java │ │ │ │ │ ├── ThreadExceptionHandler.java │ │ │ │ │ ├── XMPPServer.java │ │ │ │ │ ├── amp/ │ │ │ │ │ │ ├── ActionAbstract.java │ │ │ │ │ │ ├── ActionIfc.java │ │ │ │ │ │ ├── ActionResultsHandlerIfc.java │ │ │ │ │ │ ├── AmpComponent.java │ │ │ │ │ │ ├── AmpFeatureIfc.java │ │ │ │ │ │ ├── ConditionIfc.java │ │ │ │ │ │ ├── JDBCMsgRepository.java │ │ │ │ │ │ ├── JidResourceMap.java │ │ │ │ │ │ ├── MsgRepository.java │ │ │ │ │ │ ├── action/ │ │ │ │ │ │ │ ├── Alert.java │ │ │ │ │ │ │ ├── Broadcast.java │ │ │ │ │ │ │ ├── Deliver.java │ │ │ │ │ │ │ ├── Drop.java │ │ │ │ │ │ │ ├── Error.java │ │ │ │ │ │ │ ├── Notify.java │ │ │ │ │ │ │ └── Store.java │ │ │ │ │ │ └── cond/ │ │ │ │ │ │ ├── Deliver.java │ │ │ │ │ │ ├── ExpireAt.java │ │ │ │ │ │ └── MatchResource.java │ │ │ │ │ ├── bosh/ │ │ │ │ │ │ ├── BoshConnectionManager.java │ │ │ │ │ │ ├── BoshIOService.java │ │ │ │ │ │ ├── BoshSendQueueTask.java │ │ │ │ │ │ ├── BoshSession.java │ │ │ │ │ │ ├── BoshSessionCache.java │ │ │ │ │ │ ├── BoshSessionTaskHandler.java │ │ │ │ │ │ ├── BoshSidLoggerFilter.java │ │ │ │ │ │ ├── BoshTask.java │ │ │ │ │ │ └── Constants.java │ │ │ │ │ ├── ext/ │ │ │ │ │ │ ├── CompConfigRepository.java │ │ │ │ │ │ ├── CompDBRepository.java │ │ │ │ │ │ ├── CompRepoDefaults.java │ │ │ │ │ │ ├── CompRepoItem.java │ │ │ │ │ │ ├── CompSQLRepository.java │ │ │ │ │ │ ├── ComponentConnection.java │ │ │ │ │ │ ├── ComponentIOService.java │ │ │ │ │ │ ├── ComponentProtocol.java │ │ │ │ │ │ ├── ComponentProtocolHandler.java │ │ │ │ │ │ ├── ExtProcessor.java │ │ │ │ │ │ ├── StreamOpenHandler.java │ │ │ │ │ │ ├── handlers/ │ │ │ │ │ │ │ ├── BindProcessor.java │ │ │ │ │ │ │ ├── ComponentAcceptStreamOpenHandler.java │ │ │ │ │ │ │ ├── ComponentConnectStreamOpenHandler.java │ │ │ │ │ │ │ ├── HandshakeProcessor.java │ │ │ │ │ │ │ ├── JabberClientStreamOpenHandler.java │ │ │ │ │ │ │ ├── SASLProcessor.java │ │ │ │ │ │ │ ├── StartTLSProcessor.java │ │ │ │ │ │ │ ├── StreamFeaturesProcessor.java │ │ │ │ │ │ │ └── UnknownXMLNSStreamOpenHandler.java │ │ │ │ │ │ └── lb/ │ │ │ │ │ │ ├── LoadBalancerIfc.java │ │ │ │ │ │ ├── ReceiverBareJidLB.java │ │ │ │ │ │ ├── ReceiverFullJidLB.java │ │ │ │ │ │ ├── SenderBareJidLB.java │ │ │ │ │ │ └── SenderFullJidLB.java │ │ │ │ │ ├── filters/ │ │ │ │ │ │ └── PacketCounter.java │ │ │ │ │ ├── monitor/ │ │ │ │ │ │ ├── MonitorComponent.java │ │ │ │ │ │ ├── MonitorPluginIfc.java │ │ │ │ │ │ └── MonitorRuntime.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── script/ │ │ │ │ │ │ ├── AbstractScriptCommand.java │ │ │ │ │ │ ├── AddScriptCommand.java │ │ │ │ │ │ ├── CommandIfc.java │ │ │ │ │ │ ├── RemoveScriptCommand.java │ │ │ │ │ │ └── Script.java │ │ │ │ │ ├── sreceiver/ │ │ │ │ │ │ ├── AbstractReceiverTask.java │ │ │ │ │ │ ├── DefaultValues.java │ │ │ │ │ │ ├── NewTaskCommand.java │ │ │ │ │ │ ├── NewsDistributor.java │ │ │ │ │ │ ├── PropertyConstants.java │ │ │ │ │ │ ├── PropertyItem.java │ │ │ │ │ │ ├── PubSubTestsTask.java │ │ │ │ │ │ ├── ReceiverTaskIfc.java │ │ │ │ │ │ ├── RepoRosterTask.java │ │ │ │ │ │ ├── RosterItem.java │ │ │ │ │ │ ├── ShortNewsPublisher.java │ │ │ │ │ │ ├── StanzaReceiver.java │ │ │ │ │ │ ├── StanzaReceiverIfc.java │ │ │ │ │ │ ├── TaskCommandIfc.java │ │ │ │ │ │ ├── TaskCommons.java │ │ │ │ │ │ ├── TaskCreationPolicy.java │ │ │ │ │ │ ├── TaskInstanceCommand.java │ │ │ │ │ │ ├── TaskType.java │ │ │ │ │ │ ├── TesterTask.java │ │ │ │ │ │ └── sysmon/ │ │ │ │ │ │ ├── AbstractMonitor.java │ │ │ │ │ │ ├── CPUMonitor.java │ │ │ │ │ │ ├── DiskMonitor.java │ │ │ │ │ │ ├── LogMonitor.java │ │ │ │ │ │ ├── MemMonitor.java │ │ │ │ │ │ ├── N270Monitor.java │ │ │ │ │ │ ├── ResourceMonitorIfc.java │ │ │ │ │ │ └── SystemMonitorTask.java │ │ │ │ │ ├── ssender/ │ │ │ │ │ │ ├── DrupalCommentsTask.java │ │ │ │ │ │ ├── DrupalForumTask.java │ │ │ │ │ │ ├── FileTask.java │ │ │ │ │ │ ├── JDBCTask.java │ │ │ │ │ │ ├── SenderTask.java │ │ │ │ │ │ ├── StanzaHandler.java │ │ │ │ │ │ └── StanzaSender.java │ │ │ │ │ ├── test/ │ │ │ │ │ │ ├── EchoComponent.java │ │ │ │ │ │ └── TestComponent.java │ │ │ │ │ ├── websocket/ │ │ │ │ │ │ ├── WebSocketClientConnectionManager.java │ │ │ │ │ │ ├── WebSocketHixie76.java │ │ │ │ │ │ ├── WebSocketHybi.java │ │ │ │ │ │ ├── WebSocketProtocolIfc.java │ │ │ │ │ │ └── WebSocketXMPPIOService.java │ │ │ │ │ ├── xmppclient/ │ │ │ │ │ │ ├── ClientConnectionManager.java │ │ │ │ │ │ ├── ClientTrustManagerFactory.java │ │ │ │ │ │ ├── IPMonitor.java │ │ │ │ │ │ ├── SeeOtherHost.java │ │ │ │ │ │ ├── SeeOtherHostDB.java │ │ │ │ │ │ ├── SeeOtherHostDualIP.java │ │ │ │ │ │ ├── SeeOtherHostDualIPSQLRepository.java │ │ │ │ │ │ ├── SeeOtherHostHashed.java │ │ │ │ │ │ ├── SeeOtherHostIfc.java │ │ │ │ │ │ ├── StreamErrorCounterIOProcessor.java │ │ │ │ │ │ ├── StreamManagementIOProcessor.java │ │ │ │ │ │ ├── XMPPIOProcessor.java │ │ │ │ │ │ └── XMPPIOProcessorsFactory.java │ │ │ │ │ ├── xmppcomponent/ │ │ │ │ │ │ └── ComponentConnectionManager.java │ │ │ │ │ ├── xmppserver/ │ │ │ │ │ │ ├── CID.java │ │ │ │ │ │ ├── CIDConnections.java │ │ │ │ │ │ ├── ConnectionHandlerIfc.java │ │ │ │ │ │ ├── LocalhostException.java │ │ │ │ │ │ ├── NotLocalhostException.java │ │ │ │ │ │ ├── OutgoingState.java │ │ │ │ │ │ ├── S2SConnection.java │ │ │ │ │ │ ├── S2SConnectionHandlerIfc.java │ │ │ │ │ │ ├── S2SConnectionManager.java │ │ │ │ │ │ ├── S2SConnectionSelector.java │ │ │ │ │ │ ├── S2SIOService.java │ │ │ │ │ │ ├── S2SProcessor.java │ │ │ │ │ │ ├── S2SRandomSelector.java │ │ │ │ │ │ ├── ServerConnectionManager.java │ │ │ │ │ │ ├── ServerConnections.java │ │ │ │ │ │ └── proc/ │ │ │ │ │ │ ├── Dialback.java │ │ │ │ │ │ ├── PacketChecker.java │ │ │ │ │ │ ├── S2SAbstractProcessor.java │ │ │ │ │ │ ├── StartTLS.java │ │ │ │ │ │ ├── StartZlib.java │ │ │ │ │ │ ├── StreamError.java │ │ │ │ │ │ ├── StreamFeatures.java │ │ │ │ │ │ └── StreamOpen.java │ │ │ │ │ └── xmppsession/ │ │ │ │ │ ├── PacketDefaultHandler.java │ │ │ │ │ ├── SMResourceConnection.java │ │ │ │ │ ├── SessionManager.java │ │ │ │ │ ├── SessionManagerConfig.java │ │ │ │ │ └── SessionManagerHandler.java │ │ │ │ ├── stats/ │ │ │ │ │ ├── Counter.java │ │ │ │ │ ├── CounterDataArchivizer.java │ │ │ │ │ ├── CounterDataFileLogger.java │ │ │ │ │ ├── CounterDataLogger.java │ │ │ │ │ ├── CounterPerSecond.java │ │ │ │ │ ├── CounterValue.java │ │ │ │ │ ├── ErrorsStatisticsProvider.java │ │ │ │ │ ├── JMXProxyListener.java │ │ │ │ │ ├── JMXProxyListenerOpt.java │ │ │ │ │ ├── JavaJMXProxy.java │ │ │ │ │ ├── JavaJMXProxyOpt.java │ │ │ │ │ ├── StatRecord.java │ │ │ │ │ ├── StatisticHolder.java │ │ │ │ │ ├── StatisticHolderImpl.java │ │ │ │ │ ├── StatisticType.java │ │ │ │ │ ├── StatisticsArchivizerIfc.java │ │ │ │ │ ├── StatisticsCollector.java │ │ │ │ │ ├── StatisticsContainer.java │ │ │ │ │ ├── StatisticsContainerIfc.java │ │ │ │ │ ├── StatisticsList.java │ │ │ │ │ ├── StatisticsProvider.java │ │ │ │ │ ├── StatisticsProviderIfc.java │ │ │ │ │ └── StatisticsProviderMBean.java │ │ │ │ ├── sys/ │ │ │ │ │ ├── CPULoadListener.java │ │ │ │ │ ├── MemoryChangeListener.java │ │ │ │ │ ├── OnlineJidsReporter.java │ │ │ │ │ ├── ResourceState.java │ │ │ │ │ ├── ShutdownHook.java │ │ │ │ │ └── TigaseRuntime.java │ │ │ │ ├── util/ │ │ │ │ │ ├── AllHistoryCache.java │ │ │ │ │ ├── DBSchemaLoader.java │ │ │ │ │ ├── DBUtils.java │ │ │ │ │ ├── DataTypes.java │ │ │ │ │ ├── ElementUtils.java │ │ │ │ │ ├── EverySecond.java │ │ │ │ │ ├── FloatHistoryCache.java │ │ │ │ │ ├── IdentityComparator.java │ │ │ │ │ ├── IntHistoryCache.java │ │ │ │ │ ├── LogFilter.java │ │ │ │ │ ├── LogFormatter.java │ │ │ │ │ ├── LogUserFilter.java │ │ │ │ │ ├── LogWithStackTraceEntry.java │ │ │ │ │ ├── LongHistoryCache.java │ │ │ │ │ ├── NonpriorityQueue.java │ │ │ │ │ ├── OSUtils.java │ │ │ │ │ ├── PatternComparator.java │ │ │ │ │ ├── PriorityQueueAbstract.java │ │ │ │ │ ├── PriorityQueueRelaxed.java │ │ │ │ │ ├── PriorityQueueStrict.java │ │ │ │ │ ├── ProcessingThreads.java │ │ │ │ │ ├── PropertiesUtil.java │ │ │ │ │ ├── QueueItem.java │ │ │ │ │ ├── RepositoryUtils.java │ │ │ │ │ ├── RoutingsContainer.java │ │ │ │ │ ├── SchemaLoader.java │ │ │ │ │ ├── ThreadPoolUtils.java │ │ │ │ │ ├── TimeUtils.java │ │ │ │ │ ├── TimerTask.java │ │ │ │ │ ├── TimingRecord.java │ │ │ │ │ ├── TimingRecorder.java │ │ │ │ │ ├── UpdatesChecker.java │ │ │ │ │ ├── WorkerThread.java │ │ │ │ │ └── tracer/ │ │ │ │ │ └── TigaseTracer.java │ │ │ │ ├── vhosts/ │ │ │ │ │ ├── VHostItem.java │ │ │ │ │ ├── VHostJDBCRepository.java │ │ │ │ │ ├── VHostListener.java │ │ │ │ │ ├── VHostManager.java │ │ │ │ │ ├── VHostManagerIfc.java │ │ │ │ │ ├── VHostRepoDefaults.java │ │ │ │ │ └── filter/ │ │ │ │ │ ├── CustomDomainFilter.java │ │ │ │ │ ├── DomainFilterPolicy.java │ │ │ │ │ └── Rule.java │ │ │ │ └── xmpp/ │ │ │ │ ├── Authorization.java │ │ │ │ ├── ConnectionStatus.java │ │ │ │ ├── ElementMatcher.java │ │ │ │ ├── NoConnectionIdException.java │ │ │ │ ├── NotAuthorizedException.java │ │ │ │ ├── PacketErrorTypeException.java │ │ │ │ ├── ProcessorFactory.java │ │ │ │ ├── RepositoryAccess.java │ │ │ │ ├── StanzaType.java │ │ │ │ ├── StreamError.java │ │ │ │ ├── XMPPDomBuilderHandler.java │ │ │ │ ├── XMPPException.java │ │ │ │ ├── XMPPIOService.java │ │ │ │ ├── XMPPIOServiceListener.java │ │ │ │ ├── XMPPImplIfc.java │ │ │ │ ├── XMPPPacketFilterIfc.java │ │ │ │ ├── XMPPParserException.java │ │ │ │ ├── XMPPPostprocessorIfc.java │ │ │ │ ├── XMPPPreprocessorIfc.java │ │ │ │ ├── XMPPPresenceUpdateProcessorIfc.java │ │ │ │ ├── XMPPProcessor.java │ │ │ │ ├── XMPPProcessorAbstract.java │ │ │ │ ├── XMPPProcessorIfc.java │ │ │ │ ├── XMPPResourceConnection.java │ │ │ │ ├── XMPPSession.java │ │ │ │ ├── XMPPStopListenerIfc.java │ │ │ │ └── impl/ │ │ │ │ ├── AbstractAuthPreprocessor.java │ │ │ │ ├── BindResource.java │ │ │ │ ├── BlockingCommand.java │ │ │ │ ├── C2SDeliveryErrorProcessor.java │ │ │ │ ├── CAPS.java │ │ │ │ ├── ClientStateIndication.java │ │ │ │ ├── DomainFilter.java │ │ │ │ ├── EntityTime.java │ │ │ │ ├── ErrorCounter.java │ │ │ │ ├── FlexibleOfflineMessageRetrieval.java │ │ │ │ ├── IBB.java │ │ │ │ ├── InvisibleCommand.java │ │ │ │ ├── JabberIqAuth.java │ │ │ │ ├── JabberIqCommand.java │ │ │ │ ├── JabberIqIq.java │ │ │ │ ├── JabberIqOOB.java │ │ │ │ ├── JabberIqPrivacy.java │ │ │ │ ├── JabberIqPrivate.java │ │ │ │ ├── JabberIqRegister.java │ │ │ │ ├── JabberIqRoster.java │ │ │ │ ├── JabberIqSi.java │ │ │ │ ├── JabberIqSocks5Bytestreams.java │ │ │ │ ├── JabberIqStats.java │ │ │ │ ├── JabberIqVersion.java │ │ │ │ ├── Jingle.java │ │ │ │ ├── LastActivity.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageAll.java │ │ │ │ ├── MessageAmp.java │ │ │ │ ├── MessageCarbons.java │ │ │ │ ├── MessageForwarding.java │ │ │ │ ├── MessagePush.java │ │ │ │ ├── MessageReceipts.java │ │ │ │ ├── MobileV1.java │ │ │ │ ├── MobileV2.java │ │ │ │ ├── MobileV3.java │ │ │ │ ├── OfflineMessages.java │ │ │ │ ├── PepPlugin.java │ │ │ │ ├── Presence.java │ │ │ │ ├── PresenceAbstract.java │ │ │ │ ├── PresenceCapabilitiesManager.java │ │ │ │ ├── PresenceOffline.java │ │ │ │ ├── PresenceState.java │ │ │ │ ├── PresenceSubscription.java │ │ │ │ ├── Privacy.java │ │ │ │ ├── RemoteRosterManagement.java │ │ │ │ ├── RosterPresence.java │ │ │ │ ├── SaslAuth.java │ │ │ │ ├── ServiceDiscovery.java │ │ │ │ ├── SessionBind.java │ │ │ │ ├── SimpleForwarder.java │ │ │ │ ├── StartTLS.java │ │ │ │ ├── StartZLib.java │ │ │ │ ├── UrnXmppPing.java │ │ │ │ ├── VCard4.java │ │ │ │ ├── VCardTemp.java │ │ │ │ ├── VCardXMPPProcessorAbstract.java │ │ │ │ ├── annotation/ │ │ │ │ │ ├── AnnotatedXMPPProcessor.java │ │ │ │ │ ├── DiscoFeatures.java │ │ │ │ │ ├── Handle.java │ │ │ │ │ ├── HandleStanzaTypes.java │ │ │ │ │ ├── Handles.java │ │ │ │ │ ├── Id.java │ │ │ │ │ ├── StreamFeature.java │ │ │ │ │ └── StreamFeatures.java │ │ │ │ ├── package-info.java │ │ │ │ └── roster/ │ │ │ │ ├── AnonymousRoster.java │ │ │ │ ├── DynamicRoster.java │ │ │ │ ├── DynamicRosterIfc.java │ │ │ │ ├── DynamicRosterTest.java │ │ │ │ ├── DynamicRosterTest123.java │ │ │ │ ├── RepositoryAccessException.java │ │ │ │ ├── Roster.java │ │ │ │ ├── RosterAbstract.java │ │ │ │ ├── RosterElement.java │ │ │ │ ├── RosterFactory.java │ │ │ │ ├── RosterFlat.java │ │ │ │ └── RosterRetrievingException.java │ │ │ ├── php/ │ │ │ │ └── drupal/ │ │ │ │ └── modules/ │ │ │ │ ├── short_news-5.x/ │ │ │ │ │ ├── short_news.info │ │ │ │ │ └── short_news.module │ │ │ │ ├── short_news-6.x/ │ │ │ │ │ ├── short_news.info │ │ │ │ │ └── short_news.module │ │ │ │ ├── short_news.module │ │ │ │ ├── tigase.module │ │ │ │ ├── tigase_monitor-5.x/ │ │ │ │ │ ├── tigase_monitor.info │ │ │ │ │ └── tigase_monitor.module │ │ │ │ ├── tigase_monitor.module │ │ │ │ └── tigase_usrreg-5.x/ │ │ │ │ ├── tigase_usrreg.info │ │ │ │ └── tigase_usrreg.module │ │ │ ├── python/ │ │ │ │ └── tigase/ │ │ │ │ └── admin/ │ │ │ │ └── PythonExample.py │ │ │ ├── resources/ │ │ │ │ ├── META-INF/ │ │ │ │ │ ├── MANIFEST.MF │ │ │ │ │ └── java.security.Provider │ │ │ │ └── mib/ │ │ │ │ └── JVM-MANAGEMENT-MIB.mib │ │ │ ├── ruby/ │ │ │ │ └── tigase/ │ │ │ │ └── admin/ │ │ │ │ └── RubyExample.rb │ │ │ └── scala/ │ │ │ └── tigase/ │ │ │ └── admin/ │ │ │ └── ScalaExample.scala │ │ └── test/ │ │ └── java/ │ │ └── tigase/ │ │ ├── auth/ │ │ │ └── mechanisms/ │ │ │ ├── SaslANONYMOUSTest.java │ │ │ ├── SaslPLAINTest.java │ │ │ ├── SaslSCRAMPlusTest.java │ │ │ └── SaslSCRAMTest.java │ │ ├── cluster/ │ │ │ ├── ClusterConnectionSelectorTest.java │ │ │ └── api/ │ │ │ └── ClusterElementTest.java │ │ ├── db/ │ │ │ └── jdbc/ │ │ │ └── JDBCRepositoryTest.java │ │ ├── disteventbus/ │ │ │ ├── component/ │ │ │ │ └── NodeNameUtilTest.java │ │ │ └── impl/ │ │ │ ├── EventNameTest.java │ │ │ ├── EventsNameMapTest.java │ │ │ └── LocalEventBusTest.java │ │ ├── io/ │ │ │ └── SSLContextContainerTest.java │ │ ├── kernel/ │ │ │ ├── Bean1.java │ │ │ ├── Bean2.java │ │ │ ├── Bean3.java │ │ │ ├── Bean4.java │ │ │ ├── Bean5.java │ │ │ ├── Bean5Factory.java │ │ │ ├── Bean6.java │ │ │ ├── Bean7.java │ │ │ ├── KernelTest.java │ │ │ ├── RegistrarKernelTest.java │ │ │ ├── Special.java │ │ │ ├── module1/ │ │ │ │ ├── Bean11.java │ │ │ │ ├── Module1Registrar.java │ │ │ │ └── Module1Service.java │ │ │ └── module2/ │ │ │ ├── Module2Registrar.java │ │ │ └── Module2Service.java │ │ ├── monitor/ │ │ │ └── tasks/ │ │ │ └── UsersDisconnectTaskTest.java │ │ ├── server/ │ │ │ ├── PacketTest.java │ │ │ ├── websocket/ │ │ │ │ ├── WebSocketHixie76Test.java │ │ │ │ ├── WebSocketHybiTest.java │ │ │ │ └── WebSocketXMPPIOServiceTest.java │ │ │ ├── xmppclient/ │ │ │ │ └── StreamManagementIOProcessorTest.java │ │ │ └── xmppserver/ │ │ │ ├── S2SConnectionManagerDomainServerNameMapperTest.java │ │ │ └── proc/ │ │ │ └── DialbackTest.java │ │ ├── tests/ │ │ │ └── SlowTest.java │ │ ├── util/ │ │ │ └── DataTypesTest.java │ │ ├── vhosts/ │ │ │ ├── VHostItemTest.java │ │ │ ├── VHostJDBCRepositoryTest.java │ │ │ └── filter/ │ │ │ ├── CustomDomainFilterTest.java │ │ │ └── DomainFilterPolicyTest.java │ │ └── xmpp/ │ │ ├── XMPPDomBuilderHandlerTest.java │ │ └── impl/ │ │ ├── BindResourceTest.java │ │ ├── BlockingCommandTest.java │ │ ├── C2SDeliveryErrorProcessorTest.java │ │ ├── DomainFilterTest.java │ │ ├── JabberIqPrivacyTest.java │ │ ├── JabberIqRegisterWhitelistTest.java │ │ ├── MessageAmpTest.java │ │ ├── MessageCarbonsTest.java │ │ ├── MessageTest.java │ │ ├── MobileV3Test.java │ │ ├── OfflineMessagesTest.java │ │ ├── ProcessorTestCase.java │ │ ├── VCardHelperTest.java │ │ ├── annotation/ │ │ │ ├── AnnotatedXMPPProcessorTest.java │ │ │ ├── TestAnnotatedXMPPProcessor.java │ │ │ └── TestAnnotatedXMPPProcessor2.java │ │ └── roster/ │ │ └── RosterElementTest.java │ ├── tests/ │ │ └── data/ │ │ ├── telnet-test.xml │ │ ├── test_config.xml │ │ ├── tigase-config-1.xml │ │ ├── tigase-config-2.xml │ │ └── tigase-config.xml │ └── win-stuff/ │ ├── Licence.txt │ ├── Setup.bat │ ├── Tigase-minimal.iss │ ├── Tigase.iss │ ├── scripts/ │ │ ├── InstallTigaseService.bat │ │ ├── Run.bat │ │ ├── Tigase.bat │ │ ├── Uninst.bat │ │ └── UninstallTigaseService.bat │ └── wrapper/ │ ├── wrapper-community-license-1.2.txt │ ├── wrapper.conf │ └── wrapper.jar └── tigase.sql ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ #1、 IM 运行环境 1. Linux CentOS 2. Oracle jdk 1.8。 #2、 运行文件部署 ##2.1 数据库建表 1. 在数据库创建数据库tigase,并给tigase库授权用户(建议创建新用户,例如:tigase)。 2. 导入tigase.sql文件 3. 执行下面命令,手动创建管理员用户名和密码(可以自定义domian,与init.properties文件中对应,例如 app.im):call TigAddUserPlainPw('admin@domian',xx); ##2.2 部署文件包tigase.tar.gz 1. 将tigase.gz解压到/usr/local目录。 2. 执行ln -s /usr/local/tigase/scripts/tigase.sh /usr/bin/tigase创建软连接。 3. 修改 /usr/local/tigase/etc/init.properties文件。修改下列数据库连接的相关配置项(ip、port、user、pwd) ``` --admins=admin@domain --virt-hosts = domain --user-db-uri=jdbc:mysql://ip:port/tigase?user=user&password=pwd&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull #维护apns记录 sess-man/plugins-conf/urn\:ietf\:params\:xml\:ns\:\xmpp-bind/apns-token-db-uri=jdbc:mysql://ip:port/tigase?user=user&password=pwd&useUnicode=true&characterEncoding=UTF8 ``` 4.创建 /usr/local/tigase/etc/init-apns.properties文件。APNs_HTMessage_Dev.p12文件保存在etc目录下 ``` cert_file=APNs_HTMessage_Dev.p12 #cert_file=htmessage_production_APNs.p12 #cert_file=HTMessage_Dev_APNs.p12 pwd=123456 executor_size=20 maxConnections=20 ``` ##2.3 系统相关设置 1.添加环境变量。修改 /etc/profile 文件,在末尾添加如下,然后执行source /etc/profile 使环境变量立即生效 ``` export TIGASE_HOME=/usr/local/tigase export JAVA_HOME=/usr/java/jdk1.8.0_45/ export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH JAVA_HOME指向jdk实际安装目录 ``` ##2.4 IM服务器的启动,停止,重启 启动命令: tigase start 停止命令: tigase stop ##2.5 登录测试 ![](/images/002.jpg) ![](/images/001.jpg)) #3.为所有消息加上时间戳 C-101 OfflineMessages.java Message.java #4.类型为5000的消息不存库 C-102 OfflineMessages.java #5. Apns 相关 C-103 BindResource.java Tigase.apns.* MessagePush.java #6.消息回执相关 C-110 Message.java MessageReceipts.java Tigase.receipt.* ---------- # 相关工程 # #最具诚意的开源IM系统 YiChat# 1. github地址:[https://github.com/YiChat](https://github.com/YiChat) 2. 开源中国地址:[https://git.oschina.net/zhangfeng_tech](https://git.oschina.net/zhangfeng_tech) ##本项目的开源内容## ###已开源的所有源码:### 1. IM服务器(负责即时通讯消息)-直接部署,无需修改参数 2. api服务器(非IM模块相关的其他业务逻辑)-修改一处参数,详见工程下文档 3. android客户端-配置参数,连接自己的服务器ip.详见工程文档 ###待开源的工程源码:### - iOS客户端:前面三个工程的github star数超过3000马上开源 ##这个开源项目的意义在于## 1. 拥有自己的IM服务器,不再受制于第三方通讯云的限制. 2. 提供了一个完善优化的客户端源码,具体参见体验包: - Android:[https://www.pgyer.com/YiChatLite](https://www.pgyer.com/YiChatLite) - iOS:[https://www.pgyer.com/9sVQ](https://www.pgyer.com/9sVQ) ##QQ:84543217 (技术相关请提交Issus,商务合作可联系QQ) ================================================ FILE: tigase-server 7.1.0/License.html ================================================ GNU Affero General Public License - GNU Project - Free Software Foundation (FSF)

GNU AFFERO GENERAL PUBLIC LICENSE

Version 3, 19 November 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.

A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.

The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.

An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS

0. Definitions.

"This License" refers to version 3 of the GNU Affero General Public License.

"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.

To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.

A "covered work" means either the unmodified Program or a work based on the Program.

To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

1. Source Code.

The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.

A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

The Corresponding Source for a work in source code form is that same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.

When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

7. Additional Terms.

"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

11. Patents.

A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".

A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.

12. No Surrender of Others' Freedom.

If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

13. Remote Network Interaction; Use with the GNU General Public License.

Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.

If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.

You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

================================================ FILE: tigase-server 7.1.0/conf/config.properties ================================================ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # Framework config properties. # # To override the packages the framework exports by default from the # class path, set this variable. #org.osgi.framework.system.packages= # To append packages to the default set of exported system packages, # set this value. #org.osgi.framework.system.packages.extra=javax.* # The following property makes specified packages from the class path # available to all bundles. You should avoid using this property. org.osgi.framework.bootdelegation=sun.*,com.sun.*,org.xml.sax.* # Felix tries to guess when to implicitly boot delegate in certain # situations to ease integration without outside code. This feature # is enabled by default, uncomment the following line to disable it. #felix.bootdelegation.implicit=false # The following property explicitly specifies the location of the bundle # cache, which defaults to "felix-cache" in the current working directory. # If this value is not absolute, then the felix.cache.rootdir controls # how the absolute location is calculated. (See next property) #org.osgi.framework.storage=${dollar}{felix.cache.rootdir}/felix-cache # The following property is used to convert a relative bundle cache # location into an absolute one by specifying the root to prepend to # the relative cache path. The default for this property is the # current working directory. #felix.cache.rootdir=${dollar}{user.dir} # The following property controls whether the bundle cache is flushed # the first time the framework is initialized. Possible values are # "none" and "onFirstInit"; the default is "none". org.osgi.framework.storage.clean=onFirstInit # The following property determines which actions are performed when # processing the auto-deploy directory. It is a comma-delimited list of # the following values: 'install', 'start', 'update', and 'uninstall'. # An undefined or blank value is equivalent to disabling auto-deploy # processing. felix.auto.deploy.action=install,start # The following property specifies the directory to use as the bundle # auto-deploy directory; the default is 'bundle' in the working directory. felix.auto.deploy.dir=jars # The following property is a space-delimited list of bundle URLs # to install when the framework starts. The ending numerical component # is the target start level. Any number of these properties may be # specified for different start levels. #felix.auto.install.1= # The following property is a space-delimited list of bundle URLs # to install and start when the framework starts. The ending numerical # component is the target start level. Any number of these properties # may be specified for different start levels. #felix.auto.start.1= felix.log.level=1 # Sets the initial start level of the framework upon startup. #org.osgi.framework.startlevel.beginning=1 # Sets the start level of newly installed bundles. #felix.startlevel.bundle=1 # Felix installs a stream and content handler factories by default, # uncomment the following line to not install them. #felix.service.urlhandlers=false # The launcher registers a shutdown hook to cleanly stop the framework # by default, uncomment the following line to disable it. felix.shutdown.hook=true # # Bundle config properties. # osgi.shell.telnet.ip=127.0.0.1 osgi.shell.telnet.port=9070 osgi.shell.telnet.maxconn=2 osgi.shell.telnet.socketTimeout=0 # debugging #felix.log.level=4 #org.apache.felix.http.debug=true ================================================ FILE: tigase-server 7.1.0/database/derby-installer-create-db.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- ================================================ FILE: tigase-server 7.1.0/database/derby-installer-post.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- ================================================ FILE: tigase-server 7.1.0/database/derby-schema-4-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- This is a dummy user who keeps all the database-properties -- QUERY START: call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: -- QUERY START: call TigPutDBProperty('schema-version', '4.0'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-4-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: create table tig_users ( uid BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY, -- Jabber User ID user_id varchar(2049) NOT NULL, -- User password encrypted or not user_pw varchar(255) default NULL, -- Time the account has been created acc_create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time of the last user login last_login timestamp, -- Time of the last user logout last_logout timestamp, -- User online status, if > 0 then user is online, the value -- indicates the number of user connections. -- It is incremented on each user login and decremented on each -- user logout. online_status int default 0, -- Number of failed login attempts failed_logins int default 0, -- User status, whether the account is active or disabled -- >0 - account active, 0 - account disabled account_status int default 1 ); -- QUERY END: -- QUERY START: create unique index user_id on tig_users ( user_id ); -- QUERY END: -- QUERY START: create index user_pw on tig_users (user_pw); -- QUERY END: -- QUERY START: create index last_login on tig_users (last_login); -- QUERY END: -- QUERY START: create index last_logout on tig_users (last_logout); -- QUERY END: -- QUERY START: create index account_status on tig_users (account_status); -- QUERY END: -- QUERY START: create index online_status on tig_users (online_status); -- QUERY END: -- QUERY START: create table tig_nodes ( nid BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY, parent_nid bigint, uid bigint NOT NULL references tig_users(uid), node varchar(255) NOT NULL ); -- QUERY END: -- QUERY START: create unique index tnode on tig_nodes ( parent_nid, uid, node ); -- QUERY END: -- QUERY START: create index node on tig_nodes ( node ); -- QUERY END: -- QUERY START: -- The new index is a duplicate of an existing index create index nuid on tig_nodes (uid); -- QUERY END: -- QUERY START: create index parent_nid on tig_nodes (parent_nid); -- QUERY END: -- QUERY START: create table tig_pairs ( nid bigint references tig_nodes(nid), uid bigint NOT NULL references tig_users(uid), pkey varchar(255) NOT NULL, pval long varchar ); -- QUERY END: -- QUERY START: -- The new index is a duplicate of an existing index create index pkey on tig_pairs ( pkey ); -- QUERY END: -- QUERY START: -- The new index is a duplicate of an existing index create index puid on tig_pairs (uid); -- QUERY END: -- QUERY START: create index pnid on tig_pairs (nid); -- QUERY END: -- QUERY START: create table short_news ( snid BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY, publishing_time timestamp default current timestamp, news_type varchar(10), author varchar(128) NOT NULL, subject varchar(128) NOT NULL, body varchar(1024) NOT NULL ); -- QUERY END: -- QUERY START: create index publishing_time on short_news (publishing_time); -- QUERY END: -- QUERY START: create index author on short_news (author); -- QUERY END: -- QUERY START: create index news_type on short_news (news_type); -- QUERY END: -- QUERY START: create table xmpp_stanza ( id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY, stanza long varchar NOT NULL ); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-4-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: CREATE function TigGetDBProperty(tkey varchar(255)) returns long varchar PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetDBProperty'; -- QUERY END: -- QUERY START: CREATE procedure TigPutDBProperty(tkey varchar(255), tval varchar(32672)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigPutDBProperty'; -- QUERY END: -- QUERY START: CREATE procedure TigInitdb() PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigInitdb'; -- QUERY END: -- QUERY START: CREATE procedure TigAddUser(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddUser'; -- QUERY END: -- QUERY START: CREATE procedure TigAddUserPlainPw(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddUserPlainPw'; -- QUERY END: -- QUERY START: CREATE procedure TigGetUserDBUid(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetUserDBUid'; -- QUERY END: -- QUERY START: CREATE procedure TigRemoveUser(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigRemoveUser'; -- QUERY END: -- QUERY START: CREATE procedure TigGetPassword(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetPassword'; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePasswordPlainPwRev(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePasswordPlainPwRev'; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePasswordPlainPw(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePasswordPlainPw'; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePassword(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePassword'; -- QUERY END: -- QUERY START: CREATE procedure TigOnlineUsers() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigOnlineUsers'; -- QUERY END: -- QUERY START: CREATE procedure TigOfflineUsers() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigOfflineUsers'; -- QUERY END: -- QUERY START: CREATE procedure TigAllUsers() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAllUsers'; -- QUERY END: -- QUERY START: CREATE procedure TigAllUsersCount() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAllUsersCount'; -- QUERY END: -- QUERY START: CREATE procedure TigUserLoginPlainPw(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLoginPlainPw'; -- QUERY END: -- QUERY START: CREATE procedure TigUserLogin(userId varchar(2049), userPw varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLogin'; -- QUERY END: -- QUERY START: CREATE procedure TigUserLogout(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLogout'; -- QUERY END: -- QUERY START: CREATE procedure TigDisableAccount(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigDisableAccount'; -- QUERY END: -- QUERY START: CREATE procedure TigEnableAccount(userId varchar(2049)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigEnableAccount'; -- QUERY END: -- QUERY START: CREATE procedure TigActiveAccounts() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigActiveAccounts'; -- QUERY END: -- QUERY START: CREATE procedure TigDisabledAccounts() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigDisabledAccounts'; -- QUERY END: -- QUERY START: CREATE procedure TigAddNode(parentNid bigint, uid bigint, node varchar(255)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddNode'; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePairs(nid bigint, uid bigint, tkey varchar(255), tval varchar(32672)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePairs'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-4.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- LOAD FILE: database/derby-schema-4-schema.sql -- LOAD FILE: database/derby-schema-4-sp.sql -- LOAD FILE: database/derby-schema-4-props.sql run 'database/derby-schema-4-schema.sql'; run 'database/derby-schema-4-sp.sql'; run 'database/derby-schema-4-props.sql'; ================================================ FILE: tigase-server 7.1.0/database/derby-schema-5-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- This is a dummy user who keeps all the database-properties -- QUERY START: call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: -- QUERY START: call TigPutDBProperty('schema-version', '5.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-5-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- run 'database/derby-schema-4-schema.sql'; -- LOAD FILE: database/derby-schema-4-schema.sql -- QUERY START: alter table tig_pairs ADD column pval2 CLOB; -- QUERY END: -- QUERY START: update tig_pairs set pval2=pval; -- QUERY END: -- QUERY START: alter table tig_pairs drop column pval; -- QUERY END: -- QUERY START: RENAME COLUMN tig_pairs.pval2 to pval; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-5-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- run 'database/derby-schema-4-sp.sql'; -- LOAD FILE: database/derby-schema-4-sp.sql -- QUERY START: drop procedure TigUpdatePairs; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePairs(nid bigint, uid bigint, tkey varchar(255), tval clob) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePairs'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- run 'database/derby-schema-5-1-schema.sql'; run 'database/derby-schema-5-1-sp.sql'; run 'database/derby-schema-5-1-props.sql'; -- LOAD FILE: database/derby-schema-5-1-schema.sql -- LOAD FILE: database/derby-schema-5-1-sp.sql -- LOAD FILE: database/derby-schema-5-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/derby-schema-5.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- run 'database/derby-schema-4-schema.sql'; run 'database/derby-schema-4-sp.sql'; run 'database/derby-schema-4-props.sql'; -- LOAD FILE: database/derby-schema-4-schema.sql -- LOAD FILE: database/derby-schema-4-sp.sql -- LOAD FILE: database/derby-schema-4-props.sql ================================================ FILE: tigase-server 7.1.0/database/derby-schema-7-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- This is a dummy user who keeps all the database-properties -- QUERY START: call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: -- QUERY START: call TigPutDBProperty('schema-version', '7.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-7-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- run 'database/derby-schema-5-1-schema.sql'; -- LOAD FILE: database/derby-schema-5-1-schema.sql -- QUERY START: ALTER TABLE tig_pairs ADD COLUMN PID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL PRIMARY KEY; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-7-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- run 'database/derby-schema-5-1-sp.sql'; -- LOAD FILE: database/derby-schema-5-1-sp.sql -- QUERY START: drop procedure TigPutDBProperty; -- QUERY END: -- QUERY START: CREATE procedure TigPutDBProperty(tkey varchar(255), tval varchar(32672)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigPutDBProperty'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- run 'database/derby-schema-7-1-schema.sql'; run 'database/derby-schema-7-1-sp.sql'; run 'database/derby-schema-7-1-props.sql'; -- LOAD FILE: database/derby-schema-7-1-schema.sql -- LOAD FILE: database/derby-schema-7-1-sp.sql -- LOAD FILE: database/derby-schema-7-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/derby-schema-upgrade-to-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: call TigPutDBProperty('schema-version','5.1'); -- QUERY END: -- QUERY START: drop procedure TigUpdatePairs; -- QUERY END: -- QUERY START: CREATE procedure TigUpdatePairs(nid bigint, uid bigint, tkey varchar(255), tval clob) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePairs'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/derby-schema-upgrade-to-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- QUERY START: drop procedure TigPutDBProperty; -- QUERY END: -- QUERY START: CREATE procedure TigPutDBProperty(tkey varchar(255), tval varchar(32672)) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigPutDBProperty'; -- QUERY END: -- QUERY START: update tig_pairs set nid = (select nid from tig_nodes where uid=(select uid from tig_users where user_id='db-properties') and node='root') where uid=(select uid from tig_users where user_id='db-properties'); -- QUERY END: -- QUERY START: ALTER TABLE tig_pairs ADD COLUMN PID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL PRIMARY KEY; -- QUERY END: -- QUERY START: call TigPutDBProperty('schema-version','7.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-installer-create-db.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: create database create database ${dbName}; -- QUERY END: create database -- QUERY START: add user GRANT ALL ON ${dbName}.* TO ${dbUser}@'%' IDENTIFIED BY '${dbPass}'; -- QUERY END: add user -- QUERY START: add user GRANT ALL ON ${dbName}.* TO ${dbUser}@'localhost' IDENTIFIED BY '${dbPass}'; -- QUERY END: add user -- QUERY START: add user GRANT ALL ON ${dbName}.* TO ${dbUser} IDENTIFIED BY '${dbPass}'; -- QUERY END: user -- QUERY START: update user privileges GRANT SELECT, INSERT, UPDATE ON mysql.proc TO ${dbUser}@'localhost'; -- QUERY END: update user privileges -- QUERY START: update user privileges GRANT SELECT, INSERT, UPDATE ON mysql.proc TO ${dbUser}@'%'; -- QUERY END: update user privileges -- QUERY START: update user privileges GRANT SELECT, INSERT, UPDATE ON mysql.proc TO ${dbUser}; -- QUERY END: update user privileges -- QUERY START: flush privileges FLUSH PRIVILEGES; -- QUERY END: flush privileges ================================================ FILE: tigase-server 7.1.0/database/mysql-installer-post.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-3.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to MySQL database execute following commands: -- -- mysqladmin -u root -pdbpass create tigase -- mysql -u root -pdbpass tigase < database/mysql-schema.sql -- echo "GRANT ALL ON tigase.* TO tigase_user@'%' \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql -- echo "GRANT ALL ON tigase.* TO tigase_user@'localhost' \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql -- echo "GRANT ALL ON tigase.* TO tigase_user \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql create table short_news ( -- Automatic record ID snid bigint unsigned NOT NULL auto_increment, -- Automaticly generated timestamp and automaticly updated on change publishing_time timestamp, -- Optional news type: 'shorts', 'minis', 'techs', 'funs'.... news_type varchar(10), -- Author JID author varchar(128) NOT NULL, -- Short subject - this is short news, right? subject varchar(128) NOT NULL, -- Short news message - this is short news, right? body varchar(1024) NOT NULL, primary key(snid), key publishing_time (publishing_time), key author (author), key news_type (news_type) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; create table xmpp_stanza ( id bigint unsigned NOT NULL auto_increment, stanza text NOT NULL, primary key (id) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; create table tig_users ( uid bigint unsigned NOT NULL, user_id varchar(128) NOT NULL, primary key (uid), unique key user_id (user_id) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; create table tig_nodes ( nid bigint unsigned NOT NULL, parent_nid bigint unsigned, uid bigint unsigned NOT NULL, node varchar(64) NOT NULL, primary key (nid), unique key tnode (parent_nid, uid, node), key node (node), constraint tig_nodes_constr foreign key (uid) references tig_users (uid) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; create table tig_pairs ( nid bigint unsigned, uid bigint unsigned NOT NULL, pkey varchar(128) NOT NULL, pval varchar(65535), key pkey (pkey), constraint tig_pairs_constr_1 foreign key (uid) references tig_users (uid), constraint tig_pairs_constr_2 foreign key (nid) references tig_nodes (nid) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; -- create table tig_max_ids ( -- max_uid bigint unsigned, -- max_nid bigint unsigned -- ) -- ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; -- insert into tig_max_ids (max_uid, max_nid) values (1, 1); -- Get top nodes for the user: user1@hostname -- -- select nid, node from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null); -- Get all subnodes of the node: /privacy/default for user: user1@hostname -- -- select nid, node from nodes, -- ( -- select nid as dnid from nodes, -- ( -- select nid as pnid from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null) -- AND (node = 'privacy') -- ) ptab where (parent_nid = pnid) -- AND (node = 'default') -- ) dtab where (parent_nid = dnid); -- Get all keys (pairs) for the node: /privacy/default/24 for user: user1@hostname -- -- select pkey, pval from pairs, -- ( -- select nid, node from nodes, -- ( -- select nid as dnid from nodes, -- ( -- select nid as pnid from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null) -- AND (node = 'privacy') -- ) ptab where (parent_nid = pnid) -- AND (node = 'default') -- ) dtab where (parent_nid = dnid) -- ) ntab where (pairs.nid = ntab.nid) AND (node = '24'); ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-4-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: -- This is a dummy user who keeps all the database-properties call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select NOW(), ' - Setting schema version to 4.0'; -- QUERY START: call TigPutDBProperty('schema-version', '4.0'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-4-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to MySQL database execute following commands: -- -- mysqladmin -u root -pdbpass create tigase -- mysql -u root -pdbpass tigase < database/mysql-schema-4.sql -- echo "GRANT ALL ON tigase.* TO tigase_user@'%' \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql -- echo "GRANT ALL ON tigase.* TO tigase_user@'localhost' \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql -- echo "GRANT ALL ON tigase.* TO tigase_user \ -- IDENTIFIED BY 'tigase_passwd'; \ -- FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql -- QUERY START: create table if not exists tig_users ( uid bigint unsigned NOT NULL auto_increment, -- Jabber User ID user_id varchar(2049) NOT NULL, -- UserID SHA1 hash to prevent duplicate user_ids sha1_user_id char(128) NOT NULL, -- User password encrypted or not user_pw varchar(255) default NULL, -- Time the account has been created acc_create_time timestamp DEFAULT CURRENT_TIMESTAMP, -- Time of the last user login last_login timestamp DEFAULT 0, -- Time of the last user logout last_logout timestamp DEFAULT 0, -- User online status, if > 0 then user is online, the value -- indicates the number of user connections. -- It is incremented on each user login and decremented on each -- user logout. online_status int default 0, -- Number of failed login attempts failed_logins int default 0, -- User status, whether the account is active or disabled -- >0 - account active, 0 - account disabled account_status int default 1, primary key (uid), unique key sha1_user_id (sha1_user_id), key user_pw (user_pw), -- key user_id (user_id(765)), key last_login (last_login), key last_logout (last_logout), key account_status (account_status), key online_status (online_status) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; -- QUERY END: -- QUERY START: CREATE INDEX part_of_user_id ON tig_users (user_id(255)); -- QUERY END: -- QUERY START: create table if not exists tig_nodes ( nid bigint unsigned NOT NULL auto_increment, parent_nid bigint unsigned, uid bigint unsigned NOT NULL, node varchar(255) NOT NULL, primary key (nid), unique key tnode (parent_nid, uid, node), key node (node), key uid (uid), key parent_nid (parent_nid), constraint tig_nodes_constr foreign key (uid) references tig_users (uid) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; -- QUERY END: -- QUERY START: create table if not exists tig_pairs ( nid bigint unsigned, uid bigint unsigned NOT NULL, pkey varchar(255) NOT NULL, pval mediumtext, key pkey (pkey), key uid (uid), key nid (nid), constraint tig_pairs_constr_1 foreign key (uid) references tig_users (uid), constraint tig_pairs_constr_2 foreign key (nid) references tig_nodes (nid) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; -- QUERY END: -- QUERY START: create table if not exists short_news ( -- Automatic record ID snid bigint unsigned NOT NULL auto_increment, -- Automaticly generated timestamp and automaticly updated on change publishing_time timestamp, -- Optional news type: 'shorts', 'minis', 'techs', 'funs'.... news_type varchar(10), -- Author JID author varchar(128) NOT NULL, -- Short subject - this is short news, right? subject varchar(128) NOT NULL, -- Short news message - this is short news, right? body varchar(1024) NOT NULL, primary key(snid), key publishing_time (publishing_time), key author (author), key news_type (news_type) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; -- QUERY END: -- QUERY START: create table if not exists xmpp_stanza ( id bigint unsigned NOT NULL auto_increment, stanza text NOT NULL, primary key (id) ) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-4-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Database stored procedures and functions for Tigase schema version 4.0.0 -- QUERY START: drop procedure if exists TigInitdb; -- QUERY END: -- QUERY START: drop procedure if exists TigAddUser; -- QUERY END: -- QUERY START: drop procedure if exists TigAddUserPlainPw; -- QUERY END: -- QUERY START: drop procedure if exists TigGetUserDBUid; -- QUERY END: -- QUERY START: drop procedure if exists TigRemoveUser; -- QUERY END: -- QUERY START: drop procedure if exists TigUpdatePassword; -- QUERY END: -- QUERY START: drop procedure if exists TigUpdatePasswordPlainPw; -- QUERY END: -- QUERY START: drop procedure if exists TigUpdatePasswordPlainPwRev; -- QUERY END: -- QUERY START: drop procedure if exists TigGetPassword; -- QUERY END: -- QUERY START: drop procedure if exists TigUserLogin; -- QUERY END: -- QUERY START: drop procedure if exists TigUserLoginPlainPw; -- QUERY END: -- QUERY START: drop procedure if exists TigUserLogout; -- QUERY END: -- QUERY START: drop procedure if exists TigOnlineUsers; -- QUERY END: -- QUERY START: drop procedure if exists TigOfflineUsers; -- QUERY END: -- QUERY START: drop procedure if exists TigAllUsers; -- QUERY END: -- QUERY START: drop procedure if exists TigAllUsersCount; -- QUERY END: -- QUERY START: drop procedure if exists TigDisableAccount; -- QUERY END: -- QUERY START: drop procedure if exists TigEnableAccount; -- QUERY END: -- QUERY START: drop procedure if exists TigActiveAccounts; -- QUERY END: -- QUERY START: drop procedure if exists TigDisabledAccounts; -- QUERY END: -- QUERY START: drop procedure if exists TigAddNode; -- QUERY END: -- QUERY START: drop procedure if exists TigTestAddUser; -- QUERY END: -- QUERY START: drop procedure if exists TigUsers2Ver4Convert; -- QUERY END: -- QUERY START: drop procedure if exists TigPutDBProperty; -- QUERY END: -- QUERY START: drop function if exists TigGetDBProperty; -- QUERY END: -- QUERY START: drop procedure if exists TigUpdatePairs; -- QUERY END: delimiter // -- QUERY START: -- Database properties get - function create function TigGetDBProperty(_tkey varchar(255) CHARSET utf8) returns mediumtext CHARSET utf8 READS SQL DATA begin declare _result mediumtext CHARSET utf8; select pval into _result from tig_pairs, tig_users where (pkey = _tkey) AND (sha1_user_id = sha1(lower('db-properties'))) AND (tig_pairs.uid = tig_users.uid); return (_result); end // -- QUERY END: -- QUERY START: -- Database properties set - procedure create procedure TigPutDBProperty(_tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists( select 1 from tig_pairs, tig_users where (sha1_user_id = sha1(lower('db-properties'))) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs, tig_users set pval = _tval where (sha1_user_id = sha1(lower('db-properties'))) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey); else insert into tig_pairs (pkey, pval, uid) select _tkey, _tval, uid from tig_users where (sha1_user_id = sha1(lower('db-properties'))); end if; end // -- QUERY END: -- QUERY START: -- The initialization of the database. -- The procedure should be called manually somehow before starting the -- server. In theory the server could call the procedure automatically -- at the startup time but I don't know yet how to solve the problem -- with multiple cluster nodes starting at later time when the server -- is already running. create procedure TigInitdb() begin update tig_users set online_status = 0; end // -- QUERY END: -- QUERY START: -- Add a new user to the database assuming the user password is already -- encoded properly according to the database settings. -- If password is not encoded TigAddUserPlainPw should be used instead. create procedure TigAddUser(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin declare res_uid bigint unsigned; insert into tig_users (user_id, sha1_user_id, user_pw) values (_user_id, sha1(lower(_user_id)), _user_pw); select LAST_INSERT_ID() into res_uid; insert into tig_nodes (parent_nid, uid, node) values (NULL, res_uid, 'root'); if _user_pw is NULL then update tig_users set account_status = -1 where uid = res_uid; end if; select res_uid as uid; end // -- QUERY END: -- QUERY START: -- Takes plain text user password and converts it to internal representation -- and creates a new user account. create procedure TigAddUserPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin case TigGetDBProperty('password-encoding') when 'MD5-PASSWORD' then call TigAddUser(_user_id, MD5(_user_pw)); when 'MD5-USERID-PASSWORD' then call TigAddUser(_user_id, MD5(CONCAT(_user_id, _user_pw))); when 'MD5-USERNAME-PASSWORD' then call TigAddUser(_user_id, MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))); else call TigAddUser(_user_id, _user_pw); end case; end // -- QUERY END: -- QUERY START: -- Low level database user id as big number. Used only for performance reasons -- and save database space. Besides JID is too large to server as UID create procedure TigGetUserDBUid(_user_id varchar(2049) CHARSET utf8) begin select uid from tig_users where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- Removes a user from the database create procedure TigRemoveUser(_user_id varchar(2049) CHARSET utf8) begin declare res_uid bigint unsigned; select uid into res_uid from tig_users where sha1_user_id = sha1(lower(_user_id)); delete from tig_pairs where uid = res_uid; delete from tig_nodes where uid = res_uid; delete from tig_users where uid = res_uid; end // -- QUERY END: -- QUERY START: -- Returns user's password from the database create procedure TigGetPassword(_user_id varchar(2049) CHARSET utf8) begin select user_pw from tig_users where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- Takes plain text user password and converts it to internal representation create procedure TigUpdatePasswordPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin case TigGetDBProperty('password-encoding') when 'MD5-PASSWORD' then call TigUpdatePassword(_user_id, MD5(_user_pw)); when 'MD5-USERID-PASSWORD' then call TigUpdatePassword(_user_id, MD5(CONCAT(_user_id, _user_pw))); when 'MD5-USERNAME-PASSWORD' then call TigUpdatePassword(_user_id, MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))); else call TigUpdatePassword(_user_id, _user_pw); end case; end // -- QUERY END: -- QUERY START: -- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order. -- Some implementations require the parameters to be in the same order as -- the update query. create procedure TigUpdatePasswordPlainPwRev(_user_pw varchar(255) CHARSET utf8, _user_id varchar(2049) CHARSET utf8) begin call TigUpdatePasswordPlainPw(_user_id, _user_pw); end // -- QUERY END: -- QUERY START: -- Update user password create procedure TigUpdatePassword(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin update tig_users set user_pw = _user_pw where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- List all online users create procedure TigOnlineUsers() begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where online_status > 0; end // -- QUERY END: -- QUERY START: -- List all offline users create procedure TigOfflineUsers() begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where online_status = 0; end // -- QUERY END: -- QUERY START: -- List of all users in database create procedure TigAllUsers() begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users; end // -- QUERY END: -- QUERY START: -- All users count create procedure TigAllUsersCount() begin select count(*) from tig_users; end // -- QUERY END: -- QUERY START: -- Performs user login for a plain text password, converting it to an internal -- representation if necessary create procedure TigUserLoginPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin case TigGetDBProperty('password-encoding') when 'MD5-PASSWORD' then call TigUserLogin(_user_id, MD5(_user_pw)); when 'MD5-USERID-PASSWORD' then call TigUserLogin(_user_id, MD5(CONCAT(_user_id, _user_pw))); when 'MD5-USERNAME-PASSWORD' then call TigUserLogin(_user_id, MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))); else call TigUserLogin(_user_id, _user_pw); end case; end // -- QUERY END: -- QUERY START: -- Perforrm user login. It returns user_id uppon success and NULL -- on failure. -- If the login is successful it also increases online_status and sets -- last_login time to the current timestamp create procedure TigUserLogin(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin if exists(select 1 from tig_users where (account_status > 0) AND (sha1_user_id = sha1(lower(_user_id))) AND (user_pw = _user_pw) AND (user_id = _user_id)) then update tig_users set online_status = online_status + 1, last_login = CURRENT_TIMESTAMP where sha1_user_id = sha1(lower(_user_id)); select _user_id as user_id; else update tig_users set failed_logins = failed_logins + 1 where sha1_user_id = sha1(lower(_user_id)); select NULL as user_id; end if; end // -- QUERY END: -- QUERY START: -- It decreases online_status and sets last_logout time to the current timestamp create procedure TigUserLogout(_user_id varchar(2049) CHARSET utf8) begin update tig_users set online_status = greatest(online_status - 1, 0), last_logout = CURRENT_TIMESTAMP where user_id = _user_id; end // -- QUERY END: -- QUERY START: -- Disable user account create procedure TigDisableAccount(_user_id varchar(2049) CHARSET utf8) begin update tig_users set account_status = 0 where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- Enable user account create procedure TigEnableAccount(_user_id varchar(2049) CHARSET utf8) begin update tig_users set account_status = 1 where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- Get list of all active user accounts create procedure TigActiveAccounts() begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where account_status > 0; end // -- QUERY END: -- QUERY START: -- Get list of all disabled user accounts create procedure TigDisabledAccounts() begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where account_status = 0; end // -- QUERY END: -- QUERY START: -- Helper procedure for adding a new node create procedure TigAddNode(_parent_nid bigint, _uid bigint, _node varchar(255) CHARSET utf8) begin insert into tig_nodes (parent_nid, uid, node) values (_parent_nid, _uid, _node); select LAST_INSERT_ID() as nid; end // -- QUERY END: -- QUERY START: -- Procedure to efficiently and safely update data in tig_pairs table create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey) then UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey; ELSE INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval); END IF; end // -- QUERY END: -- QUERY START: -- For testing only: create procedure TigTestAddUser(_user_id varchar(2049) CHARSET utf8, _user_passwd varchar(255) CHARSET utf8, success_text text CHARSET utf8, failure_text text CHARSET utf8) begin declare insert_status int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET insert_status=1; call TigAddUserPLainPw(_user_id, _user_passwd); if insert_status = 0 then select success_text; else select failure_text; end if; end // -- QUERY END: -- QUERY START: create procedure TigUsers2Ver4Convert() begin declare _user_id varchar(2049) CHARSET utf8; declare _password varchar(255) CHARSET utf8; declare _parent_nid bigint; declare _uid bigint; declare _node varchar(255) CHARSET utf8; declare l_last_row_fetched int default 0; DECLARE cursor_users CURSOR FOR select user_id, pval as password from tig_users, tig_pairs where tig_users.uid = tig_pairs.uid and pkey = 'password'; DECLARE CONTINUE HANDLER FOR NOT FOUND SET l_last_row_fetched=1; START TRANSACTION; SET l_last_row_fetched=0; OPEN cursor_users; cursor_loop:LOOP FETCH cursor_users INTO _user_id, _password; IF l_last_row_fetched=1 THEN LEAVE cursor_loop; END IF; call TigUpdatePasswordPlainPw(_user_id, _password); END LOOP cursor_loop; CLOSE cursor_users; SET l_last_row_fetched=0; COMMIT; end // -- QUERY END: delimiter ; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-4-test.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- select 'Initializing database..'; call TigInitdb(); -- Possible encodings are: -- - 'MD5-USERID-PASSWORD' -- - 'MD5-PASSWORD' -- - 'PLAIN' -- More can be added if needed. call TigPutDBProperty('password-encoding', 'PLAIN'); call TigPutDBProperty('schema-version', '4.0'); select 'Adding new user with PlainPw: ', 'test_user', 'test_password'; call TigTestAddUser('test_user', 'test_passwd', 'SUCCESS - adding new user', 'ERROR - adding new user'); call TigUserLogin('test_user', 'wrong_passwd', @res_user_id); select @res_user_id as user_id\g select if(@res_user_id is NULL, 'SUCCESS - User login failed as expected, used UserLogin', 'ERROR - User login succeeded as NOT expected'); call TigUserLoginPlainPw('test_user', 'wrong_passwd', @res_user_id); select if(@res_user_id is NULL, 'SUCCESS - User login failed as expected, used wrong password', 'ERROR - User login succeeded as NOT expected'); call TigUserLoginPlainPw('test_user', 'test_passwd', @res_user_id); select if(@res_user_id is not NULL, 'SUCCESS - User login OK as expected, used UserLoginPlainPw', 'ERROR - User login failed as NOT expected'); call TigUserLogout('test_user'); call TigUserLogout('test_user'); select online_status into @res_online_status from tig_users where user_id = 'test_user'; select if(@res_online_status = 0, 'SUCCESS - online status OK after 2 logouts', 'ERROR - online status incorrect after 2 logouts'); select 'Changing password using UpdatePassword'; call TigUpdatePassword('test_user', 'new_password'); call TigUserLoginPlainPw('test_user', 'new_password', @res_user_id); select if(@res_user_id is NULL, 'SUCCESS - User login failed as expected, password incorrectly changed', 'ERROR - User login succeeded as NOT expected'); select 'Changing password using UpdatePasswordPlainPw'; call TigUpdatePasswordPlainPw('test_user', 'new_password'); call TigUserLoginPlainPw('test_user', 'new_password', @res_user_id); select if(@res_user_id is not NULL, 'SUCCESS - User login OK as expected, password updated with PlainPw', 'ERROR - User login failed as NOT expected'); call TigUserLogout('test_user'); select 'Disabling user account'; call TigDisableAccount('test_user'); call TigUserLoginPlainPw('test_user', 'new_password', @res_user_id); select if(@res_user_id is NULL, 'SUCCESS - User login failed as expected, account disabled', 'ERROR - User login succeeded as NOT expected'); select 'Enabling user account'; call TigEnableAccount('test_user'); call TigUserLoginPlainPw('test_user', 'new_password', @res_user_id); select if(@res_user_id is not NULL, 'SUCCESS - User login OK as expected, account enabled', 'ERROR - User login failed as NOT expected'); call TigUserLogout('test_user'); select 'Adding new user with PlainPw: ', 'test_user_2', 'test_password_2'; call TigTestAddUser('test_user_2', 'test_passwd_2', 'SUCCESS - adding new user', 'ERROR - adding new user'); select 'Adding a user with the same user_id: ', 'test_user', 'test_password_2'; call TigTestAddUser('test_user', 'test_password_2', 'ERROR, that was duplicate entry insertion and it should fail.', 'SUCCESS - user adding failure as expected as that was duplicate entry insertion attempt'); call TigRemoveUser('test_user'); call TigRemoveUser('test_user_2'); call TigOnlineUsers(); call TigOfflineUsers(); ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-4.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- source database/mysql-schema-4-schema.sql; source database/mysql-schema-4-sp.sql; source database/mysql-schema-4-props.sql; -- LOAD FILE: database/mysql-schema-4-schema.sql -- LOAD FILE: database/mysql-schema-4-sp.sql -- LOAD FILE: database/mysql-schema-4-props.sql ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-5-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: -- This is a dummy user who keeps all the database-properties call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select NOW(), ' - Setting schema version to 5.1'; -- QUERY START: call TigPutDBProperty('schema-version', '5.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-5-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Database stored procedures and functions for Tigase schema version 5.1 source database/mysql-schema-4-schema.sql; -- LOAD FILE: database/mysql-schema-4-schema.sql ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-5-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Database stored procedures and functions for Tigase schema version 5.1 source database/mysql-schema-4-sp.sql; -- LOAD FILE: database/mysql-schema-4-sp.sql -- QUERY START: drop procedure if exists TigUpdatePairs; -- QUERY END: delimiter // -- QUERY START: -- Procedure to efficiently and safely update data in tig_pairs table create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey) then UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey; ELSE INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval); END IF; end // -- QUERY END: delimiter ; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- source database/mysql-schema-4-schema.sql; source database/mysql-schema-5-1-sp.sql; source database/mysql-schema-5-1-props.sql; -- LOAD FILE: database/mysql-schema-4-schema.sql; -- LOAD FILE: database/mysql-schema-5-1-sp.sql; -- LOAD FILE: database/mysql-schema-5-1-props.sql; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-5.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- source database/mysql-schema-4-schema.sql; source database/mysql-schema-4-sp.sql; source database/mysql-schema-4-props.sql; -- LOAD FILE: database/mysql-schema-4-schema.sql; -- LOAD FILE: database/mysql-schema-4-sp.sql; -- LOAD FILE: database/mysql-schema-4-props.sql; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-7-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- QUERY START: -- This is a dummy user who keeps all the database-properties call TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select NOW(), ' - Setting schema version to 7.1'; -- QUERY START: call TigPutDBProperty('schema-version', '7.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-7-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- Database stored procedures and functions for Tigase schema version 5.1 source database/mysql-schema-5-1-schema.sql; -- LOAD FILE: database/mysql-schema-5-1-schema.sql -- QUERY START: ALTER TABLE tig_pairs ADD `pid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-7-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- Database stored procedures and functions for Tigase schema version 5.1 source database/mysql-schema-5-1-sp.sql; -- LOAD FILE: database/mysql-schema-5-1-sp.sql -- QUERY START: drop procedure if exists TigAddNode; -- QUERY END: -- QUERY START: drop procedure if exists TigPutDBProperty; -- QUERY END: -- QUERY START: drop procedure if exists TigUserLogout; -- QUERY END: delimiter // -- QUERY START: -- Helper procedure for adding a new node create procedure TigAddNode(_parent_nid bigint, _uid bigint, _node varchar(255) CHARSET utf8) begin if exists(SELECT 1 FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node) then SELECT nid FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node; ELSEIF exists(SELECT 1 FROM tig_nodes WHERE _parent_nid is null AND uid = _uid AND 'root' = _node) then SELECT nid FROM tig_nodes WHERE uid = _uid AND node = _node; ELSE insert into tig_nodes (parent_nid, uid, node) values (_parent_nid, _uid, _node); select LAST_INSERT_ID() as nid; END IF; end // -- QUERY END: -- QUERY START: -- Database properties set - procedure create procedure TigPutDBProperty(_tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists( select 1 from tig_pairs, tig_users where (sha1_user_id = sha1(lower('db-properties'))) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs tp, tig_users tu, tig_nodes tn set pval = _tval where (tu.sha1_user_id = sha1(lower('db-properties'))) AND (tu.uid = tp.uid) AND (tp.pkey = _tkey) AND (tn.node = "root"); else insert into tig_pairs (pkey, pval, uid, nid) select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (tu.sha1_user_id = sha1(lower('db-properties')) and tn.node="root"); end if; end // -- QUERY END: -- QUERY START: -- It decreases online_status and sets last_logout time to the current timestamp create procedure TigUserLogout(_user_id varchar(2049) CHARSET utf8) begin update tig_users set online_status = greatest(online_status - 1, 0), last_logout = CURRENT_TIMESTAMP where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: delimiter ; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- source database/mysql-schema-7-1-schema.sql; source database/mysql-schema-7-1-sp.sql; source database/mysql-schema-7-1-props.sql; -- LOAD FILE: database/mysql-schema-7-1-schema.sql; -- LOAD FILE: database/mysql-schema-7-1-sp.sql; -- LOAD FILE: database/mysql-schema-7-1-props.sql; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-upgrade-to-4.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Database schema upgrade for Tigase version 4.0.0 select NOW(), ' - Dropping foreign indexes'; -- QUERY START: alter table tig_nodes DROP FOREIGN KEY tig_nodes_constr; -- QUERY END: -- QUERY START: alter table tig_pairs DROP FOREIGN KEY tig_pairs_constr_1; -- QUERY END: -- QUERY START: alter table tig_pairs DROP FOREIGN KEY tig_pairs_constr_2; -- QUERY END: select NOW(), ' - Renaming old tig_pairs table for later convertion'; -- QUERY START: alter table tig_pairs rename to tig_pairs_old; -- QUERY END: select NOW(), ' - Renaming old tig_nodes table for later convertion'; -- QUERY START: alter table tig_nodes rename to tig_nodes_old; -- QUERY END: -- QUERY START: alter table tig_nodes_old add index parent_nid (parent_nid); -- QUERY END: -- QUERY START: alter table tig_nodes_old add index uid (uid); -- QUERY END: select NOW(), ' - Renaming old tig_users table for later convertion'; -- QUERY START: alter table tig_users rename to tig_users_old; -- QUERY END: select NOW(), ' - Loading new database schema 4.0'; -- LOAD SCHEMA: source database/mysql-schema-4-schema.sql; select NOW(), ' - Setting passwords encoding in the database'; -- Possible encodings are: -- - 'MD5-USERID-PASSWORD' -- - 'MD5-PASSWORD' -- - 'PLAIN' -- More can be added if needed. -- QUERY START: call TigPutDBProperty('password-encoding', 'PLAIN'); -- QUERY END: select NOW(), ' - Temporarly adding old_uid column to tig_users table'; -- QUERY START: alter table tig_users add column old_uid bigint; -- QUERY END: -- QUERY START: alter table tig_users add index old_uid (old_uid); -- QUERY END: select NOW(), ' - Temporarly adding old_nid column to tig_nodes table'; -- QUERY START: alter table tig_nodes add column old_nid bigint; -- QUERY END: -- QUERY START: alter table tig_nodes add index old_nid (old_nid); -- QUERY END: select NOW(), ' - Copying tig_users data to a new table'; -- QUERY START: insert into tig_users (user_id, sha1_user_id, old_uid) select user_id, sha1(user_id), uid from tig_users_old; -- QUERY END: select NOW(), ' - Copying tig_nodes data to a new table'; -- QUERY START: insert into tig_nodes (uid, old_nid, node) select tig_users.uid, nid, node from tig_users, tig_nodes_old where (tig_nodes_old.uid = tig_users.old_uid); -- QUERY END: select NOW(), ' - Updating parent_nids in the new tig_nodes table'; -- QUERY START: create temporary table temp_nodes select tig_nodes.uid as new_uid, tig_nodes.nid as new_nid, tig_nodes_old.nid as old_nid, tig_nodes_old.parent_nid as old_parent_nid from tig_nodes, tig_nodes_old where tig_nodes.old_nid = tig_nodes_old.nid; -- QUERY END: -- QUERY START: alter table temp_nodes add index new_nid (new_nid); -- QUERY END: -- QUERY START: alter table temp_nodes add index old_nid (old_nid); -- QUERY END: -- QUERY START: update tig_nodes, tig_nodes_old, temp_nodes set tig_nodes.parent_nid = temp_nodes.new_nid where (tig_nodes.old_nid = tig_nodes_old.nid) AND (tig_nodes_old.parent_nid = temp_nodes.old_nid); -- QUERY END: select NOW(), ' - Loading tig_pairs table from old one with new uids and nids'; -- QUERY START: insert into tig_pairs (nid, uid, pkey, pval) select tig_nodes.nid, tig_users.uid, pkey, pval from tig_pairs_old, tig_users, tig_nodes where (tig_pairs_old.uid = tig_users.old_uid) AND (tig_pairs_old.nid = tig_nodes.old_nid); -- QUERY END: select NOW(), ' - Droping temporarly columns'; -- QUERY START: alter table tig_users drop index old_uid; -- QUERY END: -- QUERY START: alter table tig_users drop column old_uid; -- QUERY END: -- QUERY START: alter table tig_nodes drop index old_nid; -- QUERY END: -- QUERY START: alter table tig_nodes drop column old_nid; -- QUERY END: select NOW(), ' - Converting user passwords to a new format'; -- QUERY START: call TigUsers2Ver4Convert(); -- QUERY END: select NOW(), ' - All done, database ready to use!'; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-upgrade-to-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- select NOW(), ' - Installing missing stored procedures'; -- QUERY START: drop procedure if exists TigUpdatePairs; -- QUERY END: delimiter // -- QUERY START: -- Procedure to efficiently and safely update data in tig_pairs table create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey) then UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey; ELSE INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval); END IF; end // -- QUERY END: delimiter ; -- QUERY START: call TigPutDBProperty('schema-version', '5.1'); -- QUERY END: select NOW(), ' - All done, database ver 5.1 ready to use!'; ================================================ FILE: tigase-server 7.1.0/database/mysql-schema-upgrade-to-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- select NOW(), ' - Upgrading schema to version 7.1'; select NOW(), 'modifying stored procedures'; -- QUERY START: drop procedure if exists TigUserLogout; -- QUERY END: -- QUERY START: drop procedure if exists TigAddNode; -- QUERY END: -- QUERY START: drop procedure if exists TigPutDBProperty; -- QUERY END: delimiter // -- QUERY START: -- It decreases online_status and sets last_logout time to the current timestamp create procedure TigUserLogout(_user_id varchar(2049) CHARSET utf8) begin update tig_users set online_status = greatest(online_status - 1, 0), last_logout = CURRENT_TIMESTAMP where sha1_user_id = sha1(lower(_user_id)); end // -- QUERY END: -- QUERY START: -- Helper procedure for adding a new node create procedure TigAddNode(_parent_nid bigint, _uid bigint, _node varchar(255) CHARSET utf8) begin if exists(SELECT 1 FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node) then SELECT nid FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node; ELSEIF exists(SELECT 1 FROM tig_nodes WHERE _parent_nid is null AND uid = _uid AND 'root' = _node) then SELECT nid FROM tig_nodes WHERE uid = _uid AND node = _node; ELSE insert into tig_nodes (parent_nid, uid, node) values (_parent_nid, _uid, _node); select LAST_INSERT_ID() as nid; END IF; end // -- QUERY END: -- QUERY START: -- Database properties set - procedure create procedure TigPutDBProperty(_tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) begin if exists( select 1 from tig_pairs, tig_users where (sha1_user_id = sha1(lower('db-properties'))) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs tp, tig_users tu, tig_nodes tn set pval = _tval where (tu.sha1_user_id = sha1(lower('db-properties'))) AND (tu.uid = tp.uid) AND (tp.pkey = _tkey) AND (tn.node = "root"); else insert into tig_pairs (pkey, pval, uid, nid) select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (tu.sha1_user_id = sha1(lower('db-properties')) and tn.node="root"); end if; end // -- QUERY END: delimiter ; -- QUERY START: select NOW(), 'adding root node for db-properties'; -- QUERY END: -- QUERY START: call TigAddNode(null,(select uid from tig_users where user_id="db-properties"),"root"); -- QUERY END: -- QUERY START: update tig_pairs set nid = (select nid from tig_nodes where uid=(select uid from tig_users where user_id="db-properties") and node="root") where uid=(select uid from tig_users where user_id="db-properties"); -- QUERY END: -- QUERY START: select NOW(), 'altering tig_pairs table to add missing indexes'; -- QUERY END: -- QUERY START: ALTER TABLE tig_pairs ADD `pid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY -- QUERY END: -- QUERY START: call TigPutDBProperty('schema-version', '7.1'); -- QUERY END: -- QUERY START: select NOW(), ' - All done, database ver 7.1 ready to use!'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-installer-create-db.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: create database create database ${dbName}; -- QUERY END: create database -- QUERY START: add user create user ${dbUser} with password '${dbPass}'; -- QUERY END: add user -- QUERY START: GRANT ALL GRANT ALL ON database ${dbName} TO ${dbUser}; -- QUERY END: GRANT ALL -- QUERY START: ALTER DATABASE ALTER DATABASE ${dbName} OWNER TO ${dbUser}; -- QUERY END: ALTER DATABASE ================================================ FILE: tigase-server 7.1.0/database/postgresql-installer-post.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Permissions fix -- QUERY START: ALTER SCHEMA ALTER SCHEMA public OWNER TO ${dbUser}; -- QUERY END: ALTER SCHEMA -- QUERY START: GRANT ALL ON ALL TABLES GRANT ALL ON ALL TABLES IN SCHEMA public TO ${dbUser}; -- QUERY END: GRANT ALL ON ALL TABLES -- QUERY START: GRANT ALL ON ALL FUNCTIONS GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO ${dbUser}; -- QUERY END: GRANT ALL ON ALL FUNCTIONS -- QUERY START: GRANT ALL ON ALL SEQUENCES GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO ${dbUser}; -- QUERY END: GRANT ALL ON ALL SEQUENCES ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-3.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql create table short_news ( -- Automatic record ID snid serial, -- Automaticly generated timestamp and automaticly updated on change publishing_time timestamp default now(), -- Optional news type: 'shorts', 'minis', 'techs', 'funs'.... news_type varchar(10), -- Author JID author varchar(128) NOT NULL, -- Short subject - this is short news, right? subject varchar(128) NOT NULL, -- Short news message - this is short news, right? body varchar(1024) NOT NULL, primary key(snid) ); create index publishing_time on short_news (publishing_time); create index author on short_news (author); create index news_type on short_news (news_type); create table xmpp_stanza ( id serial, stanza text NOT NULL ); create table tig_users ( uid bigint NOT NULL, user_id varchar(128) NOT NULL, primary key (uid) ); create unique index user_id on tig_users ( user_id ); create table tig_nodes ( nid bigint NOT NULL, parent_nid bigint, uid bigint NOT NULL references tig_users(uid), node varchar(64) NOT NULL, primary key (nid) ); create unique index tnode on tig_nodes ( parent_nid, uid, node ); create index node on tig_nodes ( node ); create table tig_pairs ( nid bigint references tig_nodes(nid), uid bigint NOT NULL references tig_users(uid), pkey varchar(128) NOT NULL, pval varchar(65535) ); create index pkey on tig_pairs ( pkey ); create table tig_max_ids ( max_uid bigint, max_nid bigint ); insert into tig_max_ids (max_uid, max_nid) values (1, 1); -- Get top nodes for the user: user1@hostname -- -- select nid, node from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null); -- Get all subnodes of the node: /privacy/default for user: user1@hostname -- -- select nid, node from nodes, -- ( -- select nid as dnid from nodes, -- ( -- select nid as pnid from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null) -- AND (node = 'privacy') -- ) ptab where (parent_nid = pnid) -- AND (node = 'default') -- ) dtab where (parent_nid = dnid); -- Get all keys (pairs) for the node: /privacy/default/24 for user: user1@hostname -- -- select pkey, pval from pairs, -- ( -- select nid, node from nodes, -- ( -- select nid as dnid from nodes, -- ( -- select nid as pnid from nodes, users -- where ('user1@hostname' = user_id) -- AND (nodes.uid = users.uid) -- AND (parent_nid is null) -- AND (node = 'privacy') -- ) ptab where (parent_nid = pnid) -- AND (node = 'default') -- ) dtab where (parent_nid = dnid) -- ) ntab where (pairs.nid = ntab.nid) AND (node = '24'); ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-4-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: -- This is a dummy user who keeps all the database-properties select TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select now(), ' - Setting schema version to 4.0'; -- QUERY START: select TigPutDBProperty('schema-version', '4.0'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-4-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: create table tig_users ( uid bigserial, -- Jabber User ID user_id varchar(2049) NOT NULL, -- User password encrypted or not user_pw varchar(255) default NULL, -- Time the account has been created acc_create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time of the last user login last_login timestamp, -- Time of the last user logout last_logout timestamp, -- User online status, if > 0 then user is online, the value -- indicates the number of user connections. -- It is incremented on each user login and decremented on each -- user logout. online_status int default 0, -- Number of failed login attempts failed_logins int default 0, -- User status, whether the account is active or disabled -- >0 - account active, 0 - account disabled account_status int default 1, primary key (uid) ); -- QUERY END: -- QUERY START: create unique index user_id on tig_users ( lower(user_id) ); -- QUERY END: -- QUERY START: create index user_pw on tig_users (user_pw); -- QUERY END: -- QUERY START: create index last_login on tig_users (last_login); -- QUERY END: -- QUERY START: create index last_logout on tig_users (last_logout); -- QUERY END: -- QUERY START: create index account_status on tig_users (account_status); -- QUERY END: -- QUERY START: create index online_status on tig_users (online_status); -- QUERY END: -- QUERY START: create table tig_nodes ( nid bigserial, parent_nid bigint, uid bigint NOT NULL references tig_users(uid), node varchar(255) NOT NULL, primary key (nid) ); -- QUERY END: -- QUERY START: create unique index tnode on tig_nodes ( parent_nid, uid, node ); -- QUERY END: -- QUERY START: create index node on tig_nodes ( node ); -- QUERY END: -- QUERY START: create index nuid on tig_nodes (uid); -- QUERY END: -- QUERY START: create index parent_nid on tig_nodes (parent_nid); -- QUERY END: -- QUERY START: create table tig_pairs ( nid bigint references tig_nodes(nid), uid bigint NOT NULL references tig_users(uid), pkey varchar(255) NOT NULL, pval text ); -- QUERY END: -- QUERY START: create index pkey on tig_pairs ( pkey ); -- QUERY END: -- QUERY START: create index puid on tig_pairs (uid); -- QUERY END: -- QUERY START: create index pnid on tig_pairs (nid); -- QUERY END: -- QUERY START: create table short_news ( -- Automatic record ID snid bigserial, -- Automaticly generated timestamp and automaticly updated on change publishing_time timestamp default now(), -- Optional news type: 'shorts', 'minis', 'techs', 'funs'.... news_type varchar(10), -- Author JID author varchar(128) NOT NULL, -- Short subject - this is short news, right? subject varchar(128) NOT NULL, -- Short news message - this is short news, right? body varchar(1024) NOT NULL, primary key(snid) ); -- QUERY END: -- QUERY START: create index publishing_time on short_news (publishing_time); -- QUERY END: -- QUERY START: create index author on short_news (author); -- QUERY END: -- QUERY START: create index news_type on short_news (news_type); -- QUERY END: -- QUERY START: create table xmpp_stanza ( id bigserial, stanza text NOT NULL ); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-4-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- Database stored procedures and fucntions for Tigase schema version 4.0.0 -- QUERY START: CREATE OR REPLACE FUNCTION public.create_plpgsql_language () RETURNS TEXT AS $$ CREATE LANGUAGE plpgsql; SELECT 'language plpgsql created'::TEXT; $$ LANGUAGE 'sql'; SELECT CASE WHEN (SELECT true::BOOLEAN FROM pg_language WHERE lanname='plpgsql') THEN (SELECT 'language already installed'::TEXT) ELSE (SELECT public.create_plpgsql_language()) END; DROP FUNCTION public.create_plpgsql_language (); -- QUERY END: -- QUERY START: -- Database properties get - function create or replace function TigGetDBProperty(varchar(255)) returns text as ' declare _result text; _tkey alias for $1; begin select pval into _result from tig_pairs, tig_users where (pkey = _tkey) AND (lower(user_id) = lower(''db-properties'')) AND (tig_pairs.uid = tig_users.uid); return _result; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Database properties set - procedure create or replace function TigPutDBProperty(varchar(255), text) returns void as ' declare _tkey alias for $1; _tval alias for $2; begin if exists( select pval from tig_pairs, tig_users where (lower(user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs set pval = _tval from tig_users where (lower(tig_users.user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey); else insert into tig_pairs (pkey, pval, uid) select _tkey, _tval, uid from tig_users where (lower(user_id) = lower(''db-properties'')); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- The initialization of the database. -- The procedure should be called manually somehow before starting the -- server. In theory the server could call the procedure automatically -- at the startup time but I don't know yet how to solve the problem -- with multiple cluster nodes starting at later time when the server -- is already running. create or replace function TigInitdb() returns void as ' begin update tig_users set online_status = 0; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Add a new user to the database assuming the user password is already -- encoded properly according to the database settings. -- If password is not encoded TigAddUserPlainPw should be used instead. create or replace function TigAddUser(varchar(2049), varchar(255)) returns bigint as ' declare _user_id alias for $1; _user_pw alias for $2; _res_uid bigint; begin if exists( select uid from tig_users where (lower(user_id) = lower(_user_id)) AND (user_pw = _user_pw) ) then return null; else insert into tig_users (user_id, user_pw) values (_user_id, _user_pw); select currval(''tig_users_uid_seq'') into _res_uid; insert into tig_nodes (parent_nid, uid, node) values (NULL, _res_uid, ''root''); return _res_uid as uid; end if; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Takes plain text user password and converts it to internal representation -- and creates a new user account. create or replace function TigAddUserPlainPw(varchar(2049), varchar(255)) returns bigint as ' declare _user_id alias for $1; _user_pw alias for $2; _enc text; _res_uid bigint; begin select TigGetDBProperty(''password-encoding'') into _enc; select case _enc when ''MD5-PASSWORD'' then TigAddUser(_user_id, MD5(_user_pw)) when ''MD5-USERID-PASSWORD'' then TigAddUser(_user_id, MD5(_user_id || _user_pw)) when ''MD5-USERNAME-PASSWORD'' then TigAddUser(_user_id, MD5(split_part(_user_id, ''@'', 1) || _user_pw)) else TigAddUser(_user_id, _user_pw) end into _res_uid; return _res_uid as uid; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Low level database user id as big number. Used only for performance reasons -- and save database space. Besides JID is too large to server as UID create or replace function TigGetUserDBUid(varchar(2049)) returns bigint as ' declare _user_id alias for $1; res_uid bigint; begin select uid into res_uid from tig_users where lower(user_id) = lower(_user_id); return res_uid; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Removes a user from the database create or replace function TigRemoveUser(varchar(2049)) returns void as ' declare _user_id alias for $1; res_uid bigint; begin select uid into res_uid from tig_users where lower(user_id) = lower(_user_id); delete from tig_pairs where uid = res_uid; delete from tig_nodes where uid = res_uid; delete from tig_users where uid = res_uid; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Returns user's password from the database create or replace function TigGetPassword(varchar(2049)) returns varchar(255) as ' declare _user_id alias for $1; res_pw varchar(255); begin select user_pw into res_pw from tig_users where lower(user_id) = lower(_user_id); return res_pw; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Takes plain text user password and converts it to internal representation create or replace function TigUpdatePasswordPlainPw(varchar(2049), varchar(255)) returns void as ' declare _user_id alias for $1; _user_pw alias for $2; _enc text; begin select TigGetDBProperty(''password-encoding'') into _enc; perform case _enc when ''MD5-PASSWORD'' then TigUpdatePassword(_user_id, MD5(_user_pw)) when ''MD5-USERID-PASSWORD'' then TigUpdatePassword(_user_id, MD5(_user_id || _user_pw)) when ''MD5-USERNAME-PASSWORD'' then TigUpdatePassword(_user_id, MD5(split_part(_user_id, ''@'', 1) || _user_pw)) else TigUpdatePassword(_user_id, _user_pw) end; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order. -- Some implementations require the parameters to be in the same order as -- the update query. create or replace function TigUpdatePasswordPlainPwRev(varchar(255), varchar(2049)) returns void as ' declare _user_pw alias for $1; _user_id alias for $2; begin perform TigUpdatePasswordPlainPw(_user_id, _user_pw); return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Update user password create or replace function TigUpdatePassword(varchar(2049), varchar(255)) returns void as ' declare _user_id alias for $1; _user_pw alias for $2; begin update tig_users set user_pw = _user_pw where lower(user_id) = lower(_user_id); return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- List all online users create or replace function TigOnlineUsers() returns void as ' begin return; select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where online_status > 0; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- List all offline users create or replace function TigOfflineUsers() returns void as ' begin return; select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where online_status = 0; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- List of all users in database create or replace function TigAllUsers() returns setof varchar(2049) as 'select user_id from tig_users;' LANGUAGE 'sql'; -- create or replace function TigAllUsers() returns void as ' -- begin -- return; -- select user_id, last_login, last_logout, online_status, failed_logins, account_status -- from tig_users; -- end; -- ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- All users count create or replace function TigAllUsersCount() returns bigint as ' declare res_cnt bigint; begin select count(*) into res_cnt from tig_users; return res_cnt; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Performs user login for a plain text password, converting it to an internal -- representation if necessary create or replace function TigUserLoginPlainPw(varchar(2049), varchar(255)) returns varchar(2049) as ' declare _user_id alias for $1; _user_pw alias for $2; res_user_id varchar(2049); _enc text; begin select TigGetDBProperty(''password-encoding'') into _enc; select case _enc when ''MD5-PASSWORD'' then TigUserLogin(_user_id, MD5(_user_pw)) when ''MD5-USERID-PASSWORD'' then TigUserLogin(_user_id, MD5(_user_id || _user_pw)) when ''MD5-USERNAME-PASSWORD'' then TigUserLogin(_user_id, MD5(split_part(_user_id, ''@'', 1) || _user_pw)) else TigUserLogin(_user_id, _user_pw) end into res_user_id; return res_user_id; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Perforrm user login. It returns user_id uppon success and NULL -- on failure. -- If the login is successful it also increases online_status and sets -- last_login time to the current timestamp create or replace function TigUserLogin(varchar(2049), varchar(255)) returns varchar(2049) as ' declare _user_id alias for $1; _user_pw alias for $2; res_user_id varchar(2049); begin if exists(select user_id from tig_users where (account_status > 0) AND (lower(user_id) = lower(_user_id)) AND (user_pw = _user_pw)) then update tig_users set online_status = online_status + 1, last_login = now() where lower(user_id) = lower(_user_id); select _user_id into res_user_id; else update tig_users set failed_logins = failed_logins + 1 where lower(user_id) = lower(_user_id); select NULL into res_user_id; end if; return res_user_id; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- It decreases online_status and sets last_logout time to the current timestamp create or replace function TigUserLogout(varchar(2049)) returns void as ' declare _user_id alias for $1; begin update tig_users set online_status = greatest(online_status - 1, 0), last_logout = now() where lower(user_id) = lower(_user_id); return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Disable user account create or replace function TigDisableAccount(varchar(2049)) returns void as ' declare _user_id alias for $1; begin update tig_users set account_status = 0 where lower(user_id) = lower(_user_id); return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Enable user account create or replace function TigEnableAccount(varchar(2049)) returns void as ' declare _user_id alias for $1; begin update tig_users set account_status = 1 where lower(user_id) = lower(_user_id); return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Get list of all active user accounts create or replace function TigActiveAccounts() returns void as ' begin return; select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where account_status > 0; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: -- Get list of all disabled user accounts create or replace function TigDisabledAccounts() returns table(user_id varchar(2049), last_login timestamp, last_logout timestamp, online_status int, failed_logins int, account_status int) as ' select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users where account_status = 0; ' LANGUAGE 'sql'; -- QUERY END: -- QUERY START: -- Helper procedure for adding a new node create or replace function TigAddNode(bigint, bigint, varchar(255)) returns bigint as ' declare _parent_nid alias for $1; _uid alias for $2; _node alias for $3; res_nid bigint; begin insert into tig_nodes (parent_nid, uid, node) values (_parent_nid, _uid, _node); select currval(''tig_nodes_nid_seq'') into res_nid; return res_nid; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: create or replace function TigUsers2Ver4Convert() returns void as ' declare user_row RECORD; begin for user_row in select user_id, pval as password from tig_users, tig_pairs where tig_users.uid = tig_pairs.uid and pkey = ''password'' loop perform TigUpdatePasswordPlainPw(user_row.user_id, user_row.password); END LOOP; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as ' declare _nid alias for $1; _uid alias for $2; _tkey alias for $3; _tval alias for $4; begin if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey) then update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey; else insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-4.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql \i database/postgresql-schema-4-schema.sql \i database/postgresql-schema-4-sp.sql \i database/postgresql-schema-4-props.sql -- LOAD FILE: database/postgresql-schema-4-schema.sql -- LOAD FILE: database/postgresql-schema-4-sp.sql -- LOAD FILE: database/postgresql-schema-4-props.sql ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-5-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- QUERY START: -- This is a dummy user who keeps all the database-properties select TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select now(), ' - Setting schema version to 5.1'; -- QUERY START: select TigPutDBProperty('schema-version', '5.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-5-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- Database stored procedures and fucntions for Tigase schema version 5.1 \i database/postgresql-schema-4-schema.sql -- LOAD FILE: database/postgresql-schema-4-schema.sql ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-5-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- Database stored procedures and fucntions for Tigase schema version 5.1 \i database/postgresql-schema-4-sp.sql -- LOAD FILE: database/postgresql-schema-4-sp.sql -- QUERY START: create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as ' declare _nid alias for $1; _uid alias for $2; _tkey alias for $3; _tval alias for $4; begin if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey) then update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey; else insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql \i database/postgresql-schema-4-schema.sql \i database/postgresql-schema-5-1-sp.sql \i database/postgresql-schema-5-1-props.sql -- LOAD FILE: database/postgresql-schema-4-schema.sql -- LOAD FILE: database/postgresql-schema-5-1-sp.sql -- LOAD FILE: database/postgresql-schema-5-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-5.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql \i database/postgresql-schema-4-schema.sql \i database/postgresql-schema-4-sp.sql \i database/postgresql-schema-4-props.sql -- LOAD FILE: database/postgresql-schema-4-schema.sql -- LOAD FILE: database/postgresql-schema-4-sp.sql -- LOAD FILE: database/postgresql-schema-4-props.sql ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-7-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- QUERY START: -- This is a dummy user who keeps all the database-properties select TigAddUserPlainPw('db-properties', NULL); -- QUERY END: select now(), ' - Setting schema version to 7.1'; -- QUERY START: select TigPutDBProperty('schema-version', '7.1'); -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-7-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- Database stored procedures and fucntions for Tigase schema version 5.1 \i database/postgresql-schema-5-1-schema.sql -- LOAD FILE: database/postgresql-schema-5-1-schema.sql -- QUERY START: ALTER TABLE tig_pairs ADD COLUMN pid BIGSERIAL PRIMARY KEY; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-7-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- Database stored procedures and fucntions for Tigase schema version 5.1 \i database/postgresql-schema-5-1-sp.sql -- LOAD FILE: database/postgresql-schema-5-1-sp.sql -- QUERY START: -- Database properties set - procedure create or replace function TigPutDBProperty(varchar(255), text) returns void as ' declare _tkey alias for $1; _tval alias for $2; begin if exists( select pval from tig_pairs, tig_users where (lower(user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs set pval = _tval from tig_users where (lower(tig_users.user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey); else insert into tig_pairs (pkey, pval, uid, nid) select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (lower(user_id) = lower(''db-properties'') and tn.node=''root'' ); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql \i database/postgresql-schema-4-schema.sql \i database/postgresql-schema-5-1-sp.sql \i database/postgresql-schema-5-1-props.sql -- LOAD FILE: database/postgresql-schema-4-schema.sql -- LOAD FILE: database/postgresql-schema-5-1-sp.sql -- LOAD FILE: database/postgresql-schema-5-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-upgrade-to-4.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- Database schema upgrade for Tigase version 4.0.0 select NOW(), ' - Dropping foreign indexes'; alter table tig_nodes DROP constraint tig_nodes_uid_fkey; alter table tig_pairs DROP constraint tig_pairs_uid_fkey; alter table tig_pairs DROP constraint tig_pairs_nid_fkey; alter table tig_users DROP constraint tig_users_pkey; alter table tig_nodes DROP constraint tig_nodes_pkey; drop index user_id; drop index tnode; drop index node; drop index pkey; select NOW(), ' - Renaming old tig_pairs table for later convertion'; alter table tig_pairs rename to tig_pairs_old; create index pkey_old on tig_pairs_old (pkey); create index puid_old on tig_pairs_old (uid); create index pnid_old on tig_pairs_old (nid); select NOW(), ' - Renaming old tig_nodes table for later convertion'; alter table tig_nodes rename to tig_nodes_old; create index nnid_old on tig_nodes_old (nid); create index parent_nid_old on tig_nodes_old (parent_nid); create index nuid_old on tig_nodes_old (uid); create index node_old on tig_nodes_old (node); select NOW(), ' - Renaming old tig_users table for later convertion'; alter table tig_users rename to tig_users_old; create index uuid_old on tig_users_old (uid); create index user_id_old on tig_users_old (user_id); select NOW(), ' - Loading new database schema 4.0'; \i database/postgresql-schema-4.sql; select NOW(), ' - Setting passwords encoding in the database'; -- Possible encodings are: -- - 'MD5-USERID-PASSWORD' -- - 'MD5-PASSWORD' -- - 'PLAIN' -- More can be added if needed. select TigPutDBProperty('password-encoding', 'PLAIN'); select NOW(), ' - Temporarly adding old_uid column to tig_users table'; alter table tig_users add column old_uid bigint; create index old_uid on tig_users (old_uid); select NOW(), ' - Temporarly adding old_nid column to tig_nodes table'; alter table tig_nodes add column old_nid bigint; create index old_nid on tig_nodes (old_nid); select NOW(), ' - Copying tig_users data to a new table'; insert into tig_users (user_id, old_uid) select user_id, uid from tig_users_old; select NOW(), ' - Copying tig_nodes data to a new table'; insert into tig_nodes (uid, old_nid, node) select tig_users.uid, nid, node from tig_users, tig_nodes_old where (tig_nodes_old.uid = tig_users.old_uid); select NOW(), ' - Updating parent_nids in the new tig_nodes table'; create temporary table temp_nodes as select tig_nodes.uid as new_uid, tig_nodes.nid as new_nid, tig_nodes_old.nid as old_nid, tig_nodes_old.parent_nid as old_parent_nid from tig_nodes, tig_nodes_old where tig_nodes.old_nid = tig_nodes_old.nid; create index new_nid on temp_nodes (new_nid); create index old_nid on temp_nodes (old_nid); update tig_nodes set parent_nid = temp_nodes.new_nid from tig_nodes_old, temp_nodes where (tig_nodes.old_nid = tig_nodes_old.nid) AND (tig_nodes_old.parent_nid = temp_nodes.old_nid); select NOW(), ' - Loading tig_pairs table from old one with new uids and nids'; insert into tig_pairs (nid, uid, pkey, pval) select tig_nodes.nid, tig_users.uid, pkey, pval from tig_pairs_old, tig_users, tig_nodes where (tig_pairs_old.uid = tig_users.old_uid) AND (tig_pairs_old.nid = tig_nodes.old_nid); select NOW(), ' - Droping temporarly columns'; drop index old_uid; alter table tig_users drop column old_uid; drop index old_nid; alter table tig_nodes drop column old_nid; select NOW(), ' - Converting user passwords to a new format'; select TigUsers2Ver4Convert(); select NOW(), ' - All done, database ready to use!'; ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-upgrade-to-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ select NOW(), ' - Installing missing stored procedures'; -- QUERY START: create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as ' declare _nid alias for $1; _uid alias for $2; _tkey alias for $3; _tval alias for $4; begin if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey) then update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey; else insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: select TigPutDBProperty('schema-version', '5.1'); -- QUERY END: select NOW(), ' - All done, database ver 5.1 ready to use!'; ================================================ FILE: tigase-server 7.1.0/database/postgresql-schema-upgrade-to-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- select NOW(), ' - Updating database version'; -- QUERY START: -- Database properties set - procedure create or replace function TigPutDBProperty(varchar(255), text) returns void as ' declare _tkey alias for $1; _tval alias for $2; begin if exists( select pval from tig_pairs, tig_users where (lower(user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey)) then update tig_pairs set pval = _tval from tig_users where (lower(tig_users.user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid) AND (pkey = _tkey); else insert into tig_pairs (pkey, pval, uid, nid) select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (lower(user_id) = lower(''db-properties'') and tn.node=''root'' ); end if; return; end; ' LANGUAGE 'plpgsql'; -- QUERY END: -- QUERY START: ALTER TABLE tig_pairs ADD COLUMN pid BIGSERIAL PRIMARY KEY; -- QUERY END: -- QUERY START: update tig_pairs set nid = (select nid from tig_nodes where uid=(select uid from tig_users where user_id='db-properties') and node='root') where uid=(select uid from tig_users where user_id='db-properties'); -- QUERY END: -- QUERY START: select TigPutDBProperty('schema-version', '7.1'); -- QUERY END: select NOW(), ' - All done, database ver 7.1 ready to use!'; ================================================ FILE: tigase-server 7.1.0/database/sqlserver-installer-create-db.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: USE database USE [master] -- QUERY END: USE database GO -- QUERY START: create database CREATE DATABASE ${dbName}; -- QUERY END: create database GO -- QUERY START: add user CREATE LOGIN [${dbUser}] WITH PASSWORD=N'${dbPass}', DEFAULT_DATABASE=[${dbName}] -- QUERY END: add user GO -- QUERY START: ALTER DATABASE IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [${dbName}] MODIFY FILEGROUP [PRIMARY] DEFAULT -- QUERY END: ALTER DATABASE GO -- QUERY START: USE DATABASE USE [${dbName}] -- QUERY END: USE DATABASE GO -- QUERY START: GRANT ALL CREATE USER [${dbUser}] FOR LOGIN [${dbUser}] -- QUERY END: GRANT ALL GO -- QUERY START: ALTER DATABASE ALTER USER [${dbUser}] WITH DEFAULT_SCHEMA=[dbo] -- QUERY END: ALTER DATABASE GO -- QUERY START: ALTER DATABASE ALTER ROLE [db_owner] ADD MEMBER [${dbUser}] -- QUERY END: ALTER DATABASE GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-installer-post.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: USE DATABASE USE [${dbName}] -- QUERY END: USE DATABASE GO -- QUERY START: ALTER DATABASE ALTER ROLE [db_owner] ADD MEMBER [${dbUser}] -- QUERY END: ALTER DATABASE GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-4.sql ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_max_ids]( [max_uid] [bigint] NULL, [max_nid] [bigint] NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_users]( [uid] [bigint] NOT NULL, [user_id] [varchar](256) NOT NULL ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_users] ON [dbo].[tig_users] ( [user_id] ASC ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_users_1] ON [dbo].[tig_users] ( [uid] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[short_news]( [snid] [bigint] IDENTITY(1,1) NOT NULL, [publishing_time] [datetime] NOT NULL CONSTRAINT [DF_short_news_publishing_time] DEFAULT (getdate()), [news_type] [varchar](50) NULL, [author] [varchar](128) NOT NULL, [subject] [varchar](128) NOT NULL, [body] [varchar](1024) NOT NULL, CONSTRAINT [PK_short_news] PRIMARY KEY CLUSTERED ( [snid] ASC ) ON [PRIMARY] ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news] ON [dbo].[short_news] ( [publishing_time] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news_1] ON [dbo].[short_news] ( [author] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news_2] ON [dbo].[short_news] ( [news_type] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[xmpp_stanza]( [id] [bigint] IDENTITY(1,1) NOT NULL, [stanza] [text] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_nodes]( [nid] [bigint] NOT NULL, [parent_nid] [bigint] NULL, [uid] [bigint] NOT NULL, [node] [varchar](128) NOT NULL ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_nodes] ON [dbo].[tig_nodes] ( [parent_nid] ASC, [node] ASC, [uid] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_tig_nodes_1] ON [dbo].[tig_nodes] ( [node] ASC ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_nodes_2] ON [dbo].[tig_nodes] ( [nid] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_pairs]( [nid] [bigint] NOT NULL, [uid] [bigint] NOT NULL, [pkey] [varchar](128) NOT NULL, [pval] [text] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_tig_pairs] ON [dbo].[tig_pairs] ( [pkey] ASC ) ON [PRIMARY] GO ALTER TABLE [dbo].[tig_nodes] WITH CHECK ADD CONSTRAINT [FK_tig_nodes_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) GO ALTER TABLE [dbo].[tig_nodes] CHECK CONSTRAINT [FK_tig_nodes_tig_users] GO ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_nodes] FOREIGN KEY([nid]) REFERENCES [dbo].[tig_nodes] ([nid]) GO ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_nodes] GO ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) GO ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_users] ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-5-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- QUERY START: -- This is a dummy user who keeps all the database-properties exec dbo.TigAddUserPlainPw 'db-properties', NULL; -- QUERY END: GO select GETDATE(), ' - Setting schema version to 5.1'; -- QUERY START: exec dbo.TigPutDBProperty 'schema-version', '5.1'; -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-5-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- To load schema to execute following commands: -- -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- QUERY START: CREATE TABLE [dbo].[tig_users]( [uid] [bigint] IDENTITY(1,1) NOT NULL, -- Jabber User ID [user_id] [nvarchar](2049) NOT NULL, -- UserID SHA1 hash to prevent duplicate user_ids [sha1_user_id] [varbinary](32) NOT NULL, -- User password encrypted or not [user_pw] [nvarchar](255) NULL, -- Time the account has been created [acc_create_time] [datetime] DEFAULT getdate(), -- Time of the last user login [last_login] [datetime] default 0, -- Time of the last user logout [last_logout] [datetime] default 0, -- User online status, if > 0 then user is online, the value -- indicates the number of user connections. -- It is incremented on each user login and decremented on each -- user logout. [online_status] [int] default 0, -- Number of failed login attempts [failed_logins] [int] default 0, -- User status, whether the account is active or disabled -- >0 - account active, 0 - account disabled [account_status] [int] default 1, -- helper column for indexing due to limitation of SQL server user_id_fragment AS LEFT (user_id, 256), CONSTRAINT [PK_tig_users] PRIMARY KEY CLUSTERED ( [uid] ASC ) ON [PRIMARY], CONSTRAINT [IX_tig_users_sha1_user_id] UNIQUE NONCLUSTERED ( [sha1_user_id] ASC ) ON [PRIMARY] ) ON [PRIMARY] -- QUERY END: -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_account_status] ON [dbo].[tig_users] ([account_status] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_last_login] ON [dbo].[tig_users] ([last_login] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_last_logout] ON [dbo].[tig_users] ( [last_logout] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_online_status] ON [dbo].[tig_users] ([online_status] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_user_id_fragment] ON [dbo].[tig_users] ( [user_id_fragment] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_users_user_pw] ON [dbo].[tig_users] ([user_pw] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE TABLE [dbo].[tig_nodes]( [nid] [bigint] IDENTITY(1,1) NOT NULL, [parent_nid] [bigint] NULL, [uid] [bigint] NOT NULL, [node] [nvarchar](255) NOT NULL, CONSTRAINT [PK_tig_nodes_nid] PRIMARY KEY CLUSTERED ( [nid] ASC ) ON [PRIMARY], CONSTRAINT [IX_tnode] UNIQUE NONCLUSTERED ( [parent_nid] ASC, [uid] ASC, [node] ASC ) ON [PRIMARY] ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_nodes_node] ON [dbo].[tig_nodes] ( [node] ASC) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_nodes_parent_nid] ON [dbo].[tig_nodes] ( [parent_nid] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_nodes_uid] ON [dbo].[tig_nodes] ( [uid] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_nodes] WITH CHECK ADD CONSTRAINT [FK_tig_nodes_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_nodes] CHECK CONSTRAINT [FK_tig_nodes_tig_users] -- QUERY END: GO -- QUERY START: CREATE TABLE [dbo].[tig_pairs]( [nid] [bigint] NULL, [uid] [bigint] NOT NULL, [pkey] [nvarchar](255) NOT NULL, [pval] [ntext] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_pairs_nid] ON [dbo].[tig_pairs] ( [nid] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_pairs_pkey] ON [dbo].[tig_pairs] ( [pkey] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_tig_pairs_uid] ON [dbo].[tig_pairs] ( [uid] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_nodes] FOREIGN KEY([nid]) REFERENCES [dbo].[tig_nodes] ([nid]) -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_nodes] -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_users] -- QUERY END: GO -- QUERY START: CREATE TABLE [dbo].[xmpp_stanza]( [id] [bigint] IDENTITY(1,1) NOT NULL, [stanza] [ntext] NOT NULL, CONSTRAINT [PK_xmpp_stanza] PRIMARY KEY CLUSTERED ( [id] ASC ) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE TABLE [dbo].[short_news]( [snid] [bigint] IDENTITY(1,1) NOT NULL, [publishing_time] [datetime] NOT NULL, [news_type] [varchar](50) NULL, [author] [nvarchar](128) NOT NULL, [subject] [nvarchar](128) NOT NULL, [body] [nvarchar](1024) NOT NULL, CONSTRAINT [PK_short_news_snid] PRIMARY KEY CLUSTERED ( [snid] ASC ) ON [PRIMARY] ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_short_news_author] ON [dbo].[short_news] ( [author] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_short_news_news_type] ON [dbo].[short_news] ( [news_type] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: CREATE NONCLUSTERED INDEX [IX_short_news_publishing_time] ON [dbo].[short_news] ( [publishing_time] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[short_news] ADD CONSTRAINT [DF_short_news_publishing_time] DEFAULT (getdate()) FOR [publishing_time] -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-5-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- Database stored procedures and functions for Tigase schema version 5.2.0 -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigInitdb') DROP PROCEDURE TigInitdb -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddUserPlainPw') DROP PROCEDURE TigAddUserPlainPw -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddUser') DROP PROCEDURE TigAddUser -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetUserDBUid') DROP PROCEDURE TigGetUserDBUid -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigRemoveUser') DROP PROCEDURE TigRemoveUser -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePasswordPlainPw') DROP PROCEDURE TigUpdatePasswordPlainPw -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePassword') DROP PROCEDURE TigUpdatePassword -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePasswordPlainPwRev') DROP PROCEDURE TigUpdatePasswordPlainPwRev -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetPassword') DROP PROCEDURE TigGetPassword -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLoginPlainPw') DROP PROCEDURE TigUserLoginPlainPw -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogin') DROP PROCEDURE TigUserLogin -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogout') DROP PROCEDURE TigUserLogout -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOnlineUsers') DROP PROCEDURE TigOnlineUsers -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOfflineUsers') DROP PROCEDURE TigOfflineUsers -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAllUsers') DROP PROCEDURE TigAllUsers -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAllUsersCount') DROP PROCEDURE TigAllUsersCount -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigDisableAccount') DROP PROCEDURE TigDisableAccount -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigEnableAccount') DROP PROCEDURE TigEnableAccount -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigActiveAccounts') DROP PROCEDURE TigActiveAccounts -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigDisabledAccounts') DROP PROCEDURE TigDisabledAccounts -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddNode') DROP PROCEDURE TigAddNode -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigTestAddUser') DROP PROCEDURE TigTestAddUser -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUsers2Ver4Convert') DROP PROCEDURE TigUsers2Ver4Convert -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigPutDBProperty') DROP PROCEDURE TigPutDBProperty -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'FN' AND name = 'TigGetDBProperty') DROP FUNCTION TigGetDBProperty -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePairs') DROP PROCEDURE TigUpdatePairs -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'FN' AND name = 'InlineMax') DROP FUNCTION InlineMax -- QUERY END: GO -- QUERY START: -- The initialization of the database. -- The procedure should be called manually somehow before starting the -- server. In theory the server could call the procedure automatically -- at the startup time but I don't know yet how to solve the problem -- with multiple cluster nodes starting at later time when the server -- is already running. create procedure dbo.TigInitdb AS begin update dbo.tig_users set online_status = 0; end -- QUERY END: GO -- QUERY START: -- Database properties get - function create function TigGetDBProperty(@_tkey nvarchar(255)) returns nvarchar(MAX) AS begin --Declare @_result nvarchar(MAX); return (select pval from dbo.tig_pairs AS p, dbo.tig_users AS u where (pkey = @_tkey) AND (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (p.uid = u.uid)); end -- QUERY END: GO -- QUERY START: -- Database properties set - procedure create procedure dbo.TigPutDBProperty @_tkey nvarchar(255), @_tval ntext AS begin Declare @_nid int; Declare @_uid int; Declare @_count int; if exists (select 1 from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey)) begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); update dbo.tig_pairs set pval = @_tval where (@_uid = uid) AND (pkey = @_tkey) ; end else begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); insert into dbo.tig_pairs (pkey, pval, uid) select @_tkey, @_tval, uid from dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))); end end -- QUERY END: GO -- QUERY START: -- Add a new user to the database assuming the user password is already -- encoded properly according to the database settings. -- If password is not encoded TigAddUserPlainPw should be used instead. create procedure dbo.TigAddUser @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin SET NOCOUNT ON; declare @res_uid bigint; insert into dbo.tig_users (user_id, sha1_user_id, user_pw) values (@_user_id, HASHBYTES('SHA1', LOWER(@_user_id)) , @_user_pw); set @res_uid = (select SCOPE_IDENTITY()); if (@res_uid is not NULL) insert into dbo.tig_nodes (parent_nid, uid, node) values (NULL, @res_uid, N'root'); if (@_user_pw is NULL) update dbo.tig_users set account_status = -1 where uid = @res_uid; select @res_uid as uid; end; -- QUERY END: GO -- QUERY START: -- Takes plain text user password and converts it to internal representation -- and creates a new user account. create procedure dbo.TigAddUserPlainPw @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin declare @_encoding nvarchar(512) declare @_hashed_pass varbinary(32) set @_encoding = dbo.TigGetDBProperty(N'password-encoding') if @_encoding = N'MD5-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_pw); exec TigAddUser @_user_id, @_hashed_pass; end if @_encoding = N'MD5-USERID-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_id + @_user_pw); exec TigAddUser @_user_id, @_hashed_pass end if @_encoding = N'MD5-USERNAME-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', (LEFT (@_user_id, CHARINDEX(N'@',@_user_id)-1)) + @_user_pw); exec TigAddUser @_user_id, @_hashed_pass; end else exec TigAddUser @_user_id, @_user_pw ; end -- QUERY END: GO -- QUERY START: -- Low level database user id as big number. Used only for performance reasons -- and save database space. Besides JID is too large to server as UID create procedure dbo.TigGetUserDBUid @_user_id nvarchar(2049) AS begin select uid from dbo.tig_users where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); end -- QUERY END: GO -- QUERY START: -- Removes a user from the database create procedure dbo.TigRemoveUser @_user_id nvarchar(2049) AS begin declare @res_uid bigint; set @res_uid = (select uid from dbo.tig_users where sha1_user_id = hashbytes('SHA1', lower(@_user_id))); delete from dbo.tig_pairs where uid = @res_uid; delete from dbo.tig_nodes where uid = @res_uid; delete from dbo.tig_users where uid = @res_uid; end -- QUERY END: GO -- QUERY START: -- Returns user's password from the database create procedure dbo.TigGetPassword @_user_id nvarchar(2049) AS begin select user_pw from dbo.tig_users where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); end -- QUERY END: GO -- QUERY START: -- Update user password create procedure dbo.TigUpdatePassword @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin update dbo.tig_users set user_pw = @_user_pw where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); end -- QUERY END: GO -- QUERY START: -- Takes plain text user password and converts it to internal representation create procedure dbo.TigUpdatePasswordPlainPw @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin declare @_encoding nvarchar(512) declare @_hashed_pass varbinary(32) set @_encoding = dbo.TigGetDBProperty(N'password-encoding') if @_encoding = N'MD5-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_pw); exec TigUpdatePassword @_user_id, @_hashed_pass; end if @_encoding = N'MD5-USERID-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_id + @_user_pw); exec TigUpdatePassword @_user_id, @_hashed_pass end if @_encoding = N'MD5-USERNAME-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', (LEFT (@_user_id, CHARINDEX(N'@',@_user_id)-1)) + @_user_pw); exec TigUpdatePassword @_user_id, @_hashed_pass; end else exec TigUpdatePassword @_user_id, @_user_pw ; end -- QUERY END: GO -- QUERY START: -- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order. -- Some implementations require the parameters to be in the same order as -- the update query. create procedure dbo.TigUpdatePasswordPlainPwRev @_user_pw nvarchar(255), @_user_id nvarchar(2049) AS begin exec TigUpdatePasswordPlainPw @_user_id, @_user_pw; end -- QUERY END: GO -- QUERY START: -- List all online users create procedure dbo.TigOnlineUsers AS begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from dbo.tig_users where online_status > 0; end -- QUERY END: GO -- QUERY START: -- List all offline users create procedure dbo.TigOfflineUsers AS begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from dbo.tig_users where online_status = 0; end -- QUERY END: GO -- QUERY START: -- List of all users in database create procedure dbo.TigAllUsers AS begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from dbo.tig_users; end -- QUERY END: GO -- QUERY START: -- All users count create procedure dbo.TigAllUsersCount AS begin select count(*) from dbo.tig_users; end -- QUERY END: GO -- QUERY START: -- Perforrm user login. It returns user_id uppon success and NULL -- on failure. -- If the login is successful it also increases online_status and sets -- last_login time to the current timestamp create procedure dbo.TigUserLogin @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin if exists(select 1 from dbo.tig_users where (account_status > 0) AND (sha1_user_id = hashbytes('SHA1', lower(@_user_id))) AND (user_pw = @_user_pw) AND (user_id = @_user_id)) begin update dbo.tig_users set online_status = online_status + 1, last_login = CURRENT_TIMESTAMP where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); select @_user_id as user_id; end else begin update dbo.tig_users set failed_logins = failed_logins + 1 where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); select NULL as user_id; end end -- QUERY END: GO -- QUERY START: -- Performs user login for a plain text password, converting it to an internal -- representation if necessary create procedure dbo.TigUserLoginPlainPw @_user_id nvarchar(2049), @_user_pw nvarchar(255) AS begin declare @_encoding nvarchar(512) declare @_hashed_pass varbinary(32) set @_encoding = dbo.TigGetDBProperty(N'password-encoding') if @_encoding = 'MD5-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_pw); exec TigUserLogin @_user_id, @_hashed_pass; end if @_encoding = N'MD5-USERID-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', @_user_id + @_user_pw); exec TigUserLogin @_user_id, @_hashed_pass end if @_encoding = N'MD5-USERNAME-PASSWORD' begin set @_hashed_pass = HASHBYTES('MD5', (LEFT (@_user_id, CHARINDEX(N'@',@_user_id)-1)) + @_user_pw); exec TigUserLogin @_user_id, @_hashed_pass; end else exec TigUserLogin @_user_id, @_user_pw ; end -- QUERY END: GO -- QUERY START: -- helper function create function dbo.InlineMax(@val1 int, @val2 int) returns int as begin if @val1 > @val2 return @val1 return isnull(@val2,@val1) end -- QUERY END: GO -- QUERY START: -- It decreases online_status and sets last_logout time to the current timestamp create procedure dbo.TigUserLogout @_user_id nvarchar(2049) AS begin update dbo.tig_users set online_status = dbo.InlineMax(online_status - 1, 0), last_logout = CURRENT_TIMESTAMP where user_id = @_user_id; end -- QUERY END: GO -- QUERY START: -- Disable user account create procedure dbo.TigDisableAccount @_user_id nvarchar(2049) AS begin update dbo.tig_users set account_status = 0 where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); end -- QUERY END: GO -- QUERY START: -- Enable user account create procedure dbo.TigEnableAccount @_user_id nvarchar(2049) AS begin update dbo.tig_users set account_status = 1 where sha1_user_id = hashbytes('SHA1', lower(@_user_id)); end -- QUERY END: GO -- QUERY START: -- Get list of all active user accounts create procedure dbo.TigActiveAccounts AS begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from dbo.tig_users where account_status > 0; end -- QUERY END: GO -- QUERY START: -- Get list of all disabled user accounts create procedure dbo.TigDisabledAccounts AS begin select user_id, last_login, last_logout, online_status, failed_logins, account_status from dbo.tig_users where account_status = 0; end -- QUERY END: GO -- QUERY START: -- Helper procedure for adding a new node create procedure dbo.TigAddNode @_parent_nid bigint, @_uid bigint, @_node nvarchar(255) AS begin SET NOCOUNT ON; insert into dbo.tig_nodes (parent_nid, uid, node) values (@_parent_nid, @_uid, @_node); select SCOPE_IDENTITY() as nid; end -- QUERY END: GO -- QUERY START: -- Procedure to efficiently and safely update data in tig_pairs table create procedure dbo.TigUpdatePairs @_nid bigint, @_uid bigint, @_tkey nvarchar(255), @_tval ntext AS begin if exists(SELECT 1 FROM dbo.tig_pairs WHERE nid = @_nid AND uid = @_uid AND pkey = @_tkey) UPDATE dbo.tig_pairs SET pval = @_tval WHERE nid = @_nid AND uid = @_uid AND pkey = @_tkey; ELSE INSERT INTO dbo.tig_pairs (nid, uid, pkey, pval) VALUES (@_nid, @_uid, @_tkey, @_tval); END -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-5-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2012 "Artur Hefczyc" -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- $Rev: $ -- Last modified by $Author: $ -- $Date: $ -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql -- LOAD FILE: database/sqlserver-schema-5-1-schema.sql -- LOAD FILE: database/sqlserver-schema-5-1-sp.sql -- LOAD FILE: database/sqlserver-schema-5-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-7-1-props.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- QUERY START: -- This is a dummy user who keeps all the database-properties exec dbo.TigAddUserPlainPw 'db-properties', NULL; -- QUERY END: GO select GETDATE(), ' - Setting schema version to 7.1'; -- QUERY START: exec dbo.TigPutDBProperty 'schema-version', '7.1'; -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-7-1-schema.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- To load schema to execute following commands: -- -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- LOAD FILE: database/sqlserver-schema-5-1-schema.sql -- QUERY START: IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('dbo.tig_pairs') AND NAME ='IX_clustered_tig_pairs_nid_uid_pkey') DROP INDEX IX_clustered_tig_pairs_nid_uid_pkey ON dbo.tig_pairs; -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] ADD [pid] [bigint] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_tig_pairs] PRIMARY KEY CLUSTERED ( [pid] ASC ) ON [PRIMARY] -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-7-1-sp.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- Database stored procedures and functions for Tigase schema version 7.1.0 -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- LOAD FILE: database/sqlserver-schema-5-1-sp.sql -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigPutDBProperty') DROP PROCEDURE TigPutDBProperty -- QUERY END: GO -- QUERY START: -- Database properties set - procedure create procedure dbo.TigPutDBProperty @_tkey nvarchar(255), @_tval ntext AS begin Declare @_nid int; Declare @_uid int; Declare @_count int; if exists (select 1 from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey)) begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); update dbo.tig_pairs set pval = @_tval where (@_uid = uid) AND (pkey = @_tkey) ; end else begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); insert into dbo.tig_pairs (pkey, pval, uid, nid) select @_tkey, @_tval, tu.uid, tn.nid from dbo.tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')) and tn.node='root'); end end -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- To load schema to PostgreSQL database execute following commands: -- -- createuser tigase -- createdb -U tigase tigase -- psql -q -U tigase -d tigase -f postgresql-schema.sql -- LOAD FILE: database/sqlserver-schema-7-1-schema.sql -- LOAD FILE: database/sqlserver-schema-7-1-sp.sql -- LOAD FILE: database/sqlserver-schema-7-1-props.sql ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema-upgrade-to-7-1.sql ================================================ -- -- Tigase Jabber/XMPP Server -- Copyright (C) 2004-2016 "Tigase, Inc." -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU Affero General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. Look for COPYING file in the top folder. -- If not, see http://www.gnu.org/licenses/. -- -- -- QUERY START: SET QUOTED_IDENTIFIER ON -- QUERY END: GO -- QUERY START: IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigPutDBProperty') DROP PROCEDURE TigPutDBProperty -- QUERY END: GO -- QUERY START: IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('dbo.tig_pairs') AND NAME ='IX_clustered_tig_pairs_nid_uid_pkey') DROP INDEX IX_clustered_tig_pairs_nid_uid_pkey ON dbo.tig_pairs; -- QUERY END: GO -- QUERY START: -- Database properties set - procedure create procedure dbo.TigPutDBProperty @_tkey nvarchar(255), @_tval ntext AS begin Declare @_nid int; Declare @_uid int; Declare @_count int; if exists (select 1 from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey)) begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); update dbo.tig_pairs set pval = @_tval where (@_uid = uid) AND (pkey = @_tkey) ; end else begin select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties'))) AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey); insert into dbo.tig_pairs (pkey, pval, uid, nid) select @_tkey, @_tval, tu.uid, tn.nid from dbo.tig_users tu left join tig_nodes tn on tn.uid=tu.uid where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')) and tn.node='root'); end end -- QUERY END: GO -- QUERY START: ALTER TABLE [dbo].[tig_pairs] ADD [pid] [bigint] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_tig_pairs] PRIMARY KEY CLUSTERED ( [pid] ASC ) ON [PRIMARY] -- QUERY END: GO -- QUERY START: update tig_pairs set nid = (select nid from tig_nodes where uid=(select uid from tig_users where user_id='db-properties') and node='root') where uid=(select uid from tig_users where user_id='db-properties'); -- QUERY END: GO select GETDATE(), ' - Setting schema version to 7.1'; -- QUERY START: exec dbo.TigPutDBProperty 'schema-version', '7.1'; -- QUERY END: GO ================================================ FILE: tigase-server 7.1.0/database/sqlserver-schema.sql ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_max_ids]( [max_uid] [bigint] NULL, [max_nid] [bigint] NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_users]( [uid] [bigint] NOT NULL, [user_id] [nvarchar](128) NOT NULL ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_users] ON [dbo].[tig_users] ( [user_id] ASC ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_users_1] ON [dbo].[tig_users] ( [uid] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[short_news]( [snid] [bigint] IDENTITY(1,1) NOT NULL, [publishing_time] [datetime] NOT NULL CONSTRAINT [DF_short_news_publishing_time] DEFAULT (getdate()), [news_type] [nvarchar](50) NULL, [author] [nvarchar](128) NOT NULL, [subject] [nvarchar](128) NOT NULL, [body] [nvarchar](1024) NOT NULL, CONSTRAINT [PK_short_news] PRIMARY KEY CLUSTERED ( [snid] ASC ) ON [PRIMARY] ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news] ON [dbo].[short_news] ( [publishing_time] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news_1] ON [dbo].[short_news] ( [author] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_short_news_2] ON [dbo].[short_news] ( [news_type] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[xmpp_stanza]( [id] [bigint] IDENTITY(1,1) NOT NULL, [stanza] [text] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_nodes]( [nid] [bigint] NOT NULL, [parent_nid] [bigint] NULL, [uid] [bigint] NOT NULL, [node] [nvarchar](64) NOT NULL ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_nodes] ON [dbo].[tig_nodes] ( [parent_nid] ASC, [node] ASC, [uid] ASC ) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_tig_nodes_1] ON [dbo].[tig_nodes] ( [node] ASC ) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [IX_tig_nodes_2] ON [dbo].[tig_nodes] ( [nid] ASC ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[tig_pairs]( [nid] [bigint] NOT NULL, [uid] [bigint] NOT NULL, [pkey] [nvarchar](128) NOT NULL, [pval] [text] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_tig_pairs] ON [dbo].[tig_pairs] ( [pkey] ASC ) ON [PRIMARY] GO ALTER TABLE [dbo].[tig_nodes] WITH CHECK ADD CONSTRAINT [FK_tig_nodes_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) GO ALTER TABLE [dbo].[tig_nodes] CHECK CONSTRAINT [FK_tig_nodes_tig_users] GO ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_nodes] FOREIGN KEY([nid]) REFERENCES [dbo].[tig_nodes] ([nid]) GO ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_nodes] GO ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_users] FOREIGN KEY([uid]) REFERENCES [dbo].[tig_users] ([uid]) GO ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_users] ================================================ FILE: tigase-server 7.1.0/debian/README.Debian ================================================ Tigase for Debian ----------------- Tigase Jabber/XMPP Server is Open Source and Free (GPLv3) Java based server. -- Tomasz Sterna , Thu Mar 13 10:40:12 CET 2009 ================================================ FILE: tigase-server 7.1.0/debian/changelog ================================================ tigase-server (4.1.5-b1686-xk1) hardy; urgency=low * Updated to SVN revision 1686: Changed SQL scripts to server-database -- Tomasz Sterna Mon, 25 May 2009 14:29:23 +0000 tigase-server (4.1.5-b1685-xk1) hardy; urgency=low * Updated to SVN revision 1685: Proper paths to derby jars in scripts -- Tomasz Sterna Mon, 25 May 2009 14:24:26 +0000 tigase-server (4.1.5-b1684-xk1) hardy; urgency=low * Updated to SVN revision 1684: Added derbytools jar to CLASSPATH during postinst -- Tomasz Sterna Mon, 25 May 2009 14:16:10 +0000 tigase-server (4.1.5-b1683-xk1) hardy; urgency=low * Updated to SVN revision 1683: Added statistics displaying number of data buffers waiting in the I/O component. Attempt to make data writing more efficient by writing as much data as possible in a single method call. Added method returning number of buffers waiting to send in the I/O. Switching to Sun Java implementation during postinstall Added derby jar to CLASSPATH during postinst -- Tomasz Sterna Mon, 25 May 2009 14:10:17 +0000 tigase-server (4.1.5-b1678-xk1) hardy; urgency=low * Updated to SVN revision 1678: Attempt to make data reading more efficient, reading as much characters from the network socket as possible in a single method run. -- Tomasz Sterna Mon, 25 May 2009 12:11:09 +0000 tigase-server (4.1.5-b1677-xk1) hardy; urgency=low * Updated to SVN revision 1677: Added check for JRE version to init script -- Tomasz Sterna Mon, 25 May 2009 10:11:08 +0000 tigase-server (4.1.5-b1676-xk2) hardy; urgency=low * Checking JRE version during init.d startup script. -- Tomasz Sterna Mon, 25 May 2009 08:52:49 +0000 tigase-server (4.1.5-b1676-xk1) hardy; urgency=low * Updated to SVN revision 1676: Presence optimizations switched off temporarily. Fixed problem with excessive CPU usage by tigase.net -- Tomasz Sterna Sun, 24 May 2009 00:11:09 +0000 tigase-server (4.1.5-b1674-xk1) hardy; urgency=low * Updated to SVN revision 1674: Fixed a bug with SM initialization and now the cluster sends broadcast to all cluster nodes about new user connection after initial presence. -- Tomasz Sterna Sat, 23 May 2009 20:11:09 +0000 tigase-server (4.1.5-b1673-xk1) hardy; urgency=low * Updated to SVN revision 1673: Typo fixes. Typo fixes. Typo fixes. -- Tomasz Sterna Sat, 23 May 2009 18:11:09 +0000 tigase-server (4.1.5-b1670-xk1) hardy; urgency=low * Updated to SVN revision 1670: Broadcasted presence are always sent to bare user jid now. Added msg and check to block user installing over existing Tigase dir Broadcasted presence are always sent to bare user jid now. Added new connection status: REMOTE for user connections established to different cluster nodes. Fixed a bug with token authentication which used getUserId() which couldn't work as user id is only available after successful authentication. Now it takes user id as a parameter. Minor code adjustments. Added method returning number of user connections with a given connection status and fixed a bug in removing invalid user connections from the list. Added callback: handleResourceBind(), now special actions can be performed on the user resource bind. Major code fixes and improvements related to the new clustering implementation. Minor code adjustments. Added local domain name to the statistics list to make it easier to find out from which cluster node statistics come. Logic bug fixed. Code changes related to a possible bug in detecting empty read calls, tests don't show any improvements though. Minor code adjustements. Minor code adjustements. Minor code adjustements. Minor code adjustements. A few fixes related to possible conflicts in the cluster mode. Added simple caching code for the connection pool. Added initRepository call for the connection pool to allow for the pool to initialize itself. For now it initializes internal cache. Clustering code reworked and new, simpler but more effective implementation created. No more connections hangs on resource bind in case of cluster communications problems. Fresh code needs more tests though. -- Tomasz Sterna Sat, 23 May 2009 12:11:10 +0000 tigase-server (4.1.5-b1649-xk1) hardy; urgency=low * Updated to SVN revision 1649: changed the code adding admin in the installer to use Tigase repo classes -- Tomasz Sterna Sat, 23 May 2009 10:11:08 +0000 tigase-server (4.1.5-b1648-xk1) hardy; urgency=low * Updated to SVN revision 1648: Fixed incorrect features providing, i hope.... Fixed incorrect features providing, i hope.... -- Tomasz Sterna Thu, 21 May 2009 16:26:41 +0000 tigase-server (4.1.5-b1646-xk1) hardy; urgency=low * Updated to SVN revision 1646: Fixed incorrect features providing, i hope.... -- Tomasz Sterna Wed, 20 May 2009 22:11:08 +0000 tigase-server (4.1.5-b1645-xk1) hardy; urgency=low * Updated to SVN revision 1645: fixed installer bug, where user selection of JDK path was overwrited by JAVA_HOME -- Tomasz Sterna Tue, 19 May 2009 08:11:09 +0000 tigase-server (4.1.5-b1644-xk1) hardy; urgency=low * Updated to SVN revision 1644: activated user adding task adding xmpp admin user from installer activated user adding task Added jmx files to the installation and a groovy script for user mgmt -- Tomasz Sterna Mon, 18 May 2009 16:11:08 +0000 tigase-server (4.1.5-b1640-xk2) hardy; urgency=low * Updated to SVN revision 1640 Merged r1637 to debian init script * Fixed bug in init script -- Tomasz Sterna Mon, 18 May 2009 13:50:04 +0000 tigase-server (4.1.5-b1637-xk1) hardy; urgency=low * Updated to SVN revision 1637:\nPresence incorrect broadcast fixed for probe and initial presence. Code formatting update CLASSPATH generating now excludes wrapper libraries -- Tomasz Sterna Mon, 18 May 2009 13:33:22 +0000 tigase-server (4.1.5-b1634-xk1) hardy; urgency=low * Updated to SVN revision 1634:\nAdded GC calls when memory is Low. -- Tomasz Sterna Sun, 17 May 2009 20:11:09 +0000 tigase-server (4.1.5-b1633-xk1) hardy; urgency=low * Updated to SVN revision 1633:\nTypo fixes. -- Tomasz Sterna Sat, 16 May 2009 18:11:09 +0000 tigase-server (4.1.5-b1632-xk1) hardy; urgency=low * Updated to SVN revision 1632:\nTypo fixes. -- Tomasz Sterna Sat, 16 May 2009 16:11:08 +0000 tigase-server (4.1.5-b1631-xk1) hardy; urgency=low * Updated to SVN revision 1631:\navoid-stale-pid.patch was merged to SVN Added info about using discovered config file -- Tomasz Sterna Sat, 16 May 2009 12:11:08 +0000 tigase-server (4.1.5-b1628-xk1) hardy; urgency=low * Updated to SVN revision 1628:\nAdded debian source directory -- Tomasz Sterna Thu, 14 May 2009 12:12:53 +0000 tigase-server (4.1.5-b1627-xk2) hardy; urgency=low * Added tigase.extras.io.PEMSSLContextContainer as default tigase.io.SSLContextContainer in init.properties * Added dependency: libbcprov-java. Required by PEMSSLContextContainer. -- Tomasz Sterna Tue, 12 May 2009 10:51:21 +0000 tigase-server (4.1.5-b1627-xk1) hardy; urgency=low * Updated to SVN revision 1627:\nReverted to old and apparently correct behaviour with sending initial presence to all from and both contacts. -- Tomasz Sterna Mon, 11 May 2009 22:37:08 +0000 tigase-server (4.1.5-b1626-xk1) hardy; urgency=low * Updated to SVN revision 1626:\nProbably fixed a bug with concurrent data reading from network socket. Each new server connection is opened in a separate thread to avoid DNS blocking. -- Tomasz Sterna Mon, 11 May 2009 18:11:33 +0000 tigase-server (4.1.5-b1624-xk1) hardy; urgency=low * Updated to SVN revision 1624:\nadding xmpp admin user from installer unneeded file cleanup config file saving fix in console installer -- Tomasz Sterna Mon, 11 May 2009 12:11:09 +0000 tigase-server (4.1.5-b1621-xk1) hardy; urgency=low * Updated to SVN revision 1621:\nMerge branch 'dbfix' -- Tomasz Sterna Sun, 10 May 2009 20:11:08 +0000 tigase-server (4.1.5-b1620-xk1) hardy; urgency=low * Updated to SVN revision 1620:\nAdded db and config screens Fixed wrong Derby location selection in console mode Improved packs selection, ignoring packs for other systems -- Tomasz Sterna Sun, 10 May 2009 16:11:08 +0000 tigase-server (4.1.5-b1616-xk3) hardy; urgency=low * Added Stored procedures for Digest Auth -- Tomasz Sterna Sun, 10 May 2009 00:56:21 +0000 tigase-server (4.1.5-b1616-xk2) hardy; urgency=low * Added digest auth methods to TigaseAuth. -- Tomasz Sterna Sun, 10 May 2009 00:01:56 +0000 tigase-server (4.1.5-b1616-xk1) hardy; urgency=low * Updated to SVN revision 1616:\nA few fixes and spelling corrections in scripts -- Tomasz Sterna Sat, 09 May 2009 16:11:08 +0000 tigase-server (4.1.5-b1615-xk2) hardy; urgency=low * Fixed init script to properly include JDBC drivers -- Tomasz Sterna Fri, 08 May 2009 10:14:32 +0000 tigase-server (4.1.5-b1615-xk1) hardy; urgency=low * Updated to SVN revision 1615 -- Tomasz Sterna Fri, 08 May 2009 09:01:07 +0000 tigase-server (4.1.5-b1614-xk1) hardy; urgency=low * Updated to SVN revision 1614 -- Tomasz Sterna Fri, 08 May 2009 09:00:07 +0000 tigase-server (4.1.5-b1613-xk1) hardy; urgency=low * Updated to SVN revision 1613 * Separated packages: - tigase-xmltools - tigase-utils - tigase-extras - tigase-muc - tigase-pubsub * Using /usr/share/tigase for all Tigase shared data -- Tomasz Sterna Thu, 07 May 2009 13:46:50 +0000 tigase-server (4.1.4-xk2) dapper; urgency=low * Moved Derby Database to /var/spool/tigase/tigase-derbydb -- Tomasz Sterna Fri, 17 Apr 2009 10:30:21 +0000 tigase-server (4.1.4-xk1) unstable; urgency=low * Updated Tigase to version 4.1.4: * tigase-extras-0.3.0.jar * tigase-muc-1.0.2.jar * tigase-pubsub-1.0.1.jar * tigase-server-4.1.4.jar * tigase-utils-3.1.2.jar * tigase-xmltools-3.1.1.jar * Updated SQLDB connectors: * mysql-connector-java-5.1.7.tar.gz * postgresql-8.3-604.jdbc3.jar -- Tomasz Sterna Mon, 16 Mar 2009 09:40:18 +0000 tigase-server (4.1.0-b1315-1) unstable; urgency=low * Initial Release. -- Tomasz Sterna Thu, 13 Mar 2009 10:42:12 +0200 ================================================ FILE: tigase-server 7.1.0/debian/compat ================================================ 4 ================================================ FILE: tigase-server 7.1.0/debian/control ================================================ Source: tigase-server Section: net Priority: extra Maintainer: Tomasz Sterna Build-Depends: cdbs, debhelper (>= 5), sun-java6-jdk, maven2 Standards-Version: 3.8.0 Package: tigase-server Architecture: all Depends: sun-java6-jre | sun-java6-jdk, sun-java6-javadb | libmysql-java | libpg-java, tigase-xmltools, tigase-utils, tigase-extras, libbcprov-java, adduser, ${misc:Depends} Description: Open Source and Free (GPLv3) Java based Jabber/XMPP server The design and implementation goals of the Tigase Jabber/XMPP Server * Make the server robust and reliable. * Make the server secure communication platform. * Make flexible server which can be applied to different use cases. * Make extensible server which takes full advantage of XMPP protocol extensibility. * Make the server easy to setup and maintain. . See http://www.tigase.org/ Homepage: http://www.tigase.org/ ================================================ FILE: tigase-server 7.1.0/debian/copyright ================================================ This package was debianized by Tomasz Sterna on Thu, 13 Mar 2009 10:46:12 +0200. It was downloaded from https://svn.tigase.org/reps/tigase-server/trunk Upstream Author: Artur Hefczyc Copyright (C) 2004-2012 "Artur Hefczyc" This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-3 If not, see . ================================================ FILE: tigase-server 7.1.0/debian/init.properties ================================================ --user-db=derby --user-db-uri=jdbc:derby:/var/spool/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase --ssl-container-class=tigase.extras.io.PEMSSLContextContainer basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log s2s/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore s2s/connections/tls/trusts-store = /etc/tigase/certs/truststore s2s/connections/tls/server-certs-dir = /etc/tigase/certs c2s/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore c2s/connections/tls/trusts-store = /etc/tigase/certs/truststore c2s/connections/tls/server-certs-dir = /etc/tigase/certs bosh/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore bosh/connections/tls/trusts-store = /etc/tigase/certs/truststore bosh/connections/tls/server-certs-dir = /etc/tigase/certs ================================================ FILE: tigase-server 7.1.0/debian/rules ================================================ #!/usr/bin/make -f # debian/rules for Jetty (uses CDBS) include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/simple-patchsys.mk build: mvn package clean:: rm -rf target binary-post-install/tigase-server:: mv debian/tigase-server/usr/share/tigase/database debian/tigase-server/usr/share/tigase/server-database sed -i 's#jars/\|libs/#lib/#g' debian/tigase-server/usr/share/tigase/scripts/*.sh sed -i 's#lib/tigase-server[^.]*.jar#lib/'`basename debian/tigase-server/usr/share/tigase/lib/tigase-server*.jar`'#g' debian/tigase-server/usr/share/tigase/scripts/*.sh sed -i 's#lib/derby#/usr/lib/jvm/java-6-sun/db/lib/derby#g' debian/tigase-server/usr/share/tigase/scripts/*.sh sed -i 's#database/#server-database/#g' debian/tigase-server/usr/share/tigase/scripts/*.sh chmod +x debian/tigase-server/usr/share/tigase/scripts/*.sh cat debian/init.properties >> debian/tigase-server/etc/tigase/init.properties find debian/tigase-server -depth -type d -name .svn -exec rm -rf {} \; ================================================ FILE: tigase-server 7.1.0/debian/std-logger.sh ================================================ #!/bin/sh LOG=$1 shift exec $* >>$LOG 2>&1 &1 | grep -q 'java version[^0-9]\+\([2-9]\|1\.[6-9]\)'; then if [ -z "$JAVA_HOME" ]; then echo "Could not start $DESC because no Java Runtime Environment (JRE) was found." else echo "$DESC needs Sun Java(TM) SE Runtime Environment at least version 1.6." fi echo "Please download and install JRE 1.6 or higher and set" echo "JAVA_HOME in /etc/default/tigase-server to the JRE's installation directory." exit 0 fi # Put all jars in classpath CLASSPATH="$TIGASE_JAR" CLASSPATH="`ls -d $TIGASE_HOME/lib/*.jar 2>/dev/null | grep -v wrapper | tr '\n' :`$CLASSPATH" for lib in /usr/lib/jvm/java-6-sun/db/lib/derby.jar \ /usr/share/java/postgresql.jar \ /usr/share/java/mysql.jar \ /usr/share/java/bcprov.jar ; do if [ -r $lib ]; then CLASSPATH="$CLASSPATH:$lib"; fi done ARGUMENTS="$JAVA_OPTIONS $TIGASE_DBDRV -cp $CLASSPATH $TIGASE_RUN -c $TIGASE_CONFIG $TIGASE_OPTIONS" ################################################## # Do the action ################################################## case "$1" in start) if start-stop-daemon --quiet --test --start --pidfile "$PIDFILE" \ --user "$TIGASE_USER" --exec "$JAVA" > /dev/null; then if [ -f $PIDFILE ]; then echo "$PIDFILE exists, but $NAME was not running. Ignoring $PIDFILE" fi echo -n "Starting $DESC: " touch $TIGASE_CONSOLE_LOG chown $TIGASE_USER:adm $TIGASE_CONSOLE_LOG echo "STARTED Tigase `date`" >>$TIGASE_CONSOLE_LOG start-stop-daemon --quiet --start --background --pidfile "$PIDFILE" --make-pidfile \ --chuid "$TIGASE_USER" --startas "$TIGASE_HOME/scripts/std-logger.sh" \ -- "$TIGASE_CONSOLE_LOG" "$JAVA" $ARGUMENTS sleep 1 if [ -e "$TIGASE_CONFIG" ]; then chown $TIGASE_USER:adm $TIGASE_CONFIG chmod 0640 $TIGASE_CONFIG fi echo "$NAME." else echo "(already running)." exit 1 fi ;; stop) echo -n "Stopping $DESC: " if start-stop-daemon --quiet --test --start --pidfile "$PIDFILE" \ --user "$TIGASE_USER" --exec "$JAVA" > /dev/null; then if [ -x "$PIDFILE" ]; then echo "(not running but $PIDFILE exists)." else echo "(not running)." fi else start-stop-daemon --quiet --stop \ --pidfile "$PIDFILE" --user "$TIGASE_USER" --exec "$JAVA" > /dev/null sleep 1 while ! start-stop-daemon --quiet --test --start \ --pidfile "$PIDFILE" --user "$TIGASE_USER" \ --startas "$JAVA" > /dev/null; do sleep 1 echo -n "." start-stop-daemon --oknodo --quiet --stop \ --pidfile "$PIDFILE" --user "$TIGASE_USER" --exec "$JAVA" done rm -f "$PIDFILE" echo "$NAME." fi ;; restart|force-reload) $0 stop $* sleep 1 $0 start $* ;; check) echo "Checking arguments to Tigase: " echo echo "PIDFILE = $PIDFILE" echo "JAVA_OPTIONS = $JAVA_OPTIONS" echo "JAVA = $JAVA" echo "TIGASE_USER = $TIGASE_USER" echo "ARGUMENTS = $ARGUMENTS" echo "TIGASE_HOME = $TIGASE_HOME" echo "TIGASE_JAR = $TIGASE_JAR" echo "TIGASE_CONFIG = $TIGASE_CONFIG" echo "TIGASE_OPTIONS = $TIGASE_OPTIONS" echo "CLASSPATH = $CLASSPATH" echo "TIGASE_CONSOLE_LOG = $TIGASE_CONSOLE_LOG" if [ -f $PIDFILE ] && kill -0 `cat $PIDFILE` 2>/dev/null then echo "Tigase running pid="`cat $PIDFILE` exit 0 fi exit 1 ;; zap) rm -f $TIGASE_PID ;; *) echo "Usage: /etc/init.d/tigase-server {start|stop|restart|force-reload|check}" >&2 exit 1 ;; esac exit 0 ================================================ FILE: tigase-server 7.1.0/debian/tigase-server.install ================================================ target/*.jar usr/share/tigase/lib scripts/*.sh usr/share/tigase/scripts debian/*.sh usr/share/tigase/scripts database usr/share/tigase etc usr/share/tigase etc/init.properties etc/tigase certs etc/tigase *.html usr/share/doc/tigase-server ================================================ FILE: tigase-server 7.1.0/debian/tigase-server.postinst ================================================ #!/bin/sh -e case "$1" in configure) if ! id tigase > /dev/null 2>&1 ; then adduser --system --home /usr/share/tigase --no-create-home \ --ingroup nogroup --disabled-password --shell /bin/false \ tigase fi chown tigase:adm /var/log/tigase chown tigase:root /etc/tigase /etc/tigase/certs \ /etc/tigase/certs/rsa-keystore /etc/tigase/certs/truststore \ /var/spool/tigase chmod 750 /var/log/tigase /var/spool/tigase \ /etc/tigase /etc/tigase/certs sed -i 's/$HOST_NAME/'`hostname --fqdn`'/g' /etc/tigase/init.properties* if grep -q 'db=derby$' /etc/tigase/init.properties DERBYDB=`sed -n 's/.*user-db-uri.*jdbc:derby://;s/;.*//p' /etc/tigase/init.properties` then if [ -n "$DERBYDB" ] && [ ! -d "$DERBYDB" ] && [ -r /usr/lib/jvm/java-6-sun/db/lib/derby.jar ] then echo "Creating Derby database for Tigase in \`$DERBYDB' ..." OLDCWD=`pwd` cd /usr/share/tigase scripts/derby-db-create.sh "$DERBYDB" >/dev/null [ -e derby.log ] && rm *.log chown -R tigase "$DERBYDB" cd $OLDCWD fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0 called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# ================================================ FILE: tigase-server 7.1.0/debian/tigase-server.postrm ================================================ #!/bin/sh -e #DEBHELPER# case "$1" in purge) userdel tigase || true rm -rf /var/log/tigase /var/spool/tigase ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) # Nothing to do here ;; *) echo "$0 called with unknown argument \`$1'" >&2 exit 1 ;; esac ================================================ FILE: tigase-server 7.1.0/debian/watch ================================================ version=3 http://www.tigase.org/files/downloads/tigase-server/tigase-server-(.*)\.tar\.gz debian uupdate ================================================ FILE: tigase-server 7.1.0/etc/APNs_HTMessage_Dev.pem ================================================ Bag Attributes friendlyName: Apple Development IOS Push Services: com.fanxinmsg.htmssage localKeyID: 5B 6C 87 73 6E 92 50 34 49 52 51 A2 6A 41 DB 96 8A 60 E4 66 subject=/UID=com.fanxinmsg.htmssage/CN=Apple Development IOS Push Services: com.fanxinmsg.htmssage/OU=TQHAZ76T65/C=US issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority -----BEGIN CERTIFICATE----- MIIFkTCCBHmgAwIBAgIIcVR8mKzwXSAwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw HhcNMTcwMTAzMDU1MDQyWhcNMTgwMTAzMDU1MDQyWjCBkDEmMCQGCgmSJomT8ixk AQEMFmNvbS5mYW54aW5tc2cuaHRtc3NhZ2UxRDBCBgNVBAMMO0FwcGxlIERldmVs b3BtZW50IElPUyBQdXNoIFNlcnZpY2VzOiBjb20uZmFueGlubXNnLmh0bXNzYWdl MRMwEQYDVQQLDApUUUhBWjc2VDY1MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAPnjSNyC3DM3quWeZym8dgfIGeHl/b1/hfSbW6tx Wn6tAfwGxjvytmRNp86lXk1nZNLzl4AteoPhqzYztsuKeaxsD8tQ8DfyZU12LGEn Mcz5ZGadK6gLKhSzgMtNW8taWIuOEqz8VLesK+Rxdeq7O/LX6Vc1Cr7cnGufDWwu ZyT4xpmI44GkfjG4OjTp4EP+BG7pH8XHN5MzSqFs9406RTCW3v9ixKjRKz5Iemr8 Q1zXWA8ra5jHBwOLYxLy3SzQ2pgoiCLs3lO1MmfeShbYZANLY3DJwuAv/rBlWrPF grPOsZIDTRHJeYOl/bmmOYkXG4dNr9HjOLnB52jIacqyO50CAwEAAaOCAeUwggHh MB0GA1UdDgQWBBRbbIdzbpJQNElSUaJqQduWimDkZjAJBgNVHRMEAjAAMB8GA1Ud IwQYMBaAFIgnFwmpthhgi+zruvZHWcVSVKO3MIIBDwYDVR0gBIIBBjCCAQIwgf8G CSqGSIb3Y2QFATCB8TCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlz IGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2Yg dGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9u cyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBw cmFjdGljZSBzdGF0ZW1lbnRzLjApBggrBgEFBQcCARYdaHR0cDovL3d3dy5hcHBs ZS5jb20vYXBwbGVjYS8wTQYDVR0fBEYwRDBCoECgPoY8aHR0cDovL2RldmVsb3Bl ci5hcHBsZS5jb20vY2VydGlmaWNhdGlvbmF1dGhvcml0eS93d2RyY2EuY3JsMAsG A1UdDwQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAjAQBgoqhkiG92NkBgMBBAIF ADANBgkqhkiG9w0BAQUFAAOCAQEAPDZc18IZn5e+5PGNgnH8y0yTNALeDqKbbgPs 4+oci/zDGXwU1dyHPG1/2a5Q+YlRAQHhIHeXlRjtft+LDR1GhOWWrrI79WHaw2q0 9CdTxnvRlXz9XrbUjo9DVyIpvidJuNXiG+KYhYHDCRFaMqPBC3gNd6Pj6073OKCX LTbGmuJo2/H5cO1/7B4+/AUNHqJG2DEH/YDwTSVcvHDm2APesPcNyvU94S111REO +3lDMYYCi7PpwhdWOPxBpyK6mlAmeHBkjlzk5dBrlePCqxjdERGhQflS1W1wqxz7 Rie3yW7WQxjYOUiAGx7C6Tpr9TFt2KN7OPsEGBJtYlXPDV8Btw== -----END CERTIFICATE----- Bag Attributes friendlyName: apple localKeyID: 5B 6C 87 73 6E 92 50 34 49 52 51 A2 6A 41 DB 96 8A 60 E4 66 Key Attributes: -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA+eNI3ILcMzeq5Z5nKbx2B8gZ4eX9vX+F9Jtbq3Fafq0B/AbG O/K2ZE2nzqVeTWdk0vOXgC16g+GrNjO2y4p5rGwPy1DwN/JlTXYsYScxzPlkZp0r qAsqFLOAy01by1pYi44SrPxUt6wr5HF16rs78tfpVzUKvtyca58NbC5nJPjGmYjj gaR+Mbg6NOngQ/4Ebukfxcc3kzNKoWz3jTpFMJbe/2LEqNErPkh6avxDXNdYDytr mMcHA4tjEvLdLNDamCiIIuzeU7UyZ95KFthkA0tjcMnC4C/+sGVas8WCs86xkgNN Ecl5g6X9uaY5iRcbh02v0eM4ucHnaMhpyrI7nQIDAQABAoIBAQCDH217MDuFsJ8/ T+hIMTkqCijyrXGA/yp2WRM4GgnnULcq3Q8mI8zrQwhb2dBrA2cXfnSv8K1KCJ+D mI1Brs7719RN1pHGea4IgIr3C88JBJBXe/+NdRZGuI5Ln7McOLMfv5QzK1D09CYw AA1k94yUeBFcDlwuHKsDmfk8G/lJnyt6YdFB9vkJQO7nxmD+ro1q67RH9dIyIyAx kyWi9AFg/vn/X2Kmn+2HGR9wwAkPI8b4LPYnOivqPDJkeqzTJrZCoT/+vUc8goeB nqq4FKyfKN+i0ZaxQMuI/oNId0ZCPWyoM2OXh2DuqilXrOVuqIixd+2COHQnaDxv pU4zpFxBAoGBAP/xH743M0cnia4FqREKYd++WpLiCWd/hqHw2F9uYfgYu21MUYCq 6FnbR0BusAXckUbe+Ma8sra0xe6uPbpRWeqFKDWaYsqk1CJYs2ChpqTen8A1q9M5 nzdQkUcO4pprjKGunifRvb0M+wAPP9B1mxlcm6RKd7oiMYiIF0f2UbNxAoGBAPnx zwmk/gXWzzFxA3LEYaNm6uE4cPb5K6mlFYErTUM43MEeltZh/Ep5fS8aXncUulw6 AJ3BqEY9dIYNtMqdUtKdZLIlszx8kLWgIMcekBFBJBgq15d5i+0+qBJfDDt9erLY cbw6OYPMM5mfqeYuDZuVyolo9VYzXI9TYTv3etztAoGASrFd6C9H4b4iKg0w1+5F vfxZhoA86l2HNv+IxeD66mKdYDpjlr9J699Yne8vo6ZJJ3uu8qDjLvr2wL9M+HEB YrXVlD8oEaek2Rk10D+c2IS37mo7aPtqAcSbgTdQ3mwAsLa7JTfKvb9qCQxqPTX1 O6ORMJMi+ck813GQCcpS8aECgYEA9ZyyWAbjfLdvGWW1/sSOMfVDoJhHIdsPFgDc lfcIUKODAt9dWEQnmMOzyWK/K4OZ8mEpE90m0Ac6BzVW0LgymDcEqa80Z5780Q4O x7z304zQvFL1UqulXjhxDsSKD7epqC/b7BzHQgWbOz5TxZbB1n8m7UrPs6p7LXjB Fx2Fha0CgYA2+Yy/9itc+vrV0YotNpFirFXMFb7ihqHO1rQr0CEiPESHHpFZXN7/ KDYAkdiysNNKuprsk2db6jpNFSfTtJY6t3XuwkDJoDdVQvDzSeJaQzH170v8AUUP o5OzXAzOAwG5srWRgJVcvxjXMycFntiZSZT+xzT7VAuUTtFu9bVC9A== -----END RSA PRIVATE KEY----- ================================================ FILE: tigase-server 7.1.0/etc/HTMessage_Dev_APNs.pem ================================================ Bag Attributes friendlyName: Apple Development IOS Push Services: com.fanxinmsg.htmssage localKeyID: 5B 6C 87 73 6E 92 50 34 49 52 51 A2 6A 41 DB 96 8A 60 E4 66 subject=/UID=com.fanxinmsg.htmssage/CN=Apple Development IOS Push Services: com.fanxinmsg.htmssage/OU=TQHAZ76T65/C=US issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority -----BEGIN CERTIFICATE----- MIIFkTCCBHmgAwIBAgIIcVR8mKzwXSAwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw HhcNMTcwMTAzMDU1MDQyWhcNMTgwMTAzMDU1MDQyWjCBkDEmMCQGCgmSJomT8ixk AQEMFmNvbS5mYW54aW5tc2cuaHRtc3NhZ2UxRDBCBgNVBAMMO0FwcGxlIERldmVs b3BtZW50IElPUyBQdXNoIFNlcnZpY2VzOiBjb20uZmFueGlubXNnLmh0bXNzYWdl MRMwEQYDVQQLDApUUUhBWjc2VDY1MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAPnjSNyC3DM3quWeZym8dgfIGeHl/b1/hfSbW6tx Wn6tAfwGxjvytmRNp86lXk1nZNLzl4AteoPhqzYztsuKeaxsD8tQ8DfyZU12LGEn Mcz5ZGadK6gLKhSzgMtNW8taWIuOEqz8VLesK+Rxdeq7O/LX6Vc1Cr7cnGufDWwu ZyT4xpmI44GkfjG4OjTp4EP+BG7pH8XHN5MzSqFs9406RTCW3v9ixKjRKz5Iemr8 Q1zXWA8ra5jHBwOLYxLy3SzQ2pgoiCLs3lO1MmfeShbYZANLY3DJwuAv/rBlWrPF grPOsZIDTRHJeYOl/bmmOYkXG4dNr9HjOLnB52jIacqyO50CAwEAAaOCAeUwggHh MB0GA1UdDgQWBBRbbIdzbpJQNElSUaJqQduWimDkZjAJBgNVHRMEAjAAMB8GA1Ud IwQYMBaAFIgnFwmpthhgi+zruvZHWcVSVKO3MIIBDwYDVR0gBIIBBjCCAQIwgf8G CSqGSIb3Y2QFATCB8TCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlz IGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2Yg dGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9u cyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBw cmFjdGljZSBzdGF0ZW1lbnRzLjApBggrBgEFBQcCARYdaHR0cDovL3d3dy5hcHBs ZS5jb20vYXBwbGVjYS8wTQYDVR0fBEYwRDBCoECgPoY8aHR0cDovL2RldmVsb3Bl ci5hcHBsZS5jb20vY2VydGlmaWNhdGlvbmF1dGhvcml0eS93d2RyY2EuY3JsMAsG A1UdDwQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAjAQBgoqhkiG92NkBgMBBAIF ADANBgkqhkiG9w0BAQUFAAOCAQEAPDZc18IZn5e+5PGNgnH8y0yTNALeDqKbbgPs 4+oci/zDGXwU1dyHPG1/2a5Q+YlRAQHhIHeXlRjtft+LDR1GhOWWrrI79WHaw2q0 9CdTxnvRlXz9XrbUjo9DVyIpvidJuNXiG+KYhYHDCRFaMqPBC3gNd6Pj6073OKCX LTbGmuJo2/H5cO1/7B4+/AUNHqJG2DEH/YDwTSVcvHDm2APesPcNyvU94S111REO +3lDMYYCi7PpwhdWOPxBpyK6mlAmeHBkjlzk5dBrlePCqxjdERGhQflS1W1wqxz7 Rie3yW7WQxjYOUiAGx7C6Tpr9TFt2KN7OPsEGBJtYlXPDV8Btw== -----END CERTIFICATE----- Bag Attributes friendlyName: apple localKeyID: 5B 6C 87 73 6E 92 50 34 49 52 51 A2 6A 41 DB 96 8A 60 E4 66 Key Attributes: -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA+eNI3ILcMzeq5Z5nKbx2B8gZ4eX9vX+F9Jtbq3Fafq0B/AbG O/K2ZE2nzqVeTWdk0vOXgC16g+GrNjO2y4p5rGwPy1DwN/JlTXYsYScxzPlkZp0r qAsqFLOAy01by1pYi44SrPxUt6wr5HF16rs78tfpVzUKvtyca58NbC5nJPjGmYjj gaR+Mbg6NOngQ/4Ebukfxcc3kzNKoWz3jTpFMJbe/2LEqNErPkh6avxDXNdYDytr mMcHA4tjEvLdLNDamCiIIuzeU7UyZ95KFthkA0tjcMnC4C/+sGVas8WCs86xkgNN Ecl5g6X9uaY5iRcbh02v0eM4ucHnaMhpyrI7nQIDAQABAoIBAQCDH217MDuFsJ8/ T+hIMTkqCijyrXGA/yp2WRM4GgnnULcq3Q8mI8zrQwhb2dBrA2cXfnSv8K1KCJ+D mI1Brs7719RN1pHGea4IgIr3C88JBJBXe/+NdRZGuI5Ln7McOLMfv5QzK1D09CYw AA1k94yUeBFcDlwuHKsDmfk8G/lJnyt6YdFB9vkJQO7nxmD+ro1q67RH9dIyIyAx kyWi9AFg/vn/X2Kmn+2HGR9wwAkPI8b4LPYnOivqPDJkeqzTJrZCoT/+vUc8goeB nqq4FKyfKN+i0ZaxQMuI/oNId0ZCPWyoM2OXh2DuqilXrOVuqIixd+2COHQnaDxv pU4zpFxBAoGBAP/xH743M0cnia4FqREKYd++WpLiCWd/hqHw2F9uYfgYu21MUYCq 6FnbR0BusAXckUbe+Ma8sra0xe6uPbpRWeqFKDWaYsqk1CJYs2ChpqTen8A1q9M5 nzdQkUcO4pprjKGunifRvb0M+wAPP9B1mxlcm6RKd7oiMYiIF0f2UbNxAoGBAPnx zwmk/gXWzzFxA3LEYaNm6uE4cPb5K6mlFYErTUM43MEeltZh/Ep5fS8aXncUulw6 AJ3BqEY9dIYNtMqdUtKdZLIlszx8kLWgIMcekBFBJBgq15d5i+0+qBJfDDt9erLY cbw6OYPMM5mfqeYuDZuVyolo9VYzXI9TYTv3etztAoGASrFd6C9H4b4iKg0w1+5F vfxZhoA86l2HNv+IxeD66mKdYDpjlr9J699Yne8vo6ZJJ3uu8qDjLvr2wL9M+HEB YrXVlD8oEaek2Rk10D+c2IS37mo7aPtqAcSbgTdQ3mwAsLa7JTfKvb9qCQxqPTX1 O6ORMJMi+ck813GQCcpS8aECgYEA9ZyyWAbjfLdvGWW1/sSOMfVDoJhHIdsPFgDc lfcIUKODAt9dWEQnmMOzyWK/K4OZ8mEpE90m0Ac6BzVW0LgymDcEqa80Z5780Q4O x7z304zQvFL1UqulXjhxDsSKD7epqC/b7BzHQgWbOz5TxZbB1n8m7UrPs6p7LXjB Fx2Fha0CgYA2+Yy/9itc+vrV0YotNpFirFXMFb7ihqHO1rQr0CEiPESHHpFZXN7/ KDYAkdiysNNKuprsk2db6jpNFSfTtJY6t3XuwkDJoDdVQvDzSeJaQzH170v8AUUP o5OzXAzOAwG5srWRgJVcvxjXMycFntiZSZT+xzT7VAuUTtFu9bVC9A== -----END RSA PRIVATE KEY----- ================================================ FILE: tigase-server 7.1.0/etc/bosh-extra-headers.txt ================================================ Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, OPTIONS Access-Control-Allow-Headers: Content-Type Access-Control-Max-Age: 86400 ================================================ FILE: tigase-server 7.1.0/etc/client-access-policy.xml ================================================ ================================================ FILE: tigase-server 7.1.0/etc/config-dump.properties ================================================ sess-man/plugins-conf/message-archive-xep-0136/required-store-method[S]=message sess-man/plugins-conf/urn:ietf:params:xml:ns:xmpp-bind/apns-token-db-uri[S]=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF8 sess-man/plugins-conf/enabled-mechanisms[S]=ANONYMOUS,PLAIN sess-man/component-id[S]=sess-man@izwz98w1n1tjfj7xt5ljyqz sess-man/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz sess-man/admins[s]=admin@app.im sess-man/scripts-dir[S]=scripts/admin sess-man/command/ALL[S]=ADMIN sess-man/max-queue-size[I]=5060 sess-man/scheduler-threads[I]=1 sess-man/incoming-filters[S]=tigase.server.filters.PacketCounter sess-man/outgoing-filters[S]=tigase.server.filters.PacketCounter sess-man/admin-scripts-dir[S]=scripts/admin/ sess-man/plugins[s]=session-close, session-open, default-handler, jabber:iq:register, jabber:iq:auth, urn:ietf:params:xml:ns:xmpp-sasl, urn:ietf:params:xml:ns:xmpp-bind, urn:ietf:params:xml:ns:xmpp-session, jabber:iq:roster, jabber:iq:privacy, jabber:iq:version, http://jabber.org/protocol/stats, starttls, vcard-temp, http://jabber.org/protocol/commands, jabber:iq:private, urn:xmpp:ping, presence-state, presence-subscription, disco, domain-filter, zlib, amp, message-carbons, vcard-xep-0292, urn:xmpp:time, urn:xmpp:csi:0, urn:xmpp:receipts, message-push, message-archive-xep-0136 sess-man/plugins-concurrency[S]= sess-man/skip-privacy[B]=false sess-man/offline-user-autocreate[S]=false sess-man/sm-threads-pool[S]=default sess-man/force-detail-stale-connection-check[B]=true sess-man/stale-connection-closer-queue-size[I]=1000 sess-man/auth-timeout[L]=120 sess-man/sm-threads-factor[I]=1 basic-conf/logging/tigase.http.level[S]=FINEST basic-conf/logging/tigase.xmpp.impl.level[S]=FINE basic-conf/logging/tigase.muc.level[S]=FINE basic-conf/logging/tigase.apns.level[S]=FINE basic-conf/logging/tigase.db.jdbc.level[S]=FINER basic-conf/component-id[S]=basic-conf@izwz98w1n1tjfj7xt5ljyqz basic-conf/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz basic-conf/admins[s]=admin@app.im basic-conf/scripts-dir[S]=scripts/admin basic-conf/command/ALL[S]=ADMIN basic-conf/logging/.level[S]=CONFIG basic-conf/logging/handlers[S]=java.util.logging.ConsoleHandler java.util.logging.FileHandler basic-conf/logging/java.util.logging.ConsoleHandler.formatter[S]=tigase.util.LogFormatter basic-conf/logging/java.util.logging.ConsoleHandler.level[S]=WARNING basic-conf/logging/java.util.logging.FileHandler.append[S]=true basic-conf/logging/java.util.logging.FileHandler.count[S]=5 basic-conf/logging/java.util.logging.FileHandler.formatter[S]=tigase.util.LogFormatter basic-conf/logging/java.util.logging.FileHandler.limit[S]=10000000 basic-conf/logging/java.util.logging.FileHandler.pattern[S]=logs/tigase.log basic-conf/logging/tigase.useParentHandlers[S]=true basic-conf/logging/java.util.logging.FileHandler.level[S]=ALL basic-conf/user-domain-repo-pool[S]=tigase.db.UserRepositoryMDImpl basic-conf/auth-domain-repo-pool[S]=tigase.db.AuthRepositoryMDImpl basic-conf/user-repo-pool-size[I]=10 basic-conf/data-repo-pool-size[I]=10 basic-conf/user-repo-class[S]=mysql basic-conf/user-repo-url[S]=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull basic-conf/auth-repo-class[S]=tigase.db.jdbc.TigaseCustomAuth basic-conf/auth-repo-url[S]=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull basic-conf/ssl-container-class[S]=tigase.io.jdk18.SNISSLContextContainer basic-conf/ssl-certs-location[S]=certs/ basic-conf/ssl-def-cert-domain[S]=default basic-conf/config-dump-file[S]=etc/config-dump.properties http/http/ports[i]=19080, 19081 http/api-keys[s]=open_access http/component-id[S]=http@izwz98w1n1tjfj7xt5ljyqz http/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz http/admins[s]=admin@app.im http/scripts-dir[S]=scripts/admin http/command/ALL[S]=ADMIN http/max-queue-size[I]=506 http/scheduler-threads[I]=1 http/incoming-filters[S]=tigase.server.filters.PacketCounter http/outgoing-filters[S]=tigase.server.filters.PacketCounter http/http/server-class[S]=tigase.http.java.JavaStandaloneHttpServer message-archive/auto[S]=true message-archive/component-id[S]=message-archive@izwz98w1n1tjfj7xt5ljyqz message-archive/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz message-archive/admins[s]=admin@app.im message-archive/scripts-dir[S]=scripts/admin message-archive/command/ALL[S]=ADMIN message-archive/max-queue-size[I]=506 message-archive/scheduler-threads[I]=1 message-archive/incoming-filters[S]=tigase.server.filters.PacketCounter message-archive/outgoing-filters[S]=tigase.server.filters.PacketCounter message-archive/tags-support[B]=false message-archive/archive-repo-uri[S]=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull message-archive/remove-expired-messages-delay[S]=PT1H message-archive/remove-expired-messages-period[S]=P1D message-archive/remove-expired-messages[B]=false amp/store-limit[L]=10000 amp/component-id[S]=amp@izwz98w1n1tjfj7xt5ljyqz amp/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz amp/admins[s]=admin@app.im amp/scripts-dir[S]=scripts/admin amp/command/ALL[S]=ADMIN amp/max-queue-size[I]=506 amp/scheduler-threads[I]=1 amp/incoming-filters[S]=tigase.server.filters.PacketCounter amp/outgoing-filters[S]=tigase.server.filters.PacketCounter amp/security-level[S]=STRICT amp/amp-repo-uri[S]=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull message-router/component-id[S]=message-router@izwz98w1n1tjfj7xt5ljyqz message-router/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz message-router/admins[s]=admin@app.im message-router/scripts-dir[S]=scripts/admin message-router/command/ALL[S]=ADMIN message-router/max-queue-size[I]=5060 message-router/scheduler-threads[I]=1 message-router/incoming-filters[S]=tigase.server.filters.PacketCounter message-router/outgoing-filters[S]=tigase.server.filters.PacketCounter message-router/components/msg-receivers/message-archive.class[S]=tigase.archive.MessageArchiveComponent message-router/components/msg-receivers/message-archive.active[B]=true message-router/components/msg-receivers/http.class[S]=tigase.http.HttpMessageReceiver message-router/components/msg-receivers/http.active[B]=true message-router/components/msg-receivers/id-names[s]=amp, bosh, c2s, eventbus, http, message-archive, monitor, s2s, sess-man, ws2s message-router/components/msg-receivers/amp.class[S]=tigase.server.amp.AmpComponent message-router/components/msg-receivers/amp.active[B]=true message-router/components/msg-receivers/bosh.class[S]=tigase.server.bosh.BoshConnectionManager message-router/components/msg-receivers/bosh.active[B]=true message-router/components/msg-receivers/c2s.class[S]=tigase.server.xmppclient.ClientConnectionManager message-router/components/msg-receivers/c2s.active[B]=true message-router/components/msg-receivers/eventbus.class[S]=tigase.disteventbus.component.EventBusComponent message-router/components/msg-receivers/eventbus.active[B]=true message-router/components/msg-receivers/monitor.class[S]=tigase.monitor.MonitorComponent message-router/components/msg-receivers/monitor.active[B]=true message-router/components/msg-receivers/s2s.class[S]=tigase.server.xmppserver.S2SConnectionManager message-router/components/msg-receivers/s2s.active[B]=true message-router/components/msg-receivers/sess-man.class[S]=tigase.server.xmppsession.SessionManager message-router/components/msg-receivers/sess-man.active[B]=true message-router/components/msg-receivers/ws2s.class[S]=tigase.server.websocket.WebSocketClientConnectionManager message-router/components/msg-receivers/ws2s.active[B]=true message-router/components/registrators/id-names[s]=vhost-man, stats message-router/components/registrators/vhost-man.class[S]=tigase.vhosts.VHostManager message-router/components/registrators/vhost-man.active[B]=true message-router/components/registrators/stats.class[S]=tigase.stats.StatisticsCollector message-router/components/registrators/stats.active[B]=true message-router/hostnames[s]=app.im message-router/disco-name[S]=Tigase message-router/disco-show-version[B]=true message-router/updates-checking[B]=true message-router/updates-checking-interval[L]=7 vhost-man/component-id[S]=vhost-man@izwz98w1n1tjfj7xt5ljyqz vhost-man/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz vhost-man/admins[s]=admin@app.im vhost-man/scripts-dir[S]=scripts/admin vhost-man/command/ALL[S]=ADMIN vhost-man/repository-class[S]=tigase.vhosts.VHostJDBCRepository vhost-man/hostnames[s]=app.im vhost-man/dns-srv-def-addr[S]=izwz98w1n1tjfj7xt5ljyqz vhost-man/dns-def-ip[S]=10.30.210.67 vhost-man/domains-per-user-limit[I]=25 stats/component-id[S]=stats@izwz98w1n1tjfj7xt5ljyqz stats/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz stats/admins[s]=admin@app.im stats/scripts-dir[S]=scripts/admin stats/command/ALL[S]=ADMIN stats/stats-history-size[I]=0 stats/stats-update-interval[L]=10 bosh/component-id[S]=bosh@izwz98w1n1tjfj7xt5ljyqz bosh/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz bosh/admins[s]=admin@app.im bosh/scripts-dir[S]=scripts/admin bosh/command/ALL[S]=ADMIN bosh/max-queue-size[I]=5060 bosh/scheduler-threads[I]=1 bosh/incoming-filters[S]=tigase.server.filters.PacketCounter bosh/outgoing-filters[S]=tigase.server.filters.PacketCounter bosh/connections/tls/use[B]=true bosh/net-buffer[I]=2048 bosh/traffic-throttling[S]=xmpp:2500:0:disc,bin:20m:0:disc bosh/net-buffer-limit[I]=2097152 bosh/elements-number-limit[I]=1000 bosh/watchdog_delay[L]=600000 bosh/watchdog_timeout[L]=1740000 bosh/watchdog_ping_type[S]=WHITESPACE bosh/connections/5280/type[S]=accept bosh/connections/5280/socket[S]=plain bosh/connections/5280/ifc[s]=* bosh/connections/5280/remote-host[S]=localhost bosh/connections/5280/connections/tls/required[B]=false bosh/connections/ports[i]=5280 bosh/white-char-ack[B]=false bosh/xmpp-ack[B]=false bosh/max-inactivity-time[L]=600 bosh/cm-see-other-host[S]= bosh/routings/multi-mode[B]=true bosh/routings/.+[S]=sess-man@izwz98w1n1tjfj7xt5ljyqz bosh/socket-close-wait[L]=1 bosh/tls-want-client-auth-enabled[B]=false bosh/max-wait[L]=30 bosh/min-polling[L]=10 bosh/max-inactivity[L]=10 bosh/concurrent-requests[I]=2 bosh/hold-requests[I]=1 bosh/max-batch-size[I]=15 bosh/batch-queue-timeout[L]=100 bosh/max-session-waiting-packets[I]=100 bosh/send-node-hostname[B]=true bosh/sid-logger-level[S]=OFF c2s/component-id[S]=c2s@izwz98w1n1tjfj7xt5ljyqz c2s/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz c2s/admins[s]=admin@app.im c2s/scripts-dir[S]=scripts/admin c2s/command/ALL[S]=ADMIN c2s/max-queue-size[I]=5060 c2s/scheduler-threads[I]=1 c2s/incoming-filters[S]=tigase.server.filters.PacketCounter c2s/outgoing-filters[S]=tigase.server.filters.PacketCounter c2s/connections/tls/use[B]=true c2s/net-buffer[I]=2048 c2s/traffic-throttling[S]=xmpp:2500:0:disc,bin:20m:0:disc c2s/net-buffer-limit[I]=2097152 c2s/elements-number-limit[I]=1000 c2s/watchdog_delay[L]=600000 c2s/watchdog_timeout[L]=1740000 c2s/watchdog_ping_type[S]=WHITESPACE c2s/connections/5222/type[S]=accept c2s/connections/5222/socket[S]=plain c2s/connections/5222/ifc[s]=* c2s/connections/5222/remote-host[S]=localhost c2s/connections/5222/connections/tls/required[B]=false c2s/connections/5223/type[S]=accept c2s/connections/5223/socket[S]=ssl c2s/connections/5223/ifc[s]=* c2s/connections/5223/remote-host[S]=localhost c2s/connections/5223/connections/tls/required[B]=false c2s/connections/ports[i]=5222, 5223 c2s/white-char-ack[B]=false c2s/xmpp-ack[B]=false c2s/max-inactivity-time[L]=86400 c2s/cm-see-other-host[S]= c2s/routings/multi-mode[B]=true c2s/routings/.+[S]=sess-man@izwz98w1n1tjfj7xt5ljyqz c2s/socket-close-wait[L]=1 c2s/tls-want-client-auth-enabled[B]=false eventbus/component-id[S]=eventbus@izwz98w1n1tjfj7xt5ljyqz eventbus/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz eventbus/admins[s]=admin@app.im eventbus/scripts-dir[S]=scripts/admin eventbus/command/ALL[S]=ADMIN eventbus/max-queue-size[I]=506 eventbus/scheduler-threads[I]=1 eventbus/incoming-filters[S]=tigase.server.filters.PacketCounter eventbus/outgoing-filters[S]=tigase.server.filters.PacketCounter eventbus/modules/jabber:iq:version[S]=tigase.component.modules.impl.JabberVersionModule eventbus/modules/receiver[S]=tigase.disteventbus.component.EventReceiverModule eventbus/modules/subscribe[S]=tigase.disteventbus.component.SubscribeModule eventbus/modules/unsubscribe[S]=tigase.disteventbus.component.UnsubscribeModule eventbus/modules/urn:xmpp:ping[S]=tigase.component.modules.impl.XmppPingModule eventbus/modules/disco[S]=tigase.component.modules.impl.DiscoveryModule eventbus/modules/publisher[S]=tigase.disteventbus.component.EventPublisherModule eventbus/modules/commands[S]=tigase.component.modules.impl.AdHocCommandModule monitor/component-id[S]=monitor@izwz98w1n1tjfj7xt5ljyqz monitor/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz monitor/admins[s]=admin@app.im monitor/scripts-dir[S]=scripts/admin monitor/command/ALL[S]=ADMIN monitor/max-queue-size[I]=506 monitor/scheduler-threads[I]=1 monitor/incoming-filters[S]=tigase.server.filters.PacketCounter monitor/outgoing-filters[S]=tigase.server.filters.PacketCounter monitor/modules/jabber:iq:version[S]=tigase.component.modules.impl.JabberVersionModule monitor/modules/urn:xmpp:ping[S]=tigase.component.modules.impl.XmppPingModule monitor/modules/disco[S]=tigase.monitor.modules.DiscoveryMonitorModule monitor/modules/commands[S]=tigase.monitor.modules.AdHocCommandMonitorModule s2s/component-id[S]=s2s@izwz98w1n1tjfj7xt5ljyqz s2s/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz s2s/admins[s]=admin@app.im s2s/scripts-dir[S]=scripts/admin s2s/command/ALL[S]=ADMIN s2s/max-queue-size[I]=506 s2s/scheduler-threads[I]=1 s2s/incoming-filters[S]=tigase.server.filters.PacketCounter s2s/outgoing-filters[S]=tigase.server.filters.PacketCounter s2s/connections/tls/use[B]=true s2s/net-buffer[I]=65536 s2s/traffic-throttling[S]=xmpp:15k:0:disc,bin:120m:0:disc s2s/net-buffer-limit[I]=20971520 s2s/elements-number-limit[I]=1000 s2s/watchdog_delay[L]=600000 s2s/watchdog_timeout[L]=1740000 s2s/watchdog_ping_type[S]=WHITESPACE s2s/connections/5269/type[S]=accept s2s/connections/5269/socket[S]=plain s2s/connections/5269/ifc[s]=* s2s/connections/5269/remote-host[S]=localhost s2s/connections/5269/connections/tls/required[B]=false s2s/connections/ports[i]=5269 s2s/white-char-ack[B]=false s2s/xmpp-ack[B]=false s2s/max-inactivity-time[L]=900 s2s/max-packet-waiting-time[L]=420 s2s/max-in-conns[I]=4 s2s/max-out-total-conns[I]=1 s2s/max-out-per-ip-conns[I]=1 s2s/s2s-conn-selector[S]=tigase.server.xmppserver.S2SRandomSelector s2s/cid-connections-tasks-threads[I]=1 s2s/s2s-domain-mapping[S]= ws2s/component-id[S]=ws2s@izwz98w1n1tjfj7xt5ljyqz ws2s/def-hostname[S]=izwz98w1n1tjfj7xt5ljyqz ws2s/admins[s]=admin@app.im ws2s/scripts-dir[S]=scripts/admin ws2s/command/ALL[S]=ADMIN ws2s/max-queue-size[I]=5060 ws2s/scheduler-threads[I]=1 ws2s/incoming-filters[S]=tigase.server.filters.PacketCounter ws2s/outgoing-filters[S]=tigase.server.filters.PacketCounter ws2s/connections/tls/use[B]=true ws2s/net-buffer[I]=2048 ws2s/traffic-throttling[S]=xmpp:2500:0:disc,bin:20m:0:disc ws2s/net-buffer-limit[I]=2097152 ws2s/elements-number-limit[I]=1000 ws2s/watchdog_delay[L]=600000 ws2s/watchdog_timeout[L]=1740000 ws2s/watchdog_ping_type[S]=WHITESPACE ws2s/connections/5290/type[S]=accept ws2s/connections/5290/socket[S]=plain ws2s/connections/5290/ifc[s]=* ws2s/connections/5290/remote-host[S]=localhost ws2s/connections/5290/connections/tls/required[B]=false ws2s/connections/ports[i]=5290 ws2s/white-char-ack[B]=false ws2s/xmpp-ack[B]=false ws2s/max-inactivity-time[L]=86400 ws2s/cm-see-other-host[S]= ws2s/routings/multi-mode[B]=true ws2s/routings/.+[S]=sess-man@izwz98w1n1tjfj7xt5ljyqz ws2s/socket-close-wait[L]=1 ws2s/tls-want-client-auth-enabled[B]=false ws2s/protocol-versions[s]=hybi ================================================ FILE: tigase-server 7.1.0/etc/cross-domain-policy.xml ================================================ ================================================ FILE: tigase-server 7.1.0/etc/htmessage_production_APNs.pem ================================================ Bag Attributes friendlyName: Apple Push Services: com.fanxinmsg.htmssage localKeyID: 3F 5E 98 55 0A 59 11 29 B1 39 40 8F FD B6 39 16 69 DB 1D 01 subject=/UID=com.fanxinmsg.htmssage/CN=Apple Push Services: com.fanxinmsg.htmssage/OU=TQHAZ76T65/O=Hefei Palm Peak Technology Co., Ltd./C=US issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority -----BEGIN CERTIFICATE----- MIIGRDCCBSygAwIBAgIIC5vm99Uw+38wDQYJKoZIhvcNAQELBQAwgZYxCzAJBgNV BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw HhcNMTcwMzA5MDIxNDM1WhcNMTgwNDA4MDIxNDM1WjCBrzEmMCQGCgmSJomT8ixk AQEMFmNvbS5mYW54aW5tc2cuaHRtc3NhZ2UxNDAyBgNVBAMMK0FwcGxlIFB1c2gg U2VydmljZXM6IGNvbS5mYW54aW5tc2cuaHRtc3NhZ2UxEzARBgNVBAsMClRRSEFa NzZUNjUxLTArBgNVBAoMJEhlZmVpIFBhbG0gUGVhayBUZWNobm9sb2d5IENvLiwg THRkLjELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB AQDHNLE+jn2wrPq0N701D7mfd68sfn8FpgYxkntI+fSICrBDoTQNAai6deKLTX33 KAO6+uxNyjsibEfJ9NtJ2YMO/kk7gN1KhfJtIrWKmjpjJ+F4G/TagQuEavVfR26+ QoXNShycnSAF8D6/FSpuZGZ50mzpuBDHElZ+f8kk74zvpKB9oeR3TnjQHzSd9P0V /bcdtdBLYsEAWoX2V1v5K1gImD8OXzn735MhiqZx+4oxuiQ7fXfolnwU1AOabfEc nLvybtxxhWSe4p1Pe3ZXYtPpwWin9W/QZZ+ZufGjmAvWYQrZq8nZAQNX1ci4AVRU KziNoNsNOhTsV1txdUM0H0BNAgMBAAGjggJ5MIICdTAdBgNVHQ4EFgQUP16YVQpZ ESmxOUCP/bY5FmnbHQEwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSIJxcJqbYY YIvs67r2R1nFUlSjtzCCARwGA1UdIASCARMwggEPMIIBCwYJKoZIhvdjZAUBMIH9 MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMgY2VydGlmaWNhdGUg YnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBvZiB0aGUgdGhlbiBhcHBs aWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHVzZSwgY2Vy dGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZpY2F0aW9uIHByYWN0aWNlIHN0YXRl bWVudHMuMDUGCCsGAQUFBwIBFilodHRwOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZp Y2F0ZWF1dGhvcml0eTAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vY3JsLmFwcGxl LmNvbS93d2RyY2EuY3JsMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEF BQcDAjAQBgoqhkiG92NkBgMBBAIFADAQBgoqhkiG92NkBgMCBAIFADCBiQYKKoZI hvdjZAYDBgR7MHkMFmNvbS5mYW54aW5tc2cuaHRtc3NhZ2UwBQwDYXBwDBtjb20u ZmFueGlubXNnLmh0bXNzYWdlLnZvaXAwBgwEdm9pcAwjY29tLmZhbnhpbm1zZy5o dG1zc2FnZS5jb21wbGljYXRpb24wDgwMY29tcGxpY2F0aW9uMA0GCSqGSIb3DQEB CwUAA4IBAQAFS4u12Ob5s/dvhwO9+ZREo5Jm/MlBthxEN/7gM0oxkMTh+LiPOWwK 44UFFlFWTOnUP5jl/xjurozS9n4oKA/BS2QDN1sQVR/bidaIAQUn5ZfEz68RDfHW rO9Dqzf/Q9gcCU+kY0NC62C1wJ1o0i5qmN04+cgUBvm0B8x26fFDS4TiCrfWyM2P SzXmoshivHRMIgtiJVdpizw3qtQTOjiWb26pQfXxTodremlEFZOOL0B9+rnySR8w Sw79xoug+2M0QRDZ4fA0itsE2tEliVQRBmXLF2f1JoyyYClL/yf8yKRf6RQDFT3X ZyrQy8ctl8L1FOg676DqsmVZhsgbwQcX -----END CERTIFICATE----- Bag Attributes friendlyName: apple localKeyID: 3F 5E 98 55 0A 59 11 29 B1 39 40 8F FD B6 39 16 69 DB 1D 01 Key Attributes: -----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAxzSxPo59sKz6tDe9NQ+5n3evLH5/BaYGMZJ7SPn0iAqwQ6E0 DQGounXii0199ygDuvrsTco7ImxHyfTbSdmDDv5JO4DdSoXybSK1ipo6YyfheBv0 2oELhGr1X0duvkKFzUocnJ0gBfA+vxUqbmRmedJs6bgQxxJWfn/JJO+M76SgfaHk d0540B80nfT9Ff23HbXQS2LBAFqF9ldb+StYCJg/Dl85+9+TIYqmcfuKMbokO313 6JZ8FNQDmm3xHJy78m7ccYVknuKdT3t2V2LT6cFop/Vv0GWfmbnxo5gL1mEK2avJ 2QEDV9XIuAFUVCs4jaDbDToU7FdbcXVDNB9ATQIDAQABAoIBAF8vU13z0iUgkm6Y j6USDX0gQCi/jMxTJ3R6bMRTA0AZ811tYqSwXUIzX/t2HLGDgjzO9yi4cAcjvC3I /RtNfq0kXjO7gIHCfTMeuaYvyaRlgvvUR+w8axdr0DElvcnVmX+dYQyIm6uavzCo 2WyENt8Q6A/JbuLgZUnun1sxx6Mdq+2JHlRWmp1oZqJavxkuxPfOgvJGsQ7Jyau6 /1qmljlR91LydJzlVfZ8gIbVdrroVSIpAi52eOYwUVpimHoQDb8gg5Z4CXf05pr2 6ZfxyE2kvplVaY5NtmjxOq63BcnjzoQB0KvB9JbTrC9RlTy4EcTX5LgCScgUBOAE ZjDzDUECgYEA40AQ5TbqRuGMwaffOtKlM3XJf9QTEZKziEeZ0VuG+9HBLzsrBGfR x+7VwEDnNVtJdHUvJOCZWVrUwe7IU88lXFnCSUOtIo6xRIIDp7s+HUTFmWc9DREy fnBa8qfSwmfrQdL92dZQEsJM22jmfVbQ2G8Ufuc49yR+4TbQFKElmpECgYEA4Gha nCRu9j8Fppi3GuOHGBvyaB45Hpq20nk2loNmmWFbT8daHLcd6n5QOVhT4ROhJ+Tc 6Op4w1402wT97AGOn+pwNHSeZ3SrKoRSc3GMcab2KrbKqGJBiUXjbxy34ke0rBR3 zBOkGBI1qAi+mt5HAUHkPI+iKEQjz3gvMtz3D/0CgYBFJGT/mKnHTzDoaw88coLZ GWlpfzkeC6icOkzOqi5zx+ojWLlJ6dymHEDk8dpnHZNH36+sZLnDuiMprmE9PrV7 V8QJTpILBadh1L0P96R6e0Yz2nl01FqspbrGQdGaXMvzhyK9eLt8OanwyAX49MUu VP3Dbs6iQ3RnSaod3Ln4QQKBgCOAXtVU7jkGv14bytv2Iuktgqv2HBM7ZrDlfD1T jGe3fzqfzyG71n/Ce+6Wiq6Q7G3jRw+SCIjf3nzHzWQI2wdxj069JFI5otqXFHQv Aoj4YPlg8a6x3Kxa4iAx6uVhcrPGiS0/7jXgq5xpxb26bIFGa1UpY/36ya+I0+64 Bl4BAoGARY09HjFavAwlKGnMNRBXqXhRjBXSfKjKbJz57pYezyYQ1xHuF/GItrgB xI/OJeEdVFpo/ApH7/0krIM6AtLLjuEwYSDsUKAHYMhf+Ymb55z4GfhuWP/iDh/+ /FjEojlv36ykWcKSFXQbKVK7XqNCJ9BHQn8fQxuD8mdFnfZ/O2o= -----END RSA PRIVATE KEY----- ================================================ FILE: tigase-server 7.1.0/etc/init-apns.properties ================================================ cert_file=APNs_HTMessage_Dev.p12 #cert_file=htmessage_production_APNs.p12 #cert_file=HTMessage_Dev_APNs.p12 pwd=123456 executor_size=20 maxConnections=20 ================================================ FILE: tigase-server 7.1.0/etc/init.properties ================================================ config-type=--gen-config-def --admins=admin@app.im --virt-hosts = app.im --user-db=mysql --user-db-uri=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull sess-man/plugins-conf/urn\:ietf\:params\:xml\:ns\:\xmpp-bind/apns-token-db-uri=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=123456&useUnicode=true&characterEncoding=UTF8 sess-man/plugins-conf/enabled-mechanisms=ANONYMOUS,PLAIN basic-conf/logging/tigase.http.level=FINEST basic-conf/logging/tigase.db.jdbc.level=FINER basic-conf/logging/tigase.xmpp.impl.level=FINE basic-conf/logging/tigase.muc.level=FINE basic-conf/logging/tigase.apns.level=FINE #sess-man/plugins-conf/amp/user-store-limit-enable[B]=false #sess-man/plugins-conf//user-store-limit-enable[B]=false amp/store-limit[L]=10000 --sm-plugins=+urn:xmpp:receipts,+message-push,+message-archive-xep-0136 --comp-name-1=http --comp-class-1=tigase.http.HttpMessageReceiver http/api-keys[s]=open_access http/http/ports[i]=19080,19081 --comp-name-2=message-archive --comp-class-2=tigase.archive.MessageArchiveComponent message-archive/auto=true sess-man/plugins-conf/message-archive-xep-0136/required-store-method=message ================================================ FILE: tigase-server 7.1.0/etc/jmx.access ================================================ ###################################################################### # Default Access Control File for Remote JMX(TM) Monitoring ###################################################################### # # Access control file for Remote JMX API access to monitoring. # This file defines the allowed access for different roles. The # password file (jmxremote.password by default) defines the roles and their # passwords. To be functional, a role must have an entry in # both the password and the access files. # # Default location of this file is $JRE/lib/management/jmxremote.access # You can specify an alternate location by specifying a property in # the management config file $JRE/lib/management/management.properties # (See that file for details) # # The file format for password and access files is syntactically the same # as the Properties file format. The syntax is described in the Javadoc # for java.util.Properties.load. # Typical access file has multiple lines, where each line is blank, # a comment (like this one), or an access control entry. # # An access control entry consists of a role name, and an # associated access level. The role name is any string that does not # itself contain spaces or tabs. It corresponds to an entry in the # password file (jmxremote.password). The access level is one of the # following: # "readonly" grants access to read attributes of MBeans. # For monitoring, this means that a remote client in this # role can read measurements but cannot perform any action # that changes the environment of the running program. # "readwrite" grants access to read and write attributes of MBeans, # to invoke operations on them, and to create or remove them. # This access should be granted to only trusted clients, # since they can potentially interfere with the smooth # operation of a running program # # A given role should have at most one entry in this file. If a role # has no entry, it has no access. # If multiple entries are found for the same role name, then the last # access entry is used. # # # Default access control entries: # o The "monitorRole" role has readonly access. # o The "controlRole" role has readwrite access. monitor readonly admin readwrite ================================================ FILE: tigase-server 7.1.0/etc/jmx.password ================================================ # ---------------------------------------------------------------------- # Template for jmxremote.password # # o Copy this template to jmxremote.password # o Set the user/password entries in jmxremote.password # o Change the permission of jmxremote.password to read-only # by the owner. # # See below for the location of jmxremote.password file. # ---------------------------------------------------------------------- ############################################################## # Password File for Remote JMX Monitoring ############################################################## # # Password file for Remote JMX API access to monitoring. This # file defines the different roles and their passwords. The access # control file (jmxremote.access by default) defines the allowed # access for each role. To be functional, a role must have an entry # in both the password and the access files. # # Default location of this file is $JRE/lib/management/jmxremote.password # You can specify an alternate location by specifying a property in # the management config file $JRE/lib/management/management.properties # or by specifying a system property (See that file for details). ############################################################## # File permissions of the jmxremote.password file ############################################################## # Since there are cleartext passwords stored in this file, # this file must be readable by ONLY the owner, # otherwise the program will exit with an error. # # The file format for password and access files is syntactically the same # as the Properties file format. The syntax is described in the Javadoc # for java.util.Properties.load. # Typical password file has multiple lines, where each line is blank, # a comment (like this one), or a password entry. # # # A password entry consists of a role name and an associated # password. The role name is any string that does not itself contain # spaces or tabs. The password is again any string that does not # contain spaces or tabs. Note that passwords appear in the clear in # this file, so it is a good idea not to use valuable passwords. # # A given role should have at most one entry in this file. If a role # has no entry, it has no access. # If multiple entries are found for the same role name, then the last one # is used. # # In a typical installation, this file can be read by anybody on the # local machine, and possibly by people on other machines. # For # security, you should either restrict the access to this file, # or specify another, less accessible file in the management config file # as described above. # # Following are two commented-out entries. The "measureRole" role has # password "QED". The "controlRole" role has password "R&D". # # monitorRole QED # controlRole R&D admin admin_pass monitor monitor_pass ================================================ FILE: tigase-server 7.1.0/etc/logback.xml ================================================ logs/tigase.log true %date [%thread] %-5level %logger{35} - %msg%n ================================================ FILE: tigase-server 7.1.0/etc/snmp.acl ================================================ # ---------------------------------------------------------------------- # Template for SNMP Access Control List File # # o Copy this template to snmp.acl # o Set access control for SNMP support # o Change the permission of snmp.acl to be read-only # by the owner. # # See below for the location of snmp.acl file. # ---------------------------------------------------------------------- ############################################################ # SNMP Access Control List File ############################################################ # # Default location of this file is $JRE/lib/management/snmp.acl. # You can specify an alternate location by specifying a property in # the management config file $JRE/lib/management/management.properties # or by specifying a system property (See that file for details). # ############################################################## # File permissions of the snmp.acl file ############################################################## # # Since there are cleartext community strings stored in this file, # this ACL file must be readable by ONLY the owner, # otherwise the program will exit with an error. # ############################################################## # Format of the acl group ############################################################## # # communities: a list of SNMP community strings to which the # access control applies separated by commas. # # access: either "read-only" or "read-write". # # managers: a list of hosts to be granted the access rights. # Each can be expressed as any one of the following: # - hostname: hubble # - ip v4 and v6 addresses: 123.456.789.12 , fe80::a00:20ff:fe9b:ea82 # - ip v4 and v6 netmask prefix notation: 123.456.789.0/24, # fe80::a00:20ff:fe9b:ea82/64 # see RFC 2373 (http://www.ietf.org/rfc/rfc2373.txt) # # An example of two community groups for multiple hosts: # acl = { # { # communities = public, private # access = read-only # managers = hubble, snowbell, nanak # } # { # communities = jerry # access = read-write # managers = hubble, telescope # } # } # ############################################################## # Format of the trap group ############################################################## # # trap-community: a single SNMP community string that will be included # in the traps sent to the hosts. # # hosts: a list of hosts to which the SNMP agent will send traps. # # An example of two trap community definitions for multiple hosts: # trap = { # { # trap-community = public # hosts = hubble, snowbell # } # { # trap-community = private # hosts = telescope # } # } # ############################################################ # # Update the community strings (public and private) below # before copying this template file # # Common SNMP ACL Example # ------------------------ # # o Only localhost can connect, and access rights # are limited to read-only # o Traps are sent to localhost only # # acl = { { communities = public, private access = read-write managers = localhost, devel.tigase.org } } # # # trap = { # { # trap-community = public # hosts = localhost # } # } ================================================ FILE: tigase-server 7.1.0/etc/tigase-http-context.xml ================================================ ================================================ FILE: tigase-server 7.1.0/etc/tigase.conf ================================================ #osgiEnabled=(true|false) #osgiEnabled=false OSGI=${osgiEnabled} ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver" #GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks" #EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0" JAVA_HOME="${JAVA_HOME}" CLASSPATH="${CLASSPATH}" JAVA_OPTIONS="${GC} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=1024m -XX:MaxDirectMemorySize=128m " TIGASE_CONFIG="etc/tigase.xml" TIGASE_OPTIONS=" --property-file etc/init.properties " ================================================ FILE: tigase-server 7.1.0/logs/server-info.html ================================================ Server informations

Tigase XMPP Server

Server informations

================================================ FILE: tigase-server 7.1.0/modules/distribution/pom.xml ================================================ pom ../.. 4.0.0 tigase tigase-server-dist Tigase XMPP Server Distribution builder ${packaging.type} tigase tigase-server-master 7.1.0-SNAPSHOT ../master !windows exec-maven-plugin org.codehaus.mojo 1.2.1 ChangeLog generation validate exec ${project.basedir}/scripts/genChangeLog.sh ${project.basedir} maven-antrun-plugin 1.7 validate run maven-assembly-plugin 2.4 dist package single src/main/assembly/dist.xml src/main/assembly/dist-max.xml gnu tigase-server-${project.version}-b${gitVersion} ../../pack maven-clean-plugin 2.6.1 default-clean clean clean clean-deps clean clean ${project.basedir}/../../jars **/*.jar false org.apache.maven.plugins maven-dependency-plugin 2.8 copy-dependencies validate copy-dependencies ${project.basedir}/../../jars true true true true> true copy-old-pubsub validate copy tigase tigase-pubsub 2.2.0 tigase-pubsub-2.2.0.jar.old jar ${project.basedir}/../../jars false true tigase-resources validate unpack tigase tigase-http-api 1.2.0-SNAPSHOT jar false ${project.basedir}/../.. *.xml tigase tigase-http-api 1.2.0-SNAPSHOT jar false ${project.basedir}/../.. **/*.groovy, **/*.html tigase tigase-http-api-jetty 1.1.0-SNAPSHOT jar false ${project.basedir}/../.. *.xml tigase tigase-http-api-jetty 1.1.0-SNAPSHOT jar false ${project.basedir}/../.. **/*.groovy tigase tigase-muc 2.4.0-SNAPSHOT jar false ${project.basedir}/../../scripts **/*.groovy tigase tigase-socks5 1.2.0-SNAPSHOT jar false ${project.basedir}/../../database **/*.sql tigase tigase-pubsub 3.2.0-SNAPSHOT jar false ${project.basedir}/../.. **/*.sql,**/*.sh,**/*.cmd,**/*.txt tigase tigase-pubsub 3.2.0-SNAPSHOT jar false ${project.basedir}/../.. **/*.groovy org.apache.maven.plugins maven-jarsigner-plugin 1.4 sign validate sign ${project.basedir}/../.. target/tigase*.?ar jars/tigase*.?ar jars/licence-lib.jar false false http://timestamp.comodoca.com/rfc3161 ${sign-skip} true ${sign-keystore} ${sign-alias} ${sign-storepass} ${sign-keypass} ${verbose-log} org.apache.maven.plugins maven-deploy-plugin 2.8.2 true tigase tigase-server 7.1.0-SNAPSHOT tigase tigase-ext-mailer 1.0.0-SNAPSHOT runtime org.apache.felix org.osgi.core tigase tigase-muc 2.4.0-SNAPSHOT runtime tigase tigase-pubsub 3.2.0-SNAPSHOT runtime tigase tigase-extras 1.1.2-SNAPSHOT runtime tigase licence-lib 1.2.0-SNAPSHOT runtime tigase tigase-stats-collector-library 1.2.0-SNAPSHOT runtime tigase tigase-stats-collector-provider 1.2.0-SNAPSHOT runtime tigase tigase-http-api 1.2.0-SNAPSHOT runtime tigase.sure.web tigase-web-ui 2.1-SNAPSHOT war tigase tigase-http-api-jetty 1.1.0-SNAPSHOT runtime tigase tigase-message-archiving 1.2.0-SNAPSHOT runtime tigase tigase-unified-archive 1.0.0-SNAPSHOT runtime tigase tigase-socks5 1.2.0-SNAPSHOT runtime tigase tigase-stun 1.1.2-SNAPSHOT runtime tigase tigase-acs 2.3.0-SNAPSHOT runtime tigase tigase-acs-muc 1.2.0-SNAPSHOT runtime tigase tigase-acs-pubsub 1.2.0-SNAPSHOT runtime tigase tigase-mongodb 1.1.0-SNAPSHOT runtime org.apache.derby derby 10.12.1.1 runtime org.apache.derby derbytools 10.12.1.1 runtime mysql mysql-connector-java 5.1.11 runtime org.postgresql postgresql 9.4.1207 runtime net.sourceforge.jtds jtds 1.3.1 runtime org.mongodb mongo-java-driver 2.14.1 runtime org.codehaus.groovy groovy-all 2.4.3 runtime org.hamcrest hamcrest-core 1.3 runtime org.slf4j slf4j-api ${slf4j.version} runtime true org.slf4j jul-to-slf4j ${slf4j.version} runtime true de.javawi jstun 0.7.3 org.apache.felix org.osgi.core 1.4.0 runtime org.apache.felix org.apache.felix.bundlerepository 1.6.6 runtime org.apache.felix org.apache.felix.http.bundle 2.2.1 runtime org.apache.felix org.apache.felix.http.bridge org.apache.felix org.apache.felix.http.cometd org.apache.felix org.apache.felix.http.jetty org.apache.felix org.apache.felix.configadmin 1.6.0 runtime org.apache.felix org.apache.felix.main 4.4.0 runtime org.apache.felix org.apache.felix.shell 1.4.2 runtime org.apache.felix org.apache.felix.shell.remote 1.0.4 runtime org.apache.felix org.osgi.core org.apache.felix org.osgi.compendium org.apache.felix org.apache.felix.shell ch.qos.logback logback-classic 1.0.0 ch.qos.logback logback-core 1.0.0 junit junit 4.11 test ================================================ FILE: tigase-server 7.1.0/modules/distribution/scripts/genChangeLog.sh ================================================ #!/bin/bash git log --pretty --numstat --summary tigase-server-5.1.0..master | scripts/git2cl > ChangeLog ================================================ FILE: tigase-server 7.1.0/modules/distribution/scripts/git2cl ================================================ #!/usr/bin/perl # Copyright (C) 2007, 2008 Simon Josefsson # Copyright (C) 2007 Luis Mondesi # * calls git directly. To use it just: # cd ~/Project/my_git_repo; git2cl > ChangeLog # * implements strptime() # * fixes bugs in $comment parsing # - copy input before we remove leading spaces # - skip "merge branch" statements as they don't # have information about files (i.e. we never # go into $state 2) # - behaves like a pipe/filter if input is given from the CLI # else it calls git log by itself # # The functions mywrap, last_line_len, wrap_log_entry are derived from # the cvs2cl tool, see : # Copyright (C) 2001,2002,2003,2004 Martyn J. Pearce # Copyright (C) 1999 Karl Fogel # # git2cl is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # git2cl is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with git2cl; see the file COPYING. If not, write to the Free # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. =head1 NAME git2cl - tool to convert git logs to GNU ChangeLog =head1 SYNOPSIS git2cl > ChangeLog If you don't want git2cl to invoke git log internally, you can use it as a pipe. It needs a git log generated with --pretty --numstat and --summary. You can use it as follows: git log --pretty --numstat --summary | git2cl > ChangeLog =head1 DESCRIPTION This is a quick'n'dirty tool to convert git logs to GNU ChangeLog format. The tool invokes `git log` internally unless you pipe a log to it. Thus, typically you would use it as follows: =head1 SEE ALSO Output format specification: =head1 AUTHORS git2cl is developed by Simon Josefsson and Luis Mondesi =cut use strict; use POSIX qw(strftime); use Text::Wrap qw(wrap); use FileHandle; use constant EMPTY_LOG_MESSAGE => '*** empty log message ***'; # this is a helper hash for stptime. # Assumes you are calling 'git log ...' with LC_ALL=C my %month = ( 'Jan'=>0, 'Feb'=>1, 'Mar'=>2, 'Apr'=>3, 'May'=>4, 'Jun'=>5, 'Jul'=>6, 'Aug'=>7, 'Sep'=>8, 'Oct'=>9, 'Nov'=>10, 'Dec'=>11, ); my $fh = new FileHandle; sub key_ready { my ($rin, $nfd); vec($rin, fileno(STDIN), 1) = 1; return $nfd = select($rin, undef, undef, 0); } sub strptime { my $str = shift; return undef if not defined $str; # we are parsing this format # Fri Oct 26 00:42:56 2007 -0400 # to these fields # sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1 # Luis Mondesi my @date; if ($str =~ /([[:alpha:]]{3})\s+([[:alpha:]]{3})\s+([[:digit:]]{1,2})\s+([[:digit:]]{1,2}):([[:digit:]]{1,2}):([[:digit:]]{1,2})\s+([[:digit:]]{4})/){ push(@date,$6,$5,$4,$3,$month{$2},($7 - 1900),-1,-1,-1); } else { die ("Cannot parse date '$str'\n'"); } return @date; } sub mywrap { my ($indent1, $indent2, @text) = @_; # If incoming text looks preformatted, don't get clever my $text = Text::Wrap::wrap($indent1, $indent2, @text); if ( grep /^\s+/m, @text ) { return $text; } my @lines = split /\n/, $text; $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e; $lines[0] =~ s/^$indent1\s+/$indent1/; s/^$indent2\s+/$indent2/ for @lines[1..$#lines]; my $newtext = join "\n", @lines; $newtext .= "\n" if substr($text, -1) eq "\n"; return $newtext; } sub last_line_len { my $files_list = shift; my @lines = split (/\n/, $files_list); my $last_line = pop (@lines); return length ($last_line); } # A custom wrap function, sensitive to some common constructs used in # log entries. sub wrap_log_entry { my $text = shift; # The text to wrap. my $left_pad_str = shift; # String to pad with on the left. # These do NOT take left_pad_str into account: my $length_remaining = shift; # Amount left on current line. my $max_line_length = shift; # Amount left for a blank line. my $wrapped_text = ''; # The accumulating wrapped entry. my $user_indent = ''; # Inherited user_indent from prev line. my $first_time = 1; # First iteration of the loop? my $suppress_line_start_match = 0; # Set to disable line start checks. my @lines = split (/\n/, $text); while (@lines) # Don't use `foreach' here, it won't work. { my $this_line = shift (@lines); chomp $this_line; if ($this_line =~ /^(\s+)/) { $user_indent = $1; } else { $user_indent = ''; } # If it matches any of the line-start regexps, print a newline now... if ($suppress_line_start_match) { $suppress_line_start_match = 0; } elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/) || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/) || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/) || ($this_line =~ /^(\s+)(\S+)/) || ($this_line =~ /^(\s*)- +/) || ($this_line =~ /^()\s*$/) || ($this_line =~ /^(\s*)\*\) +/) || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/)) { $length_remaining = $max_line_length - (length ($user_indent)); } # Now that any user_indent has been preserved, strip off leading # whitespace, so up-folding has no ugly side-effects. $this_line =~ s/^\s*//; # Accumulate the line, and adjust parameters for next line. my $this_len = length ($this_line); if ($this_len == 0) { # Blank lines should cancel any user_indent level. $user_indent = ''; $length_remaining = $max_line_length; } elsif ($this_len >= $length_remaining) # Line too long, try breaking it. { # Walk backwards from the end. At first acceptable spot, break # a new line. my $idx = $length_remaining - 1; if ($idx < 0) { $idx = 0 }; while ($idx > 0) { if (substr ($this_line, $idx, 1) =~ /\s/) { my $line_now = substr ($this_line, 0, $idx); my $next_line = substr ($this_line, $idx); $this_line = $line_now; # Clean whitespace off the end. chomp $this_line; # The current line is ready to be printed. $this_line .= "\n${left_pad_str}"; # Make sure the next line is allowed full room. $length_remaining = $max_line_length - (length ($user_indent)); # Strip next_line, but then preserve any user_indent. $next_line =~ s/^\s*//; # Sneak a peek at the user_indent of the upcoming line, so # $next_line (which will now precede it) can inherit that # indent level. Otherwise, use whatever user_indent level # we currently have, which might be none. my $next_next_line = shift (@lines); if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) { $next_line = $1 . $next_line if (defined ($1)); # $length_remaining = $max_line_length - (length ($1)); $next_next_line =~ s/^\s*//; } else { $next_line = $user_indent . $next_line; } if (defined ($next_next_line)) { unshift (@lines, $next_next_line); } unshift (@lines, $next_line); # Our new next line might, coincidentally, begin with one of # the line-start regexps, so we temporarily turn off # sensitivity to that until we're past the line. $suppress_line_start_match = 1; last; } else { $idx--; } } if ($idx == 0) { # We bottomed out because the line is longer than the # available space. But that could be because the space is # small, or because the line is longer than even the maximum # possible space. Handle both cases below. if ($length_remaining == ($max_line_length - (length ($user_indent)))) { # The line is simply too long -- there is no hope of ever # breaking it nicely, so just insert it verbatim, with # appropriate padding. $this_line = "\n${left_pad_str}${this_line}"; } else { # Can't break it here, but may be able to on the next round... unshift (@lines, $this_line); $length_remaining = $max_line_length - (length ($user_indent)); $this_line = "\n${left_pad_str}"; } } } else # $this_len < $length_remaining, so tack on what we can. { # Leave a note for the next iteration. $length_remaining = $length_remaining - $this_len; if ($this_line =~ /\.$/) { $this_line .= " "; $length_remaining -= 2; } else # not a sentence end { $this_line .= " "; $length_remaining -= 1; } } # Unconditionally indicate that loop has run at least once. $first_time = 0; $wrapped_text .= "${user_indent}${this_line}"; } # One last bit of padding. $wrapped_text .= "\n"; return $wrapped_text; } # main my @date; my $author; my @files; my $comment; my $state; # 0-header 1-comment 2-files my $done = 0; $state = 0; # if reading from STDIN, we assume that we are # getting git log as input if (key_ready()) { #my $dummyfh; # don't care about writing #($fh,$dummyfh) = FileHandle::pipe; $fh->fdopen(*STDIN, 'r'); } else { $fh->open("LC_ALL=C git log --pretty --numstat --summary|") or die("Cannot execute git log...$!\n"); } while (my $_l = <$fh>) { #print STDERR "debug ($state, " . (@date ? (strftime "%Y-%m-%d", @date) : "") . "): `$_'\n"; if ($state == 0) { if ($_l =~ m,^Author: (.*),) { $author = $1; } if ($_l =~ m,^Date: (.*),) { @date = strptime($1); } $state = 1 if ($_l =~ m,^$, and $author and (@date+0>0)); } elsif ($state == 1) { # * modifying our input text is a bad choice # let's make a copy of it first, then we remove spaces # * if we meet a "merge branch" statement, we need to start # over and find a real entry # Luis Mondesi my $_s = $_l; $_s =~ s/^ //g; if ($_s =~ m/^Merge branch/) { $state=0; next; } $comment = $comment . $_s; $state = 2 if ($_l =~ m,^$,); } elsif ($state == 2) { if ($_l =~ m,^([0-9]+)\t([0-9]+)\t(.*)$,) { push @files, $3; } $done = 1 if ($_l =~ m,^$,); } if ($done) { print (strftime "%Y-%m-%d $author\n\n", @date); my $files = join (", ", @files); $files = mywrap ("\t", "\t", "* $files"), ": "; if (index($comment, EMPTY_LOG_MESSAGE) > -1 ) { $comment = "[no log message]\n"; } my $files_last_line_len = 0; $files_last_line_len = last_line_len($files) + 1; my $msg = wrap_log_entry($comment, "\t", 69-$files_last_line_len, 69); $msg =~ s/[ \t]+\n/\n/g; print "$files: $msg\n"; @date = (); $author = ""; @files = (); $comment = ""; $state = 0; $done = 0; } } if (@date + 0) { print (strftime "%Y-%m-%d $author\n\n", @date); my $msg = wrap_log_entry($comment, "\t", 69, 69); $msg =~ s/[ \t]+\n/\n/g; print "\t* $msg\n"; } ================================================ FILE: tigase-server 7.1.0/modules/distribution/src/main/assembly/dist-max.xml ================================================ dist-max zip tar.gz ./ ./ README ChangeLog License.html package.html ../../certs certs dummy.cer rsa-keystore truststore ../../database database * ../../docs docs Administration_Guide/html_chunk/**/* Administration_Guide/pdf/**/* Development_Guide/html_chunk/**/* Development_Guide/pdf/**/* Properties_Guide/html_chunk/**/* Properties_Guide/pdf/**/* User_Guide/html_chunk/**/* User_Guide/pdf/**/* javadoc/**/* ../../win-stuff win-stuff */** ../../etc etc bosh-extra-headers.txt cross-domain-policy.xml client-access-policy.xml init.properties tigase.conf jmx.access jmx.password logback.xml snmp.acl tigase-http-context.xml ../../conf conf config.properties ../../src/main/groovy/tigase/admin scripts/admin **/* ../../jars jars **/*.old ../../scripts scripts **/* 0744 0744 ./ /logs */** 0744 0754 jars false ${artifact.artifactId}.${artifact.extension} false runtime tigase:tigase-server tigase:tigase-acs tigase:tigase-acs-muc tigase:tigase-acs-pubsub tigase:tigase-muc tigase:tigase-pubsub tigase:tigase-extras tigase:licence-lib tigase:tigase-stats-collector-library tigase:tigase-stats-collector-provider tigase:tigase-http-api tigase:tigase-http-api-jetty tigase.sure.web:tigase-web-ui tigase:tigase-message-archiving tigase:tigase-unified-archive tigase:tigase-socks5 tigase:tigase-stun tigase:tigase-mongodb tigase:tigase-ext-mailer org.apache.derby:derby org.apache.derby:derbytools mysql:mysql-connector-java org.postgresql:postgresql net.sourceforge.jtds:jtds org.mongodb:mongo-java-driver org.codehaus.groovy:groovy-all openDMK:jdmkrt org.hamcrest:hamcrest-core org.slf4j:slf4j-api org.slf4j:jul-to-slf4j de.javawi:jstun javax.servlet:javax.servlet-api org.eclipse.jetty:jetty-http org.eclipse.jetty:jetty-io org.eclipse.jetty:jetty-security org.eclipse.jetty:jetty-server org.eclipse.jetty:jetty-servlet org.eclipse.jetty:jetty-util org.osgi:org.osgi.core org.apache.felix:org.apache.felix.bundlerepository org.apache.felix:org.apache.felix.configadmin org.apache.felix:org.apache.felix.main org.apache.felix:org.apache.felix.shell org.apache.felix:org.apache.felix.shell.remote ch.qos.logback:logback-classic ch.qos.logback:logback-core javax.activation:activation com.sun.mail:javax.mail com.sun.mail:smtp ================================================ FILE: tigase-server 7.1.0/modules/distribution/src/main/assembly/dist.xml ================================================ dist zip tar.gz ./ ./ README ChangeLog License.html package.html ../../certs certs dummy.cer rsa-keystore truststore ../../database database * ../../docs docs Administration_Guide/html_chunk/**/* Administration_Guide/pdf/**/* Development_Guide/html_chunk/**/* Development_Guide/pdf/**/* Properties_Guide/html_chunk/**/* Properties_Guide/pdf/**/* User_Guide/html_chunk/**/* User_Guide/pdf/**/* javadoc/**/* ../../win-stuff win-stuff */** ../../etc etc bosh-extra-headers.txt cross-domain-policy.xml client-access-policy.xml init.properties tigase.conf jmx.access jmx.password logback.xml snmp.acl tigase-http-context.xml ../../src/main/groovy/tigase/admin scripts/admin **/* ../../scripts scripts **/* 0744 0744 ./ /logs */** 0644 0754 false jars ${artifact.artifactId}.${artifact.extension} false tigase:tigase-server tigase:tigase-http-api tigase.sure.web:tigase-web-ui javax.servlet:javax.servlet-api org.apache.derby:derby org.apache.derby:derbytools mysql:mysql-connector-java org.postgresql:postgresql org.codehaus.groovy:groovy-all openDMK:jdmkrt net.sourceforge.jtds:jtds ================================================ FILE: tigase-server 7.1.0/modules/distribution/src/main/resources/META-INF/java.security.Provider ================================================ # our security providers tigase.auth.TigaseSaslProvider ================================================ FILE: tigase-server 7.1.0/modules/documentation/.gitignore ================================================ .html ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/css/docbook-xsl.css ================================================ /* CSS stylesheet for XHTML produced by DocBook XSL stylesheets. */ body { font-family: Georgia,serif; } code, pre { font-family: "Courier New", Courier, monospace; } span.strong { font-weight: bold; } body blockquote { margin-top: .75em; line-height: 1.5; margin-bottom: .75em; } html body { margin: 1em 5% 1em 5%; line-height: 1.2; } body div { margin: 0; } h1, h2, h3, h4, h5, h6 { color: #527bbd; font-family: Arial,Helvetica,sans-serif; } div.toc p:first-child, div.list-of-figures p:first-child, div.list-of-tables p:first-child, div.list-of-examples p:first-child, div.example p.title, div.sidebar p.title { font-weight: bold; color: #527bbd; font-family: Arial,Helvetica,sans-serif; margin-bottom: 0.2em; } body h1 { margin: .0em 0 0 -4%; line-height: 1.3; border-bottom: 2px solid silver; } body h2 { margin: 0.5em 0 0 -4%; line-height: 1.3; border-bottom: 2px solid silver; } body h3 { margin: .8em 0 0 -3%; line-height: 1.3; } body h4 { margin: .8em 0 0 -3%; line-height: 1.3; } body h5 { margin: .8em 0 0 -2%; line-height: 1.3; } body h6 { margin: .8em 0 0 -1%; line-height: 1.3; } body hr { border: none; /* Broken on IE6 */ } div.footnotes hr { border: 1px solid silver; } div.navheader th, div.navheader td, div.navfooter td { font-family: Arial,Helvetica,sans-serif; font-size: 0.9em; font-weight: bold; color: #527bbd; } div.navheader img, div.navfooter img { border-style: none; } div.navheader a, div.navfooter a { font-weight: normal; } div.navfooter hr { border: 1px solid silver; } body td { line-height: 1.2 } body th { line-height: 1.2; } ol { line-height: 1.2; } ul, body dir, body menu { line-height: 1.2; } html { margin: 0; padding: 0; } body h1, body h2, body h3, body h4, body h5, body h6 { margin-left: 0 } body pre { margin: 0.5em 10% 0.5em 1em; line-height: 1.0; color: navy; } tt.literal, code.literal { color: navy; } .programlisting, .screen { border: 1px solid silver; background: #f4f4f4; margin: 0.5em 10% 0.5em 0; padding: 0.5em 1em; } div.sidebar { background: #ffffee; margin: 1.0em 10% 0.5em 0; padding: 0.5em 1em; border: 1px solid silver; } div.sidebar * { padding: 0; } div.sidebar div { margin: 0; } div.sidebar p.title { margin-top: 0.5em; margin-bottom: 0.2em; } div.bibliomixed { margin: 0.5em 5% 0.5em 1em; } div.glossary dt { font-weight: bold; } div.glossary dd p { margin-top: 0.2em; } dl { margin: .8em 0; line-height: 1.2; } dt { margin-top: 0.5em; } dt span.term { font-style: normal; color: navy; } div.variablelist dd p { margin-top: 0; } div.itemizedlist li, div.orderedlist li { margin-left: -0.8em; margin-top: 0.5em; } ul, ol { list-style-position: outside; } div.sidebar ul, div.sidebar ol { margin-left: 2.8em; } div.itemizedlist p.title, div.orderedlist p.title, div.variablelist p.title { margin-bottom: -0.8em; } div.revhistory table { border-collapse: collapse; border: none; } div.revhistory th { border: none; color: #527bbd; font-family: Arial,Helvetica,sans-serif; } div.revhistory td { border: 1px solid silver; } /* Keep TOC and index lines close together. */ div.toc dl, div.toc dt, div.list-of-figures dl, div.list-of-figures dt, div.list-of-tables dl, div.list-of-tables dt, div.indexdiv dl, div.indexdiv dt { line-height: normal; margin-top: 0; margin-bottom: 0; } /* Table styling does not work because of overriding attributes in generated HTML. */ div.table table, div.informaltable table { margin-left: 0; margin-right: 5%; margin-bottom: 0.8em; } div.informaltable table { margin-top: 0.4em } div.table thead, div.table tfoot, div.table tbody, div.informaltable thead, div.informaltable tfoot, div.informaltable tbody { /* No effect in IE6. */ border-top: 3px solid #527bbd; border-bottom: 3px solid #527bbd; } div.table thead, div.table tfoot, div.informaltable thead, div.informaltable tfoot { font-weight: bold; } div.mediaobject img { margin-bottom: 0.8em; } div.figure p.title, div.table p.title { margin-top: 1em; margin-bottom: 0.4em; } div.calloutlist p { margin-top: 0em; margin-bottom: 0.4em; } a img { border-style: none; } @media print { div.navheader, div.navfooter { display: none; } } span.aqua { color: aqua; } span.black { color: black; } span.blue { color: blue; } span.fuchsia { color: fuchsia; } span.gray { color: gray; } span.green { color: green; } span.lime { color: lime; } span.maroon { color: maroon; } span.navy { color: navy; } span.olive { color: olive; } span.purple { color: purple; } span.red { color: red; } span.silver { color: silver; } span.teal { color: teal; } span.white { color: white; } span.yellow { color: yellow; } span.aqua-background { background: aqua; } span.black-background { background: black; } span.blue-background { background: blue; } span.fuchsia-background { background: fuchsia; } span.gray-background { background: gray; } span.green-background { background: green; } span.lime-background { background: lime; } span.maroon-background { background: maroon; } span.navy-background { background: navy; } span.olive-background { background: olive; } span.purple-background { background: purple; } span.red-background { background: red; } span.silver-background { background: silver; } span.teal-background { background: teal; } span.white-background { background: white; } span.yellow-background { background: yellow; } span.big { font-size: 2em; } span.small { font-size: 0.6em; } span.underline { text-decoration: underline; } span.overline { text-decoration: overline; } span.line-through { text-decoration: line-through; } ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/files/StatsDumper.groovy ================================================ //CLASSPATH=/home/tigase/tigase-server/jars/tigase-server.jar import tigase.stats.JavaJMXProxy import tigase.stats.JMXProxyListener import tigase.stats.StatisticsProviderMBean if (args.size() > 0) { if (args[0] == "-h") { println ("Parameters are: [hostname] [username] [password] [dir] [port] [delay(ms)] [interval(ms)] [loadhistory(bool)]") System.exit(0) } } def hostname = args.size() > 0 ? args[0] : "0.0.0.0" def username = args.size() > 1 ? args[1] : "admin" def password = args.size() > 2 ? args[2] : "pass" def dir = args.size() > 3 ? args[3] : "stats" def port = args.size() > 4 ? args[4].toInteger() : 9050 def delay = args.size() > 5 ? args[5].toLong() : 10000 def interval = args.size() > 6 ? args[6].toLong() : 10000 def loadHistory = args.size() > 7 ? args[7].toBoolean() : false if (!new File(dir).exists()) { new File(dir).mkdir() } def proxy = new JavaJMXProxy(hostname, hostname, port, username, password, delay, interval, loadHistory) proxy.start() sleep delay while (true) { try { def allStats = proxy.getAllStats(0) if (allStats != null) { def timeToken = (int) System.currentTimeMillis() / 1000.toInteger() / 60.toInteger() def file1 = new File("${dir}/stats_${new Date().format('yyyy-MM-dd_hh:mm:ss')}.txt") println "Saving stats to the file ${file1.path}" allStats.each { key, value -> file1 << key + " " + value + "\n" } } } catch(all) { println("An exception: " + all) } sleep interval } ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/index.asciidoc ================================================ = Tigase Administration Guide Tigase Team v7.1.0 :numbered: :website: http://tigase.net :Date: 2014-07-10 Welcome to the Tigase Administration Guide. :leveloffset: 1 include::text/Tigase_v7.1.0.asciidoc[] include::text/Admin_Guide_01_-_About_Tigase_Jabber_XMPP_Server.asciidoc[] include::text/Admin_Guide_02_-_Quick_Start.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_03_-_Quick_Start_-_A_-_Installation_Using_GUI_Installer.asciidoc[] include::text/Admin_Guide_04_-_Quick_Start_-_B_-_Installation_Using_Web_Installer.asciidoc[] include::text/Admin_Guide_05_-_Quick_Start_-_C_-_Installing_Using_Console_Installer.asciidoc[] include::text/Admin_Guide_06_-_Quick_Start_-_D_-_Manual_Installation_in_Console_Mode.asciidoc[] include::text/Admin_Guide_07_-_Quick_Start_-_E_-_Windows_Installation.asciidoc[] include::text/Admin_Guide_07_-_Quick_Start_-_F_-_Setting_Up_Server.asciidoc[] :leveloffset: 1 include::text/Admin_Guide_08_-_Latest_and_Nightly_Builds.asciidoc[] include::text/Admin_Guide_09_-_Configuration.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_10_-_Configuration_-_A_-_Tigase_XMPP_Server_init.properties_Configuration.asciidoc[] include::text/Admin_Guide_11_-_Configuration_-_B_-_Startup_Files_tigase.sh_and_tigase.asciidoc[] include::text/Admin_Guide_12_-_Configuration_-_C_-_Linux_Settings_for_High_Load_Systems.asciidoc[] include::text/Admin_Guide_13_-_Configuration_-_D_-_Configuration_Storage_Options.asciidoc[] include::text/Admin_Guide_13_-_Configuration_-_E_-_JVM_settings.asciidoc[] include::text/Admin_Guide_105_-_Configuration_-_F_-_Sess-man.asciidoc[] :leveloffset: 1 include::text/Admin_Guide_14_-_Security.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_15_-_Security_-_A_-_Server_Certificates.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_16_-_Security_-_A_-_Server_Certificates_-_1_-_Creating_and_Loading_the_Server_Certificate_in_PEM_Files.asciidoc[] include::text/Admin_Guide_17_-_Security_-_A_-_Server_Certificates_-_2_-_Installing_StartCom_Certificate_in_your_Linux_System.asciidoc[] //include::text/Admin_Guide_18_-_Security_-_A_-_Server_Certificates_-_3_-_Server_Certificate_Using_Keytool_and_Keystore.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_19_-_Security_-_B_-_Authentication_Connectors.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_20_-_Security_-_B_-_Authentication_Connectors_-_1_-_Tigase_Auth_Connector.asciidoc[] include::text/Admin_Guide_21_-_Security_-_B_-_Authentication_Connectors_-_2_-_Tigase_Custom_Auth_Connector.asciidoc[] include::text/Admin_Guide_22_-_Security_-_B_-_Authentication_Connectors_-_3_-_Drupal_Authentication_Added.asciidoc[] include::text/Admin_Guide_23_-_Security_-_B_-_Authentication_Connectors_-_4_-_LDAP_Authentication_Connector.asciidoc[] include::text/Admin_Guide_24_-_Security_-_B_-_Authentication_Connectors_-_5_-_Configuration_of_SASL_EXTERNAL.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_25_-_Security_-_C_-_Packet_Filtering.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_26_-_Security_-_C_-_Packet_Filtering_-_1_-_Domain_Based_Packet_Filtering.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_27_-_Security_-_D_-_Access_Control_List.asciidoc[] :leveloffset: 1 include::text/Admin_Guide_28_-_Database_Management.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_29_-_Database_Management_-_A_-_Database_Preparation.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_29_-_Database_Management_-_A_-_Database_Preperation_-_1_-_DbSchemaLoader.asciidoc[] include::text/Admin_Guide_30_-_Database_Management_-_A_-_Database_Preparation_-_1_-_Prepare_the_MySQL_Database_for_Tigase_Server.asciidoc[] include::text/Admin_Guide_31_-_Database_Management_-_A_-_Database_Preparation_-_2_-_Prepare_the_Derby_Database_for_Tigase_Server.asciidoc[] include::text/Admin_Guide_32_-_Database_Management_-_A_-_Database_Preparation_-_3_-_Prepare_the_MS_SQL_Server_Database_for_Tigase_Server.asciidoc[] include::text/Admin_Guide_33_-_Database_Management_-_A_-_Database_Preparation_-_4_-_Prepare_the_PostgreSQL_Database_for_Tigase_Server.asciidoc[] include::text/Admin_Guide_34_-_Database_Management_-_A_-_Database_Preperation_-_5_-_Prepare_Tigase_for_MongoDB.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_35_-_Database_Management_-_B_-_Hashed_User_Passwords_in_Database.asciidoc[] include::text/Admin_Guide_36_-_Database_Management_-_C_-_Tigase_Server_and_Multiple_Databases.asciidoc[] include::text/Admin_Guide_37_-_Database_Management_-_D_-_Importing_User_Data.asciidoc[] include::text/Admin_Guide_38_-_Database_Management_-_E_-_Integrating_Existing_Databases.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_39_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_1_-_Connecting_Tigase_Server_to_MySQL_Database.asciidoc[] include::text/Admin_Guide_40_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_2_-_Integrating_Tigase_Server_with_Drupal.asciidoc[] include::text/Admin_Guide_41_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_3_-_Integrating_Tigase_Server_with_LibreSource.asciidoc[] include::text/Admin_Guide_42_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_4_-_MySQL_Database_Use.asciidoc[] include::text/Admin_Guide_43_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_5_-_PostgreSQL_Database.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_44_-_Database_Management_-_F_-_Schema_Updates.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_45_-_Database_Managament_-_F_-_Schema_Updates_-_A_-_Tigase_Server_7.1.asciidoc[] include::text/Admin_Guide_46_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x.asciidoc[] include::text/Admin_Guide_47_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_1_-_Derby.asciidoc[] include::text/Admin_Guide_48_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_2_-_MySQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc[] include::text/Admin_Guide_49_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_3_-_PostgreSQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc[] include::text/Admin_Guide_50_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_4_-_Tigase_Database_Minor_but_Useful_Schema_Change_in_Version_5.1.asciidoc[] include::text/Admin_Guide_51_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x.asciidoc[] include::text/Admin_Guide_52_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x_-_1_-_MySQL_Database_Schema_Upgrade_for_Tigase_4.0.asciidoc[] :leveloffset: 1 include::text/Admin_Guide_53_-_Components.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_54_-_Components_-_A_-_StanzaSender.asciidoc[] include::text/Admin_Guide_55_-_Components_-_B_-_Tigase_HTTP_API.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_56_-_Components_-_B_-_Tigase_HTTP_API_-_1_-_REST_API_Guide.asciidoc[] include::text/Admin_Guide_57_-_Components_-_B_-_Tigase_HTTP_API_-_2_-_Admin_UI.asciidoc[] include::text/Admin_Guide_58_-_Components_-_B_-_Tigase_HTTP_API_-_3_-_Web_Client.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_59_-_Components_-_C_-_Message_Archiving.asciidoc[] include::text/Admin_Guide_60_-_Components_-_D_-_Advanced_Message_Processing_-_AMP_XEP-0079.asciidoc[] include::text/Admin_Guide_61_-_Components_-_E_-_PubSub.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_62_-_Components_-_E_-_PubSub_-_1_-_Offline_Message_Sink.asciidoc[] include::text/Admin_Guide_63_-_Components_-_E_-_PubSub_-_2_-_PubSub_Schema_Changes.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_64_-_Components_-_F_-_Server_Monitoring.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_65_-_Components_-_F_-_Server_Monitoring_-_1_-_Setting_up_Remote_Monitoring_in_the_Server.asciidoc[] include::text/Admin_Guide_66_-_Components_-_F_-_Server_Monitoring_-_2_-_Retrieving_statistics.asciidoc[] include::text/Admin_Guide_102_-_Statistics_Descriptions.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_67_-_Components_-_F_-_Server_Monitoring_-_3_-_EventBus.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_68_-_Components_-_G_-_Server_to_Server_Protocol.asciidoc[] include::text/Admin_Guide_69_-_Components_-_H_-_MUC.asciidoc[] include::text/Admin_Guide_70_-_Components_-_I_-_Tigase_Load_Balancing.asciidoc[] include::text/Admin_Guide_71_-_Components_-_J_-_External_Component_Configuration.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_72_-_Components_-_J_-_External_Component_Configuration_-_1_-_Basic_Configuration_Options_(external_component).asciidoc[] include::text/Admin_Guide_73_-_Components_-_J_-_External_Component_Configuration_-_2_-_Tigase_as_External_Component.asciidoc[] include::text/Admin_Guide_74_-_Components_-_J_-_External_Component_Configuration_-_3_-_Load_Balancing_External_Components_in_Cluster_Mode.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_103_-_Components_-_K_-_C2S.asciidoc[] include::text/Admin_Guide_106_-_Components_-_L_-_Socks5.asciidoc[] include::text/Admin_Guide_75_-_Virtual_Hosts_in_the_Tigase_Server.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_76_-_Virtual_Hosts_in_the_Tigase_Server_-_A_-_Specification_for_ad-hoc_Commands_Used_to_Manage_Virtual_Domains.asciidoc[] include::text/Admin_Guide_77_-_Virtual_Hosts_in_the_Tigase_Server_-_B_-_Virtual_Components_for_Cluster_Mode.asciidoc[] :leveloffset: 1 include::text/Admin_Guide_78_-_Using_Tigase.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_79_-_Using_Tigase_-_A_-_Log_Guide.asciidoc[] include::text/Admin_Guide_80_-_Using_Tigase_-_B_-_Debugging_Tigase.asciidoc[] include::text/Admin_Guide_81_-_Using_Tigase_-_C_-_Basic_System_Checks.asciidoc[] include::text/Admin_Guide_82_-_Using_Tigase_-_D_-_Add_and_Manage_Virtual_Domains.asciidoc[] include::text/Admin_Guide_83_-_Using_Tigase_-_E_-_Presence_Forwarding.asciidoc[] include::text/Admin_Guide_84_-_Using_Tigase_-_F_-_Register_Own_XMPP_Domain.asciidoc[] include::text/Admin_Guide_85_-_Using_Tigase_-_G_-_Tigase_and_PyMSN-t_Transport.asciidoc[] include::text/Admin_Guide_86_-_Using_Tigase_-_H_-_Two_or_more_SessionManagers.asciidoc[] include::text/Admin_Guide_87_-_Using_Tigase_-_I_-_Watchdog.asciidoc[] include::text/Admin_Guide_88_-_Using_Tigase_-_J_-_Tips_and_Tricks.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_89_-_Using_Tigase_-_J_-_Tips_and_Tricks_-_1_-_Tigase_Tip_Checking_the_Runtime_Environment.asciidoc[] include::text/Admin_Guide_91_-_Using_Tigase_-_J_-_Tips_and_Tricks_-_3_-_Best_Practices_for_Connecting_From_Web_Browser_to_Tigase_XMPP_Server.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_92_-_Using_Tigase_-_K_-_Command_Line_Tools.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_93_-_Using_Tigase_-_K_-_Command_Line_Tools_-_1_-_Configuration_Managament_Tool.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_94_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase.asciidoc[] :leveloffset: 3 include::text/Admin_Guide_95_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_1_-_Scripting_Introduction_-_Hello_World.asciidoc[] include::text/Admin_Guide_96_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_2_-_Tigase_Scripting_Version_4.4.x_Update_for_Administrators.asciidoc[] include::text/Admin_Guide_97_-_Using_Tigase_-_L_-_Scripting_Support_in_Tigase_-_3_-_Tigase_and_Python.asciidoc[] :leveloffset: 2 include::text/Admin_Guide_98_-_Using_Tigase_-_M_-_Configuration_Wizards.asciidoc[] include::text/Admin_Guide_99_-_Using_Tigase_-_N_-_Offline_Messages.asciidoc[] include::text/Admin_Guide_100_-_Using_Tigase_-_O_-_Licensing.asciidoc[] include::text/Admin_Guide_101_-_Using_Tigase_-_P_-_Advanced_Options.asciidoc[] include::text/Admin_Guide_104_-_Using_Tigase_-_Q_-_Clustering.asciidoc[] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_01_-_About_Tigase_Jabber_XMPP_Server.asciidoc ================================================ [[about]] = About Tigase XMPP Server :Author: Artur Hefczyc :Version: v2.0, June 2014: reformatted for AsciiDoc :Date: 2010-04-06 16:18 :Revision: 2.1 :toc: :numbered: :website: http://tigase.net *Tigase XMPP Server* is an *Open Source and Free (AGPLv3)* Java based server. The goals behind its design and implementation of the server are: . Make the server robust and reliable. . Make the server a secure communication platform. . Make a flexible server which can be applied to different use cases. . Make an extensible server which takes full advantage of XMPP protocol extensibility. . Make the server easy to setup and maintain. == Robust and reliable This means that the server can handle many concurrent requests/connections and can run for a long time reliably. The server is designed and implemented to handle millions of simultaneous connections. It is not enough however to design and implement a high load server and hope it will run well. The main focus of the project is put in into testing. Tests are taken so seriously that a dedicated testing framework has been implemented. All server functions are considered as implemented only when they pass a rigorous testing cycle. The testing cycle consists of 3 fundamental tests: . *Functional tests* - Checking whether the function works at all. . *Performance tests* - Checking whether the function performs well enough. . *Stability tests* - Checking whether the function behaves well in long term run. It must handle hundreds of requests a second in a several hour server run. == Security There are a few elements of the security related to XMPP servers: secure data transmissions which is met by the implementation of *SSL* or *TLS* protocol, secure user authorization which is met by the implementation of *DIGEST* or *SASL* user authorization and secure deployment which is met by component architecture. *Secure deployment* Tigase software installation does not impact network security. Companies usually have their networks divided into 2 parts: *DMZ* which is partially open to the outside world and the *Private network* which is closed to the outside world. If the XMPP server is to provide an effective way of communication between company employees regardless if they are in a secure company office or outside (perhaps at a customer site), it needs to accept both internal and external connections. So the natural location for the server deployment is the *DMZ*. However, this solution has some considerations: each company has normally established network users base and integrated authorization mechanisms. However, that information should be stored outside the DMZ to protect internal security, so how to maintain ease of installation and system security? *Tigase server* offers a solution for such a case. With it's component structure, Tigase can be easily deployed on any number machines and from the user's point of view it is seen as a one logical XMPP server. In this case we can install a Session Manager module in the *private* network, and a Client Connection Manager with Server Connection Manager in the *DMZ*. Session Manager connects to *DMZ* and receives all packets from external users. Thus is can securely realize users authorization based on company authorization mechanisms. == Flexibility There are many different XMPP server implementations. The most prevolant are: - Used as a business communication platform in small and medium companies where the server is not under a heavy load. For such deployments security is a key feature. - For huge community websites or internet portal servers is, on the other hand, usually under very heavy load and has to support thousands or millions of simultaneous connections. For such a deployment we need a different level of security as most of the service is open to the public. - For very small community deployments or for small home networks the key factor is ease to deploy and maintain. Architecture based on components provides the ability to run selected modules on separate machines so the server can be easily applied in any scenario. For simple installation the server generates a config file which can be used straight away with very few modifications or none at all. For complex deployments though, you can tweak configurations to your needs and setup XMPP server on as many physical machines as you need. == Extensibility The world changes all the time as does user's needs. The XMPP protocol has been designed to be extensible to make it easy to add new features and apply it to those different user's needs. As a result, XMPP is a very effective platform not only for sending messages to other users, it can also be extended for sending instant notifications about events, a useful platform for on-line customer service, voice communication, and other cases where sending information instantly to other people is needed. *Tigase server* has been designed to be extensible using a modular architecture. You can easily replace components which do not fulfill your requirements with others better fitting your needs. But that is not all, another factor of extensibility is how easy is to replace or add new extensions. A great deal of focus has been put into the server design API to make it easy for other software developers to create extensions and implement new features. == Ease of Use Complex computer networks consisting of many servers with different services are hard to maintain. This requires employing professional staff to operate and maintain the network. Not all networks are so complex however, most small companies have just a few servers for their needs with services like e-mail and a HTTP server. They might want to add an XMPP server to the collection of their services and don't want to dedicate resources on setup and maintenance. For such users our default configuration is exactly what they need. If the operating system on the server is well configured, then Tigase should automatically pickup the correct hostname and be ready to operate immediately. Tigase server is designed and implemented to allow dynamic reconfiguration during runtime so there is no need to restart the server each time you want to change configuration settings. There are also interfaces and handlers available to make it easy to implement a web user interface for server monitoring and configuring. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_02_-_Quick_Start.asciidoc ================================================ [[QuickStart]] = Quick Start Guide :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: 2.1 :toc: :numbered: :website: http://tigase.net == Minimum Requirements Before you begin installing Tigase server onto your system, please make sure the minimum requirements are installed first: + - *Java Development Kit v8 or later* - We recommend Oracle JDK. OpenJDK may work, but some features might cause errors. + - *Administrator access* - We recommend that you install Tigase Server from a user login with administrator access. + == Contents This is a set of documents allowing you to quickly start with our software. Every document provides an introduction to a single topic allowing you to start using/developing or just working on the subject. Please have a look at the documents list below to find a topic you are looking for. If you don't find a document for the topic you need please link:http://www.tigase.net/contact[let us know]. - xref:guiinstall[Installation using GUI installer] - xref:consoleinstall[Installing using console installer] - xref:manualinstall[Manual installation in console mode] - xref:webinstall[Installation Using Web Installer] - xref:TSBupdates[Tigase server binary updates] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_03_-_Quick_Start_-_A_-_Installation_Using_GUI_Installer.asciidoc ================================================ [[guiinstall]] = Installation Using GUI Installer :author: Mateusz Fiolka :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: 2.1 :toc: :numbered: :website: http://tigase.net If you don't want to install Tigase using a manual method, you can use the GUI installer. It not only copies server files to preferred place, but also assists with configuration of the most important parameters and database setup. Therefore we recommend this as the way to install Tigase. == Prerequisites Before you can start the GUI installer you will need to have working Java environment. Although installer only requires *JRE* (Java Runtime Environment), server needs the *JDK* (Java Development Kit). Please do note that *currently minimal JDK version Tigase is capable to run on is 1.6*. If you don't have JDK installed it is the right moment to do it. Visit the link:http://java.sun.com/javase/downloads/index.jsp[Java downloads site] From the list of available packages select newest JDK version (if you don't have a specific need to use J2EE then choose a package without it). After configuring JDK you can download the Tigase GUI installer and start the server installation process. It is also important to set the +JAVA_HOME+ environment correctly. == Download the Installer You can always find the newest Tigase packages in the link:https://projects.tigase.org/projects/tigase-server/files[download section]. When you enter the page, you will be presented a list of files to choose from. You may be confused at the beginning as there are lot of choices, but all Tigase binary packages have conventional names, which help to differentiate them easily. They are of form *tigase-server-x.y.z-bv.ext* where 'x', 'y', 'z' and 'v' are version numbers and they change from a release to release. Ext is the file extension which in the case of our GUI installation program is *.jar*. We recommend you to download the latest version (highest version number) of the server as it contains latest functions and improvements == Run the jar File On most systems installing JRE or JDK creates a default association which allows to run the *.jar* file by just double clicking on it. However if nothing happens when you do it there is a way to do it manually. Perform the steps in the following order: . If you are on *Windows* system you can use the command prompt to run the installer directly using the java command. .. Click on the *Start* menu and choose *Run...* (You can also use the *Win+R* shortcut). .. You will be presented with a dialog box where you can enter a command. Type "*cmd*" (or "*command*" in the case of windows version older then 2000) and submit the window. If you are on a *Linux* system, you can use a terminal. It should be easily discoverable as it is a standard tool on this platform. Find and run it. . Command prompt / terminal will appear. You will be able to check a whether your *Java* environment is working. To do it type the + [source,bash] ----- java -version ----- + command and press Enter. If the message says that the command is not recognized then your *Java* installation may be corrupt or not configured properly. For correctly setting up *JRE/JDK* including setting the *JAVA_HOME* environmental variable please check documentation provided on the JDK download site. Also when the command succeeds please check if the printed version number fulfills Tigase requirements. When many versions of *JDK/JRE* are installed on one machine *java* command will need to be invoked with the full path it is placed on. + . When you have no doubt that you can run the correct Java launcher, you may start the installer i.e. for the file *tigase-server-4.1.0-b1315.jar* downloaded to the *c:\download* directory type the following command: + [source,bash] ----- java -jar c:\download\tigase-server-4.1.0-b1315.jar ----- + This command should start the installer or print an error message explaining what is the cause of problem. == Starting the Installation Please note that this tutorial covers only the basic installation mode. Some screens have been omitted because they contain advanced options which are not shown in simple installation mode. Others such as progress of copying files and summary info on the other hand are self explanatory and will also not described. == JDK Selection image:images/winInstall2.gif[] This screen is only shown when JDK has not been selected automatically. When your JAVA_HOME path is properly set, it will be auto-detected saving you some configuration time. If you are reading this step and still don't have JDK installed, then go back to the xref:prerequisites[prerequisites] section where you can find some info on how to prepare your system for Tigase installation. Sometimes your system will be configured in a way that prevents detection of JDK path. This often happens when you install JRE after installing JDK. You will have to find JDK directory yourself. It is by default installed in the *Program Files\Java* directory of your system drive. == Installation Type Selection image:images/winInstall3.gif[] Recommended practice is to choose both installation and configuration of the server as manual configuration is more complicated, time consuming and error-prone. == Introduction To the Server image:images/winInstall4.gif[] This screen shows some information about Tigase which may help you understand what it is and how it can help to take advantage of the *XMPP* protocol. It is important that you read all information's appearing on the installer screens, as they contain valuable hints and most recent information. == Choice of Base Directory image:images/winInstall6.gif[] This is the point where you choose where do you want you server to be installed. Recommended path should not contain spaces, as it may be reason of some strange path problems. In the case of installation on Windows it should be installed on a short path because there is a limit of path lengths. Also note that on Windows Vista there may be some problems with making the server work while installed in the Program Files directory, related to the working of UAC mechanism, so better don't install it there. If you don't want are unsure about where to place the server, you can always leave the default selection. == Packages selection image:images/winInstall7.gif[] Next important step is package selection. Note that some choices are grayed out and you cannot change them as they are essential. Packages consist of documentation, database drivers, sources of the server and some extras. When you select an item, you will be presented with a short description of it's content. We recommend that you install documentation. It contains valuable resources which may be very helpful in administration and general use of the server. If you have a working database platform that you want to use for storing all important user information in, just select appropriate db drivers. If you don't have a database engine, you can use the included derby database along with also included drivers. If you are a developer and you want to be able to check how the server is working or if you want to help with the development, you can install also the included source codes. == Basic Server Configuration image:images/winInstall13.gif[] On this screen you will find most important basic configuration options. As this guide covers only non-advanced set up - disable the advanced configuration checkbox. From here you can select which components will be installed. For most installations the default selection will be most appropriate. You can expand the list to check if any of the other options will better suit your needs. It is very important that you enter your domain name correctly here. - On *Linux* like system you can use the *hostname* command and extract the domain part from the output. If you use the *-f* parameter then you will get the fully qualified domain name. - On *Windows* use the standard *System* control panel applet. You will find your domain (computer name) in the *Computer name* tab. On the other hand if you want to use Tigase virtual domain support and you have your *DNS* system configured properly, then you can put your virtual domains list here. Just separate them by comma characters. For example if your server is seen from the outside as *veloci.tigase.org,* *mammoth.tigase.org* and *tigase.org* then you can use Tigase instance as if it were three separate instances. In reality it will be one server, however *admin@veloci.tigase.org* will be a different user then *admin@tigase.org.* This feature allows to use one server to separate user groups, for example ones from different organizations. When you have your domain name just enter it in the domain text box. Next parameter will be the JID of server administrator. Standard practice is to use *admin*, however you may choose any name you like. For example for domain *tigase.org* the full admin name would be *admin@tigase.org.* Just stick your chosen name and domain together using the @ character as separator. Using this information your XMPP admin will be automatically added to the database, so after installation you can just login into the server without registering admin first manually. You should also select a database which will be used for storing user info. Default is the *Derby* database, if you don't need anything special just leave it as it is. Just select a new password as the default one is easy for a hacker to guess. *Important notice: Tigase installer does not contain the actual databases, only drivers allowing db access. The only exception is Derby database, which is included in JDK. It is automatically configured by installer, in case of other databases you will need to configure them by yourself.* == Verification of Database Connection and Performing DB Tasks image:images/winInstall20.gif[] When you switch to this screen an automatic test of database configuration will be started. It consists of few steps which will be executed in order. After testing connection and configuring schema, admin users will be added. What to do if any of the tests will fail? - If you decided to use your own database, check if you entered correct password and whether your database is running. - If you use the embedded *Derby* database then probably your problem is more complicated. An error may indicate a bug in the installer. You may report it to one of Tigase developers. If you cannot go beyond this step after trying to resolve database problems you may try xref:manualinstall[manual installation] mode. == Finishing Installation When you perform all those steps altogether with choosing Start Menu location and other basic actions you will be informed that installation process is complete. You can now use your Tigase server. There are some post installation actions you may want to perform. They are briefly presented below. == Running the Server Part of the installation process is the selection of Tigase base directory. This is where you can find all important server files. The installer will create some configurable shortcuts in the *Start Menu*. You can navigate to the menu and use it to start the server. To run the server manually: - On a *Linux* system you may start the server using the *tigase* file found in the *scripts* sub-directory of Tigase server base directory. You will need to select the type of linux you have, debian, gentoo, mandirva, or redhat, and use the script located in the init.d folder. In the root server directory type the following command: [source,bash] ----- ./scripts/{OS}/init.d/tigase start etc/tigase.conf ----- Of course if you have a custom config file then change last command appropriately. - On a *Windows* platform you can use a *bat* file to run the server. There is a *run.bat* file in the Tigase root directory. Just double click it in *Explorer* or run it from command line to start the server. A window with server log output will pop-up. image:images/winRun.gif[] == Installation as a Service On *Windows* you can install Tigase as a service. To do it use the *InstallTigaseService.bat* batch file found also in server root directory. In this mode service will be running in background and will be controllable from the *Services* management snapshot. To launch the tool right click on the *Computer* icon on the desktop. Choose the *Manage* action. It will run the *Computer management* graphical configuration program. On the left side choose the *Services* item. You will be shown with a list of services. Here you can find Tigase service when it will be installed. To uninstall Tigase service use the *UninstallTigaseService.bat* file from Tigase server root directory. == How to Check if the Server is Running Checking if the server is running is quite easy. Just try to connect to it by using one of the many available *XMPP* clients. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_04_-_Quick_Start_-_B_-_Installation_Using_Web_Installer.asciidoc ================================================ [[webinstall]] = Installation Using Web Installer :author: Eric Dziewa :version: v1.0, January 2015: New Web Installer! :Date: 2015-01-15 :revision: v1.1 :toc: :numbered: :website: http://tigase.net When Tigase XMPP Server starts up, it looks for the default configuration file: *etc/init.properties*. If this file has not been modified you can run the web installer. Which will step you through the process of configuring Tigase. If you are installing Tigase in a Windows environment, please see the xref:winWebInstall[Windows Installation] section. == Download and Extract First download Tigase XMPP Server and extract it. You can download the link:https://projects.tigase.org/projects/tigase-server/files[official binaries], or the latest and greatest link:http://build.xmpp-test.net/nightlies/dists/[nightly builds]. [source,bash] ----- $ wget http://build.xmpp-test.net/nightlies/dists/2015-01-12/tigase-server-7.0.0-SNAPSHOT-b3752-dist-max.tar.gz $ tar -xf tigase-server-7.0.0-SNAPSHOT-b3752-dist-max.tar.gz $ cd tigase-server-7.0.0-SNAPSHOT-b3752 ----- Please do not run as root. == Start the Server [source,bash] ----- scripts/tigase.sh start ----- == Verify Tigase is Running You should see a list of listening ports. [source,bash] ----- $ lsof -i -P COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 18387 tigase 141u IPv6 22185825 0t0 TCP *:8080 (LISTEN) java 18387 tigase 148u IPv6 22185834 0t0 TCP *:5222 (LISTEN) java 18387 tigase 149u IPv6 22185835 0t0 TCP *:5223 (LISTEN) java 18387 tigase 150u IPv6 22185836 0t0 TCP *:5290 (LISTEN) java 18387 tigase 151u IPv6 22185837 0t0 TCP *:5280 (LISTEN) java 18387 tigase 152u IPv6 22185838 0t0 TCP *:5269 (LISTEN) ----- [[connecttoWebInstall]] == Connect to the Web Installer Some points before you can connect: This setup page is restricted access, however for first setup there is a default account set to setup Tigase: Username: admin Password: tigase This combination will only be valid once as it will be removed from init.properties file on compleation of setup process. After this point the setup page will only be accessable using the following: . JID accounts listed as administrators in --admins line in init.properties . Username and password combinations added to init.properties file manually, or at the last page in this process. Point your browser to *http://localhost:8080/setup/* unless you are working remotely. Then you can use the domain name, or IP address. I used http://tpub.xmpp-test.net:8080/setup/ for this guide. Enter the username and password above to gain access. == Step Through the Installation Process You will be greeted by the following "About software" page. image:images/web-install-01.png[] Read it and then click "Next" image:images/web-install-02.png[] Here is some information about our commercial products and licensing. Please read though the agreement, type your name or company and click "Next". image:images/web-install-04.png[] This page will look over your default configuration settings, these include the type, Domains you wish to use, and gives you a chance to specify an administrator for the domain. Also, you will be selecting what type of database Tigase server will be using. image:images/web-install-05.png[] The Advanced configuration page. Select what components and configurations you need. image:images/web-install-06.png[] Plugins which will be loaded by the server, most plugins are enabled by default. image:images/web-install-07.png[] This is where the database schema is installed. *BE SURE TO SPECIFY SUPER USER ACCOUNT AND PASSWORD* image:images/web-install-08.png[] You should see a page like this after a successful database setup. This page will reveal any issues with your database setup such as invalid URIs, passwords, and schemas. image:images/web-install-09.png[] Next a page asking if you'd like to provide an API Access Key to access HTTP REST commands. It is highly recommended that you either specify an API key or block access. Open API keys allow any REST command to be interpreted by the server. image:images/web-install-10.png[] The Setup Access Page will be locked from the admin/tigase user as specified above. This is your chance to have the setup pages add a specific user in addition to admin accounts to re-access this setup process later. If left blank, only JIDs listed in admin will be allowed to access. image:images/web-install-11.png[] The installation is complete and this is what the *init.properties* file will look like. If you have a custom setup, or would like to put your own settings in, you may copy and past the contents here to edit the current init.properties file. Click "Save" to write the file to disk. image:images/web-install-12.png[] You have now finished the installation, proceed to the next step to restart the server. == Restart the Server It is recommended at this point to stop the server manually and restart it using the proper script for your OS. From the Tigase base directory enter [source,bash] ----- ./scripts/tigase.sh stop ./scripts/{OS}/init.d/tigase start etc/tigase.conf ----- where {OS} is your type of Linux, gentoo, debian, mandriva, or redhat To further fine tune the server you should edit etc/tigase.conf. Ensure *JAVA_HOME* path is correct, and increase memory if needed using *JAVA_OPTIONS* -Xmx (max), and -Xms (initial). You will need to direct Tigase to read settings from this file on startup as follows. Everything should be running smooth at this point. Check the logfiles in logs/ if you experience any problems. [[winWebInstall]] == Windows Instructions for using Web Installer There are a few steps involved with setting up Tigase with the web installer in a Windows environment. Please follow this guide. First step is to extract the dist-max archive in it's entirety to the intended running directory. Once there, run the Setup.bat file inside the win-stuff folder. This will move the necessary files to the correct folders before Tigase begins operation. From here, you have a few options how to run Tigase; run.bat will operate Tigase using a java command, or run.bat which will start Tigase using the wrapper. You may also install Tigase and run it as a service. One this setup is finished, web installer will continue the same from xref:connecttoWebInstall[here]. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_05_-_Quick_Start_-_C_-_Installing_Using_Console_Installer.asciidoc ================================================ [[consoleinstall]] = Installing Using Console Installer :author: Mateusz Fiolka :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: 2.1 :toc: :numbered: :website: http://tigase.net == Installation Using the text-mode Installer When you install Tigase server on a desktop machine or a server having a graphical user interface - you can use the xref:guiinstall[GUI Installer]. However servers are often administered using *SSH* text-mode connection because of low bandwidth requirements or user preferences. Due to popular demand, the Tigase development team has decided to implement a console installer for the server. *Note! The console installer is only available for Tigase server version 4.1.5 and later*. === Requirements and Important Notice Before trying the installer please keep in mind: - This is first - alpha rate version of the text-mode installation - meant to install the server and do some basic configuration. We will be very happy to see bug reports and overall feedback about this feature. Please send your remarks to mailto:artur.hefczyc@tigase.net[Artur Hefczyc] or Mateusz Fiolka. - You will still need to perform some additional steps before running the installer. The main requirement is to download and install *Java JDK v1.6 or newer*. This guide is aimed at advanced users - thus downloading and configuring JDK is left to the reader. You can find more info at the link:http://java.sun.com/javase/downloads/index.jsp[Java downloads site]. == Download the Installer You can always find the newest Tigase packages in the link:https://projects.tigase.org/projects/tigase-server/files/[download section]. When you enter the page, you will be presented a list of files to choose from. All Tigase binary packages have conventional names, which help to differentiate them easily. They are of form *tigase-server-x.y.z-bv.ext* where 'x', 'y', 'z' and 'v' are version numbers and they change from a release to release. Ext is the file extension which in the case of our console installation program is *.jar*. We recommend you download the latest version (highest version number) of the server as it contains latest functions and improvements. == Run the jar File In terminal (SSH or Windows cmd prompt if you use on) type: [source,bash] ----- java -jar nameOfTheDownloadedJarFile.jar -console ----- == Installation Steps Now you are ready to to install the server. Some tips for working with the console installer: - Please remember to write down your JDK location because you will need to type it during the installation process. - Installer consists of number of screens which relate to different configuration aspects. Most of the panels end with a question whether you want to redisplay the panel or quit installer. When you make a mistake you will be probably asked later if you want re-enter the data again. - To quit the installer use standard termination key specific to your platform. For example on a *Linux* system it is the Ctrl+C key combination. Keep in mind that if you quit the installer after it copied some files - it may leave them in the place and you might have to remove them manually. - In current version the installer is of beta quality and using advanced configuration is not recommended. It might work, however it is not much tested and will be improved later. === Initial Screen On this screen you will find server version info which will be useful if you would to suggest something to Tigase developers. [source,bash] ----- Welcome to the installation of Tigase XMPP (Jabber) Server X.Y.Z! The homepage is at: http://www.tigase.org/ press 1 to continue, 2 to quit, 3 to redisplay ----- === JDK Selection Your system may contain more then one JDK installation, thus you will have to make an explicit decision which one to use. Currently console mode installer doesn't contain any auto-detection code nor validation. You will have to enter the path correctly or you may have problems with running the server. For example on *Ubuntu Linux* you can find the JDK in the /lib/jvm/java-6-sun directory. For the current Tigase server JDK of version at least *1.6* is required. [source,bash] ----- The installed application needs a JDK. A java run-time environment (JRE) will be not sufficient. Enter path: /lib/jvm/java-6-sun ----- === Actions Selection Choose whether you want to configure the server in addition to install it. [source,bash] ----- *** Select what you want to do next: On this panel you can specify whether you want to install only or configure already installed server or to do both. If you are just installing a server on your machine it is a good idea to do both steps. The wizards you want to execute Installation of the Tigase Server [on, off] on Configuration of the Tigase Server [on, off] on ----- === Installer Info Introduction to the installer. [source,bash] ----- Please note! While the Tigase server is quite stable and well tested application the installer itself is a new addition. Take precautions especially if you upgrade the server from earlier version. Backup old server files and the database. If you notice any problems please report them to address: Artur Hefczyc press 1 to continue, 2 to quit, 3 to redisplay ----- === Server Info If you don't know what exactly Tigase server is, you can find some basic introduction on this screen. [source,bash] ----- Tigase XMPP (Jabber) server ver 4.1.5-bDEV About Copyright (C) 2004 Tigase.org. Tigase Jabber/XMPP Server is Open Source and Free (AGPLv3) Java based server. The goals behind the design and implementation of the server are: Make the server robust and reliable. Make the server secure communication platform. Make flexible server which can be applied to different use cases. Make extensible server which takes full advantage of XMPP protocol extensibility. --- Press ENTER to continue --- Make the server easy to setup and maintain. Installation, configuration and compilation The most recent documentation on all these topics is always available in the project website: www.tigase.org. Please refer to the website for all the details and always up to date guides. You would probably want to start with Quick Start: http://www.tigase.org/content/quick-start documentation. The website also contains lots of other useful information like load tests results, user discussions and on-line support and help always available to you. This is 4.1.5-bDEV release of the server. Please include the exact version number in all correspondence regarding the server. press 1 to continue, 2 to quit, 3 to redisplay ----- === Server License This is a license that you have to agree to use Tigase server. Please read it carefully. Take note, that in this manual only part is shown in order to decrease guide length. [source,bash] ----- Please read the following license agreement carefully: GNU General Public License - GNU Project - Free Software Foundation (FSF) GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble ... ... Fragment cut out ... You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see --- Press ENTER to continue --- . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . 1. I accept the terms of this license agreement. 2. I do not accept the terms of this license agreement. Choose number (1-2): 1 press 1 to continue, 2 to quit, 3 to redisplay ----- === Server Location Selection Enter where you want the server to be installed. If you have administrator rights you can place it in a standard location where all your applications reside. If you don't have write permissions for this place, you can always install the server in your home directory. [source,bash] ----- Select target path [/home/user/tigase] /home/user/tigase-server press 1 to continue, 2 to quit, 3 to redisplay 1 ----- === Selection of Packs to be Installed Some packs are optional and you can disable/enable them. In the following screen they have an [x] option before them. To switch their state enter item number and ENTER. When done press d and ENTER. [source,bash] ----- Select the packs you want to install: 1 => Base, The base files 2 => Unix Files, Files needed to run the server on Unix like systems 3 => [x] Docs, The documentation 4 => [x] Extras, Extras libraries, MUC, PubSub... 5 => [x] Derby Database, Derby database and JDBC driver 6 => [x] MySQL Database, MySQL JDBC driver (MySQL has to be installed separately) 7 => [x] PostgreSQL Database, PostgreSQL JDBC driver (PostgreSQL has to be installed separately) 8 => [x] SQL Server Database, SQL Server JDBC driver (SQL Server has to be installed separately) 9 => [ ] Sources, The server source files, tools and libraries sources are not included r => Redisplay menu d => Done Choose action: d press 1 to continue, 2 to quit, 3 to redisplay ----- === Installation During extracting and copying server files to their target you will be presented with the process progress. [source,bash] ----- [ Starting to unpack ] [ Processing package: Base (1/9) ] [ Processing package: Unix Files (2/9) ] [ Processing package: Windows Files (3/9) ] [ Processing package: Docs (4/9) ] [ Processing package: Extras (5/9) ] [ Processing package: Derby Database (6/9) ] [ Processing package: MySQL Database (7/9) ] [ Processing package: PostgreSQL Database (8/9) ] [ Processing package: SQL Server Database (9/9) ] [ Unpacking finished ] ----- === Basic Configuration This panel contains most important configuration options for the Tigase server. You can choose which components should be configured to be used when running server, add XMPP admin users and enter their password (many admins, comma separated, initially having the same password). Choose different password from the default one. Then select preferred database. If you don't have a standalone DB which you would like to use, you can choose the included Derby DB. *Important notice: Tigase installer doesn't contain the actual databases, only drivers allowing db access. One exception is Derby database, which is included in JDK. It is automatically configured by installer, in case of other databases you will need to configure them by yourself.* [source,bash] ----- *** Basic Tigase server configuration On this panel you can specify basic configuration settings for the Tigase server. Based on your selection here more configuration options might be presented later on. After the configuration is complete init.properties file will be created. You can optionally restart the server at the end of the process if you like. 0 [x] Default installation 1 [ ] Default plus extra components 2 [ ] Session Manager only 3 [ ] Network connectivity only input selection: 0 Your XMPP (Jabber) domains [my-laptop] Server administrators [admin@my-laptop] Admin password [tigase] 0 [x] Derby (built-in database) 1 [ ] MySQL 2 [ ] PostgreSQL 3 [ ] SQLServer 4 [ ] Other... input selection: 1 ----- === Advanced Configuration *Please note: in this version advanced configuration is not supported. Although it may work it has not been tested and thus is not recommended. Please enter off to not use it.* [source,bash] ----- Advanced configuration options [on, off] off press 1 to continue, 2 to quit, 3 to redisplay ----- === Database Configuration Depending on which database you selected, you will be presented with related options to configure its connectivity options. As you will see, the parameters have default values. [source,bash] ----- *** Database configuration: You have selected MySQL database. This database needs additional configuration parameters. Please enter all required information. MySQL super user account will be used only to create and configure database for the Tigase server. It will not be used by the Tigase server later on. Super user account name: [root] WARNING: password will be visible while entering Super user password: mysecretpassword WARNING: password will be visible while entering Retype password: mysecretpassword MySQL database details. It will be created automatically if it does not exist. Database account: [tigase] Account password: [tigase12] Database name: [tigasedb] Database host or IP: [localhost] Additional database parameters: [] press 1 to continue, 2 to quit, 3 to redisplay ----- === Database Checking and Preparation After entering all database information an automatic test of connection and database setup is performed. If everything is ok the installer will try to convert database schema to required version and finally adds XMPP administrators to it. [source,bash] ----- Performing DB tasks Checking connection to the database Connection OK Checking if the database exists Exists OK Checking the database schema New schema loaded OK Checking whether the database needs conversion Conversion not needed Adding XMPP admin accounts Added admins OK ----- === Installation Complete Now you can run the server and use it! [source,bash] ----- Install was successful application installed on /home/user/tigase-server [ Console installation done ] ----- === Running the Sever You can start the server using the tigase file found in the scripts sub-directory of Tigase server base directory. There, select the type of linux you have, debian, gentoo, mendriva or redhat. In the root server directory type the following command: [source,bash] ----- ./scripts/{OS}/init.d/tigase start etc/tigase.conf ----- Where {OS} is your *nix operating system. Of course if you have a custom config file then change last command appropriately. On a Windows platform you can use a bat file to run the server. There is a run.bat file in the Tigase root directory. Just double click it in Explorer or run it from command line to start the server. A window with server log output will pop-up. === How to Check if the Server is Running Checking to see if the server is running is quite easy. Just connect to it by using one of mnay available XMPP clients. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_06_-_Quick_Start_-_D_-_Manual_Installation_in_Console_Mode.asciidoc ================================================ [[manualinstall]] = Manual Installation in Console Mode :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Our preferred way to install the Tigase server is using xref:guiinstall[GUI installer] and configuration program which comes with one of the binary packages. Please pick up the latest version of the JAR file in our link:http://www.tigase.org/filebrowser/tigase-server[download section]. In many cases however this is not always possible to use the GUI installer. In many cases you have just an ssh access or even a direct access in console mode only. We are going to provide a text-only installer in one of the next releases but for the time being you can use our binary packages to install the server manually. Please continue reading to learn how to install and setup the server in a few easy steps... If you have an old version of the Tigase server running and working and you intend to upgrade it please always backup the old version first. == Get the Binary Package Have a look at our link:http://www.tigase.org/filebrowser/tigase-server[download area]. Always pick the latest version of the package available. For manual installation either *zip* or *tar.gz* file is available. Pick one of files with filename looking like: *tigase-server-x.y.z-bv.tar.gz* or *tigase-server-x.y.z-bv.zip* where 'x', 'y', 'z' and 'v' are version numbers and they change from a release to release. == Unpack the Package Unpack the file using command for the tar.gz file: [source,sh] ----- $ tar -xzvf tigase-server-x.y.z-bv.tar.gz ----- or for the zip file: [source,sh] ----- $ unzip tigase-server-x.y.z-bv.zip ----- A new directory will be created: *tigase-server-x.y.z-bv/*. Sometimes after unpacking package on unix system startup script doesn't have execution permissions. To fix the problem you have to run following command: [source,sh] ----- $ chmod u+x ./scripts/tigase.sh ----- == Prepare Configuration If you look inside the new directory, it should like this output: [source,sh] ----- $ ls -l total 316K -rw-r--r-- 1 265K 2008-12-15 22:24 ChangeLog -rw-r--r-- 1 37K 2008-12-15 22:24 License.html -rw-r--r-- 1 1.1K 2008-12-15 22:24 README drwxr-xr-x 6 204 2009-02-03 13:25 certs/ drwxr-xr-x 22 748 2009-02-03 13:25 database/ drwxr-xr-x 3 102 2008-12-15 22:24 docs/ drwxr-xr-x 4 136 2009-02-03 13:25 etc/ drwxr-xr-x 3 102 2009-02-03 13:25 jars/ drwxr-xr-x 12 408 2009-02-03 13:25 libs/ drwxr-xr-x 2 68 2008-12-15 22:24 logs/ -rw-r--r-- 1 1.5K 2008-12-15 22:24 package.html drwxr-xr-x 7 238 2009-02-03 13:25 scripts/ ----- At the moment the most important is the etc/ directory with 2 files: [source,sh] ----- $ ls -l etc/ total 8.0K -rw-r--r-- 1 97 2008-12-15 22:24 init.properties -rw-r--r-- 1 333 2008-12-15 22:24 tigase.conf ----- A Small change in the tigase.conf file is needed. Find the line setting for *JAVA_HOME*: [source,sh] ----- JAVA_HOME="${JDKPath}" ----- and replace *$\{JDKPath}* with a path to Java installation on your system. You need also to edit the init.properties file. It contains initial parameters normally set by the configuration program. As this is a manual installation, you will have to edit this document yourself. It contains already a few lines: [source,sh] ----- $ cat etc/init.properties config-type=--gen-config-def --admins=admin@$HOST_NAME --virt-hosts = $HOST_NAME --debug=server ----- You have to replace *$HOST_NAME* with a domain name used for your XMPP installation. Let's say this is \'*jabber.your-great.net*'. Your init.properties should look like this then: [source,sh] ----- $ cat etc/init.properties config-type=--gen-config-def --admins=admin@jabber.your-great.net --virt-hosts = jabber.your-great.net --debug=server ----- You can also use multiple virtual domains if you want. Please have a look at the detailed description for *--virt-hosts* property in the init.properties guide and also more detailed information in the Virtual Hosts section of the Tigase Server guide. You will also need to configure connection to the database. First you have to decide what database you want to use: *Derby*, *MySQL* or *PostgreSQL*. Then there are to more properties you have to add to the *init.properties:* *--user-db* and *--user-db-uri.* The first property specifies the database type you use and the second the database connection string. For simplicity let's assume you want to use *Derby* database with files located in directory */var/lib/tigase/derby*. 2 more lines need to be added to the *init.properties* file: [source,sh] ----- $ cat etc/init.properties config-type=--gen-config-def --admins=admin@jabber.your-great.net --virt-hosts = jabber.your-great.net --debug=server --user-db=derby --user-db-uri=jdbc:derby:/var/lib/tigase/derby ----- This is enough basic configuration to have your Tigase server installation running. == Prepare Database Normally the database is prepared for you during the installation process. Now you are on your own. As in section above we prepare your first installation to run with the *Derby* database. Creating and preparing the Derby database is actually quite easy if you use a helper script: link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/entry/scripts/db-create-derby.sh[./scripts/db-create-derby.sh]. The file might not be in your *scripts/* directory if you have an earlier version of the package. Simply download it from the link provided if it is missing and put it in the *scripts/* directory and execute it with the database location as the parameter: [source,sh] ----- $ ./scripts/db-create-derby.sh /var/lib/tigase/derby ----- There will be lots of output but if there is no error at the end of the output it means your database has been created and it is ready to use. *NOTE:* There might be filesystem access restrictions for the directory: */var/lib/* and you might want/need to select a different location. == Start the Server You can start the server using the tigase file found in the scripts sub-directory of Tigase server base directory. There, select the type of linux you have, debian, gentoo, mendriva or redhat. In the root server directory type the following command: [source,bash] ----- ./scripts/{OS}/init.d/tigase start etc/tigase.conf ----- Where {OS} is your *nix operating system. and you should get the output like this: [source,sh] ----- Starting Tigase: nohup: redirecting stderr to stdout Tigase running pid=18103 ----- == Check if it is Working The server is started already but how do you know if it is really working and there were no problems. Have a look in the *logs/* directory. There should be a few files in there: [source,sh] ----- $ ls -l logs/ total 40K -rw-r--r-- 1 20K 2009-02-03 21:48 tigase-console.log -rw-r--r-- 1 16K 2009-02-03 21:48 tigase.log.0 -rw-r--r-- 1 0 2009-02-03 21:48 tigase.log.0.lck -rw-r--r-- 1 6 2009-02-03 21:48 tigase.pid ----- The first 2 files are the most interesting for us: *tigase-console.log* and *tigase.log.0*. The first one contains very limited information and only the most important entries. Have a look inside and check if there are any *WARNING* or *SEVERE* entries. If not everything should be fine. Now you can connect with an XMPP client of your choice. The first thing to do would be registering the first account - the admin account from your init.properties file: admin@jabber.your-great.net. Refer to your client documentation how to register a new account. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_07_-_Quick_Start_-_E_-_Windows_Installation.asciidoc ================================================ [[windowsInstallation]] = Windows Installation :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Tigase server installation should be started with downloading the Tigase installer server from our link:https://projects.tigase.org/attachments/download/273/tigase-server-3.3.2-b889.exe[download area]. This guide describes installation procedure for the branch 3.x of the server so please pick up the latest version of the Tigase 3.x. The Windows binary package is an executable file containing an installer. Run the file and the server will be installed and icons will be added to your Windows start menu. Locate the Tigase group in your menu and execute: "Install Tigase service" which will install the Tigase server as the system service and it will be automatically started whenever your system starts. If you are going to use the Tigase server with MySQL database have a look now in the directory where the Tigase server is installed. There is a directory +etc/+. Have a look inside and find file called +init.properties+. Open the file with a text editor and make sure you added there 2 following lines: [source,bash] ----- --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass ----- The content of the file should look like the example screenshot below: image:images/init_properties1.jpg[] == MySQL Database Installation The section describes installation and configuration of the MySQL database to work with Tigase server. Download the binary package from MySQL download area at link:http://dev.mysql.com/downloads/mysql/5.0.html#win32[mysql.com]. Make sure you select executable proper for your operating system. Run the installation program and follow default installation steps. When the installation is complete find the MySQL elements in the Windows Start menu and run the MySQL Configuration Wizard. Follow the wizard and make sure to check settings against the screenshots in the guide below. In Welcome window just press 'Next'.(pic.1) image:images/sql1.JPG[] In the next window select option: 'Detailed Configuration' and press 'Next' (pic. 2) image:images/sql2.JPG[] On the next screen select option: 'Server Machine' and press 'Next' (pic. 3) image:images/sql3.JPG[] On the forth windows leave the default" 'Multifunctional Database' and press 'Next' (pic. 4) image:images/sql4.JPG[] On the step number five just press 'Next' using defaults. (pic. 5) image:images/sql5.JPG[] Again, on window 6 select the default - 'Decision Support (DSS)/OLAP' and press 'Next' (pic.6) image:images/sql6.JPG[] Make sure you switch OFF the 'Strict mode' and and press 'Next' (pic. 7) image:images/sql7.JPG[] On the character encoding page select: 'Manual Selected Default Character set/ Collation' and 'utf8', press 'Next' (pic.8) image:images/sql8.JPG[] On next window select 'Include Bin Directory in Windows PATH' and press 'Next' (pic.9) image:images/sql9.JPG[] On this window just enter the database super user password and make sure you remember it. When ready press 'Next' (pic. 10) image:images/sql10.JPG[] This is the last screen. Press 'Execute' to save the configuration parameters. (pic. 11) image:images/sql11.JPG[] When the configuration is saved you can repeat all the steps and change settings at any time by running: *START => Programs => MYSQL=> MYSQL serwer machine=> MySQL Server Instance Config Wizard* Now we have to setup Tigase database. From the Start menu run the MySQL console and enter all commands below finishing them with **: . Create the database: + [source,sql] ----- mysql>create database tigasedb; ----- . Add database user: + [source,bash] ----- mysql> GRANT ALL ON tigasedb.* TO tigase_user@'%' IDENTIFIED BY 'tigase_passwd'; mysql> GRANT ALL ON tigasedb.* TO tigase_user@'localhost' IDENTIFIED BY 'tigase_passwd'; mysql> GRANT ALL ON tigasedb.* TO tigase_user IDENTIFIED BY 'tigase_passwd'; mysql> FLUSH PRIVILEGES; ----- . Load Tigase database schema: + [source,bash] ----- mysql> use tigasedb; mysql> source c:/Program Files/Tigase/database/mysql-schema.sql; ----- There is a small configuration bug in the installation of Tigase version 3.x. If you look in the *run.bat* file in the Tigase directory you have to replace string *inital.propereties* with *init.properties*. You can now restart your machine and all services including the MySQL database and the Tigase server should be running. Alternatively if you don't want to restart your computer you can start both services manually if you know how to do it. When the system is up and running you can connect with any XMPP client (Psi for example) to your server to see if it is working. Now, you can tweak the server configuration further. Use the guide describing init.properties file for configuration details. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_07_-_Quick_Start_-_F_-_Setting_Up_Server.asciidoc ================================================ [[setupTigaseServer]] = Tigase Server Network Instructions :author: Daniel Wisnewski :version: v1.0, May 2016: Reformatted for AsciiDoc. :date: 2016-05-13 10:30 :toc: :numbered: :website: http://tigase.net One you have installed Tigase XMPP Server on a machine, you're going to want to use it. If you are just using for local communications on a network behind a router, you're all set. Enjoy and use! However, if you want to have people from other computers outside your network connect to your server, you're going to have to go through a few more steps to show your server out to the public. NOTE: This guide is merely a recommendation of how to get a local server to be open to incoming communications. Any time you open ports, or take other security measures you risk compromising your network security. These are only recommendations, and may not be appropriate for all installations. Please consult your IT Security expert for securing your own installation. XMPP, being a decentralized communication method, relies on proper DNS records to figure out where and how an XMPP server is setup. Operating an XMPP Server will require you to properly setup DNS routing so not only can clients connect to you, but if you decide to run a federated server and enable server to server communication, you will need to do the same. If you already have a DNS server already, you should have little issue adding these records. If you do not have a DNS setup pointing to your server, you may use a free dynamic name service such as dynu.com. == A Records You will not be able to use an IP Address or a CNAME record to setup an XMPP Server. While it's not required, an A record can provide some other benefits such serving as a backup in case the SRV record is not configured right. == SRV Records You will need to set SRV records both for client-to-server (c2s) communication and, if you plan to use it, server to server (s2s) communication. We recommend both records are entered for every server as some resources or clients will check for both records. For this example we will use tigase.org is our domain, and xmpp as the xmpp server subdomain. SRV records have the following form: _service._protocol.name. TTL class SRV Priority weight port target. The key is as follows: * *service*: is the symbolic name of the desired service, in this case it would be _xmpp-client_ or _xmpp-server_. * *protocol*: is the transport protocol, either TCP or UDP, XMPP traffic will take place over _TCP_. * *name*: the domain name where the server resides, in this case _tigase.org_. * *TTL*: a numeric value for DNS time to live in milliseconds, by default use _86400_. * *class*: DNS class field, this is always _IN_. * *priority*: the priority of the target host with lower numbers being higher priority. Since we are not setting up multiple SRV records, we can use _0_. * *weight*: the relative weight for records with the same priority. We can use _5_. * *port*: the specific TCP or UDP port where the service can be found. In this case it will be _5222_ or _5269_. * *target*: the hostname of the machine providing the service, here we will use _xmpp.tigase.org_. For our example server, the SRV records will then look like this: *_xmpp-client._TCP.tigase.org 86400 IN SRV 0 5 5222 xmpp.tigase.org* *_xmpp-server._TCP.tigase.org 86400 IN SRV 0 5 5269 xmpp.tigase.org* === Tigase and Vhosts If you are running multiple vhosts or subdomains that you wish to separate, you will need another record. In this case an A record will be all you need if you are using default ports. If you are using custom ports, you will need to have a new SRV record for each subdomain. == Port Forwarding Once your server is setup, you may need to open at least two ports. XMPP communication handling and SRV records occur on two ports; 5222 and 5269. SRV records may result in an error if these ports cannot be contacted by the SRV records service, and you will be unable to connect from outside your network. Both ports should be setup to use TCP only. Remember, if you set custom ports for your servers communications, you may need to forward them as well. . If you are using TURN or STUN, you will need to forward 3478 under TCP and UDP. . If you are planning to use STUN or TURN over TLS, forward 5349 under TCP. If you have a cell phone on a separate network with an XMPP client, you can now try to login to test the server. If that is not handy, you can use an online tool to check proper DNS records such as kingant's: link:https://kingant.net/check_xmpp_dns/[https://kingant.net/check_xmpp_dns/] and it will tell you if anything is missing. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_08_-_Latest_and_Nightly_Builds.asciidoc ================================================ [[TSBupdates]] = Tigase Server Binary Updates :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: 2.1 :toc: :numbered: :website: http://tigase.net Most open source projects try to make sure that the nightly builds compile correctly so that these builds can be used. However, we at Tigase believe that these builds should be seperated until they are thoroughly tested and released. Although lots of installations out there we know of just run from our nightly builds, this puts an extra responsibility to make sure all code is functional and will constantly work. Therefore, our general approach is to run all basic functionality tests before each code commit to make sure it works correctly. This does not guarantee that there will never be a problem, but it is a precaution from preventing bad builds from arriving in the hands of our customers. Some users on the other hand, like to be on the bleeding edge and regularly use our nightly builds exploring new code changes and playing with new features before they are put to a full release. Others prefer to stick to stable and fully tested public releases. Others however, want something from the middle, the most recent features, but bug fixes, something like a beta or a release-candidate state. Should you choose to use the nighly builds, a few things you should consider: - Changes may be made to the code that can negatively affect performance. - Changes may be made to the code that can negatively affect security. We *highly* recommend testing these builds in your environments before upgrading. With these considerations in mind, we provide nightly builds at link:http://build.xmpp-test.net/nightlies/dists/[this link] which provides directories by date. Standard naming format is tigase-server-x.x.x-SNAPSHOT-byyyy.* x.x.x is the major version the builds are working towards, with yyyy being the specific build. *Note individual days may have the same builds as noted by the byyyy section of the file.* Just like the standard distributions, the builds are available with the following extensions: . .jar - Java installer version . .exe - Windows binary installer version . -javadoc.jar - Java installer for javadoc only . -dist.zip - Compressed binaries with no dependencies. . -dist.tar.gz - tarball compressed binaries with no dependencies. . -dist-max.zip - Compressed binaries with all dependencies. . -dist-max.tar.gz - tarball compressed binaries with all dependencies. We also provide automated testing of each of our nightly builds for each supported databases. Tests are done with both functional and low memory parameters in mind, and are available link:http://build.xmpp-test.net/nightlies/tests/[at this link]. These tests can provide a quick examination of function before upgrading your current build. The latest Cluster tests are available at link:http://graph.cluster-c.xmpp-test.net/latest/[this link] which shows performance and traffic use under strain using the latest available build of Tigase. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_09_-_Configuration.asciidoc ================================================ [[configuration]] = Configuration :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 12:28 :revision: 2.1 :toc: :numbered: :website: http://tigase.net When the user tries to setup the client for the first time he comes across 2 configuration files: *tigase.conf* and *init.properties* in the /etc folder. Here is a brief explanation what all those files are about and in other sections you can learn all the details needed to configure the server. . xref:initPropertiesGuide[init.properties] file is a simple text file with server parameters in form: *key* = *value*. When the XML configuration file is missing the Tigase server reads *init.properties* file and uses parameters found there as defaults for generation of the XML file. Therefore if you change the *init.properties* file you normally have to stop the server, remove the XML file and start the server again. All the settings from the *init.properties* are read and applied to the XML configuration. The properties file is easy to read and very safe to modify. At the moment this is the recommended way change the server configuration. . xref:manualconfig[tigase.conf] is the Tigase server startup configuration. It is actually not used by the server itself. It rather contains operating system settings and environment parameters to correctly run the link:http://java.sun.com/[Java Virtual Machine]. It is only useful on the unix-like systems with Bash shell. If you run the server on MS Windows systems *tigase.bat* and *wrapper.conf* files are used instead. The *tigase.conf* file is read and loaded by the *scripts/tigase.sh* shell script which also scans the operating system environment for Java VM and other tools needed. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_100_-_Using_Tigase_-_O_-_Licensing.asciidoc ================================================ [[licenseserver]] = Licensing :author: Daniel Wisnewski :version: v1.0, March 2016 :date: 2016-03-15 11:00 :numbered: :website: http://tigase.net :toc: From release of v7.1.0, users and commercial clients alike may now be able to register and request a license file from our servers on their own. This process helps us maintain licenses, and can allow for client installations of new servers without the need to wait for a license file. Users who do not wish to register will not be required to register. However, If you are using Tigase ACS or other commercial pieces of software, you will be required to register. *Again, Tigase XMPP Server will still be available free under AGPLv3, and free users will not need to register.* == Registering for a License To obtain a license from our licensing servers, you will first need to register with us. This may be done in a few methods. The easiest method, and recommended is VIA use of our web portal. === Web Portal Pointing your browser to link:http://license.tigase.net:8080/rest/licence/register[license.tigase.net:8080/rest/licence/register] will give you the following page: image::images/Licwebregform.png[Registation form] Fill out the three required forms, your name, an E-mail where you will receive the license, and answer the math problem, to prove you are a human. Once filled out, you will be greeted with the following screen: image::images/Licwebregok.png[Confirmation page] You will receive an E-mail shortly from tigase@tigase.net and will look like this: [source,bash] ----- Hi! Welcome User Name! Your CustomerID is 9s82stmw2tasc4h6q05n69azxs Please add this line yo your init.properties: --customer-id=9s82stmw2tasc4h6q05n69azxs -- Tigase Team ----- Once you have this E-mail, proceed to xref:licenseconfig[License Configuration]. === AdHoc Commands The new license server can now accept adHoc commands to be sent and received using XMPP stanzas. This is more complicated, but it may help you use scripts or automate the server registration process: These Ad-Hoc commands may be used to manually start the following operations: ==== +create-customer-id+ Creates a new customer-id. Returns a blank form containing the following fields to be filled: - +name+ - full name of the user - +email+ - the email address user [source,xml] ---- ---- The server sends in response: Registration Form [source,xml] ---- Customer Registration Please fill all fields ---- The user now sends the completed form: Registration form response [source,xml] ---- Bob Bobowsky bob@somewhere.gov ---- After sending the filled form, a new +customer-id+ will be generated and sent to the E-mail listed in the form. If you are already registered, it will be sent to the following address existing +customer-id+ ==== +retrieve-license+ To obtain a license from the server must send a form containing a +customer-id+: Start-up Command +retrieve-license+ [source,xml] ---- ---- In response, the server will send a form asking for +customer-id+. If the server's found his JabberID, it sent the form will automatically be filled in: Asking for +customer-id+ [source,xml] ---- Retrieve licence Please fill all fields ---- The user sends the completed form: Filled Form license generation [source,xml] ---- 6if49ogdd9qbenat2t1461f1kf acs ---- The server sends a form containing the license. NOTE: Warning! The license may be in plain-text or Base64 encoded! .Generated license [source,xml] ---- max-costam=9 comment=Licencja całkowicie domyślna licence-nr=1 licence-id=de54488e-13d0-38a4-8614-1b624cc73ac0 customer-name=Bob Bobowsky customer-jid=bob@coffeebean.local template-id=fb9971738214b50c5700673956ade0fa0b8169d0 valid-since=2015-07-17 valid-until=2015-10-17 signature=2bca48ad20b63dd76be08b1a6…374dab308 ---- [[licenseconfig]] == Configuring Tigase XMPP Server License Registration As seen earlier, you will need to include your +customer-id+ into the init.properties file on your installation by adding the line: [source,properties] ----- --customer-id=9s82stmw2tasc4h6q05n69azxs ----- Everything should be automated from there. == Statistics Sent If you are using Tigase without a customer ID, you will be given a warning that statistics will be sent to Tigase. Below is a breakdown of what is sent to the server. NOTE: The text below has been better formatted for readability, but does not reflect the actual text being sent to Tigase. [source,output] ----- xmppserver 2016-06-23T17:16:24.777-0700 vhost1.xmppserver.com 308833 30924376 1426063360 1 0 0 1 0 amp Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.AmpComponentClustered bosh Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.BoshConnectionClustered c2s Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.ClientConnectionClustered cl-comp Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.ClusterConnectionManager eventbus Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.disteventbus.component.EventBusComponent http Tigase HTTP API component: Tigase HTTP API component 1.2.0-SNAPSHOT-b135/27310f9b-7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.http.HttpMessageReceiver monitor Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.monitor.MonitorComponent muc Tigase ACS - MUC Component 1.2.0-SNAPSHOT-b62/74afbb91-2.4.0-SNAPSHOT-b425/d2e26014 tigase.muc.cluster.MUCComponentClustered class tigase.muc.cluster.ShardingStrategy pubsub Tigase ACS - PubSub Component 1.2.0-SNAPSHOT-b65/1c802a4c-3.2.0-SNAPSHOT-b524/892f867f tigase.pubsub.cluster.PubSubComponentClustered class tigase.pubsub.cluster.PartitionedStrategy s2s Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.server.xmppserver.S2SConnectionManager sess-man Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.SessionManagerClustered class tigase.server.cluster.strategy.OnlineUsersCachingStrategy ws2s Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.WebSocketClientConnectionClustered vhost-man Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.vhosts.VHostManager stats Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.stats.StatisticsCollector cluster-contr Tigase XMPP Server 7.1.0-SNAPSHOT-b4226/5e7210f6 (2016-06-01/23:15:52) tigase.cluster.ClusterController ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_101_-_Using_Tigase_-_P_-_Advanced_Options.asciidoc ================================================ [[tigaseAdvancedOptions]] = Tigase Advanced Options :author: Daniel Wisnewski :date: 2016-03-28 14:55 :version: v1.0 March 2016 :toc: :numbered: :website: http://www.tigase.net This section is designed to include a number of advanced configuration options available within Tigase, but may not have a relevant section yet to house them. == Enabling Support for storing offline messages without body content Tigase now supports the full implementation or XEP-0334, See link:http://xmpp.org/extensions/xep-0334.html[XEP-0334] for protocol details. This can be customized by setting a list of paths and xmlns to trigger and place storage of offline messages using the following settings in init.properties: ----- sess-man/plugins-conf/amp/msg-store-offline-paths[s]=/message/received[urn:xmpp:receipts],/message/store-offline ----- This will require the enabling of AMP plugin, so be sure +--sm-plugins=+amp+ is enabled. [[emptyNicks]] == Enabling Empty Nicknames Tigase can now support users with empty nicknames. This can be enabled by adding the following code is in init.properties. ------ sess-man/plugins-conf/jabber\:iq\:roster/empty_name_enabled=true ------ [[accountRegLimit]] == Account Registration Limits In order to protect Tigase servers from DOS attacks, a limit on number of account registrations per second has been implemented. This may be configured by adding the following line in the init.properties file: ----- sess-man/plugins-conf/jabber\:iq\:register/registrations-per-second=10 ----- This setting allows for 10 registrations from a single IP per second. If the limit is exceeded, a +NOT_ALLOWED+ error will be returned. [[silentIgnore]] == Enable Silent Ignore on Packets Delivered to Unavailable Resources You can now have Tigase ignore packets delivered to unavailable resources to avoid having a packet bounce around and create unnecessary traffic. You may set this globally, within standard message handling only, or within the AMP component using the following settings: Globally: [source] ----- sess-man/plugins-conf/silently-ignore-message=true ----- Message Processing Only: [source] ----- sess-man/plugins-conf/message/silently-ignore-message=true ----- AMP Component: [source] ----- sess-man/plugins-conf/amp/silently-ignore-message=true ----- [[errorCounting]] == Mechanism to count errors within Tigase A new processor within statistics has been added to count the number of errors that Tigase returns. This processor, named +error-counter+, will count all errors returned by Tigase, however by default the number is always zero if it is not enabled. It can be found as an MBean object in JMX under +ErrorStatistics+ and contains values for packets with +ERROR+ and grouped by type. To enable counting of these errors, you must ensure the processor is included in your --sm-plugins: [source,properties] ----- --sm-plugins=error-counter ----- === Including stream errors Stream +ERROR+ packets are not included in the above counter by default as they are processed separately. To enable this to be added to the counter, the following line must be in your init.properties file. [source,properties] ----- c2s/processors[s]=stream-error-counter ----- [[streamResumptiontimeout]] === Stream resumption default & max-timeout +SteamManagementIOProcessor+ now has a setting that can be used to change the maximum timeout time it will wait for reconnection if a client does not send a time to wait. Two settings are now available: [source,properties] ----- c2s/processors/urn\:xmpp\:sm\:3/resumption-timeout[I]=90 ----- The above setting in init.properties file will change the default timeout period to 90 seconds. [source,properties] ----- c2s/processors/urn\:xmpp\:sm\:3/max-resumption-timeout[I]=900 ----- This setting will set the maximum time allowed for stream resumption to 900 seconds. This can be handy if you expect a number of mobile phones to connect to your server and want to avoid duplicate messages being sent back and forth. [[autoSub]] You may setup a server to automatically approve presence subscriptions or roster authorizations for all users. Say you were hosting bots and wanted to automate the process. This can be done with the following settings: [source,properties] ----- sess-man/plugins-conf/jabber\:iq\:roster/auto-authorize=true sess-man/plugins-conf/presence/auto-authorize=true ----- Both of these settings are false by default, and you may use them together or separately. The following behavior is followed when they are both activated: - Upon sending a subscription request - Both contacts will each others' subscription and be added to each others' roster. Presence information will immediately be exchanged between both parties. - Upon sending presence with type either unsubscribe or unsubscribed follows the rules defined in RFC regarding processing of these stanzas (i.e. adjusting subscription type of user/contact), but without forwarding those stanzas to the receiving entity to avoid any notifications to the client. However, a roster push is generated to reflect changes to presence in user roster in a seamless manner. - Simply adding an item to the roster (i.e. with stanza with correct semantics) will also cause an automatic subscription between the user and the contact in a matter explained above. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_102_-_Statistics_Descriptions.asciidoc ================================================ [[statsticsDescription]] = Statistics description :author: Daniel Wisnewski (daniel@tigase.org) :date: 2016-04-22 10:40 :version: v1.0 April 2016 :toc: :numbered: :website: http://www.tigase.org Statistics are divided between components and processors. You may see the same statistics collected for multiple components which are defined in common components section. Note that statistics are defined by {$component}/statistic so if you wanted Max queue size on pubsub, you would look for +pubsub/Max queue size+. Statistics will not be provided by components that are not enabled. == *Statistics common to components* These statistics may be found in multiple components and may be seen multiple times. For example both s2s and c2s will have Bytes sent statistic, so each can be found the following way: [source,properties] ----- s2s/Bytes received c2s/Bytes received ----- === add-script last {interval} The number of times that +add-script+ adhoc command has been run within the last interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +add-script/Average processing time+: The average time in ms, returned as an integer, it takes for +add-script+ to execute. *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/adhoc-command/add-script last hour {compname}/adhoc-command/add-script last minute {compname}/adhoc-command/add-script last second {compname}/adhoc-command/add-script/Average processing time ----- === Average processing time on last 100 runs [ms] The average processing time in milliseconds for all commands and scripts for this component over the last 100 times component is called. This number will populate with less than 100 runs, and will continue averaging until 100 runs happens, at that point, it's the most recent 100 instances. This statistic will reset every time the server shuts down or restarts. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Average processing time on last 100 runs [ms] ----- === Bytes received The total number of bytes that the component has received during the current server instance. This statistic resets at server shutdown or restart. *Statistics Level*: FINE|FINEST c2s is FINE, all others are FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, proxy, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Bytes received ----- === Bytes sent The total number of bytes that the component has sent during the current server instance. This statistic resets at server shutdown or restart. *Statistics Level*: FINE|FINEST c2s is FINE, all others are FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, proxy, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Bytes sent ----- === del-script last {interval} The number of times that +del-script+ adhoc command has been run within the last interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +del-script/Average processing time+: The average time in ms, returned as an integer, it takes for +del-script+ to execute. *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/adhoc-command/del-script last hour {compname}/adhoc-command/del-script last minute {compname}/adhoc-command/del-script last second {compname}/adhoc-command/del-script/Average processing time ----- === Last {interval} packets The number of packets that have been handled by this component in the last interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/last hour packets {compname}/last minute packets {compname}/last second packets ----- === list-commands last {interval} The number of +list-commands+ requests sent to the component in the last interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +list-commands/Average processing time+: The average time in ms, returned as an integer, it takes for +list-commands+ to execute. *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/list-commands last hour {compname}/list-commands last minute {compname}/list-commands last second {compname}/list-commands/Average processing time ----- === {IN|OUT|Total} queue overflow The number of times the in or out queue has overflown for this component. That is there are more packets queues than the max queue size. A total statistic is also available that combines both results. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/IN queue overflow {compname}/OUT queue overflow {compname}/Total queue overflow ----- === {in|out} queue wait: {priority} The number of packets with {priority} priority currently in the incoming or outgoing queue. *Available {priority}*: SYSTEM|CLUSTER|HIGH|NORMAL|LOW|PRESENCE|LOWEST *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/In queue wait: SYSTEM {compname}/In queue wait: CLUSTER {compname}/In queue wait: HIGH {compname}/In queue wait: NORMAL {compname}/In queue wait: LOW {compname}/In queue wait: PRESENCE {compname}/In queue wait: LOWEST {compname}/Out queue wait: SYSTEM {compname}/Out queue wait: CLUSTER {compname}/Out queue wait: HIGH {compname}/Out queue wait: NORMAL {compname}/Out queue wait: LOW {compname}/Out queue wait: PRESENCE {compname}/Out queue wait: LOWEST ----- === {IN|OUT}_QUEUE processed {type} The number of stanzas of different types that have been processed VIA the In or Out Queue of this component. This number will reset at the end of the server instance. Each component will have a list of the different types of stanzas it can process. *Available {type}*: [source,list] ----- messages presences cluster other IQ no XMLNS IQ http://jabber.org/protocol/disco#items IQ bind IQ jabber:iq:roster IQ session IQ vCard IQ command IQ jabber:iq:private IQ http://jabber.org/protocol/disco#info total IQ ----- NOTE: Several statistics are only available from statistics component, shutdown thread will ONLY print the following: messages, presences, cluster, other, IQ no XLMNS, total IQ. *Statistics Level*: FINER *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/IN_QUEUE processed messages {compname}/IN_QUEUE processed presences {compname}/IN_QUEUE processed cluster {compname}/IN_QUEUE processed other {compname}/IN_QUEUE processed IQ no XMLNS {compname}/IN_QUEUE processed IQ http://jabber.org/protocol/disco#items {compname}/IN_QUEUE processed IQ http://jabber.org/protocol/disco#info {compname}/IN_QUEUE processed IQ bind {compname}/IN_QUEUE processed IQ jabber:iq:roster {compname}/IN_QUEUE processed IQ jabber:iq:private {compname}/IN_QUEUE processed IQ session {compname}/IN_QUEUE processed IQ vCard {compname}/IN_QUEUE processed IQ command {compname}/IN_QUEUE processed total IQ {compname}/OUT_QUEUE processed messages {compname}/OUT_QUEUE processed presences {compname}/OUT_QUEUE processed cluster {compname}/OUT_QUEUE processed other {compname}/OUT_QUEUE processed IQ no XMLNS {compname}/OUT_QUEUE processed IQ http://jabber.org/protocol/disco#items {compname}/OUT_QUEUE processed IQ http://jabber.org/protocol/disco#info {compname}/OUT_QUEUE processed IQ bind {compname}/OUT_QUEUE processed IQ jabber:iq:roster {compname}/OUT_QUEUE processed IQ jabber:iq:private {compname}/OUT_QUEUE processed IQ session {compname}/OUT_QUEUE processed IQ vCard {compname}/OUT_QUEUE processed IQ command {compname}/OUT_QUEUE processed total IQ ----- === max queue size The maximum number of items allowed in the packet queue for this component. *Statistics Level*: *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, muc, monitor, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/max queue size ----- === Open Connections The number of open connections to the component. *Statistics Level*: INFO|FINEST c2s is INFO, all other components are FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, proxy, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Open connections ----- === Packets received The total number of packets received by the component from external sources in the current instance. This number resets at server shutdown or restart. *Statistics Level*: FINE *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Packets received ----- === Packets sent The total number of packets sent by the component in the current instance. This number resets at server shutdown or restart. *Statistics Level*: FINE *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Packets sent ----- === Processed packets thread: {in|out}_{#} How many packets have been processed in and out by each processing thread. Statistics will provide a list with each processing thread, and each thread having an in and an out counter. Let's say that we have 4 threads set for ws2s, a list will be seen like this: [source,list] ----- ws2s/Processed packets thread: in_0-ws2s ws2s/Processed packets thread: in_2-ws2s ws2s/Processed packets thread: in_3-ws2s ws2s/Processed packets thread: in_4-ws2s ws2s/Processed packets thread: out_0-ws2s ws2s/Processed packets thread: out_1-ws2s ws2s/Processed packets thread: out_2-ws2s ws2s/Processed packets thread: out_3-ws2s ----- Note that the processor counter starts with 0 and will count for as many threads as the component has as defined in xref:processingthreadsstat[{compname}/Processing threads]. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, pubsub, proxy, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Processed packets thread: in_0-{compname} {compname}/Processed packets thread: out_0-{compname} {compname}/Processed packets thread: in_1-{compname} {compname}/Processed packets thread: out_1-{compname} {compname}/Processed packets thread: in_2-{compname} {compname}/Processed packets thread: out_2-{compname} {compname}/Processed packets thread: in_3-{compname} {compname}/Processed packets thread: out_3-{compname} {compname}/Processed packets thread: in_4-{compname} {compname}/Processed packets thread: out_4-{compname} {compname}/Processed packets thread: in_5-{compname} {compname}/Processed packets thread: out_5-{compname} ... ----- [[processingthreadsstat]] === processing threads The number of threads provided for the particular component. *Statistics Level*: FINER *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/processing threads ----- === Socket overflow The number of times that this component has experienced socket overflow and had to drop packets. This does not include the number of dropped packets. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, proxy, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Socket overflow ----- === Total {in|out} queues wait The number of packets in the inbound or outbound queue that are currently waiting to be sent. This includes packets of all types. This is an instant statistics, in that the number in queue is only as many in the queue the moment statistics are gathered. *Related Statistics*: +{compname}/Total queue wait+: A combined total of +Total in queue wait+ and +Total out queue wait+ statistics for this component. +Total queues wait+: A combined total of all component queue wait statistics. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, muc, monitor, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Total in queues wait {compname}/Total out queues wait {compname}/Total queues wait Total queues wait ----- === Total queues overflow The number of times the component packet wait queue has overflown and had to drop packets. This statistic does not keep track of the number of dropped packets. *Related Statistics*: +total/Total queues overflow+: The combined total of all queue overflow statistics for all components. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- amp, bosh, c2s, cl-comp, eventbus, message-archive, message-router, monitor, muc, proxy, pubsub, rest, s2s, sess-man, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Total queues overflow total/Total queues overflow ----- === Waiting to send The number of packets in the component's queue that are waiting to be sent. This number will usually be 0 however it will grow if a large number of packets are jamming up your system, or your queue sizes are set too low. *Statistics Level*: FINEST *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, proxy, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Waiting to send ----- === Watchdog runs The number of times watchdog has been run on this component to check for stale connections. *Statistics Level*: FINER *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, c2s, cl-comp, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Watchdog runs ----- === Watchdog stopped The number of times watchdog identified and closed a connection it has found to be stale according to the settings in init.properties or by the defaults defined xref:watchdog[in this section]. *Statistics Level*: FINER *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, cl-comp, c2s, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Watchdog stopped ----- === Watchdog tests The number of times watchdog has found a potential stale connection and has conducted a test to determine whether or not to close the connection. This is per component in the current server instance. *Statistics Level*: FINER *Result Format*: Integer *Available from the following components*: [source,list] ----- bosh, cl-comp, c2s, s2s, ws2s ----- *List of possible statistics*: [source,list] ----- {compname}/Watchdog tests ----- == *AMP* No exclusive amp specific statistics == *bosh* === Bosh sessions The number of currently open and running BOSH sessions to the server. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- bosh/Bosh sessions ----- === pre-bind-session last {interval} The number of times the pre-bind-session command has been executed within the last specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +bosh/pre-bind-session/Average processing time+: The average time in ms, returned as an integer, it takes for +pre-bind-session+ to execute. *List of possible statistics*: [source,list] ----- bosh/adhoc-command/pre-bind-session last hour bosh/adhoc-command/pre-bind-session last minute bosh/adhoc-command/pre-bind-session last second bosh/adhoc-command/pre-bind-session/Average processing time ----- == *c2s* No exclusive c2s specific statistics == *cl-comp* === adhoc-command/cluster-nodes-list last {interval} The number of times per interval that the cluster-nodes-list command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +cl-comp/Adhoc-command/cluster-nodes-list/Average processing time+: The average time in ms, returned as an integer, it takes for +cluster-nodes-list+ to execute. *List of possible statistics*: [source,list] ----- cl-comp/adhoc-command/cluster-nodes-list last hour cl-comp/adhoc-command/cluster-nodes-list last minute cl-comp/adhoc-command/cluster-nodes-list last second cl-comp/adhoc-command/cluster-nodes-list/Average processing time ----- === adhoc-command/force-stop-service last {interval} The number of times per interval that the force-stop-service command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +cl-comp/Adhoc-command/force-stop-service/Average processing time+: The average time in ms, returned as an integer, it takes for +force-stop-service+ to execute. *List of possible statistics*: [source,list] ----- cl-comp/adhoc-command/force-stop-service last hour cl-comp/adhoc-command/force-stop-service last minute cl-comp/adhoc-command/force-stop-service last second cl-comp/adhoc-command/force-stop-service/Average processing time ----- === adhoc-command/service-keys last {interval} The number of times per interval that the service-keys command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +cl-comp/Adhoc-command/service-keys/Average processing time+: The average time in ms, returned as an integer, it takes for +service-keys+ to execute. *List of possible statistics*: [source,list] ----- cl-comp/adhoc-command/service-keys last hour cl-comp/adhoc-command/service-keys last minute cl-comp/adhoc-command/service-keys last second cl-comp/adhoc-command/service-keys/Average processing time ----- === adhoc-command/sim-serv-stopped {interval} The number of times per interval that the sim-serv-stopped command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +cl-comp/Adhoc-command/sim-serv-stopped/Average processing time+: The average time in ms, returned as an integer, it takes for +sim-serv-stopped+ to execute. *List of possible statistics*: [source,list] ----- cl-comp/adhoc-command/sim-serv-stopped last hour cl-comp/adhoc-command/sim-serv-stopped last minute cl-comp/adhoc-command/sim-serv-stopped last second cl-comp/adhoc-command/sim-serv-stopped/Average processing time ----- === Average compression ratio The average compression ratio of data sent to other clusters during the session. *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- cl-comp/Average compression ratio ----- === Average decompression ratio The average compression ratio of data received from other clusters during the session. *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- cl-comp/Average decompression ratio ----- === Known cluster nodes The number of cluster nodes currently connected to the server. *Statistics Level*: INFO *Result Format*: Integer *List of possible statistics*: [source,list] ----- cl-comp/Known cluster nodes ----- === Last {interval} disconnects The number of cluster disconnections within the specified interval. *Available {interval}*: day|hour *Statistics Level*: FINE *Result Format*: Comma separated Array. For day, each array is the number of disconnections each hour, most recent first. For hour each array is the number of disconnections each minute, most recent first. *List of possible statistics*: [source,list] ----- cl-comp/Last day disconnects cl-comp/Last hour disconnects ----- === Service connected time-outs The number of time-outs during connection initialization of cluster nodes. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- cl-comp/Service connected time-outs ----- === Total disconnects The number of clusters that have disconnected during the current session. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- cl-comp/Total disconnects ----- == *eventbus* No exclusive eventbus specific statistics == *message-archive* === Removal time of expired messages (avg) The average amount of time in milliseconds it takes to remove expired messages from the repository. This includes manual and automatic removal of messages. *Statistics Level*: FINE *Result Format*: Integer *List of possible statistics*: [source,list] ----- message-archive/Removal time of expired messages (avg) ----- == *message-router* === CPUs no The number of CPUs available on the host machine. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- message-router/CPUs no ----- === CPU usage % of available CPU power used by Tigase Server at the moment statistics are taken. Two formats are available for CPU usage: A float integer which expresses a long decimal available from +CPU Usage [%]+, and a string which provides a rounded number with a % sign from +CPU usage+. *Statistics Level*: FINE *Result Format*: Float|String *List of possible statistics*: [source,list] ----- message-router/CPU usage [%] message-router/CPU usage ----- === Free Heap The amount of heap memory that is available for use, expressed in KB *Statistics Level*: FINE *Result Format* String *List of possible statistics*: [source,list] ----- message-router/Free Heap ----- === Free NonHeap The amount of non-heap memory that is available for use, expressed in KB *Statistics Level*: FINE *Result Format* String *List of possible statistics*: [source,list] ----- message-router/Free NonHeap ----- === HEAP usage [%] Total percent of HEAP memory in use by Tigase. *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- message-router/HEAP usage [%] ----- === Local hostname The local hostname of the physical server. *Statistics Level*: INFO *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Local hostname ----- === Load average The average system load for the previous minute. The way in which the load average is calculated is operating system specific but is typically a damped time-dependent average. *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- message-router/Load average ----- === Max Heap mem Maximum amount of heap memory available as defined by JAVA_OPTIONS in tigase.conf, in Kb. *Statistics Level*: INFO *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Max Heap mem ----- === Max NonHeap mem Maximum amount of non-heap memory available as defined by JAVA_OPTIONS in tigase.conf, in Kb. *Statistics Level*: FINE *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Max NonHeap mem ----- === NONHEAP usage [%] Total amount of NONHEAP memory in use expressed as a percentage. *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- message-archive/NONHEAP usage [%] ----- === Threads count The total number of processing threads available across all components. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- message-router/Threads count ----- === Uptime The total amount of time the server has been online for this session. *Statistics Level*: INFO *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Uptime ----- === Used Heap The amount of heap memory in use in KB. *Statistics Level*: INFO *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Used Heap ----- === Used NonHeap The amount of non-heap memory in use shown in KB. *Statistics Level*: FINE *Result Format*: String *List of possible statistics*: [source,list] ----- message-router/Used NonHeap ----- == *monitor* === adhoc-command/load-errors last {interval} The number of times per interval that the load-errors command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +monitor/Adhoc-command/load-errors/Average processing time+: The average time in ms, returned as an integer, it takes for +load-errors+ to execute. *List of possible statistics*: [source,list] ----- monitor/adhoc-command/load-errors last hour monitor/adhoc-command/load-errors last minute monitor/adhoc-command/load-errors last second monitor/adhoc-command/load-errors/Average processing time ----- == *muc* === adhoc-command/remove-room last {interval} The number of times per interval that the remove-room command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +muc/Adhoc-command/remove-room/Average processing time+: The average time in ms, returned as an integer, it takes for +remove-room+ to execute. *List of possible statistics*: [source,list] ----- monitor/adhoc-command/remove-room last hour monitor/adhoc-command/remove-room last minute monitor/adhoc-command/remove-room last second monitor/adhoc-command/remove-room/Average processing time ----- === adhoc-command/default-room-config last {interval} The number of times per interval that the default-room-command command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +muc/Adhoc-command/default-room-config/Average processing time+: The average time in ms, returned as an integer, it takes for +default-room-config+ to execute. *List of possible statistics*: [source,list] ----- muc/adhoc-command/default-room-config last hour muc/adhoc-command/default-room-config last minute muc/adhoc-command/default-room-config last second muc/adhoc-command/default-room-config/Average processing time ----- == *proxy* === Average transfer size in KB Average size of packets sent through the proxy component during the current session. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- proxy/Average transfer size in KB ----- === KBytes transferred Total number of Kb transferred through the proxy component. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- proxy/KBytes transferred ----- === Open streams Number of currently open proxy streams. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- proxy/Open streams ----- === Transfers completed Number of specific transfers completed through proxy component. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- proxy/Transfers completed ----- == *pubsub* === Added new nodes The total number of new nodes that has been added in the current server instance. This statistic is reset when the server resets. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Added new nodes ----- === adhoc-command/delete-item last {interval} The number of times per interval that the delete-item command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/delete-item/Average processing time+: The average time in ms, returned as an integer, it takes for +delete-item+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/delete-item last hour pubsub/adhoc-command/delete-item last minute pubsub/adhoc-command/delete-item last second pubsub/adhoc-command/delete-item/Average processing time ----- === adhoc-command/delete-node last {interval} The number of times per interval that the delete-node command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/delete-node/Average processing time+: The average time in ms, returned as an integer, it takes for +delete-item+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/delete-node last hour pubsub/adhoc-command/delete-node last minute pubsub/adhoc-command/delete-node last second pubsub/adhoc-command/delete-node/Average processing time ----- === adhoc-command/list-items last {interval} The number of times per interval that the list-items command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/list-items/Average processing time+: The average time in ms, returned as an integer, it takes for +list-items+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/list-items last hour pubsub/adhoc-command/list-items last minute pubsub/adhoc-command/list-items last second pubsub/adhoc-command/list-items/Average processing time ----- === adhoc-command/list-nodes last {interval} The number of times per interval that the list-nodes command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/list-nodes/Average processing time+: The average time in ms, returned as an integer, it takes for +list-nodes+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/list-nodes last hour pubsub/adhoc-command/list-nodes last minute pubsub/adhoc-command/list-nodes last second pubsub/adhoc-command/list-nodes/Average processing time ----- === adhoc-command/publish-item last {interval} The number of times per interval that the publish-item command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/publish-item/Average processing time+: The average time in ms, returned as an integer, it takes for +publish-item+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/publish-item last hour pubsub/adhoc-command/publish-item last minute pubsub/adhoc-command/publish-item last second pubsub/adhoc-command/publish-item/Average processing time ----- === adhoc-command/retrieve-item last {interval} The number of times per interval that the retrieve-item command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/adhoc-command/retrieve-item/Average processing time+: The average time in ms, returned as an integer, it takes for +retrieve-item+ to execute. *List of possible statistics*: [source,list] ----- pubsub/adhoc-command/retrieve-item last hour pubsub/adhoc-command/retrieve-item last minute pubsub/adhoc-command/retrieve-item last second pubsub/adhoc-command/retrieve-item/Average processing time ----- === AdHocConfigCommandModule last {interval} The number of times per interval that the AdHocConfigCommandModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/AdHocConfigCommandModule/Average processing time+: The average time in ms, returned as an integer, it takes for +AdHocConfigCommandModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/AdHocConfigCommandModule last hour pubsub/AdHocConfigCommandModule last minute pubsub/AdHocConfigCommandModule last second pubsub/AdHocConfigCommandModule/Average processing time ----- === Affiliations count (in cache) The total number of pubsub affiliations that are resident in cache memory. Affiliations include JIDs that are one of the following; Owner, Publisher, Publish-Only, Member, None, Outcast. This may not reflect total pubsub affiliations in repository. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Affiliations count (in cache) ----- === Average DB write time [ms] The average time of all DB writes from PubSub component. Average is calculated using two other statistics: (Total writing time / Database writes) *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Average DB write time [ms] ----- === cache/hits last {interval} The number of times the cache has achieved a hit within the last interval. A hit is when a request for information is matched to data that is inside the cache memory. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/cache/hits last hour pubsub/cache/hits last minute pubsub/cache/hits last second ----- === cache/hit-miss ratio per {interval} The ratio of cache hits to cache misses over the specified period. A cache hit is when a request for information from the cache is matched with information in the cache. A miss is when that information request cannot find a match in cache. A miss only indicates that that information was not found in the cache, not that it is not in the repository. *Available {interval}*: hour|minute *Statistics Level*: FINE *Result Format*: Float *List of possible statistics*: [source,list] ----- pubsub/cache/hit-miss ratio per hour pubsub/cache/hit-miss ratio per minute ----- === cache/requests last {interval} The number of memory cache requests made within the last interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/cache/Requests last hour pubsub/cache/Requests last minute pubsub/cache/Requests last second ----- === Cached nodes The number of nodes that is currently in memory cache. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Cached nodes ----- === CapsModule The number of times per interval that the CapsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/CapsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +CapsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/CapsModule last hour pubsub/CapsModule last minute pubsub/CapsModule last second pubsub/CapsModule/Average processing time ----- === db/GetNodeItems requests last {interval} The number of times +GetNodeItems+ command has been run within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/db/GetNodeItems/Average processing time+: The average time in ms, returned as an integer, it takes for +GetNodeItems+ to execute. *List of possible statistics*: [source,list] ----- pubsub/db/GetNodeItems last hour pubsub/db/GetNodeItems last minute pubsub/db/GetNodeItems last second pubsub/db/GetNodeItems/Average processing time ----- === DefaultConfigModule last {interval} The number of times per interval that the DefaultConfigModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/DefaultConfigModule/Average processing time+: The average time in ms, returned as an integer, it takes for +DefaultConfigModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/DefaultConfigModule last hour pubsub/DefaultConfigModule last minute pubsub/DefaultConfigModule last second pubsub/DefaultConfigModule/Average processing time ----- === DiscoverInfoModule last {interval} The number of times per interval that the DiscoverInfoModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/DiscoverInfoModule/Average processing time+: The average time in ms, returned as an integer, it takes for +DiscoverInfoModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/DiscoverInfoModule last hour pubsub/DiscoverInfoModule last minute pubsub/DiscoverInfoModule last second pubsub/DiscoverInfoModule/Average processing time ----- === DiscoverItemsModule last {interval} The number of times per interval that the DiscoverItemsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/DiscoverItemsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +DiscoverItemsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/DiscoverItemsModule last hour pubsub/DiscoverItemsModule last minute pubsub/DiscoverItemsModule last second pubsub/DiscoverItemsModule/Average processing time ----- === JabberVersionModule last {interval} The number of times per interval that the JabberVersionModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/JabberVersionModule/Average processing time+: The average time in ms, returned as an integer, it takes for +JabberVersionModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/JabberVersionModule last hour pubsub/JabberVersionModule last minute pubsub/JabberVersionModule last second pubsub/JabberVersionModule/Average processing time ----- === ManageAffiiationsModule last {interval} The number of times per interval that the ManageAffiliationsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/ManageAffiliationsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +ManageAffiliationsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/ManageAffiliationsModule last hour pubsub/ManageAffiliationsModule last minute pubsub/ManageAffiliationsModule last second pubsub/ManageAffiliationsModule/Average processing time ----- === ManageSubscriptionModule last {interval} The number of times per interval that the ManageSubscriptionModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/ManageSubscriptionModule/Average processing time+: The average time in ms, returned as an integer, it takes for +ManageSubscriptionModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/ManageSubscriptionModule last hour pubsub/ManageSubscriptionModule last minute pubsub/ManageSubscriptionModule last second pubsub/ManageSubscriptionModule/Average processing time ----- === NodeConfigModule last {interval} The number of times per interval that the NodeConfigModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/NodeConfigModule/Average processing time+: The average time in ms, returned as an integer, it takes for +NodeConfigModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/NodeConfigModule last hour pubsub/NodeConfigModule last minute pubsub/NodeConfigModule last second pubsub/NodeConfigModule/Average processing time ----- === NodeCreateModule last {interval} The number of times per interval that the NodeCreateModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/NodeCreateModule/Average processing time+: The average time in ms, returned as an integer, it takes for +NodeCreateModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/NodeCreateModule last hour pubsub/NodeCreateModule last minute pubsub/NodeCreateModule last second pubsub/NodeCreateModule/Average processing time ----- === NodeDeleteModule last {interval} The number of times per interval that the NodeDeleteModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/NodeDeleteModule/Average processing time+: The average time in ms, returned as an integer, it takes for +NodeDeleteModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/NodeDeleteModule last hour pubsub/NodeDeleteModule last minute pubsub/NodeDeleteModule last second pubsub/NodeDeleteModule/Average processing time ----- === PresenceCollectorModule last {interval} The number of times per interval that the PresenceCollectorModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/PresenceCollectorModule/Average processing time+: The average time in ms, returned as an integer, it takes for +PresenceCollectorModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/PresenceCollectorModule last hour pubsub/PresenceCollectorModule last minute pubsub/PresenceCollectorModule last second pubsub/PresenceCollectorModule/Average processing time ----- === PendingSubscriptionModule last {interval} The number of times per interval that the PendingSubscriptionModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/PendingSubscriptionModule/Average processing time+: The average time in ms, returned as an integer, it takes for +PendingSubscriptionModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/PendingSubscriptionModule last hour pubsub/PendingSubscriptionModule last minute pubsub/PendingSubscriptionModule last second pubsub/PendingSubscriptionModule/Average processing time ----- === PresenceNotifierModule last {interval} The number of times per interval that the PresenceNotifierModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/PresenceNotifierModule/Average processing time+: The average time in ms, returned as an integer, it takes for +PresenceNotifierModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/PresenceNotifierModule last hour pubsub/PresenceNotifierModule last minute pubsub/PresenceNotifierModule last second pubsub/PresenceNotifierModule/Average processing time ----- === PublishItemModule last {interval} The number of times per interval that the PublishItemModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/PublishItemModule/Average processing time+: The average time in ms, returned as an integer, it takes for +PublishItemModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/PublishItemModule last hour pubsub/PublishItemModule last minute pubsub/PublishItemModule last second pubsub/PublishItemModule/Average processing time ----- === PurgeItemsModule last {interval} The number of times per interval that the PurgeItemsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/PurgeItemsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +PurgeItemsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/PurgeItemsModule last hour pubsub/PurgeItemsModule last minute pubsub/PurgeItemsModule last second pubsub/PurgeItemsModule/Average processing time ----- === Repository writes Number of individual writes to Repository from the pubsub component since startup. *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: [source,list] ----- pubsub/Repository writes ----- === RetractItemModule last {interval} The number of times per interval that the RetractItemModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/RetractItemModule/Average processing time+: The average time in ms, returned as an integer, it takes for +RetractItemModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/RetractItemModule last hour pubsub/RetractItemModule last minute pubsub/RetractItemModule last second pubsub/RetractItemModule/Average processing time ----- === RetrieveAffiliationsModule last {interval} The number of times per interval that the RetrieveAffiliationsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/RetrieveAffiliationsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +RetrieveAffiliationsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/RetrieveAffiliationsModule last hour pubsub/RetrieveAffiliationsModule last minute pubsub/RetrieveAffiliationsModule last second pubsub/RetrieveAffiliationsModule/Average processing time ----- === RetrieveItemsModule last {interval} The number of times per interval that the RetrieveItemsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/RetrieveItemsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +RetrieveItemsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/RetrieveItemsModule last hour pubsub/RetrieveItemsModule last minute pubsub/RetrieveItemsModule last second pubsub/RetrieveItemsModule/Average processing time ----- === RetrieveSubscriptionsModule last {interval} The number of times per interval that the RetrieveSubscriptionsModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/RetrieveSubscriptionsModule/Average processing time+: The average time in ms, returned as an integer, it takes for +RetrieveSubscriptionsModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/RetrieveSubscriptionsModule last hour pubsub/RetrieveSubscriptionsModule last minute pubsub/RetrieveSubscriptionsModule last second pubsub/RetrieveSubscriptionsModule/Average processing time ----- === SubscribeNodeModule last {interval} The number of times per interval that the SubscribeNodeModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/SubscribeNodeModule/Average processing time+: The average time in ms, returned as an integer, it takes for +SubscribeNodeModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/SubscribeNodeModule last hour pubsub/SubscribeNodeModule last minute pubsub/SubscribeNodeModule last second pubsub/SubscribeNodeModule/Average processing time ----- === Subscription count (in cache) The total number of pubsub subscriptions that are resident in cache memory. This may not reflect total pubsub subscriptions in repository. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Subscription count (in cache) ----- === Total writing time The cumulative total of time pubsub component has written to the database expressed in milliseconds. *Statistics Level*: FINEST *Result Format*: String (###ms) *List of possible statistics*: [source,list] ----- pubsub/Total writing time ----- === UnsubscribeNodeModule last {interval} The number of times per interval that the UnsubscribeNodeModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/UnsubscribeNodeModule/Average processing time+: The average time in ms, returned as an integer, it takes for +UnsubscribeNodeModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/UnsubscribeNodeModule last hour pubsub/UnsubscribeNodeModule last minute pubsub/UnsubscribeNodeModule last second pubsub/UnsubscribeNodeModule/Average processing time ----- === Update subscription calls Number of times Subscriptions have been updated (this includes new, deleted, and edited). *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- pubsub/Update subscriptions calls ----- === XmppPingModule last {interval} The number of times per interval that the XmppPingModule command has been executed. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +pubsub/XmppPingModule/Average processing time+: The average time in ms, returned as an integer, it takes for +XmppPingModule+ to execute. *List of possible statistics*: [source,list] ----- pubsub/XmppPingModule last hour pubsub/XmppPingModule last minute pubsub/XmppPingModule last second pubsub/XmppPingModule/Average processing time ----- [[repo-factoryStatistics]] == *repo-factory* === repo-factory/Number of data repositories The number of data repositories setup for this XMPP server. *Statistics Level*: FINE *Result Format*: Integer *List of possible statistics*: [source,list] ----- repo-factory/Number of data repositories ----- === repo-factory/repository {jdbclocation} connections count The number of connections made to this database. *Statistics Level*: FINE *Result Format*: Integer *List of possible statistics*: [source,list] ----- repo-factory/repository {jdbclocation} connections count ----- === repo-factory/repository {jdbclocation} reconnections The number of reconnections made to this database. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- repo-factory/repository {jdbclocation} reconnections ----- === repo-factory/repository {jdbclocation} failed reconnections The number of reconnections that have failed to connect to this database. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- repo-factory/repository {jdbclocation} failed reconnections ----- == *rest* No exclusive rest specific statistics == *s2s* === adhoc-command/get-cid-connection last {interval} The number of times get-cid-connection command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +s2s/adhoc-command/get-cid-connection/Average processing time+: The average time in ms, returned as an integer, it takes for +get-cid-connection+ to execute. *List of possible statistics*: [source,list] ----- s2s/adhoc-command/get-cid-connection last hour s2s/adhoc-command/get-cid-connection last minute s2s/adhoc-command/get-cid-connection last second s2s/adhoc-command/get-cid-connection/Average processing time ----- === adhoc-command/s2s-bad-state-conns last {interval} The number of times s2s-bad-state-conns command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/s2s-bad-state-conns/Average processing time+: The average time in ms, returned as an integer, it takes for +s2s-bad-state-conns+ to execute. *List of possible statistics*: [source,list] ----- s2s/adhoc-command/s2s-bad-state-conns last hour s2s/adhoc-command/s2s-bad-state-conns last minute s2s/adhoc-command/s2s-bad-state-conns last second s2s/adhoc-command/s2s-bad-state-conns/Average processing time ----- === adhoc-command/reset-bad-state-conns last {interval} The number of times reset-bad-state-conns command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/reset-bad-state-conns/Average processing time+: The average time in ms, returned as an integer, it takes for +reset-bad-state-conns+ to execute. *List of possible statistics*: [source,list] ----- s2s/adhoc-command/reset-bad-state-conns last hour s2s/adhoc-command/reset-bad-state-conns last minute s2s/adhoc-command/reset-bad-state-conns last second s2s/adhoc-command/reset-bad-state-conns/Average processing time ----- === CIDs number ConnectionID for the server. This may include multiple CIDs if server is running multiple vhosts. *Statistics Level*: FINEST *Result Format*: String *List of possible statistics*: [source,list] ----- s2s/CIDs number ----- === Total DB keys Total number of database keys. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total DB keys ----- === Total {incoming|outgoing} The total number of server-to-server connections, outgoing is local server connecting to other servers, and incoming is connections from other servers. The results may or may not be the same. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total incoming s2s/Total outgoing ----- === Total {incoming|outgoing} TLS The total number of server-to-server connections using TLS, outgoing is local server connecting to other servers, and incoming is connections from other servers. The results may or may not be the same. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total incoming TLS s2s/Total outgoing TLS ----- === Total outgoing handshaking Total number of outgoing connections that are currently handshaking to other servers. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total outgoing handshaking ----- === Total control waiting Total number of connections that were manually told to wait. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total control waiting ----- === Total waiting Total number of connections that are currently waiting for response from other server. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- s2s/Total waiting ----- == *sess-man* === Active user connections Number of user connections that are considered active. An active user is a user that has sent stanzas to the server or through the server within the last 5 minutes. *Statistics Level*: FINER *Result Format*: Integer *list of possible statistics*: [source,list] ----- sess-man/Active user connections ----- === adhoc-command/connection-time last {interval} The number of times connection-time command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/connection-time/Average processing time+: The average time in ms, returned as an integer, it takes for +connection-time+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/connection-time last hour sess-man/adhoc-command/connection-time last minute sess-man/adhoc-command/connection-time last second sess-man/adhoc-command/connection-time/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#add-user last {interval} The number of times admin#add-user command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#add-user/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#add-user+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user last second sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#add-user-tracker last {interval} The number of times admin#add-user-tracker command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#add-user-tracker/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#add-user-tracker+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user-tracker last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user-tracker last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user-tracker last second sess-man/adhoc-command/http://jabber.org/protocol/admin#add-user-tracker/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#announce last {interval} The number of times admin#announce command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#announce/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#announce+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#announce last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#announce last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#announce last second sess-man/adhoc-command/http://jabber.org/protocol/admin#announce/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#change-user-password last {interval} The number of times admin#change-user-password command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#change-user-password/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#change-user-password+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#change-user-password last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#change-user-password last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#change-user-password last second sess-man/adhoc-command/http://jabber.org/protocol/admin#change-user-password/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#delete-user last {interval} The number of times admin#delete-user command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#delete-user/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#delete-user+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#delete-user last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#delete-user last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#delete-user last second sess-man/adhoc-command/http://jabber.org/protocol/admin#delete-user/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#end-user-session last {interval} The number of times admin#end-user-session command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#end-user-session/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#end-user-session+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#end-user-session last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#end-user-session last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#end-user-session last second sess-man/adhoc-command/http://jabber.org/protocol/admin#end-user-session/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-active-users last {interval} The number of times admin#get-active-users command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-active-users/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-active-users+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-users last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-users last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-users last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-users/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-active-user-num last {interval} The number of times admin#get-active-user-num command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-active-user-num/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-active-user-num+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-user-num last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-user-num last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-user-num last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-active-user-num/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-idle-users last {interval} The number of times admin#get-idle-users command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-idle-users/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-idle-users+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num last {interval} The number of times admin#get-idle-users-num command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-idle-users-num+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-idle-users-num/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-online-users-list last {interval} The number of times admin#get-online-users-list command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-online-users-list/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-online-users-list+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-online-users-list last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-online-users-list last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-online-users-list last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-online-users-list/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-top-active-users last {interval} The number of times admin#get-top-active-users command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-top-active-users/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-top-active-users+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-top-active-users last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-top-active-users last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-top-active-users last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-top-active-users/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list last {interval} The number of times admin#get-registered-users-list command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-registered-users-list+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-registered-users-list/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#get-user-roster last {interval} The number of times admin#get-user-roster command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#get-user-roster/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#get-user-roster+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#get-user-roster last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#get-user-roster last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#get-user-roster last second sess-man/adhoc-command/http://jabber.org/protocol/admin#get-user-roster/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#remove-user last {interval} The number of times admin#remove-user command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#remove-user/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#remove-user+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#remove-user last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#remove-user last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#remove-user last second sess-man/adhoc-command/http://jabber.org/protocol/admin#remove-user/Average processing time ----- === adhoc-command/http://jabber.org/protocol/admin#user-stats last {interval} The number of times admin#user-stats command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/http://jabber.org/protocol/admin#user-stats/Average processing time+: The average time in ms, returned as an integer, it takes for +admin#user-stats+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/http://jabber.org/protocol/admin#user-stats last hour sess-man/adhoc-command/http://jabber.org/protocol/admin#user-stats last minute sess-man/adhoc-command/http://jabber.org/protocol/admin#user-stats last second sess-man/adhoc-command/http://jabber.org/protocol/admin#user-stats/Average processing time ----- === adhoc-command/get-user-info last {interval} The number of times get-user-info command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/get-user-info/Average processing time+: The average time in ms, returned as an integer, it takes for +get-user-info+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/get-user-info last hour sess-man/adhoc-command/get-user-info last minute sess-man/adhoc-command/get-user-info last second sess-man/adhoc-command/get-user-info/Average processing time ----- === adhoc-command/modify-user last {interval} The number of times modify-user command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/modify-user/Average processing time+: The average time in ms, returned as an integer, it takes for +modify-user+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/modify-user last hour sess-man/adhoc-command/modify-user last minute sess-man/adhoc-command/modify-user last second sess-man/adhoc-command/modify-user/Average processing time ----- === adhoc-command/oauth-credentials last {interval} The number of times oauth-credentials command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/oauth-credentials/Average processing time+: The average time in ms, returned as an integer, it takes for +oauth-credentials+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/oauth-credentials last hour sess-man/adhoc-command/oauth-credentials last minute sess-man/adhoc-command/oauth-credentials last second sess-man/adhoc-command/oauth-credentials/Average processing time ----- === adhoc-command/roster-fixer last {interval} The number of times roster-fixer command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/roster-fixer/Average processing time+: The average time in ms, returned as an integer, it takes for +roster-fixer+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/roster-fixer last hour sess-man/adhoc-command/roster-fixer last minute sess-man/adhoc-command/roster-fixer last second sess-man/adhoc-command/roster-fixer/Average processing time ----- === adhoc-command/roster-fixer-cluster last {interval} The number of times roster-fixer-cluster command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/roster-fixer-cluster/Average processing time+: The average time in ms, returned as an integer, it takes for +roster-fixer-cluster+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/roster-fixer-cluster last hour sess-man/adhoc-command/roster-fixer-cluster last minute sess-man/adhoc-command/roster-fixer-cluster last second sess-man/adhoc-command/roster-fixer-cluster/Average processing time ----- === adhoc-command/user-domain-perm last {interval} The number of times user-domain-perm command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/user-domain-perm/Average processing time+: The average time in ms, returned as an integer, it takes for +user-domain-perm+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/user-domain-perm last hour sess-man/adhoc-command/user-domain-perm last minute sess-man/adhoc-command/user-domain-perm last second sess-man/adhoc-command/user-domain-perm/Average processing time ----- === adhoc-command/user-roster-management last {interval} The number of times user-roster-management command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/user-roster-management/Average processing time+: The average time in ms, returned as an integer, it takes for +user-roster-management+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/user-roster-management last hour sess-man/adhoc-command/user-roster-management last minute sess-man/adhoc-command/user-roster-management last second sess-man/adhoc-command/user-roster-management/Average processing time ----- === adhoc-command/user-roster-management-ext last {interval} The number of times user-roster-management-ext command has been executed within the specified interval. *Available {interval}*: hour|minute|second *Statistics Level*: FINEST *Result Format*: Integer *Sub-level Statistics Available*: +adhoc-command/user-roster-management-ext/Average processing time+: The average time in ms, returned as an integer, it takes for +user-roster-management-ext+ to execute. *List of possible statistics*: [source,list] ----- sess-man/adhoc-command/user-roster-management-ext last hour sess-man/adhoc-command/user-roster-management-ext last minute sess-man/adhoc-command/user-roster-management-ext last second sess-man/adhoc-command/user-roster-management-ext/Average processing time ----- === Authentication timeouts The number of connections that have timed out during the authentication process. Default timeout is 2 minutes. *Statistics Level*: FINEST *Result Format*: Integer *List of available statistics*: [source,list] ----- sess-man/Authentication timeouts ----- === Closed user connections User connections that have been terminated by the user (as opposed to the server). *Statistics Level*: FINEST *Result Format*: Integer *List of available statistics*: [source,list] ----- sess-man/Closed user connections ----- === default-handler/Invalid registrations Number of invalid registrations attempted with the server *Statistics Level*: FINEST *Result Format*: Integer *List of available statistics*: [source,list] ----- sess-man/default-handler/Invalid registrations ----- === default-handler/Registered users Number of registered users for this server. *Statistics Level*: FINEST *Result Format*: Integer *List of available statistics*: [source,list] ----- sess-man/default-handler/Registered users ----- === Maximum user connections Maximum number of connections that have been made during server instance, this number includes users connecting multiple times. *Statistics Level*: INFO *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Maximum user connections ----- === Maximum user sessions {today|yesterday} The number of most simultaneous sessions within the specified interval. Today = previous 24 hours, Yesterday = 24 hours after previous 24 hours (does not go by calendar date). *Statistics Level*: INFO|FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Maximum user sessions today sess-man/Maximum user sessions yesterday ----- === Registered accounts Sum total of registered accounts for the server. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Registered accounts ----- === Open user connections The current number of open user connections. This may be interpreted as number of connections from users, however a user can have more than one connection (connection from mobile and PC for example). *Statistics Level*: INFO *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Open user connections ----- === Open user sessions The current number of open user sessions. *Statistics Level*: INFO *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Open user sessions ----- === Total user connections The cumulative number of connections that have been made to the server during the current instance. *Statistics Level*: FINER *Result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Total user connections ----- === Total user sessions The cumulative number of sessions that this server has negotiated during the current instance. *Statistics Level*: FINER *result Format*: Integer *List of possible statistics*: [source,list] ----- sess-man/Total user sessions ----- === presence/Users status changes The number of presence changes for all users that have been conducted during the server instance. *Stastics Level*: INFO *List of possible statistics*: [source,list] ----- sess-man/presence/Users status changes sess-man/presence-state/Users status changes ----- === sess-man/Processor Processor statistics will result in a field of labels and values exclusive to that processor. The field shows as follows: [source,properties] ----- , Queue: 0, AvTime: 0, Runs: 0, Lost: 0 ----- Where: Queue: Number of packets in process queue AvTime: Average time in ms processor takes to conduct it's operation. Runs: Number of times Processor has been run. Lost: Number of packets lost during processing. *Statistics Level*: FINEST *List of possible statistics*: [source,list] ----- sess-man/Processor: message carbons sess-man/Processor: http://jabber.org/protocol/stats sess-man/Processor: jabber:iq:auth sess-man/Processor: vcard-temp sess-man/Processor: amp sess-man/Processor: presence-subscription sess-man/Processor: disco sess-man/Processor: msgoffline sess-man/Processor: urn:xmpp:blocking sess-man/Processor: urn:xmpp:ping sess-man/Processor: jabber:iq:register sess-man/Processor: urn:ietf:params:xml:ns:xmpp-sasl sess-man/Processor: prp sess-man/Processor: presence sess-man/Processor: message-archive-xep-0136 sess-man/Processor: default-handler sess-man/Processor: jabber:iq:roster sess-man/Processor: starttls sess-man/Processor: presence-state sess-man/Processor: jabber:iq:version sess-man/Processor: urn:xmpp:time sess-man/Processor: session-open sess-man/Processor: jabber:iq:privacy sess-man/Processor: urn:ietf:params:xml:ns:xmpp-bind sess-man/Processor: http://jabber.org/protocol/commands sess-man/Processor: vcard-xep0292 sess-man/Processor: session-close sess-man/Processor: urn:ietf:params:xml:ns:xmpp-session sess-man/Processor: jabber:iq:private sess-man/Processor: Average amp on last 100 runs [ms] sess-man/Processor: Average msgoffline on last 100 runs[ms] These are example scripts included with Tigase for demonstration purposes, it is likely you will not encounter or need them. sess-man/groovy-example last hour sess-man/groovy-example last minute sess-man/groovy-example last second sess-man/groovy-example/Average processing time sess-man/hello last hour sess-man/hello last minute sess-man/hello last second sess-man/hello/Average processing time ----- == *vhost-man* === Checks is anonymous domain Number of anonymous domain checks that have been run within vhost-man. *Statistics Level*: FINEST *Result Format*: Integer *List of possible statistics*: [source,list] ----- vhost-man/Checks is anonymous domain ----- === Checks: is local domain Number of local domain checks that have been run within vhost-man. *Statistics Level*: FINER *Result Format*: Integer *List of possible statistics*: [source,list] ----- vhost-man/Checks: is local domain ----- === Get components for local domain Number of components loaded within local domain. *Statistics Level*: FINER *Result Format* Integer *List of possible statistics*: [source,list] ----- vhost-man/Get components for local domain ----- === Get components for non-local domain Number of components loaded outside local domain. *Statistics Level*: FINEST *Result Format* Integer *List of possible statistics*: [source,list] ----- vhost-man/Get components for non-local domain ----- === Number of Vhosts Number of configured and running Virtual Hosts. *Statistics Level*: FINE *Result Format* Integer *List of possible statistics*: [source,list] ----- vhost-man/Number of VHosts ----- == *ws2s* No exclusive ws2s specific statistics ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_103_-_Components_-_K_-_C2S.asciidoc ================================================ [[c2scomponent]] = Client to Server Communication :author: Daniel Wisnewski (daniel@tigase.org) :date: 2016-06-23 08:20 :version: v1.0 June 2016 Client to server communication is an integral part of XMPP communication. C2S handles all client communication to the server, and is responsible for filtering and handling remote communications. C2S CAN be disabled, however doing so will only allow communication of internal components, and S2S communications. = Configuration == Resumption timeout It is now possible to set a default stream resumption timeout that the server uses. This allows control of how long a server will wait for a reconnection from a client. This can be particularly helpful to manage mobile clients connecting to your server as they may not have complete coverage, and you do not want to close the stream right away. By default, Tigase sets this value to 60 seconds. [source,properties] ----- c2s/processors/urn\:xmpp\:sm\:3/resumption-timeout[I]=90 ----- This sets the default timeout to 90 seconds. You may, if you choose, specify a maximum timout time, which will allow the server to wait between the default and maximum before a connection is closed. [source,properties] ----- c2s/processors/urn\:xmpp\:sm\:3/max-resumption-timeout[I]=900 ----- NOTE: If the max-resumption-timeout is not set, it will always equal the resumption-timeout number, or default is none is set. Available since v7.1.0 ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_104_-_Using_Tigase_-_Q_-_Clustering.asciidoc ================================================ [[tigaseClustering]] = Tigase Clustering :author: Daniel Wisnewski :version: v1.0 June 2016 :date: 24-06-2016 11:00 Tigase Clustering allows the use of a number of servers to be unified in delivering, from what a client or user sees, a single unified platform. There are two typical reasons why clustering should be employed: - High Availability By using clustering, services can be provided with a high reliability and redundancy. By using a network of multiple servers, content or services can be served on any of the clustered servers maintaining a consistent uptime without relying on one machine. - Load Balancing This type of cluster helps to distribute a workload over a number of servers to reduce bottlenecking from heavy resource loads on a particular server. With Tigase, you don't have to choose between either/or! *Tigase Clustering* offers *Full Redundancy* and *Automatic Load Balancing* allowing addition of new nodes at runtime with a simple configuration. All without a severe tax on resource consumption. All basic components support clustering configuration, and some may be turned on or off. == Configuration To enable Clustering on Tigase servers, use the following line in your init.properties file: [source,properties] ----- --cluster-mode=true ----- That's it! === Custom Ports You can customize ports for the cluster component, just be sure that each clustered server also has the same settings so they can communicate. [source,properties] ----- --cl-comp-ports=4250,3540 ----- You can fine tune each port configuration, however this is not typically needed. ==== Custom Port Configuration Each port has it's own details that can be manipulated VIA the following ports. Again *THIS IS OPTIONAL* [source,properties] ----- cl-comp/connections/4250/type[S]=accept cl-comp/connections/4250/socket[S]=plain cl-comp/connections/4250/ifc[s]=* cl-comp/connections/4250/remote-host[S]=localhost cl-comp/connections/4250/connections/tls/required[B]=false ----- === Multi-node configuration Each node should have +--cluster-mode=true+ enabled that you wish to connect to the cluster. They will automatically discover other nodes to connect to VIA Server to Server traffic. Nodes that are added or removed will be periodically updated. === Traffic Control You can customize the traffic going between clustered servers with a few options. ==== cm-ht-traffic-throttling This setting will control the number of bytes sent over non-user connections. Namely, Server to Server or S2S connections. [source,properties] ----- --cm-ht-traffic-throttling=xmpp:25k:0:disc,bin:200m:0:disc ----- The format is as follows: {traffic-type}:{maximum-traffic}:{max-lifespan-traffic}:{action} - *traffic-type* Specifies the type of traffic controlled. This can either be *XMPP* or *bin*. XMPP limits the number of packets transferred, whereas bin limits the number of bytes transferred. - *maximum-traffic* Specifies how many bytes or packets may be sent within one minute. - *max-lifespan-traffic* Specifies how many bytes or packets may be sent within the lifetime of the connection. 0 means unlimited. - *action* Specifies the action to be taken which can be *disc* which disconnects the connection, or *drop* which will drop any data exceeding the thresholds. ==== cm-see-other-host This allows the specific use of a load balancing mechanism by selecting +SeeOtherHostIfc+ implementation. For more details, see xref:loadBalanding[Tigase Load Balancing] documentation. == Old configuration method While these options are still available these settings CAN be less reliable. *Use ONLY if you need specific setups that cannot be accommodated by the automatic cluster mode*. === Specifying Specific nodes You can still use the old method of specifying every node on each server. Server 3 needs the following set [source,properties] ----- --cluster-nodes=serv1.xmpp-test.org,serv2.xmpp-test.org ----- Server 2 needs [source,properties] ----- --cluster-nodes=serv1.xmpp-test.org,serv3.xmpp-test.org ----- and so on... ==== Password and Port configuration You may specify a password and port to specific cluster servers if that is required. To do so, you will need to add {password}:{port} to the domain, like this example: [source,properties] ----- --cluster-nodes=serv1.xmpp-test.org:domainpass:5600 ----- == Checking Cluster Connections After setting up clustering you may want to verify that the clusters are operational. Right now it can be done in two manners - first by checking that there are actual network connections established between cluster nodes. The other is to check internal status of the server. === Established connections There are number of ways to check for opened connections, simplest one use command line. (Tigase uses port _5277_ for cluster connections) * Linux [source,sh] ----- $ lsof -iTCP:5277 -sTCP:ESTABLISHED -P -n ----- * Windows [source,sh] ----- C:\WINNT>netstat -anp tcp | find ":5277 " ----- === Cluster nodes connected (using XMPP) Verifying clustering connectivity over XMPP protocol requires any XMPP client capable of http://xmpp.org/extensions/xep-0030.html[XEP-0030: Service Discovery]. It's essential to remember that only an administrator (a user whose JID is configured as administrative) has access. ==== Psi XMPP Client For the purpose of this guide a http://psi-im.org/[Psi] client will be used. After successfully configuring and connecting to account with administrative privileges we need to access _Service Discovery_, either from application menu or from context menu of the particular account account: image:images/monitoring_xmpp_1.png[caption="Figure 1: ", title="Access service discovery", alt="roster-discovery", width="233"] In the _Service Discovery_ window we need to find _Cluster Connection Manager_ component. After expanding the tree node for the component a list of all cluster nodes will be presented with the current status (either _connected_ or _disconnected_). Node column will contain actual hostname of the cluster node: image:images/monitoring_clustering.png[caption="Figure 2: ", title="List of cluster nodes", alt="discovery-nodes", width="558"] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_105_-_Configuration_-_F_-_Sess-man.asciidoc ================================================ [[sessMan]] = Session Manager :author: Daniel Wisnewski :version: v1.0 June 2016 :date: 24-06-2016 11:00 Tigase Session Manager is where most of Tigase basic options can be configured, and where many operations are controlled from. Changes to session manager can effect operations throughout an entire XMPP installation, so care must be made when changing settings here. [[sessManMobileOpts]] == Mobile Optimizations By default, Tigase employs XEP-0352 Client State Indication which allows for a more streamlined mobile experiencing by allowing the XMPP server to suppress or reduce the number of updates sent to a client thereby reducing the number of stanzas sent to a mobile client that is inactive. This employment is contained within the processor +ClientStateIndication+ and is independent from the MobileV1, MobileV2, MobileV3 settings. However, this can be fine tuned by using mobile plugins from Tigase which can be used at the same time by adding the following line to the init.properties file: [source,properties] ----- sess-man/plugins-conf/urn\:xmpp\:csi\:0/logic=tigase.xmpp.impl.MobileV1 ----- Options are: === MobileV1 Keeps all presence stanzas in queue until client is active. === MobileV2 This setting delays delivery of presences while client is in inactive state, but only keeps the last presence for each full jid. *This is the default setting for CSI logic*. === MobileV3 Keeps the same presence logic as MobileV2, but also queues Message Carbons. *Currently not supported by CSI processor, will cause issues*. === Disabling CSI If you wish to not use the +ClientStateIndication+ processor, set the following in your init.properties file: [source,properties] ----- --sm-plugins=-urn:xmpp:csi:0 ----- === A note about Mobile Plugins Previously, you could enable Mobile optimization logic using +--sm-plugins=+Mobile_V1+. If you have used these in the past, it is recommended you change your system to use the CSI processor with the appropriate mobile processing logic. If you require v3 logic, or do not wish to use CSI, be sure to disable it using the above option. == Thread Pool Counts Session manager can control the number of available thread pools for each processor. By adding the following line to the init.properties file, the global thread pool can be increased by a specified factor: [source,properties] ----- sess-man/sm-threads-factor[I]=3 ----- In this case, the global thread pools is increased by a factor or 3. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_106_-_Components_-_L_-_Socks5.asciidoc ================================================ [[socks5]] = Socks 5 Component :author: Daniel Wisnewski :date: 2016-07-26 10:35 :version: v1.0 July 2016 Tigase SOCKS5 component allows for file transfers to be made over a SOCKS5 proxy in accordance with link:http://xmpp.org/extensions/xep-0065.html[XEP-0065 SOCKS5 Bytestreams]. This allows for some useful features such as: - transfer limits per user, domain, or global - recording transfers between users - quotas and credits system implementation == Installation Tigase SOCKS5 component comes built into the dist-max archives for Tigase XMPP server, and requires the component to be listed in init.properties file: [source,properties] ----- --comp-name-3=proxy --comp-class-3=tigase.socks5.Socks5ProxyComponent ----- You will also need to decide if you wish to use database-based features or not. If you wish to simply run the socks5 proxy without features such as quotas, limits add the following line: [source,properties] ----- proxy/verifier-class=tigase.socks5.verifiers.DummyVerifier ----- This will enable the SOCKS5 Proxy without any advanced features. If you wish to use those features, see the configuration section below. == Database Preparation In order to use the more advanced features of the SOCKS5 Proxy Component, your database needs to be prepared with the proper schema prior to running the server. You may either edit an existing database, or create a new database for specific use with the Proxy. === Edit Existing Database You can add the proper schema to your existing database using the DBSchemaLoader utility included with Tigase. The database folder contains the schema file for your type of database. First, backup your database before performing any actions and shut down Tigase XMPP Server. Then from the Tigase installation directory run the following command: [source,bash] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbType {derby,mysql,postgresql,sqlserver} - dbHostname {db address} -dbName {dbname} -rootUser root -rootPass root -file database/{dbtype}-socks5-schema.sql ----- You should see the following dialogue ----- LogLevel: CONFIG tigase.util.DBSchemaLoader CONFIG Properties: [{dbHostname=localhost, logLevel=CONFIG, dbType=derby, file=database/derby-socks5-schema.sql, rootUser=root, dbPass=tigase_pass, dbName=tigasedb, schemaVersion=7-1, rootPass=root, dbUser=tigase_user}] tigase.util.DBSchemaLoader validateDBConnection INFO Validating DBConnection, URI: jdbc:derby:tigasedb;create=true tigase.util.DBSchemaLoader validateDBConnection CONFIG DriverManager (available drivers): [[jTDS 1.3.1, org.apache.derby.jdbc.AutoloadedDriver@34a245ab, com.mysql.jdbc.Driver@3941a79c, org.postgresql.Driver@6e2c634b]] tigase.util.DBSchemaLoader validateDBConnection INFO Connection OK tigase.util.DBSchemaLoader validateDBExists INFO Validating whether DB Exists, URI: jdbc:derby:tigasedb;create=true tigase.util.DBSchemaLoader validateDBExists INFO Exists OK tigase.util.DBSchemaLoader loadSchemaFile INFO Loading schema from file: database/derby-socks5-schema.sql, URI: jdbc:derby:tigasedb;create=true tigase.util.DBSchemaLoader loadSchemaFile INFO completed OK tigase.util.DBSchemaLoader shutdownDerby INFO Validating DBConnection, URI: jdbc:derby:tigasedb;create=true tigase.util.DBSchemaLoader shutdownDerby WARNING Database 'tigasedb' shutdown. tigase.util.DBSchemaLoader printInfo INFO Database init.properties configuration: --user-db=derby --user-db-uri=jdbc:derby:tigasedb;create=true ----- One this process is complete, you may begin using SOCKS5 proxy component. === Create New Database If you want to create a new database for the proxy component and use it as a separate socks5 database, create the database using the appropriate schema file in the database folder. Once this is created, add the following line to your init.properties folder. [source,properties] ----- proxy/repo-url=driver:address ----- For example, a mysql database will have this type of URL: jdbc:mysql://localhost/SOCKS?user=root&password=root to replace {database URL}. For more options, check the database section of xref:databasePreperation[this documentation]. == Configuration === *+verifier-class+* [source,properties] ----- proxy/verifier-class= ----- Specifies the class used to verify transfer limits. The following options are available: ==== +LimitsVerifier+ - Class Name: +tigase.socks5.verifiers.LimitsVerifier+ Uses the database to store limits and record the amount of data transferred VIA the proxy. It accepts one parameter, +transfer-update-quantization+ which is used to create a value to check if the value of transferred bytes should be updated in the database or not. By default, this value is 1MB. NOTE: Low values can slow down file transfers, while high values can allow for users to exceed quotas. ==== +DummyVerifier+ - Class Name: tigase.socks5.verifiers.DummyVerifier This accepts file transfers VIA SOCKS5 proxy from any user and does not check limitations against the database. === *+socks5-repo-cls+* [source,properties] ----- proxy/socks5-repo-cls= ----- Specifies implementation of repository used to store usage statistics. Two options are available for this setting: - tigase.socks5.verirepository.JDBCSocks5Repository - Uses the database implementation. - tigase.socks5.repository.DummySocks5Repository - ignores data storage, and is the default implementation. === *+repo-url+* [source,properties] ----- proxy/repo-url= ----- The database connection URL for the socks5 repository. === *+verifier-params+* [source,properties] ----- proxy/repo-params= ----- Comma separated parameters for +LimitsVerifier+ which will override the defaults. All of these limits are on a per calendar month basis. For example, a user is limited to 10MB for all transfers. If he transfers 8MB between the 1st and the 22nd, he only has 2MB left in his limit. On the 1st of the following month, his limit is reset to 10MB. Available parameters: - +global-limit+ - Transfer limit for all domains in MB per month. - +instance-limit+ - Transfer limit for server instance in MB per month. - +default-domain-limit+ - The Default transfer limit per domain in MB per month. - +default-user-limit+ - The default transfer limit per user in MB per month. - +default-file-limit+ - The default transfer limit per file in MB per month. === *+remote-addresses+* [source,properties] ----- proxy/remote-addresses= ----- A comma separated list of IP addresses that will be accessible VIA the Socks5 Proxy. This can be useful if you want to specify a specific router address to allow external traffic to transfer files using the proxy to users on an internal network. == Database usage for specific settings The above configuration allows for global settings, however you may also define specifics for users and the scopes of those limitations by editing the database information directly. The +user_id+ field denotes the scope of the limitation. . Using a +domain_name+ defines limits for all users whose JIDs are within that domain. . Using a +JID+ of a user defines limit for this exact user. If the value set is larger than 0, that is the specific limit. If value is equal to 0 the limit is not overridden and the global limit is used. If value equals -1 proxy will forbid any transfer for this user. It there is no value for user in this table, a new row will be created during first transfer and limits for domain or global limits will be used. Socks5 database is setup in this manner: [width="100%",frame="topbot",options="header"] |================================= |uid |user_id |sha1_user_id |domain |sha1_domain |filesize_limit |transfer_limit_per_user |transfer_limit_per_domain |1 |user@domain.com |c35f2956d804e01ef2dec392ef3adae36289123f |domain.com |e1000db219f3268b0f02735342fe8005fd5a257a |0 |3000 |0 |2 |domain.com |e1000db219f3268b0f02735342fe8005fd5a257a |domain.com |e1000db219f3268b0f02735342fe8005fd5a257a |500 |0 |0 |================================= This example table shows that user@domain.com is limited to 3000MB per transfer whereas all users of domain.com are limited to a max file size of 500MB. This table will populate as users transfer files using the SOCKS5 proxy, once it begins population, you may edit it as necessary. A second database is setup tig_socks5_connections that records the connections and transmissions being made, however it does not need to be edited. == Example init.properties block Combined, your init.properties should look like the below excerpt to run socks5 transfers using a separate database. [source,properties] ----- proxy/repo-url=jdbc:mysql://localhost/SOCKS?user=root&password=root proxy/verifier-class=tigase.socks5.verifiers.LimitsVerifier proxy/socks5-repo-cls=tigase.socks5.verirepository.JDBCSocks5Repository ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_10_-_Configuration_-_A_-_Tigase_XMPP_Server_init.properties_Configuration.asciidoc ================================================ [[initPropertiesGuide]] = Tigase XMPP Server init.properties Configuration :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2013-02-09 03:54 :revision: v2.1 :toc: :numbered: :website: http://tigase.net init.properties is a slightly extended version of the Java properties file with (key, value) pairs. Comment lines will have as it's first non-white space ASCII character either '#' or '!'. The key starts with first non-white space ASCII character and ends on either first white space ASCII character or either of '=' or ':'. Therefore if your key contains any of '=', ':' or white space characters you have to escape them with backslash \'\': \: or \=. All examples below specify 'vhosts' as a key and 'test-a, test-b, test-c' as a value: [source,bash] ----- vhosts=test-a, test-b, test-c vhosts : test-a, test-b, test-c vhosts = test-a, test-b, test-c ----- Possible types are: - *[S]* (or nothing) - Characters string: 'abcdef' - *[s]* - String array: 'abcdef, ghaijk, lmnopq' - *[B]* - Boolean: 'true' or 'false' - *[b]* - Boolean array: 'true, true, false' - *[L]* - Long number: 1234567890 - *[l]* - Long array: '12334, 45435, 45645' - *[I]* - Integer number: 123456 - *[i]* - Integer array: '123, 456, 678' There are lots of parameters which have broader meaning than just one property. Some of them affect many configuration settings or can generate whole sections in the XML file. Most of them starts with \'--' double hyphen. Please note, each property put in the init.properties file starting with \'--' becomes a JVM system property (without \'--' at the beginning). //example init.properties goes here Reference the property guide for a description of properties. *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#admins[--admins] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#authDb[--auth-db] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#authDbUri[--auth-db-uri] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#authDomainRepoPool[--auth-domain-repo-pool] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#authRepoPool[--auth-repo-pool] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#authRepoPoolSize[--auth-repo-pool-size] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#bindExtHostnames[--bind-ext-hostnames] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#boshCloseConnection[--bosh-close-connection] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#boshExtraHeadersFile[--bosh-extra-headers-file] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#clConnRepoClass[--cl-conn-repo-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#clientAccessPolicyFile[--client-access-policy-file] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#clusterConnectAll[--cluster-connect-all] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#clusterMode[--cluster-mode] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#clusterNodes[--cluster-nodes] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#cmHtTrafficThrottling[--cm-ht-traffic-throttling] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#cmSeeOtherHost[--cm-see-other-host] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#cmTrafficThrottling[--cm-traffic-throttling] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#cmpnamePorts[--cmpname-ports] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#compClass[--comp-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#compName[--comp-name] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#crossDomainPolicyFile[--cross-domain-policy-file] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#dataRepoPoolSize[--data-repo-pool-size] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#debug[--debug] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#debugPackages[--debug-packages] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#domainFilterPolicy[--domain-filter-policy] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#elementsNumberLimit[--elements-number-limit] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#extComp[--ext-comp] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#extcompRepoClass[--extcomp-repo-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#external[--external] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#hardenedMode[--hardened-mode] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#maxQueueSize[--max-queue-size] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#monitoring[--monitoring] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#netBuffHighThroughput[--net-buff-high-throughput] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#netBuffStandard[--net-buff-standard] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#newConnectionsThrottling[--new-connections-throttling] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#nonpriorityQueue[--nonpriority-queue] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#queueImplementation[--queue-implementation] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#rosterImplementation[--roster-implementation] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#s2sEjabberdBugWorkaroundActive[--s2s-ejabberd-bug-workaround-active] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#s2sSecret[--s2s-secret] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#s2sSkipTlsHostnames[--s2s-skip-tls-hostnames] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#scriptDir[--script-dir] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#smClusterStrategyClass[--sm-cluster-strategy-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#smPlugins[--sm-plugins] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#smThreadsPool[--sm-threads-pool] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#sslCertsLocation[--ssl-certs-location] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#sslContainerClass[--ssl-container-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#sslDefCertDomain[--ssl-def-cert-domain] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#statsHistory[--stats-history] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#stringprepProcessor[--stringprep-processor] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#test[--test] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#tigaseConfigRepoClass[--tigase-config-repo-class] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#tigaseConfigRepoUri[--tigase-config-repo-uri] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#tlsJdkNssBugWorkaroundActive[--tls-jdk-nss-bug-workaround-active] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#trusted[--trusted] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#userDb[--user-db] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#userDbUri[--user-db-uri] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#userDomainRepoPool[--user-domain-repo-pool] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#userRepoPool[--user-repo-pool] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#userRepoPoolSize[--user-repo-pool-size] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostAnonymousEnabled[--vhost-anonymous-enabled] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostMaxUsers[--vhost-max-users] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostMessageForwardJid[--vhost-message-forward-jid] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostPresenceForwardJid[--vhost-presence-forward-jid] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostRegisterEnabled[--vhost-register-enabled] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#vhostTlsRequired[--vhost-tls-required] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#virtHosts[--virt-hosts] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#watchdogDelay[--watchdog_delay] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#watchdogPingType[--watchdog_ping_type] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#watchdogTimeout[--watchdog_timeout] *Property name:* link:http://docs.tigase.org/tigase-server/snapshot/Properties_Guide/html/#configType[config-type] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_11_-_Configuration_-_B_-_Startup_Files_tigase.sh_and_tigase.asciidoc ================================================ [[manualconfig]] = Startup File for tigase.sh - tigase.conf :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Property file names for +tigase.sh+ startup script is a second parameter for the startup script. It can be skipped if environmental variables are set in different location or in different way. Config file for startup script simply sets number of environment variables with the location of required components. Possible variables to set in this file are: - *JAVA_HOME* - location of Java installation home directory. *Must be set*. - *TIGASE_HOME* - location of Tigase installation home directory. _By default script try to find this location by searching directories from the location where the script has been run._ - *TIGASE_CONSOLE_LOG* - file to which all console messages will be redirected if server is run in background. By default it will be: _TIGASE_HOME/logs/tigase-console.log_. *_If this file/directory is not writable by Tigase process all console messages will be redirected to /dev/null_* - *TIGASE_PID* location of the file with server PID number. By default it will be _TIGASE_HOME/logs/tigase.pid_. - *JAVA_OPTIONS* - options for JVM like size of RAM allocated for the JVM, properties and so on. - *TIGASE_OPTIONS* - additional options for Tigase server program. You can tweak initial parameters for your environment here. Sample file to run *Tigase* with *PostgreSQL* database may look like: [source,bash] ----- ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " CLASSPATH="" TIGASE_CONFIG="tigase-pgsql.xml" TIGASE_OPTIONS=" --property-file etc/init.properties " ----- Please note encoding settings. JVM by default uses encoding set in operating system environment. XMPP protocol, however uses +UTF-8+ for all data processing. So the ENC settings enforces +UTF-8+ encoding for all operations. Another significant setting is \'*CLASSPATH*'. It is intentionally set to an empty string. The *tigase.sh* startup script builds the *CLASSPATH* on it's own from files found in *jars/* and *libs/* directories. It is advised to set the *CLASSPATH* to the empty string because the Tigase server scans all available classes to find all components and plugins implementation. If the *CLASSPATH* contains lots of libraries which are not used anyway it can cause a long startup time and high system loads. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_12_-_Configuration_-_C_-_Linux_Settings_for_High_Load_Systems.asciidoc ================================================ [[linuxhighload]] = Linux Settings for High Load Systems :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net There are a few basic settings you have to adjust for high load systems to make sure the server has enough resources to handle a big number of network connections. The main parameter is a maximum number of opened files allowed for the process to keep at the same time. Each network connection uses a file handler, therefore if the limit is too low you can quickly run out of handlers and the server can not accept any more connections. This limit is set on 2 levels - on the kernel level (*fs.file-max*) and on the system level (*nofile*). Another kernel property which can be important in certain configurations (like transports installations or when you use proxy for Bosh connections) is: *net.ipv4.ip_local_port_range*. This parameter can be set the same way as the +fs.file-max+ property. == fs.file-max The *fs.file-max* kernel property is set via sysctl command. You can see current settings by executing the command: [source,sh] ----- # sysctl fs.file-max fs.file-max = 358920 ----- If you plan to run high load service with large number of server connections, then this parameter should be at least as twice big as the number of network connections you expect to support. You can change this setting by executing the command: [source,java] ----- # sysctl -w fs.file-max=360000 fs.file-max = 360000 ----- == net.ipv4.ip_local_port_range You can see current settings by executing the command: [source,sh] ----- # sysctl net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range = 32768 61000 ----- You can change this setting by executing the command: [source,sh] ----- # sysctl -w net.ipv4.ip_local_port_range="1024 65000" net.ipv4.ip_local_port_range = 1024 65000 ----- == TCP_keepalive According to link:http://blog.kolargol.eu/2006/06/tcpkeepalive.html[blog.kolargol.eu] or link:http://www.gnugk.org/keepalive.html[www.gnugk.org/] some keepalive settings should be changed to improve reliability. [source,sh] ----- # sysctl -w net.ipv4.tcp_keepalive_time="60" net.ipv4.tcp_keepalive_time = 60 # sysctl -w net.ipv4.tcp_keepalive_probes="3" net.ipv4.tcp_keepalive_probes = 3 # sysctl -w net.ipv4.tcp_keepalive_intvl="90" net.ipv4.tcp_keepalive_intvl = 90 ----- == /etc/sysctl.conf The above commands let the system remember new settings until the next system restart. If you want to make the change permanent you have to edit the file: */etc/sysctl.conf* and add the property at the end of the file: [source,sh] ----- fs.file-max=360000 net.ipv4.ip_local_port_range=1024 65000net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3 net.ipv4.tcp_keepalive_intvl=90 ----- It will be automatically loaded next time you start the server. Command: [source,sh] ----- # sysctl -p ----- Causes the +/etc/systcl.conf+ to be reloaded which is useful when you have added more parameters to the file and don't want to restart the server. == nofile This is the property used by the system limits. For example running the command +ulimit -a+ shows you all limits set for the current user: [source,sh] ----- # ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 38912 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 40960 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 38912 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ----- To make it even more interesting and more complex, there are 2 types of system limits: *soft limit* which can be temporarily exceeded by the user and *hard limit* which can not be exceeded. To see your *hard limit* execute command: [source,sh] ----- # ulimit -a -H core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 38912 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 40960 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) unlimited cpu time (seconds, -t) unlimited max user processes (-u) 38912 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ----- The hard limits are usually bigger then the soft limits or sometimes the same. For us the most important parameter is: *open files*. You can change the property in file: +/etc/security/limits.conf+. You have to append 2 following lines to the end of the file: [source,sh] ----- jabber soft nofile 350000 jabber hard nofile 350000 ----- Where the *jabber* is the user name of the account running you IM service. You can also set the limits for all users on the machine in a following way: [source,sh] ----- * soft nofile 350000 * hard nofile 350000 ----- For those changes to make an effect you have to logout from the modified account and login again. New limits should be applied. == su and init script If one intends to use init scripts for startup purposes (or simply wants to be able to start the server utilizing su command) it's necessary to adjust PAM configuration by modifying /etc/pam.d/su file and uncomment following line: [source,sh] ----- session required pam_limits.so ----- Afterwards the init scripts will respect configured limits. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_13_-_Configuration_-_D_-_Configuration_Storage_Options.asciidoc ================================================ [[confChanges5x]] = Configuration Storage Options in Tigase :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-01-06 20:22 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The whole configuration framework for the Tigase server has been redesigned and rewritten for v5.1. This was done to cleanup all the configuration code and logic as well as extend the current functionality to allow for configuration storage in different kinds of repositories - memory, file, database, ... Although this article is titled configuration changes, version 5.x still follows our policy about backward compatibility. So the changes could be considered extensions rather than complete overhauls. There is however one change which can affect a few users. Those who use the server and worked with it's configuration remember the mess and confusion related to duality in the server configuration - the +init.properties+ file and +tigase.xml+ file. This is now over. == Default Behavior By default Tigase server loads tigase.conf.ConfigurationCache class which stores the whole configuration in memory. Please note that the +init.properties+ file with initial settings is always loaded if it is available at the given location and all settings in this file work exactly as before. For more details, please refer to the online documentation. A couple of times 'initial configuration' and 'whole configuration' were mentioned. What is this about, what is the difference? The 'initial configuration' are startup settings provided by the user in the +init.properties+ file. Most of the server elements use far more configuration parameters which are set to sensible default values if they are not provided by the user. The configuration framework in Tigase server always keeps the complete configuration of all active elements. This is implemented in such a way to make it possible to present currently used settings to the end-users or administrators and allow them to change the server parameters during runtime. == Storing Configuration in SQL Database There is one more configuration storage implemented right now. It allows you to store the server settings in the SQL database. In most cases this is not quite useful, just opposite, very inconvenient. However. there is at least one case where you really want to keep the server configuration in the SQL database. This is in the cluster mode. If you have a Tigase cluster system of 10 or more nodes it is much easier to keep the configuration in a single central location and manage it from there, rather then go to every single machine every time you want to change some settings. You can even change any settings for all cluster nodes with a single database query. You set the SQL storage the same way as you set it for XML file. However, there is one more parameter as you have to provide also database connection string for the server so it knows where to connect to for the settings: . Parameters in init.properties file: + [source,bash] ----- --tigase-config-repo-class=tigase.conf.ConfigSQLRepository --tigase-config-repo-uri=connection-uri ----- . Alternatively you can provide system properties to the JVM: + [source,bash] ----- -Dtigase-config-repo-class=tigase.conf.ConfigSQLRepository -Dtigase-config-repo-uri=connection-uri ----- Please note, the current implementation for the SQL storage automatically creates the tables necessary to operate if it does not exist. So you don't have to worry about the schema, but you should make sure that the database user used by the Tigase has permissions to create a table. Configuration is stored in table with following schema: [source,sql] ----- create table tigase_configuration ( -- The component name by which the configuration parameter -- is used. component_name varchar(127) NOT NULL, -- The configuration property key name or identifier. key_name varchar(127) NOT NULL, -- The configuration property value value varchar(8191) NOT NULL, -- The cluster node by which the configuration property is read, -- if empty it will be read by all cluster nodes. cluster_node varchar(255) NOT NULL DEFAULT '', -- Additional, secondary identifier for the configuration property. -- The configuration can be organized in a hierarchical way to allow -- multiple occurrences of the same property name for a single -- component, for example you can have the same property for -- different tcp/ip ports set to a different value: -- c2s/5222/port_type=plain -- c2s/5223/port_type=ssl -- the port number is a secondary identifier. key_node varchar(127) NOT NULL DEFAULT '', -- Not currently used. In future it will be used to distinguish between -- different kind of properties (initial settings, defaults, updated by -- user, etc...) flag varchar(32) NOT NULL DEFAULT 'DEFAULT', -- The system detects basic Java types and stores information about -- the property type, when the property is read the original property -- type is restored and provided to the component without need for -- a parsing or conversion. value_type varchar(8) NOT NULL DEFAULT 'S', -- It is not currently used. In the future it will be used to reload -- settings changed in last, defined period of time. Basically, the -- system can automatically check the configuration database to -- see whether some properties have been updated, then reload -- them and apply automatically. last_update timestamp, primary key(cluster_node, component_name, key_node, key_node, flag)); ----- == Reverting To the Old Behavior While using the +tigase.xml+ file is still possible and the old behavior can be preserved, it is now disabled by default. By default the Tigase server reads only +init.properties+ file with initial settings and stores all the complete configuration in memory only. The +init.properties+ works exactly as before and all old parameters are still working exactly as before. The only difference is the lack of the tigase.xml which is not created or read by default if it is present. The main advantage is that you don't have to remove it each time you change something in the +init.properties+ to pick up new settings. Firstly we will go into how to re-enable the server to check and use the +tigase.xml+ file to retain functionality with older settings. This is actually very simple to accomplish. The Tigase server now, offers pluggable repository support. This means that you can easily extend current functionality with a different configuration storage by writing own class which reads and writes configuration parameters. By default class +tigase.conf.ConfigurationCache+ is loaded which stores configuration in memory only. Please note, the +init.properties+ file is always read if it exists at a given location. To revert to the old behavior you just need to pass a parameter to Tigase server with a class name which is responsible for keeping server parameters in the old XML file. You can do it in two ways: . Add a parameter to init.properties file: + [source,bash] ----- --tigase-config-repo-class=tigase.conf.ConfigXMLRepository ----- . Or you can pass a system property to the JVM at the startup time: + [source,bash] ----- -Dtigase-config-repo-class=tigase.conf.ConfigXMLRepository ----- == Going Further As the configuration mechanism in the Tigase server offers pluggable storage engines, you can easily write your own engine by implementing the interface: +tigase.conf.ConfigRepositoryIfc+ or by extending one of current implementations. The whole configuration framework is pluggable and you can replace it completely if it does not suit you well enough. Your implementation has to extend +tigase.conf.ConfiguratorAbstract+ class and can be set using JVM system property (as this is configuration framework you can't do this via any configuration system): [source,sh] ----- -Dtigase-configurator=tigase.conf.Configurator ----- The example above shows the parameter set to the default configuration framework. == Message Router Implementation is Configurable Too The Message router component was the only component which was fixed to the Tigase instance. In theory it could always have been replaced but in practice there was no way of doing it as that was the first element loaded at startup. Now Tigase message router implementation can be easily replaced to and it can be made a configurable option if needed. At the server startup time the code creates configurator and calls method: +getMessageRouterClassName()+ which by default returns class: +tigase.server.MessageRouter+. You can extend the configurator and provide any different class name instead which implements required interfaces. You can even make it configureable as it is no longer tied to the server instance. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_13_-_Configuration_-_E_-_JVM_settings.asciidoc ================================================ [[jvm_settings]] = JVM settings and recommendations :author: Daniel Wisnewski :version: v1.0, June 2016. :date: 2016-06-02 :toc: :numbered: :website: http://tigase.net Tigase configuration file `tigase.conf` (described in more detail in <>) mentioned a couple of environmental variables which are related to the operation of the JVM. In this guide we would like to expound on those configuration options and provide hints for the optimal settings. Settings included in the `etc/tigase.conf` are as follows: [source, bash] ---- #GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly" #EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc " #PRODUCTION_HEAP_SETTINGS=" -Xms5G -Xmx5G " # heap memory settings must be adjusted on per deployment-base! JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP} -XX:MaxDirectMemorySize=128m " ---- And while this file utilizes bash variables, JVM configuration options can be used in the same manner on all operating systems. The guide will consists of two main parts - memory settings and Garbage Collector tweaks descriptions and hints. We recommend using `-server` JVM parameter in all cases. == Heap Sizing For the non-production deployments (development or stating environments) we recommend using default memory settings of the JVM (which depends on the underlaying operating system), which result i automatic memory allocation and, by the rule of thumb - are the safest in such environments. For the production environments we recommend a fixed size HEAP - both initial and maximum size, which can be set with (respectively)`-Xms` and `-Xmx` JVM flags - ideally to the same value (which should be roughtly 95% of the available memory, if Tigase will be the only service on the machine) to avoid allocation and deallocation. For convenience it's possible to uncomment line with `PRODUCTION_HEAP_SETTINGS` and adjust parameters accordingly. == GC settings Let's start with stating that there is no "one to rule them all" - each deployment and use-case is different, however we will try to give a couple of pointers and recommendations proceed with short introduction to GC itself. XMPP is quite specific in terms of memory allocation - short-lived objects (various types of stanzas) usually exceed number of long-lived objects (user connections and related data). This is important bit of information in the context of how usually JVM HEAP is organised and how Garbage Collector works. On the most basic level Heap is separated into couple of regions: === Generations * *Young Generation*, which is further divided in to: ** *Eden* - the region when the objects are usually allocated when they are created; ** *Survivor Spaces* - (_to_ and _from_ - one of which is always empty) - responsible for storing all live object remaining after collecting *Young Generation* (process is repeated several times until objects are finally considered _old enough_); * *Old Generation* - (_Tenured Space_) - responsible for live objects remaining after running GC on *Survivor Spaces* - those would be _long-lived_ objects (usually user connections and associated data); === Minor, Major and Full GC - optimizing General thinking suggests that: * *Minor GC* cleans Young generation; * *Major GC* cleans Tenured space; * *Full GC* cleans all heap. However, while we can certainly state that Minor GC cleans Young generation it's a bit more difficult to differentiate Major and Full GC, especially considering that Major GC can be quite often triggered by Minor GC and some garbage collectors can perform cleaning concurrently. Instead of focusing of distinguishing phases one should pay closer attention to actual operations of Garbage Collector itself - uncommenting the line `GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc "` in `etc/tigase.conf` (or adding same properties to the java commandline) and subsequently analyzing the results should prove more helpful. In addition monitoring GC operation using for example VisualVM (with VisualGC plugin) will also be helpful. === Settings for XMPP Ideally we should limit both number of GC pauses as well as their duration. After running rather tests following conclusions were made: * Garbage Collection is the faster the more dead objects occupies given space, therefore on high-traffic installation it’s better to have rather large YoungGen resulting in lower promotion of the objects to the OldGen; * with JVM8 default sizing of Young / Old generation changed, even tho NewRatio is still defaulting to “2” - setting it explicitly to "2" brought back previous sizing; * Concurrent Mark and Sweep (CMS) enabled (applies to Tenured space only) with explicit configuration of NewRatio set to default value of 2 (i.e. `-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2`) in general behaves best; * For small installations (few core CPU, less memory) with low traffic default Parallel collector may be a better solution; * Using Heap size adjusted to the actual usage is better as the larger the heap the larger are spaces over which collection needs to be performed thus resulting in longer pauses; in case of huge heaps G1 collector may be better solution to avoid longer pauses; Considering all of the above using following options should be a good starting point toward further optimizing of Garbage Collection: `GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"` === GC settings worth considering In addition to the general recommendation to use CMS collector, following options (or changes to the options) may be worth considering: * `-XX:NewRatio=2` - defines the ratio between the young and tenured generation is 1:2. In other words, the combined size of the eden and survivor spaces will be one-third of the total heap size. The parameters NewSize and MaxNewSize bound the young generation size from below and above. Setting these to the same value fixes the young generation, just as setting -Xms and -Xmx to the same value fixes the total heap size. * `-XX:CMSInitiatingOccupancyFraction=percent` - sets the percentage of the old generation occupancy (0 to 100) at which to start a CMS collection cycle. * `-XX:+UseCMSInitiatingOccupancyOnly` - instructs the JVM not to base its decision when to start a CMS cycle on run time statistics but instead it uses the value of CMSInitiatingOccupancyFraction for every CMS cycle. * `-XX:ParallelGCThreads=x` - sets the number of threads used for parallel garbage collection in the young and old generations. The default value depends on the number of CPUs available to the JVM. If the Tigase JMV is the only one running on the installation default value is recommended. * `-XX:ConcGCThreads=x` - sets the number of threads used for concurrent GC. The default value depends on the number of CPUs available to the JVM. If the Tigase JMV is the only one running on the installation default value is recommended. * `-XX:+UseBiasedLocking` and `-XX:+DoEscapeAnalysis` - designed to eliminate locking overhead, however their effect on performance is unpredictable therefore testing is required; reduced locking should improve concurrency and, on current multi-core hardware, improve throughput. * `-XX:+OptimizeStringConcat` - enables the optimization of String concatenation operations. This option is enabled by default. * `-XX:+UseNUMA` - enables performance optimization of an application on a machine with nonuniform memory architecture (NUMA - most modern computers are based on NUMA architecture) by increasing the application's use of lower latency memory. By default, this option is disabled and no optimization for NUMA is made. The option is only available when the parallel garbage collector is used (-XX:+UseParallelGC). * `-XX:-UseCompressedOops` -- disables the use of compressed pointers. By default, this option is enabled, and compressed pointers are used when Java heap sizes are less than 32 GB. When this option is enabled, object references are represented as 32-bit offsets instead of 64-bit pointers, which typically increases performance when running the application with Java heap sizes less than 32 GB. This option works only for 64-bit JVMs. == What to use with Machine x, y, z? === Server class machine (non-VM), > 16GB, >= 8 core CPU For such setup enabling CMS garbage collector is recommended. Depending on the traffic usage and particular use-case adjusting NewRatio may be needed. Adjusting Xms and Xms sizes for actual available memory is needed (or better yet, for the actual traffic!). Following should be used: [source, bash] ---- GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly" EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc " PRODUCTION_HEAP_SETTINGS=" -Xms15G -Xmx15G " # heap memory settings must be adjusted on per deployment-base! JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP} -XX:MaxDirectMemorySize=128m " ---- For installation with lot of available memory and intention to utilize it all, using G1GC collector may be a better idea : [source, bash] ---- GC="-XX:+UseG1GC -XX:ConcGCThreads=4 -XX:G1HeapRegionSize=2 -XX:InitiatingHeapOccupancyPercent=35 -XX:MaxGCPauseMillis=100" EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc " PRODUCTION_HEAP_SETTINGS=" -Xms60G -Xmx60G " # heap memory settings must be adjusted on per deployment-base! JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP} -XX:MaxDirectMemorySize=128m " ---- === VM machine, 8GB of RAM, 4 core CPU equivalent For such setup enabling CMS garbage collector is also recommended. Depending on the traffic usage and particular use-case adjusting NewRatio may be needed (and configuring NewRatio is a must!). Adjusting Xms and Xms sizes for actual available memory is needed (or better yet, for the actual traffic!). Following should be used: [source, bash] ---- GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly" EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc " PRODUCTION_HEAP_SETTINGS=" -Xms7G -Xmx7G " # heap memory settings must be adjusted on per deployment-base! JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP} -XX:MaxDirectMemorySize=128m " ---- === VM machine with 4GB or less of RAM, and less than 4 core CPU equivalent Small installations with limited resources could operate better with default (for JVM versions up to 8, which is the most current at the moment of the writing). Again - depending on the traffic usage and particular use-case adjusting NewRatio may be needed. Adjusting Xms and Xms sizes for actual available memory is recommended (or better yet, for the actual traffic!). Following should be used (i.e. `GC` line should be commented so the defaults will be used): [source, bash] ---- #GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly" EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA" #GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc " PRODUCTION_HEAP_SETTINGS=" -Xms3G -Xmx3G " # heap memory settings must be adjusted on per deployment-base! JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP} -XX:MaxDirectMemorySize=128m " ---- == Additional resources * https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html[Sizing the Generations] * http://www.c0t0d0s0.org/archives/6617-About-Java,-parallel-garbage-collection-and-processor-sets.html[About Java, parallel garbage collection and processor sets] * http://hiroshiyamauchi.blogspot.cl/2009/12/gc-threads.html[GC Threads] * https://github.com/chewiebug/GCViewer#readme[GCViewer readme] * http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html[Java HotSpot™ Virtual Machine Performance Enhancements] * https://plumbr.eu/java-garbage-collection-handbook[Java Garbage Collection handbook] * Useful JVM Flags ** https://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-1-jvm-types-and-compiler-modes/[Part 1 - JVM Types and Compiler Modes] ** https://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-2-flag-categories-and-jit-compiler-diagnostics/[Part 2 - Flag Categories and JIT Compiler Diagnostics)] ** https://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-3-printing-all-xx-flags-and-their-values/[Part 3 - Printing all XX Flags and their Values] ** https://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-4-heap-tuning/[Part 4 - Heap Tuning] ** https://blog.codecentric.de/en/2012/08/useful-jvm-flags-part-5-young-generation-garbage-collection/[Part 5 - Young Generation Garbage Collection] ** https://blog.codecentric.de/en/2013/01/useful-jvm-flags-part-6-throughput-collector/[Part 6 - Throughput Collector] ** https://blog.codecentric.de/en/2013/10/useful-jvm-flags-part-7-cms-collector/[Part 7 - CMS Collector] ** https://blog.codecentric.de/en/2014/01/useful-jvm-flags-part-8-gc-logging/[Part 8 - GC Logging] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_14_-_Security.asciidoc ================================================ = Security :author: Daniel Wisnewski :version: v1.0 October, 2015 :date: 2015-05-10 13:31 The articles here cover advanced security features built into to Tigase Server, and some options for adding your own levels of security. [[blockingCommand]] == XEP-0191 Support The simplest security feature, however, inside an XMPP server is the ability to block users and JIDS. link:http://xmpp.org/extensions/xep-0191[XEP-0191] specifies the parameters of simple blocking without using privacy lists. Below is a breakdown and some sample commands you may find helpful. To enable this feature, be sure the following is in your init.properties file: ---- --sm-plugins +urn:xmpp:blocking ---- If you have other plugins running, then just add ++urn:blocking+ to the list to activate this feature. To confirm if your installation of Tigase supports this feature, a quick disco#info of your server should reveal the following feature: ----- ----- Blocked users are stored on the server on a per-JID basis, so one user may only see his or her blocked JIDs. Lists of blocked JIDs will return as an IQ stanza with a list of fields. To retrieve the blocklist, the following command is issued: [source,xml] ----- ----- The server responds: [source,xml] ----- ----- To block a JID, a similar stanza to the one above is sent to the server with the items of the blocked JIDs you wish to add: [source,xml] ----- ----- The server will then push an unavailable presence to blocked contacts. Communication between a contact that is blocked, and an entity that blocked it will result in a error: [source,xml] ----- Hello, are you online? ----- Unblocking a contact is just as easy as blocking, send an unblock stanza to the server: [source,xml] ----- ----- The server will begin pushing presence information to unblocked contacts and resources so long as permissions have not changed between. You may also opt to unblock all contacts and essentially clear out your blocked list using the following command: [source,xml] ----- ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_15_-_Security_-_A_-_Server_Certificates.asciidoc ================================================ [[ServerCertificates]] = Server Certificates :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net - xref:certspem[Creating and Loading the Server Certificate in pem Files] - xref:startcomCertificate[Installing StartCom Certificate in Your Linux System] //- xref:keytoolKeystore[Server Certificate Using Keytool and Keystore] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_16_-_Security_-_A_-_Server_Certificates_-_1_-_Creating_and_Loading_the_Server_Certificate_in_PEM_Files.asciidoc ================================================ [[certspem]] = Creating and Loading the Server Certificate in pem Files :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :Revision: v2.1 :toc: :numbered: :website: http://tigase.net == Server Certificates Server certificates are needed when you use secure socket connections - SSL/TLS. For secure socket connection a proper certificate is needed. You can either generate your own self-signed certificate or obtain certificate from trusted third party organization. Here are steps how to obtain certificate from a trusted organization. === Generating your Own Certificates Self-signed certificates can be generated easily on a Linux system. Although it may not be considered a 'trusted' certificate authority, it can be useful to test server installations. *We do not recommend regular use of self-signed certificates*. Note that Tigase v5.0 and later can automatically create self signed PEM files if needed. However we will cover doing this process by hand. This tutorial assumes you are running a Linux-based operating system with access to command shell, and the 'Openssl' package is installed on the system. The process takes the following steps: + 1. Create a local private key. This file ends with .key extension. It is recommended to create a new private key for the process. + 2. Generate a certificate request. This file ends with the .csr extension and is the file sent to the Certificate Authority to be signed. + 3. CA signs private key. This can be done by your own computer, but can also be done by private CAs for a fee. + 4. Results are obtained from the CA. This is a .crt file which contains a separate public certificate. + 5. Combine the .csr and .crt file into a unified .pem file. Tigase requires keys to be non-password protected PEM files. + .Generate local private key [source,sh] ----- openssl genrsa -out[domain.com.key] 1024 ----- This command generates a private key using a 1024 bit RSA algorithm. -out designates the name of the file, in this case it will be *domain.com.key*. The exact name is not important, and the file will be created in whatever directory you are currently in. .Generate a certificate request: [source,sh] ----- openssl req -nodes -key domain.com.key -out domain.com.csr ----- This command generates a certificate request using the file specified after -key, and the result file will be domain.com.csr. You will be asked a series of questions to generate the request. [source,sh] ----- Country Name (2 letter code) [AU]:AU State or Province Name (full name) [Some-State]:Somestate Locality Name (eg, city) []:Your city name Organization Name (eg, company) [Internet Widgits Pty Ltd]:Company name Organizational Unit Name (eg, section) []:Department or any unit Common Name (eg, YOUR name) []:*.yourdomain.com Email Address []:your_email_address@somedomain.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: ----- .Sign the Certificate Request: Now the .csr file will be signed by a Certificate Authority. In this tutorial, we will be self-signging our certificate. This practice however is generally not recommended, and you will receive notifications that your certificate is not trusted. There are commercial offers from companies to sign your certificate from trusted sources. Please see the xref:OtherSources[Certificate From Other Providers] section for more information. [source,bash] ----- openssl x509 -req -days 365 -in domain.com.csr -signkey domain.com.key -out domain.com.crt ----- This command signs the certificate for 365 days and generates the domain.com.crt file. You can, of course use any number of days you like. .Generate PEM file You should now have the following files in the working directory: ..\ domain.com.key domain.com.csr domain.com.crt [source,sh] ----- cat yourdomain.com.crt yourdomain.com.key > yourdomain.com.pem ----- If the certificate is issued by third-party authority you will have to attach the certificate chain, that being certificate of the authority who has generated your certificate. You normally need to obtain certificates for your chain from the authority who has generated your certificate. For example, if you have a certificate from XMPP federation you need to download link:http://www.startssl.com/certs/ca.pem[StartCom root certificate] *and* link:http://www.startssl.com/certs/sub.class1.server.ca.pem[intermediate ICA certificate]. In such cases the pem file is created using following command: [source,sh] ----- cat yourdomain.com.crt yourdomain.com.key sub.class1.xmpp.ca.crt ca.crt > yourdomain.com.pem ----- The result file should looks similar to: [source,sh] ------ -----BEGIN CERTIFICATE----- MIIG/TCCBeWgAwIBAgIDAOwZMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ . . . pSLqw/PmSLSmUNIr8yQnhy4= -----END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- WW91J3JlIGtpZGRpbmchISEKSSBkb24ndCBzaG93IHlvdSBvdXIgcHJpdmF0ZSBr . . . ZXkhISEhCkNyZWF0ZSB5b3VyIG93biA7KSA7KSA7KQo= -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE----- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW . . . xV/stleh -----END CERTIFICATE----- ------ For Tigase server as well as many other servers (Apache 2.x), the order is following; your domain certificate, your private key, authority issuing your certificate, root certificate. *Note! Tigase requires full certificate chain in PEM file (described above)! Different applications may require pem file with certificates and private key in different order. So the same file may not be necessarily used by other services like Web server or e-mail server. Currently, Tigase can automatically sort certificates in PEM file while loading it.* == Installing/Loading Certificate To the Tigase Server From version *3.1.0-b802* of Tigase server, installing and loading certificates is very easy. The server can load all certificates directly from *pem* files. You just need to create a separate pem file for each of your virtual domains and put the file in a directory accessible by the server. Tigase server can automatically load all *pem* files found in given directory. By default, and to make things easy, we recommend the +Tigase/certs+ directory. [[OtherSources]] == Certificate From Other Providers There is number of certificate providers offering certificates either for free or for money. You can use any of them, however you have to be aware that sometimes certificates might not be recognized by all XMPP servers, especially if it's one from a new provider. Here is an example list of providers: - link:https://www.cacert.org/[CAcert] - free certificates with an excellent Web GUI for managing generated certificates and identities. - link:https://www.startssl.com/[StartCom] - both free and paid certificates, class 1, 2 and 3. Very good GUI for managing certificates and identities. - link:https://www.verisign.com/[Verisign] - very expensive certificates comparing to above provides but the provider is recognized by everybody. If you have a certificate from Verisign you can be sure it is identified as a valid certificate. - link:http://www.comodo.com/business-security/digital-certificates/ssl-certificates.php[Comodo Certificate Authority] offers different kind of commercial certificates To obtain certificate from a third party authority you have to go to its website and request the certificate using certificate request generated above. I cannot provide any instructions for this as each of the providers listed have different requirements and interfaces. [[onecertmultipledomain]] == Using one certificate for multiple domains By default, each virtual hosts will require it's own certificate. However, if you choose to use one certificate for all virtual hosts, Tigase supports that option. For example, if you have host1.example.net, host2.example.net, and host3.example.net each vhost will need some configuration: [source,properties] ----- basic-conf/virtual-hosts-cert-host1.example.net=/home/tigase/certs/host1.pem basic-conf/virtual-hosts-cert-host2.example.net=/home/tigase/certs/host2.pem basic-conf/virtual-hosts-cert-host3.example.net=/home/tigase/certs/host3.pem ----- This may be time consuming if you have many Vhosts, or expect to generate many more. The good news is, now one certificate can be used for ALL Vhosts using the following configuration line: [source,properties] ----- basic-conf/virt-hosts-cert-*.example.net=/home/tigase/certs/certificate.pem ----- Now any Vhosts created will use the same certificate located at /home/tigase/certs/certificate.pem. *NOTE:* This is an all or nothing option, if you wish to customize each Vhost, you will need to do so individually. == Tigase Server Configuration for 5.1.0 and older Starting from version 5.1.0 and newer it's not needed to use external libraries nor extra configuration in the init.properties file. With this version Tigase uses, loaded by default thus no need to configure it, following class: [source,bash] ----- --ssl-container-class=tigase.io.SSLContextContainer ----- Older versions require different configurations. In order to be able to load server certificates directly from *pem* files you need to have *tigase-extras* package installed in your server *libs/* directory in version at least *0.1.0*. If you use a Tigase server binary package other than *mini*, this library is included by default. If you haven't changed anything in your XML configuration file, put following line in your +initial.properties+ file: [source,bash] ----- --ssl-container-class=tigase.extras.io.PEMSSLContextContainer ----- Copy all your *pem* files with certificates into certs/ subdirectory in Tigase server installation, stop the server, remove XML configuration file and start the server. XML configuration will be automatically regenerated with the new SSLContainer used by all components and all certificates will be automatically loaded. If you have changed your XML configuration file, and do not want to lose those changes, you will now have to manually change the existing SSLContainer class with the new one. Just replace all occurrences of the default SSLContainer - tigase.io.SSLContextContainer with the new - tigase.extras.io.PEMSSLContextContainer, copy all your *pem* files with certificates into certs/ subdirectory in Tigase server installation and restart the server. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_17_-_Security_-_A_-_Server_Certificates_-_2_-_Installing_StartCom_Certificate_in_your_Linux_System.asciidoc ================================================ [[startcomCertificate]] = Installing StartCom Certificate in Your Linux System :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The third party authority for free XMPP server certificates is link:http://cert.startcom.org/[Startcom]. Startcom root certificates are not normally known to your system as a valid a certificate and appear as a self-signed certificate. To make it known to your system as valid you will have to install it in your system. In any case on any operating system, you have to download the certificate from the issuer link:http://cert.startcom.org/?lang=en&app=110[web site]. == Gentoo Linux . Copy downloaded ca.crt file to /etc/ssl/certs/starcom_ca.crt file. . Run command: + [source,sh] ----- update-ca-certificates ----- All done. To test it, run following command: [source,sh] ----- openssl s_client -connect tigase.org:5223 -CApath /etc/ssl/certs ----- Scroll the output up and look for something like: [source,bash] ----- verify return:1 ----- Which means certificate verification was successful. If you find however: [source,bash] ----- verify return:0 ----- Look one line up for an error message which may look like this: [source,bash] ----- verify error:num=19:self signed certificate in certificate chain ----- Which means the root certificate is still not recognized in your system. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_18_-_Security_-_A_-_Server_Certificates_-_3_-_Server_Certificate_Using_Keytool_and_Keystore.asciidoc ================================================ [[keytoolKeystore]] = Server Certificate Using Keytool and Keystore :author: Bartosz Malkowski :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :toc: :numbered: :website: http://tigase.net To allow secure connections through SSL or TLS channel you need a SSL certificate. The main purpose of SSL certificate is to provide connecting entity with proof of identity of your server. A Significant role in proving the identity of your server is played by a trusted third party - usually the issuer of the certificate. Certificate issued by trusted third parties usually come with a cost. However, you can also use self signed certificate which works just as well. The downside is it gives an authentication warning on client software upon connection. Tigase server binary package and source repositories contain so-called "dummy" certificates which do not refer to any real site name. This certificate is temporary and should be used only for initial testing of your server. It should be replaced with either a self signed certificate or one issued by trusted third party organization as soon as possible. Here are instructions how to install certificates for Tigase server. _Please note! You must use the *keytool* program included in JDK-1.6 or later. The utility included in earlier versions can not import third party signed certificates correctly._ == Self Signed Certificate If you don't have a third party signed certificate, you should generate a self-signed certificate. Some XMPP clients don't work correctly with DSA keys, so we need to use RSA algorithm for generation. To generate private and public keypair, you should use keytool with the following commands: [source,sh] ----- keytool -genkey -alias yourdomain -keystore rsa-keystore \ -keyalg RSA -sigalg MD5withRSA ----- Where +yourdomain+ is a domain part of _JIDs_ on your _XMPP_ server. If you want to have TLS support for virtual domains, you have to create certificate for each virtual domain. If you have just one domain, or for some reason you have to use one certificate for all domains, use +default+ as an alias. Now, enter the password to protect the keystore: [source,sh] ----- Enter keystore password: 123456 ----- The keytool will ask several questions about the certificate data. First question is very important! You must enter the hostname of your XMPP server!! [source,sh] ----- What is your first and last name? [Unknown]: jabber.myserver.org What is the name of your organizational unit? [Unknown]: What is the name of your organization? [Unknown]: What is the name of your City or Locality? [Unknown]: What is the name of your State or Province? [Unknown]: What is the two-letter country code for this unit? [Unknown]: Is CN=jabber.myserver.org, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct? [no]: yes ----- In last step you can enter a new password for the certificate key. At the moment different passwords for both keystore and keys are not supported so you must have the same passwords for each. [source,sh] ----- Enter key password for (RETURN if same as keystore password): ----- Now you have to copy the rsa-keystore file to directory certs/ in your tigase server installation directory. The file may be installed in different location, but then corrections to config file are required. Refer to xref:manualconfig[manual configuration] for details. == Certificate from Certificate Authority If you don't have third-party signed certificate yet but you want to have one, you could obtain it from link:http://www.cacert.org/[cacert.org] for free. First, you have to generate a Certificate Request using keytool: [source,sh] ----- keytool -certreq -alias yourdomain -keystore rsa-keystore ----- Where +yourdomain+ is a domain name for which this certificate is generated. If you need support for multiple virtual domains, you need to have certificate for each domain separately and assign proper alias to the certificates. If you have just one domain or for some reason you want to use one certificate use +default+ as an alias for all domains. Keytool generates the request: [source,bash] ------ -----BEGIN NEW CERTIFICATE REQUEST----- MIIBrzCCARgCAQAwbzEQMA4GA1UEBhMHVW5rbm93bjEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UE BxMHVW5rbm93bjEQMA4GA1UEChMHVW5rbm93bjEQMA4GA1UECxMHVW5rbm93bjETMBEGA1UEAxMK c2VydmVyLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs73Y70725OcG0j4kpCfDX59e qhz2gdGOO0LyMO7rm4m+ZCenq8E88M0RJ8/LV/7q0mtOAzbI8dtXZnmJ74xihCH8ZTFpVDMyFWgk WCj2kz+IUD9vWt6i1UepSkr1a/jYmVMN3RSaoS+j+QLBsJ4rWeOHgIdbiF5tnMhoZMXU//0CAwEA AaAAMA0GCSqGSIb3DQEBBAUAA4GBAHY5r9rftqiKESbbkCcfVhvnUqN4aMTC8/zXWwzBX8guC0kd H46+p6eizwJg6p+h6rqShG2OqXCPrJzO3buHr1jEWRTlB8l5CM53L/xq61nYuaSf5R7Vv/RX2+aD JyoBqYIoSUED0+Sjhej0SUPTOdpA/bfnqdfdtckday4vsLPC -----END NEW CERTIFICATE REQUEST----- ------ Now send the request to your Certificate Authority. The CA issues a signed certificate and sends it to you. It may may look like: [source,bash] ------ -----BEGIN CERTIFICATE----- MIICUDCCAbkCBEUqAK0wDQYJKoZIhvcNAQEEBQAwbzEQMA4GA1UEBhMHVW5rbm93bjEQMA4GA1UE CBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjEQMA4GA1UEChMHVW5rbm93bjEQMA4GA1UECxMH VW5rbm93bjETMBEGA1UEAxMKc2VydmVyLm9yZzAeFw0wNjEwMDkwNzU2MjlaFw0wNzAxMDcwNzU2 MjlaMG8xEDAOBgNVBAYTB1Vua25vd24xEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1Vua25v d24xEDAOBgNVBAoTB1Vua25vd24xEDAOBgNVBAsTB1Vua25vd24xEzARBgNVBAMTCnNlcnZlci5v cmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALO92O9O9uTnBtI+JKQnw1+fXqoc9oHRjjtC 8jDu65uJvmQnp6vBPPDNESfPy1f+6tJrTgM2yPHbV2Z5ie+MYoQh/GUxaVQzMhVoJFgo9pM/iFA/ b1reotVHqUpK9Wv42JlTDd0UmqEvo/kCwbCeK1njh4CHW4hebZzIaGTF1P/9AgMBAAEwDQYJKoZI hvcNAQEEBQADgYEAQqRPdkbc/pdDcPIWOThn2XPp0gitPkXq89ZM1mb0Pib1OISj9ekjqhEZz0UA cI6g1XttpY6hKi6Gg+mRbwiHNVebkDLamE2UIcVJ1wBtowYeOcV1CcLnlj91ScMKNhfD5ebQL+be tWWrJX3ep+80kF/NdVkc7htGOhLebopp8SQ= -----END CERTIFICATE----- ------ Save the Certificate to a disk file. Now that you have third-party signed certificate, you have to import it with *keytool* program to server certificate storage. _Note! You must have a root CA certificate!!! You can download the cert from CA (ie.: root.crt) and import:_ [source,sh] ----- keytool -import -keystore rsa-keystore -file root.crt \ -alias root ----- Last step is import the Certificate to your keystore: [source,sh] ----- keytool -import -alias yourdomain -keystore rsa-keystore \ -file your-certificate.cer ----- Where +yourdomain+ is a domain name for which this certificate has been generated. If you need support for multiple virtual domains you have to import certificate for each domain separately and assign proper alias to each certificate. If you have just one domain or for some reason you want to use one certificate use +default+ as an alias for all domains. It's also good to import root CA certificate to this keystore. //You must find it on CA website. [source,sh] ----- keytool -import -keystore rsa-keystore -file rootCA.cer ----- It may also generate certreq using +openssl+ for use in other services like WWW. In such a case you may have your private key and certificate in separate files. Let's say private key is in ssl.key file and certificate is in +ssl.crt+ file. To merge them into a single file together use following command: [source,sh] ----- openssl pkcs12 -export -inkey ssl.key -in ssl.crt \ -out mycert.pfx -name "default" ----- Now you can load certificate with a private key to your keystore: [source,sh] ----- keytool -importkeystore -srckeystore mycert.pfx \ -srcstoretype pkcs12 -destkeystore rsa-keystore \ -srcalias default -destalias yourdomain \ -destkeypass your_keystore_pass ----- *Note!* _Please note -destkeypass parametr. Your keys password must be the same as keystore password. Otherwise it won't work._ Now you have to copy file +rsa-keystore+ to directory +certs/+ in your tigase server installation. The file could also be installed in different location but then corrections to the config file are required. Refer to configuration documentation for details. Finally, don't forget to modify tigase server configuration file and set proper password for your keystore. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_19_-_Security_-_B_-_Authentication_Connectors.asciidoc ================================================ [[customAuthentication]] = Custom Authentication Connectors :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This article presents configuration options available to the administrator and describe how to set Tigase server up to use user accounts data from a different database. The first thing to know is that Tigase server always opens 2 separate connections to the database. One connection is used for user login data and the other is for all other user data like the user roster, vCard, private data storage, privacy lists and so on... In this article we still assume that Tigase server keeps user data in it's own database and only login data is retrieved from the external database. At the moment Tigase offers following authentication connectors: - 'mysql', 'pgsql', 'derby' - standard authentication connector used to load user login data from the main user database used by the Tigase server. In fact the same physical implementation is used for all JDBC databases. - 'drupal' - is the authentication connector used to integrate the Tigase server with link:http://drupal.org/[Drupal CMS]. - 'libresource' - is the authentication connector used to integrate the Tigase server with link:http://dev.libresource.org/[Libresource Collaboration platform]. - 'tigase-auth' - is the authentication connector which can be used with any database. It executes stored procedures to perform all actions. Therefore it is a very convenient way to integrate the server with an external database if you don't want to expose the database structure. You just have to provide a set of stored procedures in the database. While implementing all stored procedures expected by the server might be a bit of work it allows you to hide the database structure and change the SP implementation at any time. You can add more actions on user login/logout without restarting or touching the server. And the configuration on the server side is very simple. For detailed description of this implementation please refer to xref:tigaseAuthConnector[Tigase Auth documentation]. - 'tigase-custom' - is the authentication connector which can be used with any database. Unlike the 'tigase-auth' connector it allows you to define SQL queries in the configuration file. The advantage of this implementation is that you don't have to touch your database. You can use either simple plain SQL queries or stored procedures. The configuration is more difficult as you have to enter carefully all SQL queries in the config file and changing the query usually involves restarting the server. For more details about this implementation and all configuration parameters please refer to xref:custonAuthConnector[Tigase Custom Auth documentation]. As always the simplest way to configure the server is through the +init.properties file+. In the article describing this file you can find long list with all available options and all details how to handle it. For the authentication connector setup however we only need 2 options: - '--auth-db = connector' - '--auth-db-uri = database connection url' If you happen to keep the user data in the same database as user authentication data you can even skip the second parameter as Tigase automatically assumes settings from the '--user-db-uri' it '--auth-db-uri' is missing. '--auth-db-uri' stored a standard JDBC connection URL and is exactly the same as for all other settings. For example if you store authentication data in a 'drupal' database on 'localhost' the URL might look like: [source,bash] ----- --auth-db-uri = jdbc:mysql://localhost/drupal?user=user&password=passwd ----- '--auth-db' stored just a connector name or connector implementation class. For convenience Tigase has predefined short names for the most common connectors but you can always use the class name if you know it. You have to use a class name if you want to attach your own authentication connector. The following 2 settings are equal: [source,bash] ----- --auth-db = tigase-auth ----- [source,bash] ----- --auth-db = tigase.db.jdbc.TigaseAuth ----- In the same exact way you can setup connector for any different database type: [source,bash] ----- --auth-db = drupal ----- [source,bash] ----- --auth-db = tigase-custom ----- You can normally skip configuring connectors for the default Tigase database format: 'mysql', 'pgsql' and 'derby' as they are applied automatically if the parameter is missing. One more important thing to know is that you will have to modify '--user-db-uri' if you use a custom authentication connector. This is because if you retrieve user login data from the external database this external database is usually managed by an external system. User accounts are added without notifying Tigase server. Then, when the user logs in and tries to retrieve the user roster, the server can not find such a user in the roster database. To keep user accounts in sync between the authentication database and the main user database you have to add following option to the end of the database connection URL: 'autoCreateUser=true'. For example: [source,bash] ----- --user-db-uri=jdbc:mysql://localhost/tigasedb?user=nobody&password=pass&autoCreateUser=true ----- If you are interested in even further customizing your authentication connector by writing your own queries or stored procedures, please have a look at 2 following guides: - xref:tigaseAuthConnector[Tigase Auth guide] - xref:custonAuthConnector[Tigase Custom Auth guide] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_20_-_Security_-_B_-_Authentication_Connectors_-_1_-_Tigase_Auth_Connector.asciidoc ================================================ [[tigaseAuthConnector]] = Tigase Auth Connector :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The Tigase Auth connector with shortcut name: *tigase-auth* is implemented in the class: link:https://projects.tigase.org/projects/tigase-server/repository/changes/src/main/java/tigase/db/jdbc/TigaseAuth.java[tigase.db.jdbc.TigaseAuth]. It allows you to connect to any external database to perform user authentication. You can find more details how to setup a custom connector in the xref:customAuthConnector[Custom Authentication Connectors] guide. To make this connector working you have to prepare your database to offer set of stored procedures for Tigase server to perform all the authentication actions. The best description is the example schema with all the stored procedures defined. Please refer to the Tigase link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/show/database[SVN repository] for the schema definition files. Files with the stored procedures implementations are located in link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/show/database[postgresql-schema-4.sql] file for PostgreSQL database. The absolute minimum of stored procedures you have to implement is: - *TigUserLoginPlainPw* - to perform user authentication. The procedure is always called when the user tries to login to the XMPP server. This is the only procedure which must be implemented and actually must work. - *TigUserLogout* - to perform user logout. The procedure is always called when the user logouts or disconnects from the server. This procedure must be implemented but it can be empty and can do nothing. It just needs to exist because Tigase expect it to exist and attempts to call it. With these 2 above stored procedures you can only perform user login/logouts on the external database. You can't register a user account, change user password or remove the user. In many cases this is fine as all the user management is handled by the external system. If you however want to allow for account management via XMPP you have to implement also following procedures: - *TigAddUserPlainPw* - to add a new user account - *TigRemoveUser* - to remove existing user account - *TigUpdatePasswordPlainPw* - to change a user password for existing account ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_21_-_Security_-_B_-_Authentication_Connectors_-_2_-_Tigase_Custom_Auth_Connector.asciidoc ================================================ [[custonAuthConnector]] = Tigase Custom Auth Connector :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The Tigase Custom Auth connector with shortcut name: *tigase-custom* is implemented in the class: link:https://projects.tigase.org/projects/tigase-server/repository/changes/src/main/java/tigase/db/jdbc/TigaseCustomAuth.java[tigase.db.jdbc.TigaseCustomAuth]. It allows you to connect to any external database to perform user authentication and use a custom queries for all actions. You can find more details how to setup a custom connector in the Custom Authentication Connectors guide. The basic configuration is very simple: [source,bash] ----- --auth-db = tigase-custom --auth-db-uri = jdbc:mysql://localhost/drupal?user=user&password=passwd ----- That's it. The connector loads correctly and starts working using predefined, default list of queries. In most cases you also might want to define your own queries in the configuration file. The shortest possible description is the following example of the content from the +init.properties+ file: [source,bash] ----- # This query is used to check connection to the database, whether it is still alive or not basic-conf/auth-repo-params/conn-valid-query=select 1 # This is database initialization query, normally we do not use it, especially in # clustered environment basic-conf/auth-repo-params/init-db-query=update tig_users set online_status = 0 # Below query performs user authentication on the database level. # The Tigase server does not need to know authentication algorithm or password # encoding type, it simply passes user id (BareJID) and password in form # which was received from the client, to the stored procedure. If the # authentication was successful the procedure returns user bare JID or null otherwise. # The Tigase checks whether the JID returned from the query matches # JID passed as a parameter. If they match, the authentication is successful. basic-conf/auth-repo-params/user-login-query={ call TigUserLoginPlainPw(?, ?) } # Below query returns number of user accounts in the database, this is mainly used # for the server metrics and monitoring components. basic-conf/auth-repo-params/users-count-query={ call TigAllUsersCount() } # Below query is used to add a new user account to the database basic-conf/auth-repo-params/add-user-query={ call TigAddUserPlainPw(?, ?) } # Below query is used to remove existing account with all user's data from the database basic-conf/auth-repo-params/del-user-query={ call TigRemoveUser(?) } # This query is used for the user authentication if "user-login-query" is not defined, # that is if there is no database level user authentication algorithm available. In such # a case the Tigase server loads user's password from the database and compares it # with data received from the client. basic-conf/auth-repo-params/get-password-query=select user_pw from tig_users where user_id = ? # Below query is used for user password update in case user decides to change his password basic-conf/auth-repo-params/update-password-query=update tig_users set user_pw = ? where user_id = ? # Below query is called on user logout event. Usually we use a stored procedure which # records user logout time and marks user as offline in the database basic-conf/auth-repo-params/user-logout-query=update tig_users, set online_status = online_status - 1 where user_id = ? # This is configuration setting to specify what non-sasl authentication mechanisms # expose to the client basic-conf/auth-repo-params/non-sasl-mechs=password,digest # This is configuration setting to specify what sasl authentication mechanisms expose to the client basic-conf/auth-repo-params/sasl-mechs=PLAIN,DIGEST-MD5 ----- Queries are defined in the configuration file and they can be either plain SQL queries or stored procedures. If the query starts with characters: '\{ call' then the server assumes this is a stored procedure call, otherwise it is executed as a plain SQL query. Each configuration value is stripped from white characters on both ends before processing. Please don't use semicolon ';' at the end of the query as many JDBC drivers get confused and the query may not work. Some queries can take arguments. Arguments are marked by question marks '?' in the query. Refer to the configuration parameters description for more details about what parameters are expected in each query. The first example shows how to put a stored procedure as a query with 2 required parameters. [source,java] ----- add-user-query={ call TigAddUserPlainPw(?, ?) } ----- The same query with plain SQL parameters instead: [source,java] ----- add-user-query=insert into users (user_id, password) values (?, ?) ----- The order of the query arguments is important and must be exactly as described in specification for each parameter. - 'conn-valid-query' - Query executing periodically to ensure active connection with the database. + Takes no arguments. + Example query: 'select 1' - 'init-db-query' - Database initialization query which is run after the server is started. + Takes no arguments. + Example query: 'update tig_users set online_status = 0' - 'add-user-query' - Query adding a new user to the database. + Takes 2 arguments: +(user_id (JID), password)+ + Example query: 'insert into tig_users (user_id, user_pw) values (?, ?)' - 'del-user-query' - Removes a user from the database. + Takes 1 argument: +(user_id (JID))+ + Example query: 'delete from tig_users where user_id = ?' - 'get-password-query' - Retrieves user password from the database for given user_id (JID). + Takes 1 argument: +(user_id (JID))+ + Example query: 'select user_pw from tig_users where user_id = ?' - 'update-password-query' - Updates (changes) password for a given user_id (JID). + Takes 2 arguments: +(password, user_id (JID))+ + Example query: 'update tig_users set user_pw = ? where user_id = ?' - 'user-login-query' - Performs user login. Normally used when there is a special SP used for this purpose. This is an alternative way to a method requiring retrieving user password. Therefore at least one of those queries must be defined: +user-login-query+ or +get-password-query.+ + If both queries are defined then user-login-query is used. Normally this method should be only used with plain text password authentication or sasl-plain. + Tigase expects a result set with user_id to be returned from the query if login is successful and empty results set if the login is unsuccessful. + Takes 2 arguments: +(user_id (JID), password)+ + Example query: 'select user_id from tig_users where (user_id = ?) AND (user_pw = ?)' - 'user-logout-query' - This query is called when user logs out or disconnects. It can record that event in the database. + Takes 1 argument: +(user_id (JID))+ + Example query: 'update tig_users, set online_status = online_status - 1 where user_id = ?' - 'non-sasl-mechs' - Comma separated list of NON-SASL authentication mechanisms. Possible mechanisms are: +password+ and +digest+. The digest mechanism can work only with +get-password-query+ active and only when password are stored in plain text format in the database. - 'sasl-mechs' - Comma separated list of SASL authentication mechanisms. Possible mechanisms are all mechanisms supported by Java implementation. The most common are: +PLAIN, DIGEST-MD5, CRAM-MD5+. + "Non-PLAIN" mechanisms will work only with the +get-password-query+ active and only when passwords are stored in plain text format in the database. Application: Tigase Server ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_22_-_Security_-_B_-_Authentication_Connectors_-_3_-_Drupal_Authentication_Added.asciidoc ================================================ [[drupalAuthentication]] = Drupal Authentication :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Currently, we can only check authentication against a *Drupal* database at the moment. Full *Drupal* authentication is not implemented as of yet. As *Drupal* keeps encrypted passwords in database the only possible authorization protocols are those based on PLAIN passwords. To protect your passwords *Tigase* server must be used with SSL or TLS encryption. Implementation of a *Drupal* database based authorization is located in +tigase.db.jdbc.DrupalAuth+ class. Although this class is capable of adding new users to the repository I recommend to switch in-band registration off due to the caching problems in *Drupal.* Changes in database are not synchronized with *Drupal* yet. Functionality for adding new users is implemented only to ease user accounts migration from different repository types from earlier *Tigase* server installations. The purpose of that implementation was to allow all accounts administration tasks from *Drupal* like: account creation, all accounts settings, like e-mail, full name, password changes and so on. *Tigase* server uses following fields from *Drupal* database: name (user account name), pass (user account password), status (status of the account). Server picks up all changes instantly. If user status is not 1 then server won't allow user to login trough XMPP even if user provides valid password. There is no _Roster_ management in *Drupal* yet. So Roster management have to be done from the XMPP client. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_23_-_Security_-_B_-_Authentication_Connectors_-_4_-_LDAP_Authentication_Connector.asciidoc ================================================ [[LDAPauth]] = LDAP Authentication Connector :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-03-30 21:56 :revision: v2.1 :toc: :numbered: :website: http://tigase.net From version 5.1.0, rev. (build) 2881 Tigase XMPP Server offers support for authenticating users against an LDAP server in *Bind* *Authentication* mode. Configuration for the LDAP support is really simple you just have to add a few lines to your +init.properties+ file. [source,bash] ----- # LDAP Authentication connector --auth-db = tigase.db.ldap.LdapAuthProvider # LDAP connection URI --auth-db-uri=ldap://ldap.tigase.com:389 # LDAP access parameters basic-conf/auth-repo-params/user-dn-pattern=cn=USER_ID,ou=people,dc=tigase,dc=org ----- Please note the *USER_ID* element, this is a special element of the configuration which is used to authenticate particular user. Tigase LDAP connector replaces it with appropriate data during authentication. You can control what Tigase should put into this part. In your configuration you must replace this string with one of the following: . *%1$s* - use user name only for authentication (JabberID's localpart) . *%2$s* - use domain name only for authentication (JabberID's domain part) . *%3$s* - use the whole Jabber ID (JID) for authentication ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_24_-_Security_-_B_-_Authentication_Connectors_-_5_-_Configuration_of_SASL_EXTERNAL.asciidoc ================================================ [[saslExternal]] = Configuration of SASL EXTERNAL :author: Bartosz Malkowski :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2013-11-27 13:34 :revision: v2.1 :toc: :numbered: :website: http://tigase.net In order to enable SASL External add following line to the +init.properties+ file [source,bash] ----- c2s/clientCertCA=/path/to/cacert.pem ----- File +cacert.pem+ contains Certificate Authority certificate which is used to sign clients certificate. Client certificate must include user's Jabber ID as +XmppAddr+ in +subjectAltName+: __________________________ As specified in RFC 3920 and updated in RFC 6120, during the stream negotiation process an XMPP client can present a certificate (a “client certificate”). If a JabberID is included in a client certificate, it is encapsulated as an id-on-xmppAddr Object Identifier (“xmppAddr”), i.e., a subjectAltName entry of type otherName with an ASN.1 Object Identifier of “id-on-xmppAddr” as specified in Section 13.7.1.4 of RFC 6120.footnote:[http://xmpp.org/extensions/xep-0178.html#c2s[XEP-0178]] __________________________ It is possible to make client certificate required: [source,bash] ----- c2s/clientCertRequired[B]=true ----- If this option will be enabled, then client must provide certificate. This certificate will be verified against +c2s/clientCertCA+. If client does not provide certificate or certificate will be invalid, TLS handshake will be interrupted and client will be disconnected. Using this options does not force client to use SASL EXTERNAL. Client still may authenticate with other SASL mechanisms. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_25_-_Security_-_C_-_Packet_Filtering.asciidoc ================================================ [[tigase41packetFiltering]] = Packet Filtering :author: not known :version: v1.0 initial release :date: 2015-07-13 16:39 :toc: Tigase offers different ways to filter XMPP packets flying through the server. The most common use for packet filtering is to restrict users from sending or receiving packets based on the sender or received address. There are also different possible scenarios: time based filtering, content filtering, volume filtering and so on. All pages in this section describe different filtering strategies. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_26_-_Security_-_C_-_Packet_Filtering_-_1_-_Domain_Based_Packet_Filtering.asciidoc ================================================ [[domainBasedPacketFiltering]] = Domain Based Packet Filtering :author: not known :version: v1.0 initial release :date: 2015-07-13 16:43 Domain based packet filtering is a simple filter allowing to restrict user communication based on the source/destination domain name. This is especially useful if we want to limit user communication within a single - own domain only or a list of domains. A company might not wish to allow employers to chat during work hours with anybody in the world. A company may also have a few different domains used by different branches or departments. An administrator may restrict communication to a list of domains. == Introduction The restriction is on a per-user basis. So the administrator can set a different filtering rules for each user. There is also a per-domain configuration and global-installation setting (applied from most general to most specific, i.e. from installation to user). Regular users can not change the settings. So this is not like a privacy list where the user control the filter. Domain filter can not be changed or controlled by the user. The system administrator can change the settings based on the company policy. There are predefined rules for packet filtering: . `ALL` - user can send and receive packets from anybody. . `LOCAL` - user can send and receive packets within the server installation only and all it's virtual domains. . `OWN` - user can send and receive packets within his own domains only . `BLOCK` - user can't communicate with anyone. This could be used as a means to temporarily disable account or domain. . `LIST` - user can send and receive packets within listed domains only (i.e. _whitelist_). . `BLACKLIST` - user can communicate with everybody (like `ALL`), except contacts on listed domains. . `CUSTOM` - user can communicate only within custom created rules set. Whitelist (`LIST`) and blacklist (`BLACKLIST`) settings are mutually exclusive, i.e. at any given point of time only one of them can be used. Those rules applicable to particular users are stored in the user repository and are loaded for each user session. If there are no rules stored for a particular user server tries to apply rules for a VHost of particular user, and if there is no VHost filtering policy server uses global server configuration. If there is no filtering policy altogether server applies defaults based on following criteria: . If this is *Anonymous* user then *LOCAL* rule is applied . For all *other* users *ALL* rule is applied. == Configuration Filtering is performed by the domain filter plugin which must be loaded at startup time. It is loaded by default if the plugins list is not set in the configuration file. However if you have a list of loaded plugins in the configuration file make sure *domain-filter* is on the list. There is no other configuration required for the plugin to work. == Administration, Rules Management Although controlling domain filtering rules is possible for each user separately, it is not practical for large installations. In most cases users are stored in the database and a third-party system keeps all the user information. To change the rule for a single user you can use loadable administration scripts feature and load link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/entry/src/main/groovy/tigase/admin/UserDomainFilter.groovy[UserDomainFilter.groovy] script. It enables modifying rules for a given user JID. == Implementation If you have a third party system which keeps and manages all user information than you probably have your own UserRepository implementation which allows the Tigase server to access user data. Filtering rules are loaded from user repository using following command: [source,java] ----- repo.getData(user_id, null, DomainFilter.ALLOWED_DOMAINS_KEY, null) repo.getData(user_id, null, DomainFilter.ALLOWED_DOMAINS_LIST_KEY, null) ----- Where *user_id* is user Jabber ID without resource part, *DomainFilter.ALLOWED_DOMAINS_KEY* is a property key: "allowed-domains". The user repository MUST return one of following only: . `ALL` - if the user is allowed to communicate with anybody . `LOCAL` - if the user is allowed to communicate with users on the same server installation. . `OWN` - if the user is allowed to communicate with users within his own domain only. . `LIST` - list of domains within which the user is allowed to communicate with other users. No wild-cards are supported. User's own domain should be included too. . `BLACKLIST` - list of domains within which the user is NOT allowed to communicate with other users. No wild-cards are supported. User's own domain should NOT be included. . `CUSTOM` - list of rules defining custom communication permissions (server processes stanza according to first matched rule, similar to XEP-0016) in the following format: [source] ----- ruleSet = rule1;rule2;ruleX; rule = order_number|policy|UID_type[|UID] order_number = any integer; policy = (allow|deny); UID_type = [jid|domain|all]; UID = user JID or domain, for example pubsub@test.com; if UID_type is ALL then this is ignored. ----- For example: [source] ----- 1|allow|self; 2|allow|jid|admin@test2.com; 3|allow|jid|pubsub@test.com; 4|deny|all; ----- . `null` - a java null if there are no settings for the user. In case of `LIST` and `BLACKLIST` filtering options, it's essential to provide list of domains for the whitelisting/blacklisting. *DomainFilter.ALLOWED_DOMAINS_LIST_KEY* is a property key: "allowed-domains-list". The user repository MUST return semicolon separated list of domains: `domain1.com;domain2.com,domain3.org` The filtering is performed by the link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/entry/src/main/java/tigase/xmpp/impl/DomainFilter.java[`tigase.xmpp.impl.DomainFilter`] plugin. Please refer to source code for more implementation details. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_27_-_Security_-_D_-_Access_Control_List.asciidoc ================================================ [[accessControlList]] = Access Control Lists in Tigase :author: Artur Hefczyc :version: v1.0 October 2015 :date: 2015-10-26 08:51 :toc: :numbered: :website: http://www.tigase.net Tigase offers support for *Access Control List (ACL)* to allow for fine grained access to administration commands on the server. By default, all administration commands are only accessible (visible through service discovery and can be executed) by the service administrators. Service administrators are existing accounts with JIDs (*BareJIDs*) listed in the +init.properties+ file under --admins. Additionally, other XMPP users and entities can be assigned permissions to execute a command or commands using Tigase's ACL capabilities. The following is a list of possible ACL modifiers for administrator command accessibility: - *ALL* - Everybody can execute the command, even users from different federated servers. - *ADMIN* - Local server administrators can execute the command, this is a default setting if no ACL is set for a command. - *LOCAL* - All users with accounts on the local server can execute the command. Users from other, federated servers will not be able to execute the command. - *DOMAIN* - Only users with accounts on the selected domain will be able to execute the command. It may be useful to setup a domain specifically for admin accounts, and automatically all users within that domain would be able to run the command. - *JID* - Comma separated list of JIDs of users who can execute the command. In any case, regardless of ACL settings, any command can be executed and accessed by the designated service wide administrators, that is accounts listed as admins in the init.properties file. Multiple ACL modifiers can be combined and applied for any command. This may not always makes sense. For example ALL supersedes all other settings, so it does not make sense to combine it with any other modifier. However, most others can be combined with JID to broaden access to specific accounts. On Tigase server the Access Control List is checked for the first matching modifier. Therefore if you combine ALL with any other modifier, anybody from a local or remote service will always be able to execute the command, no matter what other modifiers are added. Please note, the ACL lists work on the command framework level. Access is verified before the command is actually executed. There might be additional access restrictions within a command itself. In many cases, even if all local users are permitted to execute a command (LOCAL modifier), some commands allow only to be executed by a domain owner or a domain administrator (and of course by the service-wide administrators as well). All the commands related to a user management such as adding a new user, removing a user, password changes, etc… belong to this category. When conducting domain (vhost) management, creation/registration of a new domain can be done by any local user (if LOCAL ACL modifier is set) but then all subsequent domain management tasks such as removing the vhost, updating its configuration, setting SSL certificate can be done by the domain owner or administrator only. The ACL list is set for a specific Tigase component and a specific command. Therefore the configuration property must specify all the details. So the general format for configuring ACL for a command is this: +comp-id/command/command-id=ACL_modifier,ACL_modifier,ACL_modifier+ The breakdown is as such: - *comp-id* is the Tigase server component ID such as: +sess-man+, +vhost-man+, +c2s+, etc.. - *command* is a static text which indicates that the property is for component's command settings. - *command-id* is a command ID for which we set the ACL such as +query-dns+, +http://jabber.org/protocol/admin#add-user+, +user-roster-management+, etc… Here are a few examples: _Allowing local users to create and manage their own domains_ [source,bash] ----- vhost-man/command/comp-repo-item-add=LOCAL vhost-man/command/comp-repo-item-remove=LOCAL vhost-man/command/comp-repo-item-update=LOCAL vhost-man/command/ssl-certificate-add=LOCAL ----- In fact all the commands except +item-add+ can be executed by the domain owner or administrator. _Allowing local users to execute user management commands:_ [source,bash] ----- sess-man/command/http\://jabber.org/protocol/admin#add-user=LOCAL sess-man/command/http\://jabber.org/protocol/admin#change-user-password=LOCAL sess-man/command/http\://jabber.org/protocol/admin#delete-user=LOCAL sess-man/command/http\://jabber.org/protocol/admin#get-online-users-list=LOCAL sess-man/command/http\://jabber.org/protocol/admin#get-registered-user-list=LOCAL sess-man/command/http\://jabber.org/protocol/admin#user-stats=LOCAL sess-man/command/http\://jabber.org/protocol/admin#get-online-users-list=LOCAL ----- As in the previous example, the commands will by executed only by local users who are the specific domain administrators. _Allowing users from a specific domain to execute +query-dns+ command and some other users for given JIDs from other domains:_ ----- vhost-man/command/query-dns=DOMAIN:tigase.com,admin@tigase.org,frank@example.com ----- To be able to set a correct ACL property you need to know component names and command IDs. Component IDs can be found in the service discovery information on running server or in the server logs during startup. A command ID can be found in the command script source code. Each script contains a list of metadata at the very beginning of it's code. One of them is +AS:CommandId+ which is what you have to use for the ACL setting. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_28_-_Database_Management.asciidoc ================================================ [[databasemgnt]] = Database Management :author: daniel wisnewski :version: v1.0 July 2015 :date: 2015-07-16 12:49 :website: http://tigase.net Tigase is coded to perform with multiple database types and numbers. Owing to it's versatile nature, there are some tools and procedures that may be of use to certain administrators. == Recommended database versions As of v7.1.0 here are the minimum and recommended versions of databases for use with Tigase: [width="100%",frame="topbot",options="header"] |================================= |Database |Recommended Version |Minimum Version |Additional Information |DerbyDB |10.12.1.1 |10.12.1.1 |Included with Tigase XMPP Server |MySQL |5.6 |5.5 | |SQLServer |2012 |2008 R2 | |MongoDB |2.6 |2.6 |Driver not working with mongoDB 3.0 or newer. |================================= Although Tigase may support other versions of databases, these are the ones we are most familiar with in offering support and advice. Use of databases outside these guidelines may result in unforeseen errors. == xref:databasePreperation[Database Preparation] Preparing new databases in case installer setup is not an option. == xref:hashedPasswords[Hashed Passwords in User Database] Providing more secure password storage. == xref:multidb[Multiple Databases in Tigase] Options for using multiple databases for different purposes in Tigase. == xref:dbImportingData[Importing User Data] Tips to move data repositories from one to another database. == xref:existingData[Import Existing Database] This section has some depreciated information, however it may be handy to upgrade, or manually connect databases. == xref:oldVerSchemas[Old Version Schemas and Updates] Contains our old Schema updates, if you have an old installation of Tigase and want to move to a more current version, see the guides revelant to you. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_29_-_Database_Management_-_A_-_Database_Preparation.asciidoc ================================================ [[databasePreperation]] = Database Preparation :author: Artur Hefczyc :author: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-07-15 06:42 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Tigase uses generally the same database schema and the same set of stored procedures and functions on every database. However, the schema creation scripts and code for stored procedures is different for each database. Therefore the manual process to prepare database is different for each database system. Of course the simplest and easiest way to prepare database is to use Tigase installer or webinstaller which automates the whole process. Sometimes this is not possible. A second option is to use the +DBSchemaLoader+ utility in Tigase. If either of those won't work, or won't suit your needs, provided are set of guides describing initialization and preparation process for each supported database. -xref:dbSchemaLoader[The DBSchemaLoader Utility] - xref:prepareMysql[Prepare the MySQL Database for the Tigase Server] - xref:hashedPasswords[Hashed User Passwords in Database] - xref:prepareDerby[Prepare the Derby Database for the Tigase Server] - xref:prepareMssql[Prepare the MS SQL Server Database for the Tigase Server] - xref:preparePostgresql[Prepare the PostgreSQL Database for the Tigase Server] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_29_-_Database_Management_-_A_-_Database_Preperation_-_1_-_DbSchemaLoader.asciidoc ================================================ [[dbSchemaLoader]] = +dbSchemaLoader+ Utility :author: Daniel Wisnewski :author: v1.0, March 2016: Reformatted for AsciiDoc. :date: 2016-03-14 14:30 :numbered: :toc: :website: http://www.tigase.net Included with Tigase is the +dbSchemaLoader+ Utility, which can be used to apply schema files to databases. It is able to operate with Derby, MySQL, SQLServer, and PostgreSQL databases. In order to use this utility with any of the databases, you will need to first have the database environment up and running, and have established user credentials. You may use root or an account with administrator write privileges. IMPORTANT: All commands in this guide are required to be running from the Tigase installation directory. == Operation & Variables First, lets cover the DBSchemaLoader operation and variables: *Operation* The utility is run using the java -cp command from the Tigase installation directory. Be sure that you have JDK v1.8 or later installed. Linux [source,command] ----- java -cp "jars/*" tigase.util.DBSchemaLoader ----- or from a Windows environment ----- java -cp jars/* tigase.util.DBSchemaLoader ----- These commands will be followed by a combination of the following variables *Variables* Use the following options to customize. Options in bold are required, {potential options are in brackets}.:: * *-dbType database_type {derby, mysql, postgresql, sqlserver}* * -schemaVersion schema version {4, 5, 5-1} * *-dbName database name* * -dbHostname database hostname (default is localhost) * -dbUser tigase username * -dbPass tigase user password * -rootUser database root username * -rootPass database root password * *-file path to sql schema file* {database/derby-schema-7-1.sql} * -query sql query to execute * -logLevel java logger Level * -adminJID comma separated list of admin JIDs * -adminJIDpass password (one for all entered JIDs) With that out of the way, lets look at some examples. Lets say you have a new mysql database server with root user root and password rood (to keep things simple, we do not recommend this). The MySQL database is hosted locally, your command would be as follows: [source,cmd] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbType mysql -dbName tigasedb -rootUser root -rootPass root -schemaVersion -adminJID admin@example.com -adminJIDpass password 7.1 -file database/mysql-schema-7-1.sql ----- This will create the tigasedb database, add an Admin user as admin@example.com with password 'password', and apply the v7.1 schema files. Output will look like this: [source,cmd] ----- LogLevel: CONFIG tigase.util.DBSchemaLoader CONFIG Properties: [{dbHostname=localhost, logLevel=CONFIG, adminJID=admin@example.com, dbType=mysql, file=database/mysql-schema-7-1.sql, rootUser=root, adminJIDpass=password, dbPass=tigase_pass, dbName=tigasedb, schemaVersion=7.1, rootPass=root, dbUser=tigase_user}] tigase.util.DBSchemaLoader validateDBConnection INFO Validating DBConnection, URI: jdbc:mysql://localhost/?user=root&password=root tigase.util.DBSchemaLoader validateDBConnection CONFIG DriverManager (available drivers): [[org.apache.derby.jdbc.AutoloadedDriver@10f87f48, org.postgresql.Driver@1b2c6ec2, com.mysql.jdbc.Driver@50040f0c, jTDS 1.3.1]] tigase.util.DBSchemaLoader validateDBConnection INFO Connection OK tigase.util.DBSchemaLoader validateDBExists INFO Validating whether DB Exists, URI: jdbc:mysql://localhost/tigasedb?user=tigase_user&password=tigase_pass tigase.util.DBSchemaLoader validateDBExists INFO Doesn't exist, creating... tigase.util.DBSchemaLoader validateDBExists INFO OK tigase.util.DBSchemaLoader loadSchemaFile INFO Loading schema from file: database/mysql-schema-7-1.sql, URI: jdbc:mysql://localhost/tigasedb?user=root&password=root tigase.util.DBSchemaLoader loadSchemaFile INFO completed OK tigase.util.DBSchemaLoader printInfo INFO Database init.properties configuration: --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb user=tigase_user&password=tigase_pass&useUnicode=true&characterEncoding=UTF-8 ----- TIP: The utility will automatically generate the lines you need to add to your init.properties file to use this database! At this time, it is suggested to load the PubSub schema since you will have to change very little of the command: [source,cmd] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbType mysql -dbName tigasedb -rootUser root -rootPass root -file database/mysql-pubsub-schema-3.2.0.sql ----- Should you wish to use the Socks5 Proxy component, you will need to load that schema as well [source,cmd] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbType mysql -dbName tigasedb -rootUser root -rootPass root -file database/mysql-socks5-schema.sql ----- At this time you're finished setting up a database for use with Tigase! For other databases that are supported, the operations will be very similar with only the -dbType and perhaps the -dbHostname being different. == -Query function Should you decide to customize your own functions, or have specific information you want to put into the database, you can use the -query function to perform a single query step. [source,cmd] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dpType mysql -dbName tigasedb -rootUser root -rootPass root -query "CREATE TABLE tigasedb.EXTRA_TABLE (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(10) NOT NULL)" ----- Of course this would break the schema for tigasedb by adding an unexpected table, you will receive the following message: ----- tigase.util.DBSchemaLoader printInfo WARNING Database schema is invalid ----- But this is a demonstration how you may run a query through the database without the need to use another tool. Note that you will need to select the specific database for each query. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_30_-_Database_Management_-_A_-_Database_Preparation_-_1_-_Prepare_the_MySQL_Database_for_Tigase_Server.asciidoc ================================================ [[prepareMysql]] = Prepare the MySQL Database for the Tigase Server :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to prepare MySQL database for connecting Tigase server. == Basic Setup The MySQL database can be prepared in many ways. Most Linux distributions contain tools which allow you to go through all steps from the shell command line. To make sure it works on all platforms in the same way, we will first show how to do it under MySQL command line client. === Configuring from MySQL command line tool Run the MySQL command line client in either Linux or MS Windows environment and enter following instructions: . Create the database for the Tigase server: + [source,sql] ----- mysql> create database tigasedb; ----- . Add the +tigase_user+ user and grant him access to the +tigasedb+ database. Depending on how you plan to connect to the database (locally or over the network) use one of following commands or all if you are not sure: + *Grant access to tigase_user connecting from any network address.* + [source,sql] ----- mysql> GRANT ALL ON tigasedb.* TO tigase_user@'%' IDENTIFIED BY 'tigase_passwd'; ----- + *Grant access to tigase_user connecting from localhost.* + [source,sql] ----- mysql> GRANT ALL ON tigasedb.* TO tigase_user@'localhost' IDENTIFIED BY 'tigase_passwd'; ----- + *Grant access to tigase_user connecting from local machine only.* + [source,sql] ----- mysql> GRANT ALL ON tigasedb.* TO tigase_user IDENTIFIED BY 'tigase_passwd'; ----- + For the Tigase server version 4.x additional permissions must be granted for the database user: + [source,sql] ----- mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user'@'localhost'; mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user'@'%'; mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user'; ----- + And now you can update user permission changes in the database: + [source,sql] ----- mysql> FLUSH PRIVILEGES; ----- . Load the proper mysql schema into the database. Full installations of Tigase will have all the SQL file you need to create and update the database. First, switch to the database you have just created: + [source,sql] ----- mysql> use tigasedb; ----- + We are assuming you run the mysql client in Linux from the Tigase installation directory. + [source,sql] ----- mysql> source database/mysql-7-1-schema.sql; ----- + For the Tigase server version v7.1.0 you have to use proper schema version which is 5.1. You will also need to manually load the PubSub schema as well, current version is v3.2.0. All modern versions will load previous schemas first so no need to do a manual upgrade. + [source,sql] ----- mysql> source database/mysql-pubsub-schema-3.2.0.sql; ----- + If you plan to use the Socks5 component, you will also need to add that schema as well. + [source,sql] ----- mysql> source database/mysql-socks5-schema.sql; ----- + On Windows you have probably to enter the full path, assuming Tigase is installed in C:\Program Files\Tigase: + [source,sql] ----- mysql> source c:/Program Files/Tigase/database/mysql-7-1-schema.sql; mysql> source c:/Program Files/Tigase/database/mysql-pubsub-schema-3.2.0.sql; mysql> source c:/Program Files/Tigase/database/mysql-socks5-schema.sql; ----- + == Configuring From the Linux Shell Command Line Follow steps below to prepare the MySQL database: . Create the database space for the Tigase server: [source,sql] ----- mysqladmin -p create tigasedb ----- . Add the +tigase_user+ user and grant access to the tigasedb database. Depending on how you plan to connect to the database (locally or over the network) use one of following commands or all if you are not sure: *Grant access to tigase_user connecting from any network address.* [source,sql] ----- echo "GRANT ALL ON tigasedb.* TO tigase_user@'%' \ IDENTIFIED BY 'tigase_passwd'; \ FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql ----- *Grant access to tigase_user connecting from localhost.* [source,sql] ----- echo "GRANT ALL ON tigasedb.* TO tigase_user@'localhost' \ IDENTIFIED BY 'tigase_passwd'; \ FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql ----- *Grant access to tigase_user connecting from local machine only.* [source,sql] ----- echo "GRANT ALL ON tigasedb.* TO tigase_user \ IDENTIFIED BY 'tigase_passwd'; \ FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql ----- . Load the proper mysql schema into the database. Full installations of Tigase will have all the SQL file you need to create and update the database. [source,sql] ----- mysql -u dbuser -p tigasedb < mysql-schema-7-1.sql mysql -u dbuser -p tigasedb < mysql-pubsub-schema-3.2.0.sql ----- If you want to use the socks5 component, then oyu will need to include the following line as well: [source,sql] ----- mysql -u dbuser -p tigasedb < mysql-socks5-schema.sql ----- == Configuring MySQL for UTF-8 Support In my.conf put following lines: [source,bash] ----- [mysql] default-character-SET=utf8 [client] default-character-SET=utf8 [mysqld] init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;' character-set-server=utf8 default-character-SET=utf8 collation-server=utf8_general_ci skip-character-set-client-handshake ----- Then connect to the database from the command line shell check settings: [source,sql] ----- SHOW VARIABLES LIKE 'character_set_database'; SHOW VARIABLES LIKE 'character_set_client'; ----- If any of these shows something else then 'utf8' then you need to fix it using the command: [source,sql] ----- ALTER DATABASE tigasedb DEFAULT CHARACTER SET utf8; ----- You can now also test your database installation if it accepts UTF-8 data. The easiest way to ensure this is to just to create an account with UTF-8 characters: [source,sql] ----- call TigAddUserPlainPw('żółw@some.domain.com', 'żółw'); ----- And then check that the account has been created: [source,sql] ----- SELECT * FROM tig_users WHERE user_id = 'żółw@some.domain.com'; ----- If the last command gives you no results it means there is still something wrong with your settings. You might also want to check your shell settings to make sure your command line shell supports UTF-8 characters and passes them correctly to MySQL: [source,sh] ----- export LANG=en_US.UTF-8 export LOCALE=UTF-8 export LESSCHARSET='utf-8' ----- It seems that MySQL 5.0.x also needs extra parameters in the connection string: '&useUnicode=true&characterEncoding=UTF-8' while MySQL 5.1.x seems to not need it but it doesn't hurt to have it for both versions. You have to edit 'etc/init.properties' file and append this to the database connection string. For MySQL 5.1.x, however, you need to also update code for all database stored procedures and functions used by the Tigase. They are updated for Tigase version 4.4.x and up, however if you use an older version of the Tigase server, you can reload stored procedures using the file from SVN. == Other MySQL Settings Worth Considering There are a number of other useful options, especially for performance improvements. Please note, you will have to review them as some of them may impact data reliability and are useful for performance or load tests installations only. [source,bash] ----- # InnoDB seems to be a better choice # so lets make it a default DB engine default-storage-engine = innodb ----- Some the general MySQL settings which mainly affect performance: [source,bash] ----- key_buffer = 64M max_allowed_packet = 32M sort_buffer_size = 64M net_buffer_length = 64K read_buffer_size = 16M read_rnd_buffer_size = 16M thread_stack = 192K thread_cache_size = 8 query_cache_limit = 10M query_cache_size = 64M ----- InnoDB specific settings: [source,bash] ----- # Keep data in a separate file for each table innodb_file_per_table = 1 # Allocate memory for data buffers innodb_buffer_pool_size = 1000M innodb_additional_mem_pool_size = 100M # A location of the MySQL database innodb_data_home_dir = /home/databases/mysql/ innodb_log_group_home_dir = /home/databases/mysql/ # The main thing here is the 'autoextend' property # without it your data file may reach maximum size and # no more records can be added to the table. innodb_data_file_path = ibdata1:10M:autoextend innodb_log_file_size = 10M innodb_log_buffer_size = 32M # Some other performance affecting settings innodb_flush_log_at_trx_commit = 2 innodb_lock_wait_timeout = 50 innodb_thread_concurrency = 16 ----- These settings may not be fully optimized for your system, and have been only tested on our systems. If you have found better settings for your systems, feel free to link:http://tigase.net/contact[let us know]. //I am certainly not a database expert nor MySQL expert and I do not pretend to be one. So any comments or suggestions you may have are very welcome and appreciated. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_31_-_Database_Management_-_A_-_Database_Preparation_-_2_-_Prepare_the_Derby_Database_for_Tigase_Server.asciidoc ================================================ [[prepareDerby]] = Prepare the Derby Database for the Tigase Server :author: Wojciech Kapcia :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-06-21 13:28 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to prepare Derby database for connecting the Tigase server. == Basic Setup Preparation of Derby database is quite simple, but the following assumptions are made - +DerbyDB+ - Derby database name - +database/+ directory contains all necessary schema files - +jars/+ and +libs/+ directories contains Tigase and Derby binaries === General Approach From the main Tigase directory execute following commands (Linux and Windows accordingly) *Linux* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar org.apache.derby.tools.ij database/derby-schema-7.1.sql ----- *Windows* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs\derby.jar;libs\derbytools.jar;jars\tigase-server.jar org.apache.derby.tools.ij "database\derby-schema-7-1.sql" ----- This will create Derby database named DerbyDB in the main Tigase directory and load Tigase schema for version 7.1. You will need to repeat this process again to add the PubSub schema into the database. *Linux* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar org.apache.derby.tools.ij database/derby-pubsub-schema-3.2.0.sql ----- *Windows* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs\derby.jar;libs\derbytools.jar;jars\tigase-server.jar org.apache.derby.tools.ij "database\derby-pubsub-schema-3.2.0.sql" ----- If you wish to use the Sock5 Proxy Component, you will need to add that schema as well: *Linux* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar org.apache.derby.tools.ij database/derby-socks5-schema.sql ----- *Windows* [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs\derby.jar;libs\derbytools.jar;jars\tigase-server.jar org.apache.derby.tools.ij "database\derby-socks5-schema.sql" ----- == Connecting Tigase to database Once the database is setup, configure the init.properties file in Tigase and add the following configuration: [source,properties] ----- jdbc:derby:{location of derby database}; ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_32_-_Database_Management_-_A_-_Database_Preparation_-_3_-_Prepare_the_MS_SQL_Server_Database_for_Tigase_Server.asciidoc ================================================ [[prepareMssql]] = Prepare the MS SQL Server Database for the Tigase Server :author: Wojciech Kapcia :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2013-09-04 14:57 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to prepare the MS SQL Server database for connecting the Tigase server to it. == Basic Setup It's expected that a working installation of Microsoft SQL Server is present. The following guide will describe the necessary configurations required for using MS SQL Server with Tigase XMPP Server. == Preparing MS SQL Server Instance After installation of MS SQL Server an instance needs to be configure to handle incoming JDBC connections. For that purpose it's required to open _SQL Server Configuration Manager_. In the left-hand side panel navigate to _SQL Server Configuration Manager_, then _SQL Server Network Configuration -> Protocols for $\{INSTANCE_NAME}_. After selecting instance in the right-hand side panel select TCP/IP and open _Properties_, in the Protocol tab in General section select Yes for Enabled property. In the IP Addresses tab select Yes for Active and Enabled properties of all IP Addresses that you want MS SQL Server to handle. Subsequently set the TCP Port property (if missing) to the default value - 1433. A restart of the instance may be required afterwards. == Configuration using MS SQL Server Management Studio In order to prepare the database you can use either a wizard or execute queries directly in the Query Editor. Firstly you need to establish a connection to the MS SQL Server instance. From Object Explorer select Connect and in the Connect to Server dialog enter administrator credentials. === Using Wizards - Create Login + In the left-hand side panel select Security -> Logins and from context menu choose New Login, in the Wizard window enter desired Login name, select SQL Server authentication and enter desired password subsequently confirming action with OK - Create Database + From the Object Explorer select Databases node and from context menu select New Database; in the Wizard window enter desired Database name and enter previously created Login name into Owner field; subsequently confirming action with OK. === Using Queries From the Object Explorer root node's context menu select New Query. In the Query windows execute following statements adjusting details to your liking: [source,sql] ----- USE [master] GO CREATE DATABASE [tigasedb]; GO CREATE LOGIN [tigase] WITH PASSWORD=N'tigase12', DEFAULT_DATABASE=[tigasedb] GO ALTER AUTHORIZATION ON DATABASE::tigasedb TO tigase; GO ----- == Import Schema From the File menu Select Open -> File (or use Ctrl+O) and then open following files: - sqlserver-schema-7-1-schema.sql - sqlserver-schema-7-1-sp.sql - sqlserver-schema-7-1-props.sql - sqlserver-pubsub-schema-3.2.0.sql Subsequently select created database from the list of Available Databases (Ctrl+U) available on the toolbar and execute each of the opened files in the order listed above. == Configuring from command line tool Creation of the database and import of schema can be done from command line as well. In order to do that, execute following commands from the directory where Tigase XMPP Server is installed otherwise paths to the schema need to be adjusted accordingly: [source,bash] ----- sqlcmd -S %servername% -U %root_user% -P %root_pass% -Q "CREATE DATABASE [%database%]" sqlcmd -S %servername% -U %root_user% -P %root_pass% -Q "CREATE LOGIN [%user%] WITH PASSWORD=N'%password%', DEFAULT_DATABASE=[%database%]" sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -Q "ALTER AUTHORIZATION ON DATABASE::%database% TO %user%;" sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-schema-7-1-schema.sql sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-schema-7-1-sp.sql sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-schema-7-1-props.sql sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-pubsub-schema-3.2.0.sql ----- Above can be automatized with provided script %tigase-server%\scripts\db-create-sqlserver.cmd (note: it needs to be executed from main Tigase XMPP Server directory due to maintain correct paths): [source,sh] ----- $ scripts\db-create-sqlserver.cmd %database_servername% %database_name% %tigase_username% %tigase_password% %root_username% %root_password% ----- If no parameters are provided then the following defaults are used: [source,bash] ----- %database_servername%=localhost %database_name%=tigasedb %tigase_username%=tigase %tigase_password%=tigase12 %root_username%=root %root_password%=root ----- == Tigase configuration - init.properties Configuration of the MS SQL Server follows general database convention. For MS SQL Support --user-db needs to be set to sqlserver: [source,bash] ----- --user-db=sqlserver ----- and the --user-db-uri needs to point to the configured database: [source,bash] ----- --user-db-uri=jdbc:[jtds:]sqlserver://db_hostname:port[;property=val] ----- where any number of additional parameters can (and should) consist of: - databaseName - name of the database - user - username configured to access database - password - password for the above username - schema - name of the database schema - lastUpdateCount - 'false' value causes all update counts to be returned, including those returned by server triggers Example: [source,sh] ----- --user-db-uri=jdbc:sqlserver://hostname:1433;databaseName=tigasedb;user=tigase;password=tigase12;schema=dbo;lastUpdateCount=false ----- == JDBC: jTDS vs MS JDBC driver Tigase XMPP Server supports two JDBC drivers intended to be used with Microsoft SQL Server - one created and provided by Microsoft itself and the alternative implementation - jTDS. Tigase is shipped with the latter in the distribution packages. Starting with the version 7.1.0 we recommend using jDTS driver that is shipped with Tigase as JDBC driver created by Microsoft can cause problems with some components in cluster installations. MS driver can be downloaded form the website: link:http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774[JDBC Drivers 4.0, 4.1 for SQL Server] then unpack the archive. Copy sqljdbc_4.0/enu/sqljdbc4.jar file to $\{tigase-server}/jars directory. Depending on the driver used --user-db-uri needs to be configured accordingly. - Microsoft driver: + [source,bash] ----- --user-db-uri=jdbc:sqlserver://... ----- - jDTS driver + [source,bash] ----- --user-db-uri=jdbc:jdts:sqlserver://... ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_33_-_Database_Management_-_A_-_Database_Preparation_-_4_-_Prepare_the_PostgreSQL_Database_for_Tigase_Server.asciidoc ================================================ [[preparePostgresql]] = Prepare the PostgreSQL Database for the Tigase Server :author: Andrzej Wojcik :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-06-16 09:38 :Revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to prepare PostgreSQL database for connecting to Tigase server. == Basic Setup The PostgreSQL database can be prepared in many ways. Below are presented two possible ways. The following assumptions apply to both methods: - +admin_db_user+ - database user with admin rights - +tigase_user+ - database user for Tigase - +tigasedb+ - database for Tigase === Configuring from PostgreSQL Command Line Tool Run the PostgreSQL command line client and enter following instructions: . Add the +tigase_user+: + [source,sql] ----- psql=# create role tigase_user with login password 'tigase123'; ----- . Create the database for the Tigase server with +tigase_user+ as owner of database: + [source,sql] ----- psql=# create database tigasedb owner tigase_user; ----- . Load database schema to initialize the Tigase server from the file that corresponds to the version of Tigase you want to use. First you need to switch to +tigasedb+. + [source,sql] ----- psql=# \connect tigasedb ----- + Begin by applying the basic Schema + [source,sql] ----- psql=# \i database/postgresql-schema-7-1.sql ----- + Continue by adding the PubSub Schema + [source,sql] ----- psql=# \i database/postgresql-pubsub-schema-3.2.0.sql ----- + And finally if you wish to use Socks5 Proxy component, add that schema: [source,sql] ----- psql=# \i database/postgresql-socks5-schema.sql ----- === Configuring From the Linux Shell Command Line Follow steps below to prepare the PostgreSQL database: . Add the +tigase_user+: + [source,sql] ----- createuser -U admin_db_user -W -D -R -S -P tigase_user ----- + You will be asked for credentials for admin_db_user and password for new database user. . Create the database for the Tigase server with tigase_user as owner of database: + [source,sql] ----- createdb -U admin_db_user -W -O tigase_user tigasedb ----- . Load database schema to initialize the Tigase server from the file that corresponds to the Tigase version you want to use. + [source,sql] ----- psql -q -U tigase_user -W tigasedb -f database/postgresql-schema-7-1.sql psql -q -U tigase_user -W tigasedb -f database/postgresql-pubsub-schema-3.2.0.sql ----- + If you want to use the socks5 proxy component, then add the following line: + [source,sql] ----- psql -q -U tigase_user -W tigasedb -f database/postgresql-socks5-schema.sql ----- The above commands should be executed from the main Tigase directory. The initialization schema file should be also available locally in database/ directory of your Tigase installation. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_34_-_Database_Management_-_A_-_Database_Preperation_-_5_-_Prepare_Tigase_for_MongoDB.asciidoc ================================================ [[mongoDBSupport]] = Preparing Tigase for MongoDB :author: not known :version: v1.0 October, 2015 :date: 2015-01-10 12:22 :toc: :numbered: :website: http://www.tiagse.org Tigase now supports MongoDB for auth, settings, and storage repositories. If you wish to use MongoDB for Tigase, please use this guide to help you. == Dependencies To run Tigase MongoDB support library requires drivers for MongoDB for Java which can be downloaded from link:https://github.com/mongodb/mongo-java-driver/releases[here]. This driver needs to be placed in +/jars+ directory located in Tigase XMPP Server installation directory. == Configuration === Configuration of user repository for Tigase XMPP Server To configure Tigase XMPP Server to use MongoDB you need to set +--user-db-uri=+ in etc/init.properties file to proper MongoDB URI pointing to which MongoDB database should be used (it will be created by MongoDB if it does not exist). +--user-db+ property should not be set to let Tigase XMPP Server autodetect proper implementation of +UserRepository+. Tigase XMPP Server will create proper collections in MongoDB if they do not exist so no schema files are necessary. Example configuration of XMPP Server pointing to MongoDB database +tigase_test+ in a local instance: [source,bash] ----- --user-db-uri=mongodb://localhost/tigase_test ----- If Tigase Server is not able to detect a proper storage layer implementation, it can be forced to use one provided by Tigase using the following lines in +etc/init.properties+ file: ----- --user-db=tigase.mongodb.MongoRepository --auth-db=tigase.mongodb.MongoRepository ----- Every component should be able to use proper implementation to support MongoDB using this URI. Also MongoDB URI can be passed as any URI in configuration of any component. === Configuration for MUC By default, MUC component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store MUC message archive, you can do this by adding the following line to +etc/init.properties+ file: [source] ----- muc/history-db-uri=mongodb://localhost/tigase_test ----- If MUC components fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the +init.properties+ file: ----- muc/history-db=tigase.mongodb.muc.MongoHistoryProvider ----- === Configuration for PubSub By default, PubSub component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store PubSub component data, you can do this by adding the following line to +etc/init.properties+ file: [source] ----- pubsub/pubsub-repo-url=mongodb://localhost/tigase_test ----- If the PubSub components fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the +init.properties+ file: ----- pubsub/pubsub-repo-class=tigase.mongodb.pubsub.PubSubDAOMongo ----- === Configuration for Message Archiving By default, the Message Archiving component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store message archives, you can do this by adding the following line to +etc/init.properties+ file: [source] ----- message-archive/archive-repo-uri=mongodb://localhost/tigase_test ----- If Message Archiving component fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the +init.properties+ file: ----- message-archive/archive-repo-class=tigase.mongodb.archive.MongoMessageArchiveRepository ----- == Schema Description This description contains only basic description of schema and only basic part of it. More collections may be created if additional components of Tigase XMPP Server are loaded and configured to use MongoDB. === Tigase XMPP Server Schema Basic schema for UserRespository and AuthRepository consists of two collections: . tig_users - contains list of users . tig_nodes - contains data related to users in tree-like way +tig_users+ collection contains the following fields: .tig_users [width="50%",options="header"] |===================================================================== |Name |Description |_id |id of user which is SHA256 hash of users jid (raw byte array) |user_id |contains full user jid |domain |domain to which user belongs for easier lookup of users by domain |password |password of user (or hash of password) |===================================================================== +tig_nodes+ collection contains the following fields .tig_nodes [width="50%",options="header"] |===================================================================== |Name |Description |_id |id of row autogenerated by MongoDB |uid |id of user which is SHA256 hash of users jid (raw byte array) |node |full path of node in tree-like structure separated by / (may not exist) |key |key for which value for node is set |value |value which is set for node key |===================================================================== Tigase XMPP Server also uses additional collections for storage of Offline Messages .msg_history collection [width="50%",options="header"] |===================================================================== |Name |Description |from |full user jid of message sender |from_hash |SHA256 hash of message sender jid as raw byte array |to |full users jid of message recipient |to_hash |SHA256 hash of message recipient full jid as raw byte array |ts |timestamp of message as date |message |serialized XML stanza containing message |expire-at |timestamp of expiration of message (if message contains AMP expire-at set) |===================================================================== ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_35_-_Database_Management_-_B_-_Hashed_User_Passwords_in_Database.asciidoc ================================================ [[hashedPasswords]] = Hashed User Passwords in Database :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-10-09 03:13 :revision: v2.1 :toc: :numbered: :website: http://tigase.net By default, user passwords are stored in plain-text in the Tigase's database. However, there is an easy way to have them encoded in either one of already supported ways or to even add a new encoding algorithm on your own. Storing passwords in hashed format in the database makes it possible to avoid using a plain-text password authentication mechanism. You cannot have hashed passwords in the database and non-plain-text password authentication. On the other hand, the connection between the server and the client is almost always secured by SSL/TLS so the plain-text password authentication method is perhaps less of a problem than storing plain-text passwords in the database. Nevertheless, it is simple enough to adjust this in Tigase's database and we will add an option in the Tigase installer to allow you to make the decision on install. == Shortcut Connect to your database from a command line and execute following statement for MySQL database: [source,sql] ----- call TigPutDBProperty('password-encoding', 'encoding-mode'); ----- Where encoding mode is one of the following: - *MD5-PASSWORD* the database stores MD5 hash code from the user's password. - *MD5-USERID-PASSWORD* the database stores MD5 hash code from concatenated user's bare JID and password. - *MD5-USERNAME-PASSWORD* the database stores MD5 hash code from concatenated user's name (localpart) and password. For example: [source,sql] ----- call TigPutDBProperty('password-encoding', 'MD5-PASSWORD'); ----- == Full Route The way passwords are stored in the DB is controlled by Tigase database schema property. Properties in the database schema can be set by a stored procedure called: +TigPutDBProperty(key, value)+. Properties from the DB schema can be retrieved using another stored function called: +TigGetDBProperty(key)+. The simplest way to call them is via command-line interface to the database. For the purpose of this guide let's say we have a MySQL database and a test account: *test@example.com* with password *test77*. By default, most of DB actions for Tigase, are performed using stored procedures including user authentication. So, the first thing to do is to make sure the stored procedures are working correctly. === Create a Test User Account To add a new user account we use a stored procedure: +TigAddUserPlainPw(bareJid, password)+. As you can see there is this strange appendix to the procedure name: *PlainPw*. This procedure accepts plain passwords regardless how it is stored in the database. So it is safe and easy to use either for plain-text passwords or hashed in the DB. There are also versions of procedures without this appendix but they are sensitive on the data format and always have to pass password in the exact format it is stored in the database. So, let's add a new user account: [source,sql] ----- call TigAddUserPlainPw('test@example.com', 'test77'); ----- If the result was 'Query OK', then it means the user account has been successfully created. === Test User Authentication We can now test user authentication: [source,sql] ----- call TigUserLoginPlainPw('test@example.com', 'test77'); ----- If authentication was successful the result looks like this: [source,sql] --------------------- +--------------------+ | user_id | +--------------------+ | 'test@example.com' | +--------------------+ 1 row in set (0.01 sec) Query OK, 0 rows affected (0.01 sec) --------------------- If authentication was unsuccessful, the result looks like this: [source,sql] ---------- +---------+ | user_id | +---------+ | NULL | +---------+ 1 row in set (0.01 sec) Query OK, 0 rows affected (0.01 sec) ---------- === Password Encoding Check +TigGetDBProperty+ is a function, not a procedure in MySQL database so we have to use select to call it: [source,sql] ----- select TigGetDBProperty('password-encoding'); ----- Most likely output is this: [source,sql] ---------------------------------------- +---------------------------------------+ | TigGetDBProperty('password-encoding') | +---------------------------------------+ | NULL | +---------------------------------------+ 1 row in set, 1 warning (0.00 sec) ---------------------------------------- Which means a default password encoding is used, in plain-text and thus no encoding. And we can actually check this in the database directly: [source,sql] ----- select uid, user_id, user_pw from tig_users where user_id = 'test@example.com'; ----- And expected result with plain-text password format would be: [source,sql] ------------------------------------- +-----+--------------------+---------+ | uid | user_id | user_pw | +-----+--------------------+---------+ | 41 | 'test@example.com' | test77 | +-----+--------------------+---------+ 1 row in set (0.00 sec) ------------------------------------- === Password Encoding Change Now let's set password encoding to MD5 hash: [source,sql] ----- call TigPutDBProperty('password-encoding', 'MD5-PASSWORD'); ----- 'Query OK', means the password encoding has been successfully changed. Of course we changed the property only. All the existing passwords in the database are still in plain-text format. Therefore we expect that attempt to authenticate the user would fail: [source,sql] ---------- call TigUserLoginPlainPw('test@example.com', 'test777'); +---------+ | user_id | +---------+ | NULL | +---------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) ---------- We can fix this by updating the user's password in the database: [source,sql] --------------------- call TigUpdatePasswordPlainPw('test@example.com', 'test777'); Query OK, 1 row affected (0.01 sec) mysql> call TigUserLoginPlainPw('test@example.com', 'test777'); +--------------------+ | user_id | +--------------------+ | 'test@example.com' | +--------------------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) --------------------- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_36_-_Database_Management_-_C_-_Tigase_Server_and_Multiple_Databases.asciidoc ================================================ [[multidb]] = Tigase Server and Multiple Databases :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-10-02 04:23 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Splitting user authentication data from all other XMPP information such as roster, vcards, etc... was almost always possible in Tigase XMPP Server. Possible and quite simple thing to configure. Also it has been always possible and easy to assign a different database for each Tigase component (MUC, PubSub, AMP), for recording the server statistics. Almost every data type or component can store information in a different location, simple and easy to setup through the configuration file. However it is much less known that it is also possible to have a different database for each virtual domain. This applies to both the user repository and authentication repository. This allows for very interesting configuration such as user database sharding where each shard keeps users for a specific domain, or physically split data based on virtual domain if each domain refers to a different customer or group of people. How can we do that then? This is very easy to do through the Tigase's configuration file. Typically the well known lines: [source,sh] ----- --auth-db=tigase-custom --auth-db-uri=jdbc:mysql://db1.tigase/dbname?user&password --user-db=mysql --user-db-uri=jdbc:mysql://db2.tigase/dbname?user&password ----- Define just a default databases for both user repository and authentication repository. Default means it is used when there is no repository specified for a particular virtual domain. However, you can have a separate, both user and authentication repository for each virtual domain. Here is, how it works: [source,sh] ----- # First, let's define our default database for all VHosts --auth-db=tigase-custom --auth-db-uri=jdbc:mysql://db1.tigase/dbname?user&password --user-db=mysql --user-db-uri=jdbc:mysql://db2.tigase/dbname?user&password # Now, we have VHost: domain1.com # User authentication data for this VHost is stored in Drupal database --auth-db[domain1.com]=drupal --auth-db-uri[domain1.com]=jdbc:mysql://db7.tigase/dbname?user&password # All other user data is stored in Tigase's standard database in MySQL --user-db[domain1.com]=mysql --user-db-uri[domain1.com]=jdbc:mysql://db4.tigase/dbname?user&password # Next VHost: domain2.com # User authentication is in LDAP server --auth-db[domain2.com]=tigase.db.ldap.LdapAuthProvider # Pretty standard Tigase's definition for the database (repository) # connection string --auth-db-uri[domain2.com]=ldap://ldap.domain2.com:389 # Now is something new, we have a custom authentication repository # settings for a single domain. # Please note how we define the VHost for which we set custom parameters basic-conf/auth-repo-params/domain2.com/user-dn-pattern=cn=,ou=,dc=,dc= # All other user data is stored in the same as default repository --user-db[domain2.com]=mysql --user-db-uri[domain2.com]=jdbc:mysql://db2.tigase/dbname?user&password # Next VHost: domain3.com # Again user authentication is in LDAP server but pointing to # a different LDAP server with different access credentials --auth-db[domain3.com]=tigase.db.ldap.LdapAuthProvider # Pretty standard Tigase's definition for the database # (repository) connection string --auth-db-uri[domain3.com]=ldap://ldap.domain3.com:389 # Now is something new, we have a custom authentication # repository settings for a single domain # Please note how we define the VHost for which we set custom parameters basic-conf/auth-repo-params/domain3.com/user-dn-pattern=cn=,ou=,dc=,dc= # All other user data is stored on the domain3 server in PostgreSQL database --user-db[domain3.com]=pgsql --user-db-uri[domain3.com]=jdbc:pgsql://db.domain3.com/dbname?user&password # For VHost: domain4.com all the data, both authentication and # user XMPP data are stored on a separate # MySQL server with custom stored procedures for both user # login and user logout processing. --auth-db[domain4.com]=tigase-custom --auth-db-uri[domain4.com]=jdbc:mysql://db14.domain4.com/dbname?user&password basic-conf/auth-repo-params/domain4.com/user-login-query={ call UserLogin(?, ?) } basic-conf/auth-repo-params/domain4.com/user-logout-query={ call UserLogout(?) } basic-conf/auth-repo-params/domain4.com/sasl-mechs=PLAIN,DIGEST-MD5 --user-db[domain4.com]=mysql --user-db-uri[domain4.com]=jdbc:mysql://db14.domain4.com/dbname?user&password ----- As you can see, it requires some writing but flexibility is very extensive and you can setup as many separate databases as you need or want. If one database (recognized by the database connection string) is shared among different VHosts, Tigase still uses a single connection pool, so it won't create an excessive number of connections to the database. I hope this helps with more complex setups and configuration cases. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_37_-_Database_Management_-_D_-_Importing_User_Data.asciidoc ================================================ [[dbImportingData]] = Importing User Data :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net You can easily copy data between Tigase compatible repositories that is repositories for which there is a database connector. However, it is not that easy to import data from an external source. Therefore a simple data import functionality has been added to repository utilities package. You can access repository utilities through command +./bin/repo.sh+ or +./scripts/repo.sh+ depending on whether you use a binary package or source distribution. +-h+ parameter gives you a list of all possible parameters: [source,sh] ------------- ./scripts/repo.sh -h Parameters: -h this help message -sc class source repository class name -su uri source repository init string -dc class destination repository class name -du uri destination repository init string -dt string data content to set/remove in repository -u user user ID, if given all operations are only for that ID if you want to add user to AuthRepository parameter must in form: "user:password" -st perform simple test on repository -at simple test for adding and removing user -cp copy content from source to destination repository -pr print content of the repository -n data content string is a node string -kv data content string is node/key=value string -add add data content to repository -del delete data content from repository ------------ -roster check the user roster -aeg [true|false] Allow empty group list for the contact -import file import user data from the file of following format: user_jid, password, roser_jid, roster_nick, subscription, group Note! If you put UserAuthRepository implementation as a class name some operation are not allowed and will be silently skipped. Have a look at UserAuthRepository to see what operations are possible or what operation does make sense. Alternatively look for admin tools guide on web site. ------------- The most critical parameters are the source repository class name and the initialization string. Therefore there are a few example preset parameters which you can use and adjust for your system. If you look inside the +repo.sh+ script you can find at the end of the script following lines: [source,sh] ----- XML_REP="-sc tigase.db.xml.XMLRepository -su ../testsuite/user-repository.xml_200k_backup" MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/tigase?user=root&password=mypass" PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase" java $D -cp $CP tigase.util.RepositoryUtils $MYSQL_REP $* ----- You can see that the source repository has been set to MySQL database with +tigase+ as the database name, +root+ the database user and +mypass+ the user password. You can adjust these settings for your system. Now to import data to your repository simply execute the command: [source,sh] ----- ./bin/repo.sh -import import-file.txt ----- _Note, the import function is available from_ *b895* The format of the import file is very simple. This is a flat file with comma separated values: [source,bash] ----- jid,password,roster_jid,roster_nick,subscriptio,group ----- To create such a file from MySQL database you will have to execute a command like this one: [source,sql] ----- SELECT a, b, c, d INTO OUTFILE 'import-file.txt' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM test_table; ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_38_-_Database_Management_-_E_-_Integrating_Existing_Databases.asciidoc ================================================ [[existingData]] = Importing Existing Data :author: Daniel Wisnewski :version: v1.0 October, 2015 :date: 2015-05-10 13:35 Information about importing user data from other databases. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_39_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_1_-_Connecting_Tigase_Server_to_MySQL_Database.asciidoc ================================================ [[connectingTigaseToMysql]] = Connecting the Tigase Server to MySQL Database :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Please before continuing reading of this manual have a look at the xref:prepareMysql[initial MySQL database setup]. It will help you with database preparation for connecting with Tigase server. The easiest way to setup Tigase server for connecting with MySQL database is to use the xref:tigase3xconfiguration[configuration wizards] (configuration generators) which release you from manually editing the XML configuration file and allow you quickly regenerate the XML configuration file in case of problems. The article describes an older way for using configuration generators which is a bit more difficult and doesn't work on Windows systems. The guide below describes a new way to use them which is simpler and can be applied to Windows systems as well. It is using the +init.properties+ file where you can put all your initial configuration parameters. This guide describes MySQL database connection parameters. This guide is actually very short as there are example configuration files which can be used and customized for your environment. Unfortunately these files are not included yet in the server version 3.x binary release and you have to download them from the SVN repository using following links: . link:https://projects.tigase.org/projects/tigase-server/repository/changes/etc/tigase-mysql.conf[tigase-mysql.conf] - the Tigase server startup file. The only difference from the default one is that it points to the file described below to load initial parameters. . link:https://projects.tigase.org/projects/tigase-server/repository/changes/etc/init-mysql.properties[init-mysql.properties] - the file contains a few initial parameters which can/should be adjusted to your environment. Here is a content of the file with each line described: + [source,bash] ----- # Load standard set of the server components. # Look at the http://www.tigase.org/configuration-wizards # document for other possible values. Normally you don't # need to change this line. config-type=--gen-config-def # List of administrator accounts, please replace them with # administrator accounts in your installation --admins=admin@tigase.org,admin@test-d # The line says that the database used by the Tigase server is 'mysql' # Look at the configuration wizards article for different options # You can also put here a Java class name if you have a custom # implementation for a database connector. --user-db=mysql # The line contains the database connection string. This is database # specific string and for each kind of database it may look differently. # Below string is for MySQL database. Please modify it for your system. # MySQL connector requires connection string in the following format: # jdbc:mysql://[hostname]/[database name]?user=[user name]&password=[user password] --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass # Virtual domains for your server installation, comma separated list of vhosts --virt-hosts=tigase.org,test-d,localhost # Select what packages you want to have logging switched for # The below setting is recommended for the initail setup and it is required # when asking for help with setting the server up --debug=server ----- Download both files and put them to your +etc/+ directory. Edit the +init-mysql.properties+ for your environment. Remove the XML configuration file. Start the server using following command: [source,sh] ----- ./bin/tigase.sh start etc/tigase-mysql.conf ----- _Ask more questions if you got stuck or need any help with this._ ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_40_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_2_-_Integrating_Tigase_Server_with_Drupal.asciidoc ================================================ [[integrateWithDrupal]] = Integrating Tigase Server with Drupal :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Tigase supports integration with Drupal on many levels. At the moment this guide can work with Drupal version 4.x and 5.x. They may also work with Drupal 6.x but this version hasn't been tested. First of all, Tigase can authenticate users against a Drupal database which means you have the same user account for both Drupal website and the XMPP server. Moreover in such a configuration all account management is done via Drupal web interface like account creation, password change update user details and so on. Administrator can temporarily disable user account and this is followed by Tigase server too. == Connecting to Drupal Database The best way to setup Tigase with Drupal database is via configuration wizards that is +init.properties+ file where you can put initial setting for Tigase configuration. If you look in +etc/+ directory of your Tigase installation you should find a few files there. The one we want to base our configuration on is: +init-mysql.properties+. In some older packages the file might be missing, then you can download it from the link:https://projects.tigase.org/projects/tigase-server/repository/changes/etc/init-mysql.properties[SVN repository]. If you look inside the file and strip all the comments you would see following lines: [source,bash] ----- config-type=--gen-config-def --admins=admin@tigase.org,admin@tigase.net --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass --virt-hosts=tigase.org,tigase.net --debug=server ----- All you need to connect to Drupal database are 2 following lines: [source,bash] ----- --auth-db=drupal --auth-db-uri=jdbc:mysql://localhost/drupal?user=drupalusr&password=drupalpass ----- Let's combine it in a single file called +etc/init-drupal.properties+: [source,bash] ----- config-type=--gen-config-def --admins=admin@tigase.org,admin@tigase.net --auth-db=drupal --auth-db-uri=jdbc:mysql://localhost/drupal?user=drupalusr&password=drupalpass --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass --virt-hosts=tigase.org,tigase.net --debug=server ----- In theory you can load Tigase database schema to Drupal database and then both +db-uris+ would have the same database connection string. More details about setting up and connecting to MySQL database can be found in the xref:prepareMysql[MySQL guide]. You need also to edit +etc/tigase.conf+ file to point to your newly created properties file. The last line which looks like this: [source,bash] ----- TIGASE_OPTIONS=" --property-file etc/init.properties " ----- should be changed to following: [source,bash] ----- TIGASE_OPTIONS=" --property-file etc/init-drupal.properties " ----- Make sure you have Java-6 installed and +JAVA_HOME+ is set to the correct location. If +JAVA_HOME+ is not set you can add following line to +etc/tigase.conf+ file: [source,bash] ----- JAVA_HOME="/your/java-6-location" ----- The best way to check whether the variable is set correctly is with command: [source,sh] ----- $ ls -l $JAVA_HOME/bin/java ----- should list you the file without error. Check also if the +logs/+ directory is created in your Tigase server location as sometimes unpacking application doesn't create empty directories. Now when you have the configuration file and databases ready to use you can start the Tigase server with the following command: [source,sh] ----- ./bin/tigase.sh start etc/tigase.conf ----- If you run the Tigase server installed from sources the command would be: [source,sh] ----- ./scripts/tigase.sh start etc/tigase.conf ----- There are system startup scripts for Gentoo and Mandriva Linux on +bin/+ or +scripts/+ directory which can be used to automatically start the server when system starts. Now you can register an account on your Drupal website and connect with an XMPP client using the account details. *Note!* _You have to enable plain password authentication in your XMPP client to connect to Tigase server with Drupal database_ ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_41_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_3_-_Integrating_Tigase_Server_with_LibreSource.asciidoc ================================================ [[integrateWithLibreSource]] = Integrating Tigase Server With LibreSource :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net *This document is still not finished.* Taken directly from link:http://dev.libresource.org/[LibreSource] page: _LibreSource is a collaborative platform dedicated to both software development and community building. Based on Java/J2EE technology, LibreSource is a modular web server that users can customize online by combining resources and rights: wiki pages, forum, trackers, files, download areas, etc. All the tools are included and integrated._ == Short Introduction Integration between *Tigase* server and *LibreSource* is on a database level. It is implemented in the same way as integration with *Drupal* but with slightly more functions available. Basically LibreSource system maintains own database with all it's data and Tigase connects to LibreSource database to authenticate users. All user data specific to XMPP service are kept in separate tables which can be located in the same database as LibreSource data or in different database. Current list of features included in the integration: - XMPP users authentication against user data stored in LibreSource database. - Recording XMPP user on-line status in LibreSource database. This can be displayed on the Web page as additional user info. - Recording user last login time and this information can also be available on Web page. - Checking user account status. So if the user account is disabled in LibreSource system then this user will not be able to login to XMPP service too. - User account creation. This feature might be useful during testing time or user data transition from an old Tigase installation to LibreSource system. _Please note! This feature should be normally disabled on live system. All user account management should be done from LibreSource system because of data caching._ - User account deletion. _Please note! This feature should be normally disabled on live system. All user account management should be done from LibreSource system because of data caching._ A few assumptions: . LibreSource data are kept in PostgreSQL database - +libresource+ and database user is demo. . For use in cases where Tigase data are stored in MySQL database name is tigase, database user is dbuser and database user password is +dbpass+ == How to set Tigase up Now we will focus on setting things up to have both services up and running together. Below is example of the most complex environment to run where LibreSource is using PostgreSQL database and Tigase is using a MySQL database. All basic user data needed for authentication is kept by LibreSource, so Tigase has to connect to PostgreSQL database also in order to authenticate users. . First you need LibreSource system up and running. Please refer to LS documentation for details. . Install Tigase server in the normal way including loading Tigase database schema. Database tables used by Tigase server use different naming convention so you can simply load Tigase DB schema to the same database as LibreSource data. It is also possible and recommended to keep Tigase data in separate database. . Using configuration wizards generate configuration for Tigase server to connect to LibreSource database. Here is the sample file with parameters for configuration wizard assuming following setup: - LibreSource data are kept in PostgreSQL database: +libresource,+ user: +demo+ - Tigase data are kept in MySQL database: +tigase+, user: +dbuser+, password: +dbpass+ - No external components are connected to Tigase server - Tigase works for domain: +domain.net+ + [source,bash] ----- ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " TIGASE_CONFIG="etc/tigase-mysql-libresource.xml" TIGASE_OPTIONS="--gen-config-def \ --user-db mysql \ --user-db-uri jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass&autoCreateUser=true \ --auth-db libresource \ --auth-db-uri jdbc:postgresql://localhost/libresource?user=demo \ --virt-hosts domain.net,localhost " ----- . A simpler example where all data (LibreSource and Tigase) are stored in the same database: - LibreSource data are kept in PostgreSQL database: +libresource+, user: +demo+ - Tigase data are kept also in PostgreSQL database: +libresource+, user: +demo+ - No external components are connected to Tigase server - Tigase works for domain: +domain.net+ + [source,bash] ----- ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " TIGASE_CONFIG="etc/tigase-mysql-libresource.xml" TIGASE_OPTIONS="--gen-config-def \ --user-db pgsql \ --user-db-uri jdbc:postgresql://localhost/libresource?user=demo&autoCreateUser=true \ --auth-db libresource \ --auth-db-uri jdbc:postgresql://localhost/libresource?user=demo \ --virt-hosts domain.net,localhost " ----- Now, you can run Tigase as normal and it all works. *Note!* _You have to load Tigase database schema for user data. Please refer to guide for specific database: xref:mysql2database[MySQL] or xref:postgresDB2[PostgreSQL]._ == Migration From an old Tigase Installation to LibreSource Tigase package includes additional tools to make it easier to manage and control you installation. One is used to change configuration settings - +config.sh+ and another is used to manipulate user data in repository - +repo.sh+. Depending on whether you use Tigase version built from sources or binary version these scripts might be available in either +scripts/+ or +bin/+ subdirectories. To make things simpler let's assume they are stored in +scripts/+ directory. Assuming you have an old Tigase server installation with number of users in MySQL database and you want to migrate all of them to LibreSource there are 2 steps involved: . User data migration . Changing your existing configuration === Data Migration First we need to migrate user data used for authentication. That data will be used by both services: _LibreSource_ and _Tigase_ and they normally stored in _LibreSource_ database. Therefore we have to use _LibreSource_ database connector to handle the data (write or read). _Tigase_ server will be using _LibreSource_ database for reading only but during migration time we need to write user accounts to LS database. Sample command to migrate user accounts looks like this: [source,sh] ----- ./scripts/repo.sh -sc tigase.db.jdbc.JDBCRepository \ -su "jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass" \ -dc tigase.db.jdbc.LibreSourceAuth \ -du "jdbc:postgresql://localhost/libresource?user=demo" \ -cp ----- The above command will copy all user accounts from MySQL tigase database to +libresource+ database. Please refer to repository management tool documentation for information how to migrate single or selected user accounts. If you want to keep all Tigase server data in the same database you have to copy also all other user data like rosters, vCards and so on. First thing we have to do is load the database schema for Tigase data. Because Tigase tables have distinct names from LibreSource, there is no danger for any conflict. As in the above example let's assume LibreSource's data is stored in libresource database and database user name is +demo+: [source,sh] ----- psql -q -U demo -d libresource -f database/postgresql-schema.sql ----- Now we can load and transfer all user data from MySQL database to LibreSource: [source,sh] ----- ./scripts/repo.sh -sc tigase.db.jdbc.JDBCRepository \ -su "jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass" \ -dc tigase.db.jdbc.JDBCRepository \ -du "jdbc:postgresql://localhost/libresource?user=demo" \ -cp ----- This command looks siumilar to the previous one. Just a Java class used for handling destination database is different. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_42_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_4_-_MySQL_Database_Use.asciidoc ================================================ [[mysql2database]] = MySQL Database Use :author: Artur Hefczyc :date: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to configure Tigase server to use link:http://www.mysql.com/[MySQL] database as a user repository. If you used an XML based user repository before you can copy all user data to MySQL database using repository management tool. All steps are described below. == MySQL Database Preparation To load db schema to your MySQL instance first create database: [source,sh] ----- mysqladmin -p create tigase ----- And then you can load database schema: [source,sh] ----- mysql -u dbuser -p tigase < mysql-schema.sql ----- == Server Configuration Now you have to change configuration to load a jdbc module instead of XML based repository. Using configuration management script, first change class name handling repository. To see current settings run command: [source,sh] ----- $ ./scripts/config.sh -c tigase-config.xml -print -key session_1/user-repo-class ----- As a result you should see something like: [source,sh] ----- session_1/user-repo-class = tigase.db.xml.XMLRepository ----- You can see that current setting points to the XML repository implementation. To use jdbc module for connecting to MySQL database you have to set tigase.db.jdbc.JDBCRepository class (enter text below in one line): [source,sh] ----- $ ./scripts/config.sh -c tigase-config.xml -print -key session_1/user-repo-class -value tigase.db.jdbc.JDBCRepository -set ----- As a result you will see new value set for the parameter: [source,bash] ----- session_1/user-repo-class = tigase.db.jdbc.JDBCRepository ----- You have also to set the same value as authorization repository unless you want to use different authorization data source: [source,sh] ----- $ ./scripts/config.sh -c tigase-config.xml -print -key session_1/auth-repo-class -value tigase.db.jdbc.JDBCRepository -set ----- And again as a result we can see: [source,bash] ----- session_1/auth-repo-class = tigase.db.jdbc.JDBCRepository ----- Next step is to set the database connection string. Assuming you have database: *tigase* on *localhost* with database user: *dbuser* and password *dbpass* your connection string will look like this: [source,bash] ----- jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass ----- To set this in your configuration file, you have to the configuration management script 2 times. First for user data repository and second for authorization data repository: [source,sh] ----- $ ./scripts/config.sh -c tigase-config.xml -print -key session_1/user-repo-url -value "jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass" -set $ ./scripts/config.sh -c tigase-config.xml -print -key session_1/auth-repo-url -value "jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass" -set ----- *Note quotes around connection string.* They are needed to make sure the shell won't interpret special characters. Now the configuration is ready to load the jdbc module and connect to your database. One more thing you need to do is to tell JVM which jdbc driver to use to connect to database. Depending on your MySQL and jdbc installation it might be: +com.mysql.jdbc.Driver.+ To set is as database driver you have to set is a jdbc.drivers property value. Usually you do this by adding -D parameter to Java call: [source,sh] ----- $ java -Djdbc.drivers=com.mysql.jdbc.Driver tigase.server.XMPPServer ----- If you use tigase.sh script to run server you will have to add +-Djdbc.drivers=com.mysql.jdbc.Driver+ to the startup script +init.Properties+ property file to +JAVA_OPTIONS+ values. == User Data Import If you previously used an XML based user repository, you can import all data into a MySQL database using repository management tool. This is quite long command so let me list all required parameters first with brief explanation: . *-cp* copy content of the source repository to destination repository. . *-sc* *tigase.db.xml.XMLRepository* source repository class. . *-su* *user-repository.xml* source repository connection string - assuming your user repository is in +user-repository.xml+ file. . *-dc* *tigase.db.jdbc.JDBCRepository* destination repository class. . *-du* *"jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass"* destination repository connection string. And now whole command. Enter all in one line: [source,sh] ----- $ ./scripts/repo.sh -cp -sc tigase.db.xml.XMLRepository -su user-repository.xml -dc tigase.db.jdbc.JDBCRepository -du "jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass" ----- For more information how to use command line administration tools refer to xref:commandLineTools2[command line tools guide.] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_43_-_Database_Management_-_E_-_Integrating_Existing_Databases_-_5_-_PostgreSQL_Database.asciidoc ================================================ [[postgresDB2]] = PostgreSQL Database Use :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:16 :revision: v2.1 :toc: :numbered: :website: http://tigase.net This guide describes how to configure Tigase server to use link:http://www.postgresql.org/[PostgreSQL] database as a user repository. If you used an XML based user repository before you can copy all user data to PostgreSQL database using repository management tool. All steps are described below. == PostgreSQL Database Preparation Create new database user account which will be used to connect to your database: [source,sh] ----- # createuser Enter name of user to add: tigase Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y ----- Now using new database user account create database for your service: [source,sh] ----- # createdb -U tigase tigasedb CREATE DATABASE ----- Now you can load the database schema: [source,sh] ----- # psql -U tigase -d tigasedb -f postgresql-schema.sql ----- Now the database is ready for Tigase server to use. == Server Configuration Server configuration is identical as MySQL database setup. The same jdbc module is used to connect to PostgreSQL database as for MySQL. The only difference is the connection string which usually looks like: [source,bash] ----- jdbc:postgresql://localhost/tigasdb?user=tigase ----- So for more detailed guide how to change configuration refer to xref:mysql2database[MySQL database use guide] or if you look for a more automatic configuration file generation refer to xref:3xconfiguration[configuration wizards] page. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_44_-_Database_Management_-_F_-_Schema_Updates.asciidoc ================================================ [[oldVerSchemas]] = Schema Updates :author: Daniel wisnewski :version: v1.0, October 2015 :date: 2015-10-05 13:41 This is a repository for Schema updates in case you have to upgrade from older installations. - xref:tigaseServer71[Tigase Server Schema v7.1 Updates] Applies to v7.1.0 and v7.2.0 - xref:tigase51schemaupgrade[Upgrades to v5.1 of Tigase] . xref:derby51upgrade[Derby Database Schema Upgrade for Tigase 5.1] . xref:mysql51upgrade[MySQL Database Schema Upgrade for Tigase 5.1] . xref:postgresql51upgrade[PostgreSQL Database Schema Upgrade for Tigase 5.1] - xref:tigase40schemaUpgrade[MySQL Database Schema Upgrade for Tigase 4.0] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_45_-_Database_Managament_-_F_-_Schema_Updates_-_A_-_Tigase_Server_7.1.asciidoc ================================================ [[tigaseServer71]] = Tigase Server Schema v7.1 Updates :author: Daniel Wisnewski :version: v1.0 October 2015 :Date: 2015-10-12 15:36 :numbered: :website: http://www.tigase.org [[v710notice]] == *FOR ALL USERS UPGRADING TO v7.1.0 FROM A v7.0.2 INSTALLATION* The schema has changed for the main database, and the pubsub repository. In order to upgrade to the new schemas, you will need to do the following: + 1. Upgrade the Main database schema to v7.1 using the database/${DB_TYPE}-schema-upgrade-to-7-1.sql file 2. Upgrade the Pubsub Schema to v3.1.0 using the database/${DB_TYPE}-pubsub-schema-3.1.0.sql file 3. Upgrade the Pubsub Schema to v3.2.0 using the database/${DB_TYPE}-pubsub-schema-3.2.0.sql file All three commands may be done at the same time in that order, it is suggested you make a backup of your current database to prevent data loss. == Tigase Schema Change for v7.1 Tigase has made changes to its database to include primary keys in the tig_pairs table to improve performance of the Tigase server. This is an auto-incremented column for Primary Key items appended to the previous schema. *You MUST update your database to be compliant with the new v7.1 schema. If you do not, Tigase will not function properly.* _This change will affect all users of Tigase using v7.1.0 and newer._ If you are installing a new version of v7.1.0 on a new database, the schema should automatically be installed. First, shut down any running instances of Tigase to prevent conflicts with database editing. Then from command line use the DBSchemaLoader class to run the -schema-upgrade-to-7.1.sql file to the database. The command is as follows: In a linux environment [source,bash] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbHostname ${HOSTNAME} -dbType ${DB_TYPE} -rootUser ${ROOT_USER} -dbPass ${DB_USER_PASS} -dbName ${DB_NAME} -schemaVersion ${DB_VERSION} -rootPass ${ROOT_USER_PASS} -dbUser ${DB_USER} -adminJID "${ADMIN_JID}" -adminJIDpass ${ADMIN_JID_PASS} -logLevel ALL -file database/${DB_TYPE}-schema-upgrade-to-7-1.sql ----- In a windows environment [source,bash] ----- java -cp jars/* tigase.util.DBSchemaLoader -dbHostname ${HOSTNAME} -dbType ${DB_TYPE} -rootUser ${ROOT_USER} -dbPass ${DB_USER_PASS} -dbName ${DB_NAME} -schemaVersion ${DB_VERSION} -rootPass ${ROOT_USER_PASS} -dbUser ${DB_USER} -adminJID "${ADMIN_JID}" -adminJIDpass ${ADMIN_JID_PASS} -logLevel ALL -file database/${DB_TYPE}-schema-upgrade-to-7-1.sql ----- All variables will be required, they are as follows: + * ${HOSTNAME} - Hostname of the database you wish to upgrade. + * ${DB_TYPE} - Type of database [derby, mysql, postgresql, sqlserver]. + * ${ROOT_USER} - Username of root user. + * ${ROOT_USER_PASS} - Password of specified root user. + * ${DB_USER} - Login of user that can edit database. + * ${DB_USER_PASS} - Password of the specified user. + * ${DB_NAME} - Name of the database to be edited. + * ${DB_VERSION} - In this case, we want this to be 7.1. + * ${ADMIN_JID} - Bare JID of a database user with admin privileges. Must be contained within quotation marks. + * ${ADMIN_JID_PASS} - Password of associated admin JID. + Please note that the SQL file for the update will have an associated database with the filename. i.e. postgresql-update-to-7.1.sql for postgresql database. A finalized command will look something like this: [source,bash] ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbHostname localhost -dbType mysql -rootUser root -rootPass root -dbUser admin -dbPass admin -schemaVersion 7.1 -dbName Tigasedb -adminJID "admin@local.com" -adminJIDPass adminpass -logLevel ALL -file database/mysql-schema-upgrade-to-7.1.sql ----- Once this has successfully executed, you may restart you server. Watch logs for any db errors that may indicate an incomplete schema upgrade. [[pubSub71]] == Changes to Pubsub Schema Tigase has had a change to the PubSub Schema, to upgrade to PubSub Schema v7.1 without having to reform your databases, use this guide to update your databases to be compatible with the new version of Tigase. *NOTE* Current PubSub Schema is v3.2.0, you will need to repeat these instructions for v3.1.0 and then v3.2.0 before you run Tigase V7.1.0. The PubSub Schema has been streamlined for better resource use, this change affects all users of Tigase. To prepare your database for the new schema, first be sure to create a backup! Then apply the appropriate PubSub schema to your MySQL and it will add the new storage procedure. All these files should be in your /database folder within Tigase, however if you are missing the appropriate files, use the links below and place them into that folder. The MySQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/revisions/master/entry/database/mysql-pubsub-schema-3.1.0.sql[Here]. The Derby schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/derby-pubsub-schema-3.1.0.sql[Here]. The PostGRESQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/postgresql-pubsub-schema-3.1.0.sql[Here]. The MS SQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/sqlserver-pubsub-schema-3.1.0.sql[Here]. The same files are also included in all distributions of v7.1.0 in +[tigaseroot]/database/+ . All changes to database schema are meant to be backward compatible. You can use a utility in Tigase to update the schema using the following command from the Tigase root: Linux ----- java -cp "jars/*" tigase.util.DBSchemaLoader ----- or from a Windows environment ----- java -cp jars/* tigase.util.DBSchemaLoader ----- *NOTE: Some variation may be necessary depending on how your java build uses -cp option* Use the following options to customize. Options in bold are required.:: * *[-dbType database_type {derby, mysql, postgresql, sqlserver}]* * [-schemaVersion schema version {4, 5, 5-1} ] * *[-dbName database name]* * [-dbHostname database hostname] (default is localhost) * [-dbUser tigase username] * [-dbPass tigase user password] * *[-rootUser database root username]* * *[-rootPass database root password]* * *[-file path to sql schema file]* * [-query sql query to execute] * [-logLevel java logger Level] * [-adminJID comma separated list of admin JIDs] * [-adminJIDpass password (one for all entered JIDs] *Arguments take following precedent: query, file, whole schema* As a result your final command should look something like this: ----- java -cp "jars/*" tigase.util.DBSchemaLoader -dbType mysql -dbName tigasedb -dbUser root -dbPass password -file database/mysql-pubsub-schema-3.1.0.sql ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_46_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x.asciidoc ================================================ [[tigase51schemaupgrade]] = Tigase 5.1 Database Schema Upgrade :author: Wojciech Kapcia :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-07-16 11:10 :toc: :numbered: :website: http://tigase.net We had to make a small change to the database schema for Tigase version 5.1.0. It does not affect data or data structure, only the way in which some data is accessed in database. We added one more stored procedure which has to be installed in database if you upgrade your installation from a previous Tigase version The schema upgrade is very simple and safe but make sure the current database schema is in version 4.0. If you happen to use ancient version of Tigase earlier than 4.0 and you want to upgrade to 5.1, you have to run xref:tigase40schemaupgrade[4.0 upgrade script] first. Please follow detailed guide for the database applicable to your installation: xref:derby51upgrade[Derby], xref:mysql51upgrade[MySQL], xref:postgresql51upgrade[PostgreSQL]. - xref:derby51upgrade[Derby Database Schema Upgrade for Tigase 5.1] - xref:mysql51upgrade[MySQL Database Schema Upgrade for Tigase 5.1] - xref:postgresql51upgrade[PostgreSQL Database Schema Upgrade for Tigase 5.1] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_47_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_1_-_Derby.asciidoc ================================================ [[derby51upgrade]] = Derby Database Schema Upgrade for Tigase 5.1 :author: Wojciech Kapcia :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-06-20 19:12 :toc: :numbered: :website: http://tigase.net The schema upgrade is very simple and safe but make sure the current database schema is in version 4.0. First things first - make a database backup: [source,sh] ----- tar -czf derbyDB.tar.gz /path/to/derbyDB ----- If you need to restore database for any reason simply extract files from the backup archive: [source,sh] ----- rm -rf /path/to/derbyDB tar -xf derbyDB.tar.gz ----- Now we can run schema upgrade script [source,sh] ----- java -Dij.protocol=jdbc:derby: -Dij.database="/path/to/derbyDB" \ -Dderby.system.home=`pwd` \ -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar \ org.apache.derby.tools.ij database/postgresql-schema-upgrade-to-5-1.sql ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_48_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_2_-_MySQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc ================================================ [[mysql51upgrade]] = MySQL Database Schema Upgrade for Tigase 5.1 :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-04-21 03:58 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The schema upgrade is very simple and safe but make sure the current database schema is in version 4.0. Assumptions: . *tigasedb* is a database name . *tigase_user* is a database user name . *mypass* is database user password First things first - make a database backup: [source,sh] ----- mysqldump -u tigase_user -pmypass tigasedb > tigasedb_dump.sql ----- If you need to restore database for any reason execute following commands: [source,sh] ----- msyqladmin -u tigase_user -pmypass drop tigasedb mysqladmin -u tigase_user -pmypass create tigasedb mysql -u tigase_user -pmypass tigasedb < tigasedb_dump.sql ----- _Note! You may be required to use root user and his password to execute mysqladmin commands._ Now we can run schema upgrade script [source,sh] ----- mysql -u tigase_user -pmypass tigasedb < database/mysql-schema-upgrade-to-5-1.sql ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_49_-_Database_Management_-_F_-_Schema_Updates_-_B_-_Tigase_Server_Version_5.x_-_3_-_PostgreSQL_Database_Schema_Upgrade_for_Tigase_5.1.asciidoc ================================================ [[postgresql51upgrade]] = PostgreSQL Database Schema Upgrade for Tigase 5.1 :author: Andrzej Wojcik :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2012-06-16 11:03 :revision: v2.1 :toc: :numbered: :website: http://tigase.net The schema upgrade is very simple and safe but make sure the current database schema is in version 4.0. Assumptions: - *tigasedb* is a database name - *tigase_user* is a database user name - *admin_db_user* is database admin user name First things first - make a database backup: [source,sql] ----- pg_dump -U tigase_user -W tigasedb > tigasedb_dump.sql ----- If you need to restore database for any reason execute following commands: [source,sql] ----- dropdb -U admin_db_user -W tigasedb createdb -U admin_db_user -W -O tigase_user tigasedb psql -U tigase_user -W tigasedb < tigasedb_dump.sql ----- Now we can run schema upgrade script [source,sql] ----- psql -q -U tigase_user -W tigasedb -f database/postgresql-schema-upgrade-to-5-1.sql ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_51_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x.asciidoc ================================================ [[tigasev4x]] = Tigase Server Version 4.x :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-01-06 20:22 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Schema Upgrades for Tigase server version 4.x. - xref:tigase40schemaUpgrade[MySQL Database Schema Upgrade for Tigase 4.0] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_52_-_Database_Management_-_F_-_Schema_Updates_-_C_-_Tigase_Server_Version_4.x_-_1_-_MySQL_Database_Schema_Upgrade_for_Tigase_4.0.asciidoc ================================================ [[tigase40schemaupgrade]] = MySQL Database Schema Upgrade for Tigase 4.0 :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-01-06 20:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net For number of reasons the database schema had to be changed for Tigase server version 4.0. The most important are: - Compliance with the XMPP RFC which says that each part of JID may have up to 1023 characters. We store in the database user JIDs without resource names thus the maximum possible size of the user id is 2047. There aren't really JIDs that long yet, but we experienced quite long JIDs in a few installations already. So it was decided to prepare Tigase to accept any JID allowed by RFC. - Performance and flexibility - the Tigase server now accesses database using stored procedures. This allows for any database storage format and it doesn't really matter for Tigase server what is the database schema how data is organized inside. What it needs is just bunch of stored procedures to access the data. This allows for much more flexibility in storing user data as well as much easier integration with third-party systems as well as organize data in more efficient way. Therefore when you run the Tigase server now it may (depending on what exact SVN revision you use) refuse to start if it detects that the database schema is not updated. If it happens just follow steps below to update the database schema and start the server again. Updating of the database schema is very easy and almost fully automated process. Just follow the steps below and you should be able to run the new version of Tigase server in a few minutes or even seconds depending on your database size. It took around 7 minutes to update our database with 200k user accounts on an average machine. *Note. Do not update the database schema before Tigase server tells you to do so. Be sure to do a database backup before starting the schema update.* _Please note. I have done a few schema upgrades already in a few different configurations and here are a few tips which might be useful if something goes wrong:_ . *You really, REALLY have to do the DB backup (database dump) before upgrading.* _If you don't you might not be able to revert database on your own._ . _In case of error:_ *ERROR 1419 (HY000) at line 31 in file: 'database/mysql-schema-4-sp.schema': You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)* _Restore the database following description found below and run the update again as MySQL super user._ . _The following error may manifest itself in many ways from the NullPointerException in Tigase server log file to message like this:_ *User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.* _The best solution to this is to grant proper permissions to this user. Enter the MySQL command line mode as MySQL super user:_ + [source,sql] ----- $ mysql -u root -proot_passwd mysql mysql> GRANT SELECT, INSERT, UPDATE ON \`mysql\`.\`proc\` TO 'tigase_user'@'localhost'; mysql> GRANT SELECT, INSERT, UPDATE ON \`mysql\`.\`proc\` TO 'tigase_user'@'%'; mysql> GRANT SELECT, INSERT, UPDATE ON \`mysql\`.\`proc\` TO 'tigase_user'; mysql> FLUSH PRIVILEGES; $ ----- Assumptions: . *tigasedb* is a database name . *tigase_user* is a database user name . *mypass* is database user password First things first - make a database backup: [source,sh] ----- mysqldump -u tigase_user -pmypass tigasedb > tigasedb_dump.sql ----- If you need to restore database for any reason execute following commands: [source,sh] ----- msyqladmin -u tigase_user -pmypass drop tigasedb mysqladmin -u tigase_user -pmypass create tigasedb mysql -u tigase_user -pmypass tigasedb < tigasedb_dump.sql ----- _Note! You may be required to use_ *root* _user and password to execute mysqladmin commands. Ok we have the database backup and we know how to restore it. Now we can run schema upgrade script:_ [source,sh] ----- mysql -u tigase_user -pmypass tigasedb < database/mysql-schema-upgrade-to-4.sql ----- _The script should generate output like this:_ [source,sh] ----- Droping index for user_id column Resizing user_id column to 2049 characters to comply with RFC Creating a new index for user_id column for first 765 bytes of the field Adding sha1_user_id column Adding user_pw column Adding last_login column Adding last_logout column Adding online_status column Adding failed_logins column Adding account_status column Creating a new index for user_pw column Creating a new index for last_login column Creating a new index for last_logout column Creating a new index for account_status column Creating a new index for online_status column Resizing node column to 255 characters Changing pval column type to mediumtext Loading stored procedures definitions Setting passwords encoding in the database Converting database to a new format Creating a new index for sha1_user_id column Setting schema version to 4.0 All done, database ready to use! ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_53_-_Components.asciidoc ================================================ [[loadComponent]] = Configuring the Tigase Server to Load a Component :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net A detailed description of all the configuration options is in the +init.properties+ guide where you can also find information described below and much more. The purpose of this document is to give you a brief introduction on how to load a component into Tigase server without the need to dig through all the details. I will show how to load 2 components into Tigase server using a configuration in the init.properties file: link:https://projects.tigase.org/projects/tigase-muc[MUC] and link:https://projects.tigase.org/projects/tigase-pubsub[PubSub]. The only step is to tell the server what components to load, how to name them and optionally give some extra parameters. To do so open the +init.properties+ file you use in your installation. Let's say you want to just add PubSub for now. All you need to do is add 2 lines to the properties file: [source,bash] ----- --comp-name-1=pubsub --comp-class-1=tigase.pubsub.PubSubComponent ----- The first line contains the component name 'pubsub' and the main class for this component is: 'tigase.pubsub.PubSubClusterComponent'. It doesn't really matter what the component name is, the only requirement is that it must be unique among other components names. Because you can load many components, it helps to provide descriptive names thus 'pubsub' is a good name for a 'PubSub' component. You can of course add more components, even PubSub components to the same server. Just remember that each of them would need to have a different name then. For example: [source,bash] ----- --comp-name-2=pubsub-priv --comp-class-2=tigase.pubsub.PubSubComponent ----- Although this may be rare, it allows for wide compatibility and platform stability. Normally, however we want to load few different components like PubSub, MUC, MSN Transport and so on.... Therefore instead of the above second PubSub we can load the MUC component: [source,bash] ----- --comp-name-2=muc --comp-class-2=tigase.muc.MUCComponent ----- Changes to the init.properties file will take effect upon server restart. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_54_-_Components_-_A_-_StanzaSender.asciidoc ================================================ [[stanzaSender]] = StanzaSender :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-04-06 21:18 :revision: v2.1 :toc: :numbered: :website: http://tigase.net StanzaSender is a component which makes it easier to integrate XMPP server with other third-party tools. It simply allows you to send stanzas from your application without implementing any XMPP specific code. The component regularly reads specified data source for XMPP packets to send. The data source can be a SQL database, directory on your filesystem, or anything you might want. If you have a Web application for example for which you want to send notifications of an event to selected users you can install link:https://projects.tigase.org/projects/tigase-server/repository/revisions/master/show/src/main/java/tigase/server/ssender[StanzaSender] component on your Tigase server. It will help you to easily distribute your messages to end-users. == How it Works The module itself doesn't do anything, it just schedules tasks and sends stanzas which come from anywhere. To do the actual work of retrieving stanzas from data source the component uses *tasks*. In theory the task can retrieve XMPP packets for sending from any location or may just generate stanzas on its own. In practice there are 2 *tasks* already implemented and ready to use. You can treat them as a sample code for implementation of your own tasks customised for your specific needs or you can just use these tasks as they are. The tasks which are available are: - +FileTask+ retrieving stanzas from directory in file system. - +JDBCTask+ retrieving stanzas from SQL database. === FileTask +FileTask+ implements tasks for cyclic retrieving stanzas from a directory and sending them to the StanzaHandler object. It looks for any new stanza to send. Any single file can contain only a single stanza to send and any entry in database table can also contain only a single stanza to send. Files on hard disk and records in databases are deleted after it is read. Any file in a given directory is treated the same way - Tigase assumes it contains valid XML data with XMPP stanza to send. You can however set in configuration, using wildchars which files contain stanzas. All stanzas must contain complete data including correct "_from_" and "_to_" attributes. By default it is looking for +*.stanza+ files in +/var/spool/jabber/+ folder but you can specify different directory names in the initialization string. Here is a sample initialization strings: - +/var/spool/jabber/*.stanza+ - +/var/spool/jabber/*+ The last is equal to: - +/var/spool/jabber/+ Note the last forward slash '/' is required in such case if the last element of the path is a directory. *Please note! Tigase must have writing permissions for this directory, otherwise it may not function properly.* === JDBCTask +JDBCTask+ implements tasks for cyclic retrieving stanzas from database and sending them to the StanzaHandler object. Database table format: - *id* - numerical unique record identifier. - *stanza* - text field containing valid XML data with XMPP stanza to send. Any record in this table is treated the same way - Tigase assumes it contains valid XML data with XMPP stanza to send. No other data are allowed in this table. All stanzas must be complete including correct "_from_" and "_to_" attributes. By default it is looking for stanzas in +xmpp_stanza+ table, but you can specify a different table name in the connection string. For example: +jdbc:mysql://localhost/tigasedb?user=tigase&password=pass&table=xmpp_stanza+ Please note the last parameter which is specific to +JDBCTask+. You can specify the table name which stores stanzas for sending, if omitted default value is: +xmpp_stanza+. == Configuration StanzaSender is a Tigase component so the configuration is similar to that of all other components. The simplest way to get the settings for *StanzaSender* is by generating a configuration with all possible components. To do this you have to run Tigase server with +--gen-config-all+ parameter set. By default this component name is *ssend* and here is a content of the configuration file for *StanzaSender*: It is one of +msg-receivers+: [source,bash] ----- ... ----- To activate the component and a specify class name for it following entries has been added: [source,bash] ----- ----- And the main settings section for the component: [source,bash] ----- ----- Most parameters should be pretty clear but some may need a little explanation. === General +StanzaSender+ parameters: - *default-interval* number which specifies in seconds how often should the task look in data source for new packets to send. - *max-queue-size* is a number which specifies internal packets queue size. This is used to prevent the component from consuming all the memory for data in case the component can not process them. - *stanza-listeners* is a list of task names to load. Each task can read XMPP packets to send from different data sources. You can load as many listeners (tasks) as you need. Each task must read stanzas from different data sources. For each task from the +stanza-listeners+ list there is a separate section with parameters for each task: - *active* boolean switch allowing you to turn on/off the task without removing configuration completely. - *class-name* Java class name which implements the task. This class must extend +tigase.server.ssender.SenderTask+ and it is loaded at runtime. - *init-string* is kind of data source connection string. For database it is just database connection string, for file system this is just a directory name. It may be even different for different tasks. The 2 tasks already implemented have some specific features: +FileTask+ allows you to use wild-chars in directory/ file name specification and +JDBCTask+ allows you to specify additional parameter at the end of JDBC connection string - database table name. For specific examples look at above config sections. - *interval* is a number which allows you to specify different interval in seconds for checking data source for each task. *NOTE:* Each task has own separate parameters list. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_55_-_Components_-_B_-_Tigase_HTTP_API.asciidoc ================================================ = Tigase HTTP API :author: Daniel Wisnewski & Andrzej Wójcik :version: v1.2 August 2015 :date: 2015-23-08 10:13 :toc: :numbered: :website: http://www.tigase.org Welcome to the Tigase HTTP API users guide. The HTTP API allows you to manage, configure, chat, and send commands to Tigase server using a simple, easy-to-use interface right from your browser! We will guide you through setup, running, and going through some features of the HTTP API. == Requirements The HTTP API Requires Tigase version v5.0.3 but we recommend using the latest version of Tigase which will give you the easiest setup and functionality. Current versions of Tigase include most of the required files needed to run the API, however you will need to add one more library: servlet-api-3.1.jar which is available link:https://projects.tigase.org/attachments/download/1504/servlet-api-3.1.jar[Here]. Place that file in your /jars directory and you're all setup and good to go. *Please note, earlier versions of Tigase installer may have not included another required file: javax.servlet-api.jar* This file is included in the archive distributions, and may be extracted to the /jars directory from there. For older versions of the API, please see link:https://projects.tigase.org/projects/tigase-http-api/wiki/Dependencies[the Tigase HTTP API Wiki]. == Setup & Configuration Once all the requirements in place, all you need to do is add the following lines to Tigase's init.properties file: [source,properties] ---- --comp-name-3=http --comp-class-3=tigase.http.HttpMessageReceiver ---- Note that the class and name number is not important, so long as you don't have anything else with the same number. With this default configuration Tigase will attempt to start an http server at port 8080 and run the default modules such as RestModule which will add context for the REST API in /rest path. RestModule will also load all groovy scripts located in scripts/rest/xxx directories and it will bind it to proper action for the /rest/xxx/ paths. More than one directory can be used, think of xxx as a wildcard. === Advanced Configuration The HTTP component has a variety of configuration options, lets see them in detail here [[httpCompProp]] ==== Component Properties Please note, for settings mentioning {compname} replace them with the exact text found as --comp-name, which may be http, rest, or something you have set custom in init.properties. {compname}/http/ports[i]=8088,8096:: Sets a comma separated list of ports on which the HTTP server listens for connections. 8080 is set by default. {compname}/2222/socket=ssl:: Sets the port you wish the HTTP server to listen to for HTTPS connections to 2222 {compname}/4096/domain=example.com:: Sets 4096 as the port number you want to listen to HTTPS connections *AND* set the domain name of the SSL certificate from Tigase XMPP server certificate store to be used. {compname}/server-class=:: Sets the name of the class used to manage the HTTP server. The following names may be used * *tigase.http.jetty.JettyStandaloneHttpServer* - starts standalone Jetty HTTP Server instance *(requires Tigase HTTP API - Jetty HTTP Server)* * *tigase.http.jetty.JettyOSGiHttpServer* - uses Jetty HTTP Server instance available as OSGi service (may be used only in OSGi envoirment) *(requires Tigase HTTP API - Jetty HTTP Server)* * *tigase.http.java.JavaStandaloneHttpServer* - uses HttpServer provided by Java JDK to start standalone HTTP server (may not work on JDK from every JDK provider) {compname}/http/port:: An older version of the /ports[i] setting, it is still supported, but expect to be phased out. {compname}/setup/admin-credentials:: Sets a user and password combination that can access the web installer setup pages. By default administrator JIDs listed in --admins property are granted access, however you may specifiy a specific user and password to give access in addition to those JIDs. + Format is [username:password] So for example, _http/setup/admin-credentials=admin:password_ + Note that this stores the information in *plaintext on init.properties file*, and *this is an optional setting*. ==== Modules Tigase HTTP API component provides functionalities as modules which may be enabled or disabled and configured separately. Common settings for modules which can be passed in component properties in following format component_name/module_id/module_setting: - active[B]= Values true/false to enable or disable module - context-path= Path of HTTP context under which module should be available - vhosts[s]= Comma separated list of virtual hosts under which the module should be availble. If this setting is not set, the HTTP module will be available for all virtual hosts. With those ideas in mind, lets look at the available modules for the HTTP API. ===== Rest Module This module provides support for the REST API. enable it by using this line in the init.properties file: ---- http/RestModule/active[B]=true ---- Assuming that comp-name for the class is +http+ rest-scripts-dir=:: Path to directory containing scripts processing REST requests. By default this directory is scripts/rest api-keys[s]=:: Comma separated list of strings which would be possible to use as keys to pass api-key parameter to request an authorization to execute. If nothing is passed, then no request will be allowed. To allow any request, this property needs to be set to +open_access+. ===== DNS Webservice Module +dns-webservice+ module provides support for resolution of DNS names using the HTTP protocol. This might be useful for web applications that need to resolve DNS address to a specific IP. For example, discover IP and port of WebSocket service to use to connect to XMPP server. To activate this module, use the following line; [source,properties] ---- http/dns-webservice/active[B]=true ---- Assuming that comp-name for the class is +http+ == Use of the HTTP API To begin using the HTTP API, point a browser to the following url http://your.server.domain:8080/ui/ and you will be presented with the following image to login with. image:images/http-login.jpg[] Use your admin-level XMPP id and it's password to login. Please use bare JID for logins. *NOTE: Normal users can login here as well to use chat and basic functions, but they will not have admin privileges as shown in this guide* == Browser interface walk-through === Chat Chat is the first window that you will see after logging in. It's quite bare here since there is no roster to speak of. If you had a roster, users would be shown. Lets add a user. Click the user add icon, and then fill in the fields below. image:images/http-add-new.jpg[] Once both users have added and authorized each other's roster listing, the users and groups will be shown on the left, with the right side being used for chat functionality. image:images/http-chat.jpg[] === Discovery The Discovery tab encapsulates the service discovery function of XMPP servers, and will provide a list of available services. Clicking on the service will give you options for executing commands, checking settings, MUC rooms and more. === Management The Management tab is your administration and settings tool for the XMPP server. Here you can change settings, add and remove users, send server-wide notifications, write and execute scripts, and even obtain server statistics at a glance. *NOTE: some changes to settings may be instant, and others require a server restart* === Statistics The statistics tab lists all running components in the server. == HTTP API Scripting Scripts in the HTTP API component are used for processing all of requests. To add a new action to HTTP API component you need to create a script in Groovy in which there is an implementation of class extending tigase.http.rest.Handler class. The URI of the script will be created from the location of script in scripts folder. For example, if TestHandler script with regular a expression will be set to +/test+ and will be placed in +scripts/rest/tested+, the handler will be called for following URI +/rest/tested/test+. === Properties If you are extending classes, you will need to set the following properties: regex:: regular expression which is used to match request URI and parse parameters embedded in URI, example below: /\/([^@\/]+)@([^@\/]+)/ requiredRole:: Role of the user required to be able to access this URI. Available values: null, "user", "admin". If requiredRole is not null, authentication will be required. isAsync:: If set to true, it will be possible to wait for results, perhaps waiting for an IQ stanza to send results. === Properties Containing Closures Extended class should also set closures for one or more of the following properties: +execGet+, +execPut+, +execPost+, and +execDelete+ depending on which HTTP action or actions you need to support for the following URI. Each closure *has dynamic arguments lists*. Below is a list of arguments passed to closure which describes how and when the list of arguments change. I) *service*: Implementation of Service interface, used to access database or send/recieve XMPP stanzas. II) *callback*: Closure which needs to be called to return data. Accepts only one argument of type +String,byte[],Map+. If data is type of Map it will be encoded to JSON or XML depending on 'Content-Type' header. III) *user*: Will be passed only if +requiredRole+ is not null. *In other cases this argument will not be in arguments list!* IV) *content*: Parsed content of the request. *Will not be in arguments list if Content-Length of request is empty*. If Content-Type is of XML or JSON type, type returned as Map. Otherwise it will be an instance of +HttpServletRequest+. V) *x*: Additional arguments passed to callback are groups from regular expression matching URI. *Groups are not passed as list, but are added to a list of arguments as next arguments*. If the property for corresponding HTTP action is not set, the component will return a 404 HTTP error. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_56_-_Components_-_B_-_Tigase_HTTP_API_-_1_-_REST_API_Guide.asciidoc ================================================ [[restAPI]] = REST API & HTTP Guide :author: many people :date: 2015-11-09 10:22 :version: v1.0 September 2015 :toc: :numbered: :website: http://www.tigase.org This component covers both REST API as well as basic HTTP component configuration. REST stands for REpresentational State Transfer which is a stateless communication method that in our case passes commands using HTTP GET, PUT, POST, and DELETE commands to resources within the Tigase server. Although REST uses HTTP to receive commands, REST itself is not intended for use in a browser. == Setup & Configuration Tigase's REST component requires the following in classpath - +servlet-api-3.1.jar+ If you have installed Tigase v7.1.0 or later, the jar is already installed. If you are using an older version of Tigase, you may download the file from link:https://projects.tigase.org/attachments/download/1504/servlet-api-3.1.jar[this link]. Once this is installed, you will also need to add the following lines in your init.properties file to enable the HTTP component. [source,bash] ------ --comp-name-4=http --comp-class-4=tigase.http.HttpMessageReceiver ------ In this default configuration, Tigase will try to start a standalone Jetty HTTP server at port 8080 and start up the default modules, including +RestModule+ which will add context for REST API in the /rest path. +RestModule+ will also load all groovy scripts located in +scripts/rest/*+ directories and will bind them to proper actions for the +/rest/*+ paths. *NOTE:* Scripts that handle HTTP requests are available in the component repository in +src/scriopts/groovy/tigase/rest/+ directory. === Component Properties Here are some additional properties for the +HttpMessageReceiver+ component that can be set in the init.properties file. - +{compname}/http/ports[i]=+ - Sets a comma separated list of ports on which the HTTP server will listen for connections. Default is 8080. - +{compname}/*********/socket=ssl+ - Sets the port for SSL connections, replace ### with the port number of your choice. - +{compname}/*********/domain=example.com+ - This sets the domain name of the SSL certificate from Tigase XMPP certificate store, also sets the port to ### to listen for HTTPS connections. - +{compname}/server-class=+ - Sets the name of the class used to manage the HTTP server. Currently there are the following options: . +tigase.http.JettyStandaloneHttpServer+ - Starts standalone Jetty HTTP Server instance *(requires Tigase HTTP API - Jetty HTTP Server)* . +tigase.http.jetty.JettyOSGIHttpServer+ - Uses Jetty HTTP Server instance available as OSGi service (may be used only in OSGi envoirment) *(require Tigase HTTP API - Jetty HTTP Server)* . +tigase.http.java.JavaStandaloneHttpServer+ - Uses +HttpServer+ provided by Java JDK to start standalone HTTP server (may not work on JDK from every JDK provider). . +{compname}/http/threads=+ - Sets the number of threads available for HTTP component. Default is 4. . +{compname}/http/request-timeout=+ - Sets the timeout time in ms for threads to close on inactive connections. Default is 60 seconds. === Modules Tigase's REST Component comes with two modules that can be enabled, disabled, and configured separately. Common settings for modules for component properties are used in the following format: +component_name/module_id/module_setting/+ the following settings are available for both listed modules: - +active[B]+ - Boolean values true/false to enable or disable the module. - +context-path+ - Path of HTTP context under which the module should be available. - +vhosts[s]+ - Comma separated list of virtual hosts for which the module should be available. If not configured, the module will be available for all vhosts. ==== Rest Module This is the Module that provides support for the REST API. Available properties: - +rest-scripts-dir+ - Provides ability to specify path to scripts processing REST requests if you do not wish to use default (scripts/rest). - +api-keys[s]+ - Comma separated list of strings which would be possible to use as keys to pass +api-key+ parameter to request authorization for request execution. If nothing is passed, then no request will be allowed. To allow any request, this property needs to be set using the following: ----- http/rest/api-keys[s]=open_access ----- You may set api-keys to any string you wish, however, when you make requests of the HTTP API service, the included API key must match *EXACTLY*. Keep the API key to ASCII characters to maintain compatibility. For example, if you were to set the following API key: ----- http/rest/api-key[s]=a7D2dm3lps138w ----- Requests made to the HTTP service must conclude with the same key: +http://localhost:8080/rest/adhoc/sess-man@domain.com?api-key=a7D2dm3lps138w+ ==== +dns-webservice+ This module provides resolution of DNS names using HTTP protocol. This particular module might be useful for web applications that need to resolve the DNS address to a particular IP. For example to help discover the IP and port of WebSocket services used to connect to the XMPP server. == Usage Examples Here are some examples using the HTTP API using available scripts. === Retrieving list of available ad-hoc commands To retrieve a list of available commands, REST needs to use the GET method from the following resource: +/rest/adhoc/sess-man@domain.com+. This provides a list of available adhoc commands from the sess-man@domain.com resource. This can be change to any bare JID that you wish to get commands from so it can be a MUC room, monitor component, or in this case, the Session manager. With the server running, lets connect to the address +http://localhost:8080/rest/+ and the following resource +/adhoc/sess-man@domain.com+ which will retrieve a list of all ad-hoc commands available at sess-man@domain.com. This particular action is protected by authentication using HTTP basic authentication so valid credentials are necessary. User credentials are available in the Tigase's user database installation, so use the bare JID and password of an admin-authorized account to conduct this activity. The result will be an XML format output of available commands, similar to an IQ stanza, below an example of that result. [source,xml] ----- sess-man@domain.com http://jabber.org/protocol/admin#get-active-users Get list of active users sess-man@domain.com del-script Remove command script sess-man@domain.com add-script New command script ----- There is also the ability to return a JSON formatted result. To achieve this, you need to pass +Content-Type: application/json+ to the HTTP header of the request, or add the +type+ parameter and set it to +application/json+ setting. An example of a JSON result is below. [source,java] ----- { "items": [ { "jid": "sess-man@domain.com", "node": "http://jabber.org/protocol/admin#get-active-users", "name": "Get list of active users" }, { "jid": "sess-man@domain.com", "node": "del-script", "name": "Remove command script" }, { "jid": "sess-man@domain.com", "node": "add-script", "name": "New command script" } ] } ----- Again, either of these methods can be used on any component with available ad-hoc commands. Feel free to experiment and see what options are available for each component. === Executing ad-hoc commands Once you have found a command you wish to use, you can send that command using the HTTP POST method. In this example, lets request a list of active users as seen in the previous section. *NOTE:* like the previous example, these commands require basic HTTP authentication. The following command is sent to +http://localhost:8080/rest/adhoc/sess-man@domain.com+ [source,xml] ----- http://jabber.org/protocol/admin#get-active-users domainjid domain.com max_items 25 ----- This particular command reqiures the three fields ++, +domainjid+, and +max_items+. These three values are the node for the command, as returned in available commands, the domain results are to be returned from, and the maximum number of results. Keep in mind that +Content-type: text/xml+ must be passed to the HTTP header to get an XML result. Not doing so may yield errors or incomprehensible results. The result for this command will look like this: [source,xml] ----- sess-man@domain.com http://jabber.org/protocol/admin#get-active-users Users: 3 admin@domain.com user1@domain.com morbo@domain.com ----- Similar results can be sent and received using JSON in a similar fashion. Again, be sure to set +ContentType: application/json+ in the header or default settings. [source,java] ----- { "command" : { "node" : "http://jabber.org/protocol/admin#get-active-users", "fields" : [ { "var" : "domainjid", "value" : "subdomain.domain.com" }, { "var" : "max_items", "value" : "25" } ] } } ----- The results will look quite similar to the XML results: [source,java] ----- { "command": { "jid": "sess-man@domain.com", "node": "http://jabber.org/protocol/admin#get-active-users", "fields": [ { "var": "Users: 2", "label": "text-multi", "value": [ "minion1@subdomain.domain.com", "overadmin@subdomain.domain.com" ] } ] } } ----- [we should take another approach, and use something more permanent, like add or delete a user] === Sending any XMPP Stanza XMPP messages or any other XMPP stanza can be sent using this API by sending HTTP POST request on http://localhost:8080/rest/stream/api-key=API_KEY with a serialized XMPP stanza as content, where API_KEY is the API key specified in the init.properties file. Each request needs to be authorized by sending a valid administrator JID and password as a user/password of BASIC HTTP authorization method. The content of the HTTP request should be encoded in UTF-8 and +Content-Type+ should be set to application/xml. ==== Handling of request If no +from+ attribute is set in the stanza, the HTTP API component will supplant it's JID instead, however if one is set it will be preserved. However, in iq stanzas, if no +from+ attribute is set the HTTP response content will be sent back as a response. Successful requests will return a HTTP response code of 200. *Examples:* Any of these examples must be sent as an HTTP POST request to /rest/stream/?api-key=API_KEY of the HTTP API component. ===== Sending XMPP message with +from+ set to HTTP API component a full JID [source,xml] ----- Example message 1 ----- ===== Sending XMPP message with +from+ set to HTTP API component with a bare JID [source,xml] ----- Example message 1 ----- ===== Sending XMPP message with from set to a specified JID to a full JID [source,xml] ----- Example message 1 ----- == Sending messages through REST You can also send messages, or really any XMPP stanza to users and components through REST API. Sending XMPP messages or stanzas using HTTP is realized as a groovy script bundled in the installation package from v7.0.2. If you want to be sure your current install supports this feature, check for the presence of +Stream.groovy+ file in the +scripts/rest/stream/+ directory. As in other examples, be sure that you have the following line in your init.properties: [source,bash] ----- http/rest/api-keys[s]=test_key ----- You may also opt to have +open_access+ set to disable API key parameter. === Usage Using the HTTP POST method, XMPP stanzas can be sent using the built in HTTP API. In a local installation, the request can be sent to +http://localhost:8080/rest/stream/?api-key=API_KEY+ with a seralized XMPP stanza as content, where API_KEY is the API key for HTTP API which is set in +etc/init.properties+ as +rest/api-keys[s]+. In the case we laid out, it would be +test_key+. Because XMPP uses XML for formatting, all content in these requests *MUST* be encoded in UTF-8 and +Content-type+ must be set to +application/xml+. Lets take a look at some examples. _In all examples the data is sent as an HTTP POST request to /rest/stream/?api-key=test-key._ ==== Send XMPP stanza with from set to HTTP API component to bare JID [source,xml] ----- Example message 1 ----- Once this message is sent, the Groovy script adds the remaining information automatically, and the following is what is receieved by test@example.com/resource-1. [source,xml] ----- Example message 1 ----- As you can see, the HTTP component is automatically populated as the sender. ==== Send XMPP stanza with from set to HTTP API component to full JID [source,xml] ----- Example message 1 ----- The syntax and formatting is the same, with the recepiant messaging being exactly the same. [source,xml] ----- Example message 1 ----- ==== Send XMPP stanza with from set to specified JID You may specify any JID that is registered in the server to send the stanza, ones that use a name that is not registered will return an error. [source,xml] ----- Example message 1 ----- Ends with the result being somewhat customized. [source,xml] ----- Example message 1 ----- [[avatarRetrievalRequests]] === Avatar retrieval requests There are different formats for avatar retrieval depending on how they are stored, see below for the resources for each type of avatar. - +/rest/avatar/user@domain+ - which returns first avatar found (PEP, VCard4 or VCardTemp in this order) - +/rest/avatar/user@domain/avatar+ - which returns PEP avatar - +/rest/avatar/user@domain/vcard4+ - which returns avatar from VCard4 - +/rest/avatar/user@domain/vcard-temp+ - which returns avatar from VCardTemp == Setting HTTP API Privacy Rules The HTTP API component has settings that allow you to specify who is allowed to use the HTTP API interface, keeping unauthorized users from accessing the feature. This feature is implemented using a Groovy admin ad-hoc stript for the Session Manager component. As a result of this method, it will be avaiulable to execution using the default GTTP API componene capability to execute the script. The actual work of filtering, however, will be conducted by the +DomainFilter+ plugin. [[getUserInfoREST]] == New Rest API added to obtain a JID login time +GetUserInfo+ command has been expanded to obtain user login and logout times in addition to standard information. To obtain the information, send a POST request to http://xmpp.domain.net:8080/rest/adhoc/sess-man@xmpp.domain.net?api-key=test-api-key with the following: [source,xml] ----- get-user-info accountjid user@xmpp.domain.net Show connected resources in table true ----- === Configuration The HTTP API privacy scipt is loaded automatically. +DomainFilter+ is a default plugin loaded by Tigase on startup. This means there is very little you need to do to have this running. Again, you may define a custom API key to limit access using the following line in init.properties [source,properties] ------ http/rest/api-keys[s]=test_key ------ === Usage Setting privacy rules can be done by sending a POST request to the session manager using this address: +http://localhost:8080/rest/sess-man@domain.com?api-key=test_key+ [source,xml] ----- user-domain-perm jid user@domain.com fiteringPolicy CUSTOM filteringList 1|allow|self; 2|allow|jid|admin@test2.com; 3|allow|jid|pubsub@test.com; 4|deny|all; ----- Here all parameters are passed to be excuted by ad-hot command. Using the +user-domain-perm+ node we were able to add jids to a +CUSTOM+ filter. Here is a brief breakdown: - +jid+ denotes which JID the settings will be applied too. - +filteringPolicy+ - This uses a +CUSTOM+ type list that allows for multi-item list of custom processing rules. - +filteringLise - This is a multi-item list, semi-colon delimited, where each line denotes one item with a rule in this format: +order_number|policy|UID_type[|UID]:+ - +order_number+ can be any integer, as long as no numbers repeat. - +policy+ can either +allow+ or +deny+. - +UID_type+ is the User ID Type, can be +jid+, +domain+, or +all+. - +UID+ is the user JID affected. If +UID_type+ is set to +all+ then this will be ignored. These ad-hoc commands replicate settings found in xref:domainBasedPacketFiltering[Domain Based Packet Filtering] in the admin guide. They may also be influenced by the link:http://docs.tigase.org/tigase-server-Properties_Guide/html?#domainFilterPolicy[--domain-filter-policy] property of init.properties. == Scripting As you can see from the above commands, Tigase uses pre-defined scripts for processing of all requests in HTTP API. Although the list may be small for now, this does mean with a little bit of Groovy scripting, you can create your own scripts to interpret REST commands and send them to the server! All scripts for this purpose will be an implementation of class extending +tigase.http.rest.Handler+ class. The URI of the scripts will be inside the scripts folder. For example, if the script uses +TestHandler+ with a regular expression set to +/test+ and is placed inside the +scripts/rest/+ the handler will be called with this URI: +scripts/rest/test/+. === Properties When extending classes, you will need to set the following listed properties. regex:: Regular expression which is used to match request URI and parse parameters embedded in URI, for example: ----- /\/([^@\/]+)@([^@\/]+)/ ----- requiredRole:: Role of user required to be able to access this URI. Available values are +null+, +user+, and +admin+. Authentication for the script will be required if +requiredRole+ is not null. isAsync:: If set to true, it will be possible to wait for results pending the arrival of IQ stanzas for instance. ==== Properties containing closures Extended class should also set for closures for one or more of the following properties: +execGet+, +execPut+, +execPost+, +execDelete+, depending on which HTTP action is needed to support the following URI. Each closure has a *dynamic arguments list* generated at runtime. Below is a list of arguments passed to closure which describe how and when the list of arguments change. service:: Implementation of service interface which is used to access database or send/receove XMPP stanzas. callback:: Callback closures needs to be called to return data. However they only accept one argument of type +string,byte[],Map+. If data is Map tupe, it will be encoded to JSON or XML depending on Content-Type header. user:: Is passed only if requiredRole is not null. Otherwise this argument will not be in the argument list. content:: Parsed content of the request. *This will not be in the list of arguments if Content-Lengeth of request is empty.* If Content-Type is set to XML or JSON the return result will be as Map, otherwise it will be an instance of +HttpServletRequest+. x:: Additional arguments passed to callback are groups from regular expression matching the URI. Groups are not passed as a list, but are added to the list of arguments and next arguments. If a property for corresponding HTTP action is not set, the component will return an HTTP 404 error. === Example Script Lets have a look at a script that is included with the install package to get a better idea of how these scripts work. This script will GET a list of all registered account and output them according to an HTML file we will look at later. [source,java] ----- import tigase.http.rest.Service import tigase.xmpp.BareJID /** * Class implements ability to retrieve by service administrator list of registered accounts * Handles requests for /rest/users/ * * Example format of content of response: * user1@domainuser2@domain2 */ class UsersHandler extends tigase.http.rest.Handler { public UsersHandler() { description = [ regex : "/", GET : [ info:'Retrieve list of registered user jids', description: """Request do not require any parameters and returns list of all registered user accounts on this server (for all vhosts). Example response will look like this: \${util.formatData([users:[items:['user1@example.com','user2@example.com','user1@example2.com'],count:3]])} """] ]; regex = /\// requiredRole = "admin" isAsync = false execGet = { Service service, callback, jid -> def users = service.getUserRepository().getUsers() callback([users:[items:users, count:users.size()]]); } } } ----- As we can see, it's a fairly short code. First it calls the rest service (required for all of the REST activity), and the BareJID handler. Next we extend out custom class to extend +tigase.http.rest.Handler+. Our author has provided a helpful description of the code to better describe it's operation and expected result. The last section is the actual code that defines what will match our query, in this case anything, a requirement that an admin make the command, that the connection will terminate with results, and what commands will be passed. The matching HTML, which will shape the output of the code is included here. [source,html] ----- ${ util.include('header', [title:'All users']) } <% result.users.items.each { user -> %> <% } %>
Avatar User JID
${user}
${ util.include('footer') } ----- This file builds a table using the user fields from the GET request. *NOTE:* Not all scripts need a matching HTML file, basic requests may not need special handling. == REST API & PubSub All PubSub Scripts are found within the +scripts/rest/pubsub+ directory of Tigase's installation directory. All examples in this section are prepared for a PubSub component available at pubsub@example.com. To use these examples for your installation, that JID needs to be replaced with with your pubsub JID. All parameters passed in the content of HTTP request needs to be wrapped with ++ tag at the root of the XML document. Returned results will be wrapped within the ++ tag in the root of the XMl document. === Create a Node HTTP URL: example.com/rest/pubsub/pubsub@example.com/create-node Available HTTP methods: *GET* Method returns example content which contains all required and optional parameters that may be passed to the newly created node. *POST* Command requires fields +node+ and +pubsub#node_type+ to be filled with proper values for execution. - +node+ Field contains id of node to create - +owner+ Field may contain JID or JIDS which will be considered owner of the node. If this field is empty, server will use JID of HTTP API Component (rest@example.com) - +pubsub#node_type+ Field should contain one of two types: * +leaf+ Node to items that will be published * +collection+ Node to nodes what will contain other nodes Below is an example of creating a +leaf+ type node with the owner set to admin@example.com. [source,xml] ----- example admin@example.com leaf ----- Server response: [source,xml] ----- Operation successful ----- === Delete a node HTTP URL: example.com/rest/pubsub/pubsub@example.com/delete-node Available HTTP methods: *GET* Command returns example content which contains all required and operational parameters that may be passed. *POST* Command requires field +node+ to be filled where +node+ is the id of the node to delete. Below is an example of removing a node with an id of +example+ [source,xml] ----- example ----- Server response [source,xml] ----- Operation successful ----- === Subscribe to a node HTTP URI: example.com/rest/pubsub/pubsub@example.com/subscribe-node Available HTTP methods: *GET* Method returns example content which contains all required and optional parameters that may be passed. *POST* Command requires +node+ and +jid+ fields to be filled. - +node+ is the id of the node to subscribe too. - +jid+ is the JID or JIDS to be subscribed to the node. Below is an example of the XML information passed between client and server with +test1@example.com+ and +test2@example.com+ subscribing to +example+ node. [source,xml] ----- example test1@example.com test2@example.com ----- Server response: [source,xml] ----- Operation successful ----- === Unsubscribe from a node HTTP URI: example.com/rest/pubsub/pubsub@example.com/unsubscribe-node Available HTTP methods: *GET* Method returns example content which contains all required and optional parameters that may be passed. *POST* Like the Subscribe to a node section, the command requires both the +node+ and +jid+ fields to be filled. - +node+ is the id of the node to unsubscribe from. - +jid+ is the JID or JIDS to be unsubscribed from the node. Below is an example of the XML information passed between client and server with +test1@example.com+ and +test2@example.com+ unsubscribing to +example+ node. [source,xml] ----- example test@example.com test2@example.com ----- Server response: [source,xml] ----- Operation successful ----- === Publish an item to a node HTTP URI: example.com/rest/pubsub/pubsub@example.com/publish-item Available HTTP methods: *GET* Method returns example content which contains all required and optional parameters that may be passed. *POST* Command requires the +node+ and +entry+ fields to be filled. Available fields: - +node+ Field contains the id of the node to be published to. - +item-id+ Field to contain the id of the entry to publish. - +expire-at+ Field may contain a timestamp after which item should not be delivered to subscribed users. Timestamp should follow this pattern: YYYY-MM-DDhh:mm:ss with a trailing Z to indicate UTC time in a 24h format. - +entry+ Field should contain multi-line entry content which should be valid XML value for an item. Below is an example exchange between client and server for publishing an item with id +item-1+ to node +example+ . [source,xml] ----- example item-1 2015-05-13T16:05:00+02:00 Example 1 Example content ----- Server response: [source,xml] ----- Operation successful ----- === List Available Nodes HTTP URI: example.com/rest/pubsub/pubsub.example.com/list-nodes Available HTTP methods *GET* This method returns list of available PubSub nodes for the domain passed as part of the URI (+pubsub.example.com+). Below is an example exchange between client and server for listing all nodes, the result having +test+, +node_54idf40037+ and +node_3ws5lz0037+ [source,xml] ----- List of available nodes test node_54idf40037 node_3ws5lz0037 ----- === List Published Items on Node HTTP URI: example.com/rest/pubsub/pubsub.example.com/list-items Available HTTP methods *GET* Method returns example content which contains all required and optional parameters that may be passed. *POST* This command requires the +node+ field to be filled. The +node+ field contains the ID of the node from which we want the list of published items. Below is an example exchange between client and server asking for all items published in the example node. [source,xml] ----- example ----- Server Response [source,xml] ----- List of PubSub node items example item-1 item-2 ----- Items item-1 and item-2 are the listed items. === Retrieve Published Item on Node HTTP URI: example.com/rest/pubsub/pubsub.example.com/retrieve-item Available HTTP methods *GET* Method returns example content which contains all required and optional parameters that may be passed. *POST* Command requires that fields +node+ and +item-id+ are filled. Available Fields: - +node+ The node the item is published to. - +item-id+ The id of the item you wish to retrieve. Example communication between client and server: [source,xml] ----- example item-1
----- Server response: [source,xml] ----- Retrive PubSub node item example item-1 <item expire-at="2015-05-13T14:05:00Z" id="item-1"><item-entry> <title>Example 1</title> <content>Example content</content> </item-entry></item> ----- Node that inside the item element, there is an XML encoded element, this will be retrieved without any decoding. == Other Example REST Commands and Documentation Other example REST commands, and accompanied documentation can be found at localhost:8080/rest/ on any server running Tigase and the HTTP component. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_57_-_Components_-_B_-_Tigase_HTTP_API_-_2_-_Admin_UI.asciidoc ================================================ [[adminUI]] = Admin UI Guide :author: Daniel Wisnewski :version: v2.0 Sept 2015 :date: 2015-02-09 10:28 :toc: :numbered: :website: http://www.tigase.org The Admin User Interface is an HTTP-based interface that sends REST commands to the server to update configurations, change settings, and retrieve statistics. == A Note about REST REST stands for REpresentational State Transfer which is a stateless communication method that in our case passes commands using HTTP GET, PUT, POST, and DELETE commands to resources within the Tigase server. Although REST uses HTTP to receive commands, REST itself is not intended for use in a browser. For more information, please see the REST API guide. == Configuration Allows you to list server components and their configurations, as well as manage server components and plugins. List server/component configuration section covers all the component options including the basic-conf and will allow you to change each setting by changing the values in the field and clicking submit. All settings are listed by the component name in the dropdown menu either as default, or as defined by --component-name property. image:images/admin-componentconfig.jpg[] Manage active server components allows you to do exactly that, but you can also add and disable components from this interface. image:images/admin-managecomponent.jpg[] Here you can List, Add, Edit, and Remove components. - *List* provides a list of all running components, each with its name, info, and class. - *Add* provides an interface to add a class and a name for components. You will not be able to add invalid component names or classes. - *Edit* enables you to edit the specific properties of any running component. Even options for which there are no current values will be listed, you can consider this list a comprehensive list of settings and options for the current component. - *Remove* provides a way to remove running components. Managing server plugins allows you to turn on or off plugins from this window VIA check-boxes. Note that the changes are made in real-time. image:images/admin-manageplugins.jpg[] == Example Scripts This is a list of script examples that can be run and do menial functions for each component. They may not have particular value themselves, but are present to be used as reference when writing custom scripts. Get list of available commands is one script, that is present for every component that is active on the server, and as its title implies, will provide a list of all commands for that component. Lastly, the two scripts from the xref:scriptingSupport[Scripting section] of this guide. Generally, there is not much needed to see in this section. == Notifications This section has one simple command: to be able to send a mass message to all logged in users. There are three types of messages that can be sent from this section: - *normal* Messages will show as a pop-up in most clients. - *headline* Certain clients will take headline messages and insert them into MUC or chats between users, otherwise it will create a pop-up like normal messages. - *chat* Chat messages will open up a chat dialog with users. == Other This section contains a considerable list of options and settings affecting server functions. === Activate log tracker for a user This allows you to set a log file to track a specific user. Set the bare or full JID of the user you want to log, and a name of the files you wish the log to be written to. The files will be written in the root Tigase directory unless you give a directory like logs/filename. The log files will be named with a .0 extension and will be named .1, .2, .3 and so on as each file reaches 10MB by default. filename.0 will always be the most recent. Logging will start once the command has been issued, and cease once the server restarts. === Add SSL certificate Here you can add SSL certificates from PEM files to specific virtual hosts. Although Tigase can generate its own self-signed certificates, this will override any default certificates. The certificates cannot contain a passphrase, or be encrypted. Be sure that the contents contain both the certificate and private key data. You also have the option to save the certificate to disk, making the change permanent. === Add listener script This section allows you to create a custom function for the eventbus component. These scripts can have the server conduct certain operations if set criteria are met. You may write the script in either Groovy or EMCAscript. Please see the xref:eventbus[eventbus section] for more details. === Add Monitor Task You can write scripts for Groovy or ECMAScript to add to monitor tasks here. This only adds the script to available scripts however, you will need to run it from another prompt. Note that these scripts may only work with the monitor component. === Add Monitor Timer Task This section allows you to add monitor scripts in Groovy while using a delay setting which will delay the start of the script. === Add New Item - ext Depending on whether you have any external components loaded or not, this may show. This allows you to add additional external components to the running instance of Tigase. === Add New Item - Vhost This allows you to add new virtual hosts to the XMPP server. A breakdown of the fields is as follows: - Domain name: the full domain name of the new vhost. Tigase will not add anything to this domain, so if it is ti be a subdomain of example.com, you will need to enter sub.domain.com. - Enabled: Whether the domain is turned on or off. - Anonymous enabled: Allow anonymous logins. - In-band registration: Whether or not to allow users to register accounts upon login. - TLS required: Require logins to the vhost to conduct a TLS handshake before opening streams. - S2S secret: a server-generated code to differentiate traffic between servers, typically there is no need to enter your own, but you may if you need to get into low level code. - Domain filter policy: Sets the filter policy for this domain, see xref:domainBasedPacketFiltering[This section] for a description of the rules. - Domain filter domains: a specific setting to restrict or control cross domain traffic. - Max users: maximum users allowed to be registered to the server. - Allowed C2S, BOSH, Websocket ports: Comma separated list of ports that this vhost will check for all of these services. - Presence forward address: specific address where presence information is forwarded too. This may be handy if you are looking to use a single domain for presence processing and handling. - Message forward address: Specific address where all messages will be sent too. This may be useful to you if you have a single server handling AMP or message storage and want to keep the load there. - Other Parameters: Other settings you may wish to pass to the server, consider this a section for options after a command. - Owner: The owner of the vhost who will also be considered an administrator. - Administrators: comma separated list of JIDs who will be considered admins for the vhost. - XEP-0136 Message Archiving Enabled: Whether to turn on or off this feature. - XEP-0136 Required store method: If XEP-0136 is turned on, you may restrict the portion of message that is saved. This is required for any archiving, if null, any portion of the message may be stored. - Client certificate required: Whether the client should submit a certificate to login. - Client certificate CA: The Certificate Authority of the client certificate. - XEP-0136 retention period: integer of number of days message archives will be set. - Trusted JIDs: Comma separated list of JIDs who will be added to the trusted list, these are JIDS that may conduct commands, edit settings, or other secure work without needed secure logins. - XEP-0136 retention type: Sets the type of data that retention period will use. May be User defined (custom number type), Unlimited, or Number of Days. - XEP-0136 - store MUC messages: Whether or not to store MUC messages for archiving. Default is user, which allows users to individually set this setting, otherwise tue/false will override. - see-other-host redirection enabled: in servers that have multiple clusters, this feature will help to automatically repopulate the cluster list if one goes down, however if this is unchecked, that list will not change and may attempt to send traffic to a down server. - XEP-0136 Default store method: The default section of messages that will be stored in the archive. === Change user inter-domain communication permission Here you can restrict users to be able to communicate on specific domains, this works similar to the domain filtering policy using the same rule sets. For more details, see xref:domainBasedPacketFiltering[Domain Based Packet Filtering] section for rule details and specifics. Note that the changes may be made to mutiple JIDs at the same time. === Connections Time Lists the longest and average connection time from clients to servers. === Create Node This section allows you to create a new node for the pubsub component. Here is a breakdown of the fields: - The node to create: this is the name of the node that will be created. - Owner JID: user JID who will be considered the owner of the node. - pubsub#node type: sets the type of node the the new node will be. Options include: * *leaf* Node that can publish and be published too. * *collection* A collection of other nodes. - A friendly name for the node: Allows spaces and other characters to help differentiate it from other nodes. - Whether to deliver payloads with event notifications: as it says, to publish events or not. - Notify subscribers when the configuration changes: default is false - Persist items to storage: whether or not to physically store items in the node. - Max # of items to persist: Limit how many items are kept in the node archive. - The collection with which the node is affiliated: If the node is to be in a collection, place that node name here. - Specify the subscriber model: Choose what type of subscriber model will be used for this node. Options include: * *authorize* - Requires all subscriptions to be approved by the node owner before items will be published to the user. Also only subscribers may retrieve items. * *open* - All users may subscribe and retrieve items from the node. * *presence* - Typically used in an instant message environment. Provides a system under which users who are subscribed to the owner JID's presence with a from or both subscription may subscribe from and retrieve items from the node. * *roster* - This is also used in an instant message environments, Users who are both subscribed to the owners presence AND is placed in specific allowed groups by the roster are able to subscribe to the node and retrieve items from it. * *whitelist* - Only explicitly allowed JIDs are allowed to subscribe and retrieve items from the node, this list is set by the owner/administrator. - Specify the Publisher model: Choose what type of publisher model will be used for this node. Options include: * *open* - Any user may publish to this node. * *publishers* - Only users listed as publishers may be able to publish. * *subscribers* - Only subscribers may publish to this node. - When to send the last published item: This allows you to decide if and when the last published item to the node may be sent to newly subscribed users. * *never* - Do not send the last published item. * *on_sub* - Send the last published item when a user subscribes to the node. * *on_sub_and_presence* - Send the last published item to the user after a subscription is made, and the user is available. - The domains allowed to access this node: Comma separated list of domains for which users can access this node. By default is is blank, and there is no domain restriction. - Whether to deliver items to available users only: Items will only be published to users with available status if this is selected. - Whether to subscription expired when subscriber going offline: This will make all subscriptions to the node valid for a single session and will need to be re-subscribed upon reconnect. - The XSL transformation which can be applied to payloads in order to generate an appropriate message body element: Since you want a properly formatted element, you can add an XSL transformation here to address any payloads or extra elements to be properly formatted here. - The URL of the XSL transformation which can be applied to payloads in order to generate an appropriate message body element: This would be the URL of the XSL Transform, e.g. http://www.w3.org/1999/XSL/Transform. - Roster groups allowed to subscribe: a list of groups for whom users will be able to subscribe. If this is blank, no user restriction will be imposed. - Notify subscribers when owner changes their subscription or affiliation state: This will have the node send a message in the case of an owner changing affiliation or subscription state. - Allows get list of subscribers for each subscriber: Allows subscribers to produce a list of other subscribers to the node. - Whether to sort collection items by creation date or update time: options include * *byCreationDate* - Items will be sorted by the creation date, i.e. when the item was made. * *byUpdateTime* - Items will be sorted by the last update time, i.e. when the item was last edited/published/etc.. === DNS Query A basic DNS Query form. === Default config - Pubsub Here you may set the default configuration for any new pubsub node. These changes will be made for all future nodes, but will not affect currently active nodes. === Default room config This page allows admins to set the default configuration for any new MUC rooms that may be made on the server. === Delete Monitor Task This removes a monitor task from the list of available monitor scripts. This action is not permanent as it will revert to inital settings on server restart. === Delete Node Provides a space to remove a node from the server. It must be the full name of the node, and only one node can be removed at a time. === Deleting ALL Nodes This page allows the logged in admin to delete all nodes from the associated vhost. This change is irreversible, be sure to read and check the box before submitting the command. === Fix User's Roster You can fix a users roster from this prompt. Fill out the bare JID of the user and the names you wish to add or remove from the roster. This will NOT edit a user's roster, but rather compare client roster to database and fix any errors between them. === Fix User's Roster on Tigase Cluster This does the same as the Fix User's Roster, but can apply to users who may not be logged into the local vhost, but are logged into a clustered server. === Get User Roster As the title implies this gets a users' roster and displays it on screen. You can use a bare or full JID to get specific rosters. === Get any file Enables you to see the contents of any file in the tigase directory. By default you are in the root directory, if you wish to go into directory use the following format: logs/tigase.log.0 === Get Configuration File If you don't want to type in the location of a configuration file, you can use this prompt to bring up the contents of either tigase.conf or init.properties. === Get init.properties File Will output the current init.properties file, this includes any modifications made during the current server session. === Get list available commands This may be listed multiple times for different components, but this will do as the section suggest and list available commands for that particular component. === Load test Here you can run a test with the pubsub component on any node to test functionality and proper settings for the node. === Load Errors Will display any errors the server encounters in loading and running. Can be useful if you need to address any issues. === New command script This space allows you to create a new command script that will work within the associated component. Note that under the hyperlinked title, there is a listing of muc.server.org or pubsub.server.org, use these to determine where the new command will operate. === OAuth Credentials This allows the setting of new custom OAuth credentials for the server, and you can also require the use of OAuth tokens for users when they login. This is a setting for the specific host you are logged into. If you are logged into xmpp1.domain.com, it will not affect settings for xmpp2.domain.com. === Pre-Bind BOSH user session This allows a JID to be paired with a BOSH session before that user logs in, can reduce CPU use if you have a user that logs in via BOSH on a regular basis, or a web client that will regularly connect. You may also specify HOLD and WAIT integers to affect how BOSH operates with the associated JID. === Publish item to node This window allows you to not only test, but publish an item to the specified node. All fields must be filled in in order to avoid the server dropping an improperly formatted stanza. === Read ALL nodes Here you can display all nodes and items from nodes that are currently in storage. === Rebuild database This will force Tigase to rebuild databases for the pubsub component, this may be useful for pubsub subscribers who continue to get pushed events after they unsubscribe. === Reload component repository This will reload any vhosts that the server is running. This may be useful if one is disconnected or broken during runtime. === Remove an item This will remove a running vhost from the server, you will be presented with a list to pick from. === Remove command script Like new command script, take a look at the subheading to determine which component you want to remove the script from. Once there, select the command you wish to remove from the server. If remove from disk is selected, then the change will be permanent. Otherwise, the command will be removed until the next server restart. === Remove listener script Select from a list the listener script you wish to remove. This will only affect custom listener scripts added to the eventbus component. === Remove room This provides fields to remove a room from the MUC component. you may suggest an alternative room which will move occupants to the alternative room once the current one is removed. === Retrieve items Here you can retrieve items from PubSub nodes, this simulates the get IQ stanza from the pubsub component. - Service name - The address of the pubsub component. - Node name - Item node to retrieve items from. - Item ID - The item ID of the item you wish to retrieve. - Items Since - UTC timestamp to start search from: YYYY-MM-DDTHH:MM:SSZ === S2S Bad State Connections This will list any connections to other servers that are considered bad or stale. This will populate very rarely as Tigase automatically adjusts around clustered servers that go down. In the event a connection stays bad, it is recommended to reset those connections in the next space. === S2S Reset Bad State Connections This will reset the connections with other servers that are considered bad and have shown up in the S2S Bad State Connections page. === S2S Get CID Connection State For internal developer use only. === Subscribe to a node This provides a space for an administrator to manually have a JID subscribe to a particular node. === Unsubscribe from node Here you can unsubscribe users from a particular node. Users can be a comma separated list. === Update item configuration Typically two entries will be seen for this entry, one for basic-conf and another for vhost-man. They each have their own sections, but provide for a plethora of server options. Changes to the server are done in realtime, and may not be permanent. ==== basic-conf This will prompt a list of nearly every component setting currently available in the Tigase installation. They are broken down as follows: Component/catagory or setting/setting So for example, if you wanted to change admins for the eventbus component, you will select 'eventbus/admins'. Another example might be if you wanted to turn on or off a task in monitor component, lets say disk-checker-task, you would find 'monitor/disk-checker-task/enabled'. Clicking Submit query will show current status and settings, and possible fields to change. Most changes done in this manner will be reset to default or as written in init.properties file on server restart. ==== vhost-man You will be presented with a list of domains that Tigase is currently hosting, you will be able to change settings for one domain at a time using this function. Once a domain is selected, you will be able to set or change the following settings: - Domain name: the full domain name of the new vhost. Tigase will not add anything to this domain, so if it is ti be a subdomain of example.com, you will need to enter sub.domain.com. - Enabled: Whether the domain is turned on or off. - Anonymous enabled: Allow anonymous logins. - In-band registration: Whether or not to allow users to register accounts upon login. - TLS required: Require logins to the vhost to conduct a TLS handshake before opening streams. - S2S secret: a server-generated code to differentiate traffic between servers, typically there is no need to enter your own, but you may if you need to get into low level code. - Domain filter policy: Sets the filter policy for this domain, see xref:domainBasedPacketFiltering[This section] for a description of the rules. - Domain filter domains: a specific setting to restrict or control cross domain traffic. - Max users: maximum users allowed to be registered to the server. - Allowed C2S, BOSH, Websocket ports: Comma separated list of ports that this vhost will check for all of these services. - Presence forward address: specific address where presence information is forwarded too. This may be handy if you are looking to use a single domain for presence processing and handling. - Message forward address: Specific address where all messages will be sent too. This may be useful to you if you have a single server handling AMP or message storage and want to keep the load there. - Other Parameters: Other settings you may wish to pass to the server, consider this a section for options after a command. - Owner: The owner of the vhost who will also be considered an administrator. - Administrators: comma separated list of JIDs who will be considered admins for the vhost. - XEP-0136 Message Archiving Enabled: Whether to turn on or off this feature. - XEP-0136 Required store method: If XEP-0136 is turned on, you may restrict the portion of message that is saved. This is required for any archiving, if null, any portion of the message may be stored. - Client certificate required: Whether the client should submit a certificate to login. - Client certificate CA: Client Certificate Authority. - XEP-0136 retention period: Integer of number of days message archives will be set. - Trusted JIDs: Comma separated list of JIDs who will be added to the trusted list, these are JIDS that may conduct commands, edit settings, or other secure work without needed secure logins. - XEP-0136 retention type: Sets the type of data that retention period will use. May be User defined (custom number type), Unlimited, or Number of Days. - XEP-0136 - store MUC messages: Whether or not to store MUC messages for archiving. Default is user, which allows users to individually set this setting, otherwise true/false will override. - see-other-host redirection enabled: in servers that have multiple clusters, this feature will help to automatically repopulate the cluster list if one goes down, however if this is unchecked, that list will not change and may attempt to send traffic to a down server. - XEP-0136 Default store method: The default section of messages that will be stored in the archive. === Update user roster entry This section allows admins to edit individual users rosters, although it provides similar functionality to fix users roster, this is designed for precision editing of a user roster. - Roster owner JID: The BareJID of the user roster you wish to edit. - JID to manipulate: The specific BareJID you want to add/remove/change. - Comma separated groups: Groups you wish to add the JID too. - Operation Type: What function will be performed? * *Add* - Add the JID to manipulate to the owner JID's roster and groups. * *Remove* - Remove the JID to manipulate from the owner JID's roster and groups. - Subscription type: The type of subscription stanza that will be sent to the server, and subsequently between the two users will be employed. * *None* - Select this if neither the owner or the user to be manipulated wishes to receive presence information. * *From* - The Roster Owner will not receive presence information from the JID to manipulate, but the opposite will be true. * *To* - The JID to manipulate will not receive presence information from the Roster Owner, but the opposite will be true. * *Both* - Both JIDs will receive presence information about each other. === Update user roster entry extended version This section is an expanded version of the previous one, all fields already specified are the same with these additions: - Roster owner name: A friendly name or nickname if you wish to change/create one. *not required* - Comma separated of owner groups: Groups that the user wants to join/leave. *not required* - Roster item JID: The specific JID that needs to be edited. - Roster item name: A friendly name or nickname that will be changed/created. *not required* - Comma separated list of item groups: A group or list of groups that the roster item JID will be added to/removed from. - Action: * *Add/update item* - Will add or update the item JID in the roster owner's roster. * *Remove item* - Will remove the item JID from the roster owner's roster. * *Add/update both rosters* - Will add or update the item in both roster owner and roster item's roster. * *Remove from both rosters* - Will remove the item from both roster owner and roster item's roster. == Scripts This section will enable administrators to custom write or enter their own scripts for specific components. Each active component will have an entry for new and remove command scripts and scripts written there will be for that component. === New Command Script - Description: A friendly name of the script, will be the title of the link in the menu on the left. - Command ID: Internal command that Tigase will use when referencing this script. - Group: The group for the script, which may be any of the headings on the left (Configuration, Example scripts, Notifications, Other etc..) or your own. If no group exists, a new one will be created. - Language: The language the script is written in. Currently Tigase supports Groovy and EMCAScript. - Script text: the fulltext of the script. - Save to disk: Scripts that are saved to disk will be permanently stored in the server's directory /scripts/admin/[Component]/commandID.js *NOTE* Scripts that are NOT saved to disk will not survive a server restart. === Remove Command Script As with New Command Script, there is an entry for each component. This page will provide a space to remove commands for the selected component. You will be provided a list of scripts associated with that component. You also have the open to remove from disk, which will permanently delete the script from the hard drive the server is on. If this is unchecked, the script will be unavailable until the next restart. == Statistics This section is more useful to test statistics scripts and components, as many of them produce very small amounts of information, however these may be collected by other components or scripts for a better information display. === Get User Statistics Provides a script output of user statistics including how many active sessions are in use, number of packets used, specific connections and their packet usage and location. All resources will return individual stats along with IP addresses. === Get Active User List Provides a list of active users under the selected domain within the server. An active user is considered a user currently logged into the XMPP server. === Get list of idle users Provides a list of users who are idle on the server. === Get list of online users Provides a list of users who are currently online. === Get number of active users Provides a list of active users, users who are not idle or away. === Get number of idle users Provides a number of idle users. === Get top active users Will produce a list of user-limited users who are considered most active in packets sent. == Users === Add User Here you can add new users to any domain handled by vHosts, users are added to database immediately and are able to login. *NOTE: You cannot bestow admin status to these users in this section.* === Change User Password This enables you to change the password of any user in the database. Although changes will take effect immediately, users currently logged in will not know the password has been changed until they try to log in again. === Delete User This removes the user or users (comma separated) from the database. The deleted users will be kicked from the server once submit is clicked. === End user session Disconnects the current selected user by ending their session with the server. === Get User Info This section allows admins to get information about a specific user including current connections as well as offline and online messages awaiting delivery. === Get registered user list This will display all registered users for the selected domain up to the number specified. === Modify User Allows you to modify some user details including E-mail and whether it is an active user. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_58_-_Components_-_B_-_Tigase_HTTP_API_-_3_-_Web_Client.asciidoc ================================================ [[webClient]] = Tigase Web Client :author: Daniel Wisnewski :date: 2015-26-08 08:41 :version: v1.0 August 2015 :toc: :numbered: :website: http://www.tigase.org Tigase now has a fully featured XMPP client built right into the HTTP interface. Everything you would expect from an XMPP client can now be done from the comfort of your browser window with no software install required! Lets walk through setup. Tigase web client requires the +Http.Message.Receiver+ plugin to be active. To enable this add the following lines to your init.properties file: ------ --comp-name-5:http --comp-class-5:tigase.HttpMessageReceiver ------ *NOTE: If you selected HTTP API to be enabled on setup, you already have everything you need.* This sets up an HTTP server with the default port of 8080. See the HTTP API guide for component configuration. To access the client, point a browser to the following address: xmpp.your-server.net:8080/ui/ It will ask you for a login, any bare JID of users registered with the server will work. *NOTE: Use your bare JID for login* Once you have logged in successfully, you will be presented with the following screen. image:images/WebUI-Home.jpg[] The commands are broken into categories shown here. All changes made in these sections are instant and should be seen the same as if you were using an external XMPP client like Psi. *NOTE* The BOSH client will automatically translate all requests to the server name. In some rare cases this may not be resolvable by the browser and you will be unable to login. Should that happen, you may disable that feature using the following line in your init.properties: bosh/send-node-hostname[B]=false You may have to specifically designate the bosh URL when using the advanced tag in the login screen. == Chat This is the default window, and your main interface for chatting inside XMPP with this server. *NOTE: you can only communicate to users logged onto the current server, or connected clusters* Users from your roster will be on the left panel, the right all active discussions and MUCs, as well as the currently selected chat will be available. image:images/WebUI-Chat.jpg[] Users that are logged in and on your roster will be displayed on the left side. Double-clicking will bring up a new chat window with the user. You can Right-click on them to bring up a sub menu with the following; image:images/WebUI-Usersubmenu.jpg[] - *Chat* replicates a double-click and opens a new window for chat. - *Modify* brings up a dialogue that allows you to change the JID of the contact, a nickname, and group. - *Delete* removes the user from your roster. This will also remove subscription authorization for the selected user to receive presence information effectively removing you from their roster. *NOTE: this will not block user packets from your JID* - *Info* brings up the User Info (this is the disco#info command for the selected user) The top right section has a few icons with specific functionality, they are; image:images/WebUI-Chat-Add-New.jpg[] adds a new user to your roster. image:images/WebUI-Chat-NewMUC.jpg[] creates a new Multi-user chatroom. image:images/WebUI-Chat-Profile.jpg[] allows you to edit your user information such as picture and nickname. image:images/WebUI-Chat-CloseWindow.jpg[] closes the active chat window. image:images/WebUI-Chat-settings.jpg[] provides a place to change your password or publish changes to your user info. *NOTE: you are limited to changing the General fields* == Discovery This is your service discovery panel, which breaks down by component in the sidebar. Each component name and its associated JID is listed to help you find what you need. Most components give you an option to Execute commands with a few exceptions allowing browsing and the ability to join a MUC. *Browse* allows you to dig deeper into certain components; for example list the chatrooms available in the MUC component. At the top of the page the specific JID of the component are you in will be displayed. This is a text field, and can be edited to reflect the JID of the component (or just the server name) to navigate. image:images/WebUI-Browse-Comp.jpg[] *Join to Room* will join you to a MUC room that is selected. Alternatively, selecting Join to Room while MUC component is selected, you can join and start a new MUC room. *Execute Command* Provides a hierarchy of commands and options to view and edit settings, run commands and scripts, view contents of files, and see statistics. Since each Component can have a unique structure it is best to explore each to see what options are available. == Management This is an advanced window for settings and management for the XMPP server. === Configuration ==== List server/component configuration From a drop-down menu you can view all the active components, or the server configuration (basic-conf). This is a read-only list of the current settings. ==== Manage active server components This section gives you a drop-down menu for components - *List* will provide a list of active running components with the following format component name :: componentInfo{Title=Server, Server version/revision (submission date), Class=component class} For example: amp :: componentInfo{Title=Tigase XMPP Server, Version=7.1.0-SNAPSHOT-b3990/574c329f (2015-08-28/10:32:06), Class=tigase.server.amp.AmpComponent} - *Add* Allows you to activate a component in a similar way you would in the init.properties files. define a name for the component, and the class for the component. Once you click Confirm that component will be active and running. - *Edit* will allow you to edit details of the selected component. All possible values for the component will be listed, even ones that do not have specific settings. Changes will be immediate, although changes will revert to ones specified in init.properties upon restart. - *Remove* allows you to remove components from a dropdown list. Components will be removed upon confirmation, however settings will be reverted on server restart. ==== Manage active server plugins Here is a list of all available plugins, and you can activate or deactivate them by checking or un-checking each one and clicking confirm. All changes are made in realtime, however changes will be reverted on server restart. === Notifications This section has one simple command: to be able to send a mass message to all logged in users. You may choose to change the type of message to headline or Normal which will show as a pop-up in most XMPP clients. Chat messages will open up a chat dialog with users. === Other This section contains a considerable list of options and settings affecting server functions. === Activate log tracker for a user This allows you to set a log file to track a specific user. Set the bare or full JID of the user you want to log, and a name of the files you wish the log to be written to. The files will be written in the root Tigase directory unless you give a directory like logs/filename. The log files will be named with a .0 extension and will be named .1, .2, .3 and so on as each file reaches 10MB by default. filename.0 will always be the most recent. Logging will cease once the server restarts. === Add SSL certificate Here you can add SSL certificates from PEM files to specific virtual hosts. Although Tigase can generate its own self-signed certificates, this will override those default certificates. === Add Monitor Task You can write scripts for Groovy or ECMAScript to add to monitor tasks here. This only adds the script to available scripts however, you will need to run it from another prompt. === Add Monitor Timer Task This section allows you to add monitor scripts in Groovy while using a delay setting which will delay the start of the script. === Add New Item - ext Provides a method to add external components to the server. By default you are considered the owner, and the Tigase load balancer is automatically filled in. === Add New Item - Vhost This allows you to add new virtual hosts to the XMPP server === Change user inter-domain communication permission You can restrict users to only be able to send and receive packets to and from certain virtual hosts. This may be helpful if you want to lock users to a specific domain, or prevent them from getting information from a statistics component. === Connections Time Lists the longest and average connection time from clients to servers. === DNS Query A basic DNS Query form. === Default room config Allows you to set the default configuration for new MUC rooms. This will not be able to modify current in use and persistent rooms. === Delete Monitor Task This removes a monitor task from the list of available monitor scripts. This action is not permanent as it will revert to initial settings on server restart. === Fix User's Roster You can fix a users roster from this prompt. Fill out the bare JID of the user and the names you wish to add or remove from the roster. You can edit a users roster using this tool, and changes are permanent. === Fix User's Roster on Tigase Cluster This does the same as the Fix User's Roster, but can apply to users in clustered servers. === Get User Roster As the title implies this gets a users' roster and displays it on screen. You can use a bare or full JID to get specific rosters. === Get any file Enables you to see the contents of any file in the tigase directory. By default you are in the root directory, if you wish to go into directory use the following format: logs/tigase.log.0 === Get Configuration File If you don't want to type in the location of a configuration file, you can use this prompt to bring up the contents of either tigase.conf or init.properties. === Get init.properties File Will output the current init.properties file, this includes any modifications made during the current server session. === Load Errors Will display any errors the server encounters in loading and running. Can be useful if you need to address any issues. === New command script - Monitor Allows you to write command scripts in Groovy and store them physically so they can be saved past server restart and run at any time. Scripts written here will only be able to work on the Monitor component. === New command script - MUC Allows you to write command scripts in Groovy and store them physically so they can be saved past server restart and run at any time. Scripts written here will only be able to work on the MUC component. === OAUth credentials Uses OAuth to set new credentials and enable or disable a registration requirement with a signed form. === Pre-Bind BOSH user session Allows admins to pre-bind a BOSH session with a full or bare JID (with the resource automatically populated on connection). You may also specify HOLD or WAIT parameters. === Reload component repository This will show if you have any external components and will reload them in case of any stuck threads. === Scripts This section provides a list of command scripts for all active components. Each component has the following options - *Get list available commands* will list script commands for the component divided by either Scripts or Groups. - *New command script* provides a method to author new command scripts for specific components written in EMCAScript or Groovy. You do have an option to save the script to disk which will make the script permanent within the server. - *Remove command script* allows you to remove the selected script from the repository. If Remove from disk is not checked, the script will be unavailable until server restart. If it is, it will be permanently removed from the server. You will be unable to edit or run commands from this section. === Statistics These statistics might be more useful as script results yield small bits of data, but you may find them useful when looking for server loads or finding user issues. ==== Get User Statistics Provides a script output of user statistics including how many active sessions are in use, number of packets used, specific connections and their packet usage and location. All resources will return individual stats along with IP addresses. ==== Get Active User List Provides a list of active users under the selected domain within the server. An active user is considered a user currently logged into the XMPP server. ==== Get list of idle users This will list all idle users separated by vhost. ==== Get list of online users This will list users separated by the vhost they are connected to. The list will include the bare JID as well as any resources for that JID. ==== Get number of active users This displays the number of current active users. ==== Get number of idle users This section returns the number of active users per specific vhost. ===== Get top active users This will list the top number of active users by packets sent and online time. This list will only be built with users currently online and from all vhosts. === Users ==== Add New User Here you can add new users to any domain handled by vHosts, users are added to database immediately and are able to login. *NOTE: You cannot bestow admin status to these users in this section.* ==== Change user password Allows for admins to change the password of a specific user without needing to know the original password for the selected bare JID. Users currently logged in will not know password has been changed until they attempt to re-login. ==== Delete user Provides a text window for admins to input the bare JID of the user they wish to remove from the server. ==== Get User Info This section allows admins to get information about a specific user including current connections as well as offline and online messages awaiting delivery. ==== Get registered user list Provides a list of vhosts to search and a maximum number of users to list. Once run, the script will display a list of registered bare JIDs of users from the selected vhost. ==== Modify User Allows you to modify some user details including E-mail and whether it is an active user. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_59_-_Components_-_C_-_Message_Archiving.asciidoc ================================================ [[messageArchiving]] = Message Archiving Component :author: Daniel Wisnewski :version: v1.0 Sept 2015 :date: 2015-17-09 13:29 :source: https://projects.tigase.org/projects/message-archiving/wiki/Wiki :toc: :numbered: :website: http://www.tigase.org *NOTE: This component is incomplete and does not support all methods specified in XEP-0136* Tigase server supports many of the features in XEP-0136, however it is not yet in full compliance with the XEP. The reason for this is that it uses the archived message date as the thread id of message due to the face that some clients sens messages with no thread id (e.g. Psi, Psi+). Due to this fact it is also possible to query the component about messages without specifying thread ids. For now the component also stores bare JIDs of recipients. == Installation The message archiving component is not included with the standard build of Tigase, and thus will need to be compiled or downloaded. Here are the two methods: === Download The easiest way is to download the link:https://projects.tigase.org/attachments/download/3435/tigase-message-archiving-1.2.0-SNAPSHOT.jar[tigase-message-archiving-1.2.0-SNAPSHOT.jar] file into your /jars directory. === Compile The Tigase Message Archive component is kept in a separate repository from Tigase-server. It will compile in a similar manner though. Be sure you have Maven 3.0 or later installed. (to check use +mvn version+) First, obtain a clone of the repository using the following command: [source,bash] ----- $ git clone https://repository.tigase.org/git/message-archiving.git ----- The repository will be downloaded to the /message-archiving/ directory. ----- $cd message-archiving /message-archiving$ mvn clean package ----- Once Maven has finished compiling, go into the /target directory and you will find the required jar there. Move that to Tigase's /jars folder and your component is ready to run. == Configuration To activate message archiving, place the following lines in the init.properties file: [source,bash] ----- --comp-name-3=message-archive --comp-class-3=tigase.archive.MessageArchiveComponent ----- These two lines are the component required to be active. As with activating any component, be sure the component name and class match, and that the number is not used by another component. ----- message-archive/archive-repo-uri=jdbc:mysql://localhost/messagearchivedb?user=test&password=test ----- This next line defines that message archives will be stored in a specific database, in this case +messagearchivedb+ hosted on localhost. If this is blank, the archive will be stored in the default user repository. ----- --sm-plugins=message-archive-xep-0136 sess-man/plugins-conf/message-archive-xep-0136/component-jid=archive@host.com ----- The next line turns on the message archive plugin, while this is not always necessary, in order to configure extra options, this line is needed. Finally, this line specifies the name for the component, if left blank the component's JID will be message-archive@local-machine-name. *NOTE: Message tagging can take up considerable resources!* There are a high number of prepared statements which are used to process and archive messages as they go through the server, and you may experience an increase in resource use with the archive turned on. It is recommended to drecrease the repository connection pool to help balance server load from this component using the following line in init.properties: [source,bash] ----- --data-repo-pool-size=5 ----- [[nonBodyStore]] === Saving Options By default, Tigase Message Archive will only store the message body with some metadata, this can exclude messages that are lacking a body. If you decide you wish to save non-body elements within Message Archive, you can now can now configure this using the following line from init.properties: ----- sess-man/plugins-conf/unified-archive/msg-archive-paths[s]=/message/body,/message/subject ----- Where above will set the archive to store messages with or elements. TIP: Enabling this for elements such as iq, or presence will quickly load the archive. Configure this setting carefully! == Usage Now that we have the archive component running, how do we use it? Currently, the only way to activate and modify the component is through XMPP stanzas. Lets first begin by getting our default settings from the component: [source,xml] ---- ---- It's a short stanza, but it will tell us what we need to know, Note that you do not need a from or a to for this stanza. The result is as follows: [source,xml] ---- ---- See below for what these settings mean. === XEP-0136 Field Values :: - *Required Attributes* * +save=+ Boolean turning archiving on or off - *Optional Settings* * +scope=+ Determines scope of archiving, default is +\'stream'+ which turns off after stream end, or may be +\'global'+ which keeps auto save permanent, :: Default element sets default settings for OTR and save modes, includes an option for archive expiration. - *Required Attribures* * +otr=+ Specifies setting for Off The Record mode. Available settings are: ** +approve+ The user MUST explicitly approve OTR communication. ** +concede+ Communications MAY be OTR if requested by another user. ** +forbid+ Communications MUST NOT be OTR. ** +oppose+ Communications SHOULD NOT be OTR. ** +prefer+ Communications SHOULD be OTR. ** +require+ Communications MUST be OTR. * +save=+ Specifies the portion of messages to archive, by default it is set to +body+. ** +body+ Archives only the items within the elements. ** +message+ Archive the entire XML content of each message. ** +stream+ Archive saves every byte of communication between server and client. (Not recommended, high resource use) - *Optional Settings* * +expire=+ Specifies after how many seconds should the server delete saved messages. :: The Item element specifies settings for a particular entity. These settings will override default settings for the specified JIDS. - *Required Attributes* * +JID=+ The Jabber ID of the entity that you wish to put these settings on, it may be a full JID, bare JID, or just a domain. * +otr=+ Specifies setting for Off The Record mode. Available settings are: ** +approve+ The user MUST explicitly approve OTR communication. ** +concede+ Communications MAY be OTR if requested by another user. ** +forbid+ Communications MUST NOT be OTR. ** +oppose+ Communications SHOULD NOT be OTR. ** +prefer+ Communications SHOULD be OTR. ** +require+ Communications MUST be OTR. * +save=+ Specifies the portion of messages to archive, by default it is set to +body+. ** +body+ Archives only the items within the elements. ** +message+ Archive the entire XML content of each message. ** +stream+ Archive saves every byte of communication between server and client. (Not recommended, high resource use) - *Optional Settings* * +expire=+ Specifies after how many seconds should the server delete saved messages. :: This element specifies the user preference for available archiving methods. - *Required Attributes* * +type=+ The type of archiving to set ** +auto+ Preferences for use of automatic archiving on the user's server. ** +local+ Set to use local archiving on user's machine or device. ** +manual+ Preferences for use of manual archiving to the server. * +use=+ Sets level of use for the type ** +prefer+ The selected method should be used if it is available. ** +concede+ This will be used if no other methods are available. ** +forbid+ The associated method MUST not be used. Now that we have established settings, lets send a stanza changing a few of them: [source,xml] ----- ----- This now sets archiving by default for all users on the domain.com server, forbids OTR, and prefers auto save method for archiving. == Manual Activation Turning on archiving requires a simple stanza which will turn on archiving for the use sending the stanza and using default settings. [source,xml] ---- ---- A sucessful result will yield this response from the server: [source,xml] ---- ---- Once this is turned on, incoming and outgoing messages from the user will be stored in +tig_ma_msgs+ table in the database. == Automatic Activation of MUC messages Enabling this feature allows MUC messages to be stored in the Message Archive repository and are added in the same way as for any other message. For this setting consider the MUC room JID, this will be the "user" that the messages will be archived with. This is the same JID used for retrevial as well as sending to storage. Archived MUC messages will be in the same format as normal archival messages with one exception, each message will have a ++ attribute attached which will be the room nick for the user that sent the message. This feature is disabled by default. *NOTE:* It is worth to mention that even if more than on user resources joins the same room and each resource will receive the same messages, then only a single message will be stored in Message Archiving repository. It is also important to note that MUC messages are archived to user messages archive only when user is joined to MUC room. For example, if message was sent to room but it was not sent to particular user, it will not be archived. === Configuration Enabling archiving of MUC messages is done by adding one more line to your init.properties file. Along with defining +comp-name+ and +comp-class+ add this line: [source,bash] ----- sess-man/plugins-conf/message-archive-xep-0136/store-muc-messages=value ----- +value+ may be one of the following values: - +user+ Allows value to be set on domain level by user if the domain level setting allows that. [what?] - +true+ Enables the feature for all users in every hosted domain. This cannot be overridden by settings for individual domains or users. - +false+ Disables the feature for all users in every hosted domain. This cannot be overridden by settings for individual domains or users. To configure this setting for individual vhosts, you will need to execute a configuration command using one of the following settings: - +user+ Allows user to start this feature - +true+ Enables feature for users of the configured domain. Users will be unable to disable this feature. - +false+ Disables feature for users of the configured domain. Users will be unable to disable this feature. == Searching for Messages Tigase Message Archiving Component allows users to query for messages or collections that contain a string. A simple stanza sent to the message archive component will begin a search. For example, the following stanza requests a search for messages with "test failed" in the element. *NOTE:* Searches can *ONLY* be conducted within elements. [source,xml] ----- test failed ----- *This query element must be the child of a +list+ or +retrieve+ element.* Search options include: - +with=+ Specify JID of user sending message - +from=+ Search from this time and date, Format: YYYY-MM-DDTHH:MM:SSZ Time is in 24h set to GMT - +end=+ Search until this time and date, Format: YYYY-MM-DDTHH:MM:SSZ Time is in 24h set to GMT === Example queries Retrieving messages with "test failed" string with user juliet@capulet.com between 2014-01-01 00:00:00 and 2014-05-01 00:00:00 [source,xml] ----- test failed ----- Retrieving collections containing messages with "test failed" string with user juliet@capulet.com between 2014-01-01 00:00:00 and 2014-05-01 00:00:00 [source,xml] ----- test failed ----- == Message Tagging Support Tigase now is able to support querying message archives based on tags created for the query. Currently, Tigase can support the following tags to help seach through message archives: - +hashtag+ Words prefixed by a hash (#) are stored with a prefix and used as a tag, for example #Tigase - +mention+ Words prefixed by an at (@) are stored with a prefix and used as a tag, for example @Tigase *NOTE:* Tags must be written in messages from users, they do not act as wildcards. To search for #Tigase, a message must have #Tigase in the element. This feature allows users to query and retrieve messages or collections from the archive that only contain one or more tags. === Activating Tagging To enable this feature, the following line must be in the init.properties file (or may be added with Admin or Web UI) [source,bash] ----- message-archiving/tags-support[B]=true ----- Where +message-archiving+ is the class name of the component. Usage ~~~~~ To execute a request, the tags must be individual children elements of the +retrieve+ or +list+ element like the following request: [source,xml] ----- #People @User1 ----- You may also specify specific senders, and limit the time and date that you wish to search through to keep the resulting list smaller. That can be accomplished by adding more fields to the retrieve element such as +'with'+, +'from+', and +'end'+ . Take a look at the below example: [source,xml] ----- #People @User1 ----- This stanza is requesting to retrieve messages tagged with @User1 and #people from chats with the user juliet@capulet.com between January 1st, 2014 at 00:00 to May 1st, 2014 at 00:00. *NOTE:* All times are in Zulu or GMT on a 24h clock. You can add as many tags as you wish, but each one is an *AND* statement; so the more tags you include, the smaller the results. === Tag Searching You can also retrieve a list of Tags that have already been used and are stored in the message archive. You can search for exact or a partial of the tag or mention. The following request is searching for tags that are 'like' #test, in this case any tags with #test present will show in a list. [source,xml] ---- ---- The result will return tags with #test in them: [source,xml] ---- #test1 #test123 #testwin 0 2 3 ---- You may retrieve a list of tags or mentions by using just the # or @ symbols in the +like=+ field. [[maPurging]] == Purging Information from Message Archive This feature allows for automatic removal of entries older than a configured number of days from the Message Archive. It is designed to clean up database and keep its size within reasonable boundaries. There are 4 settings available for this feature: To enable the feature: +message-archive/remove-expired-messages[B]=true+ This setting changes the initial delay after the server is started to begin removing old entries. In other words, MA purging will not take place until the specified time after the server starts. Default setting is PT1H, or one hour. +message-archive/remove-expired-messages-delay=PT2H+ This setting sets how long MA purging will wait between passes to check for and remove old entries. Default setting is P1D which is once a day. +message-archive/remove-expired-messages-period=PT2D+ *NOTE* that these commands are also compatible with +unified-archive+ component, just replace +message+ with +unified+. === Configuration of number of days in VHost VHost holds a setting that determines how long a message needs to be in archive for it to be considered old and removed. This can be set independently per Vhost. This setting can be modified by either using the HTTP admin, or the update item execution in adhoc command. Command-line utility Sets after how many days message should be removed - by default we use 24 hours. So if entry is older than 24 hours then it will be removed, ie. entry from yesterday from 10:11 will be removed after 10:11 after next execution of purge. This configuration is done by execution of Update item configuration adhoc command of vhost-man component, where you should select domain for which messages should be removed and then in field XEP-0136 - retention type select value Number of days and in field XEP-0136 - retention period (in days) enter number of days after which events should be removed from UA. In adhoc select domain for which messages should be removed and then in field XEP-0136 - retention type select value Number of days and in field XEP-0136 - retention period (in days) enter number of days after which events should be removed from UA. In HTTP UI select Other, then Update Item Configuration (Vhost-man), select the domain, and from there you can set XEP-0136 retention type, and set number of days at XEP-0136 retention period (in days). Value of +remove-expired-messages-delay+ and +remove-expired-messages-period+ is in format described at Duration.parse() in Java documentation. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_60_-_Components_-_D_-_Advanced_Message_Processing_-_AMP_XEP-0079.asciidoc ================================================ [[amp0079]] = Advanced Message Processing - AMP XEP-0079 :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-05-13 16:09 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Tigase server *5.1.0* or later offers support for link:http://xmpp.org/extensions/xep-0079.html[Advanced Message Processing], called AMP or XEP-0079. It is enabled by default but there are several configuration options that you may tweak. Configuration of AMP is not very complex, but as it is implemented as a component in the Tigase server it does needs a few settings to get it right. Here is a first, brief overview of the AMP configuration and later detailed explanation of each parameter. [source,bash] ----- --sm-plugins=amp,-message,-msgoffline --amp-repo-uri=jdbc:mysql://localhost/tigasedb?user=db_usr&password=db_pwd --amp-security-level=STRICT sess-man/plugins-conf/amp/amp-jid=amp@your-domain.tld ----- == First of all: plugins: Even though the whole functionality is implemented inside the component you need a way to forward messages with +AMP+ payload to that component. This is what the 'amp' plugin does. The 'amp' plugin intercepts all ++ packets even without AMP payload, redirecting some of the to the +AMP+ component and others processing in a standard way. Therefore you no longer need 'message' plugin or 'msgoffline' plugin. Those are all functions are offered by the 'amp' plugin now. Hence you have to switch 'message' and 'msgoffline' plugins off (the 'amp' plugin is loaded by default): [source,bash] ----- --sm-plugins=+amp,-message,-msgoffline ----- The 'amp' plugin needs to know where to forward all the +AMP+ packets. By default plugin uses hostname of the given machine as this is true to the most installations. However, this is configured by the last line of the example configuration, which forwards all packets to the address 'amp@your-domain.tld': [source,bash] ----- sess-man/plugins-conf/amp/amp-jid=amp@your-domain.tld ----- == Secondly: component: By default Tigase loads the component with the standard name 'amp' == Optional parameters: There is also one parameter shared between the component and the plugin. Connection to the database where offline messages are stored. The AMP component has a dedicated schema for storing offline messages designed for a high traffic and high load installations. It does not use +UserRepository+ for storing messages. By default the same physical database as for +UserRepository+ is used but you can change it and store messages in a completely separate location to reduce performance degradation of rest of the system. You can set a database connection string using following property: [source,bash] ----- --amp-repo-uri=jdbc:mysql://localhost/tigasedb?user=db_usr&password=db_pwd ----- The link:http://xmpp.org/extensions/xep-0079.html[XEP-0079] specification has a link:http://xmpp.org/extensions/xep-0079.html#security[Section 9. - Security Considerations]. As it describes, in some cases the AMP protocol can be used to reveal user's presence information by other users who are not authorised for presence updates. There are a few possible ways to prevent this. Tigase's implementation offers 3 modes to handle +AMP+ requests to prevent revealing user's status to non-authorized users: [source,bash] ----- --amp-security-level=STRICT ----- In this mode the server performs strict checking. The +AMP+ specification is fully handled. This however involves roster loading for each offline user, hence it may impact the service performance. It may not be feasible or possible to run in this mode for services under a high load with lots of AMP messages. In the XEP this mode is described in the following way: _Accept the relevant condition only if the sender is authorized to receive the receiver's presence, as a result of which the server MUST reply with a error condition if the sender is not so authorized; this is the RECOMMENDED behavior. This is also the default in Tigase._ [source,bash] ----- --amp-security-level=PERFORMANCE ----- Dummy checking is performed efficiently by just returning an error response every time there is a chance that the default action may reveal user status without looking into the user's roster. This does not affect performance but it does impact the +AMP+ compliance. In the XEP this mode is described in the following way: _Accept the relevant condition only if the action is "drop", as a result of which the server MUST reply with a error condition if the action is "alert", "error", or "notify"; this is slightly less restrictive but still unnecessarily restricts the functionality of the system, so is NOT RECOMMENDED._ It does not do any checking. It acts like all users are authorized to receive notifications, even if it may reveal user status to unauthorized users. It does not impact the server performance and it offers full AMP compliance. [source,bash] ----- --amp-security-level=NONE ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_61_-_Components_-_E_-_PubSub.asciidoc ================================================ [[PubSubComp]] = PubSub Component :author: many authors :version: v1.0, September 2015 :date: 2015-09-30 17:25 :toc: :numbered: :website: http://www.tigase.org == Configuration Tigase's Publish Subscribe component is an link:http://www.xmpp.org/extensions/xep-0060.html[XEP-0060] compliant plugin handling all publish and subscribe activity within Tigase server. To enable the component the following should be in your init.properties file ----- --comp-name-2 = pubsub --comp-class-2 = tigase.pubsub.PubSubComponent ----- == Pubsub naming Within Tigase, all pubsub component address MUST be domain-based address and not a JID style address. This was made to simplify communications structure. Tigase will automatically set component names to pubsub.domain, however any messages send to pubsub@domain will result in a +SERVICE_UNAVAILABLE+ error. Pubsub nodes within Tigase can be found as a combination of JID and node where nodes will be identified akin to service discovery. For example, to address a friendly node, use the following structure: [source,xml] ----- ----- [[rosterLimit]] == Configure Roster Maxmimum size Starting with Tigase v7.1.0, administrators can configure the maximum allowable roster size per user via the init.properties file. ----- sess-man/plugins-conf/jabber\:iqa\:roster/max_roster_size=100 ----- This sets the roster limit to 100 entries per user. It can be set to any integer, however by default no limit is set. == AdHoc Commands Similar to the HTTP API, AdHoc commands based on groovy scripts can be sent to this component to do a number of tasks. All scripts for these Ad-hoc commands are found at +sec/main/groovy/tigase/admin+ in source distrubitions, or at link:https://projects.tigase.org/projects/tigase-pubsub/repository/revisions/master/show/src/main/groovy/tigase/admin[this link]. To use them, the scripts need to be copied into the +scripts/admin/pubsub+ folder in the Tigase installation directory. For all examples, the component address will be +pubsub.example.com+. === Create a Node Ad-hoc command node: +create-node+ Required role: Service Administrator Command requires fields +node+ and +pubsub#node_type+ to be filled with proper values for execution. - +node+ Field containing id of node to create. - +pubsub#node_type+ Contains one of two possible values. * +leaf-node+ Node that will be published. * +collection+ Node that will contain other nodes. Other fields are optional fields that can be set to change configuration of newly create node to different configuration than default. Example call using TCLMT: ----- bin/tclmt.sh -u admin@example.com -p admin123 remote pubsub.example.com create-node example admin@example.com leaf ----- === Delete a Node Ad-hoc command node: +delete-node+ Required role: Service Administrator Command requires +node+ field to be filled. - +node+ Field containing id of node to delete. Example call using TCLMT: ----- bin/tclmt.sh -u admin@example.com -p admin123 remote pubsub.example.com delete-node example ----- === Subscribe to a Node Ad-hoc command node: +subscribe-node+ Required role: Service Administrator Command requires +node+ and +jids+ nodes to be filled. - +node+ Field containing node to subscribe to. - +jids+ Field containing list of JIDs to subscribe to the node. Example call using TCLMT: ----- bin/tclmt.sh -u admin@example.com -p admin123 remote pubsub.example.com subscribe-node example admin@example.com,test1@example.com ----- === Unsubscribe to a Node Ad-hoc command node: +unsubscribe-node+ Required role: Service Administrator Command requires +node+ and +jids+ nodes to be filled. - +node+ Field containing node to unsubscribe to. - +jids+ Field containing list of JIDs to unsubscribe to the node. Example call using TCLMT: ----- bin/tclmt.sh -u admin@example.com -p admin123 remote pubsub.example.com unsubscribe-node example admin@example.com,test2@example.com ----- === Publish an item to a Node Ad-hoc command node: +publish-item+ Required role: Service Administrator Command requires fields +node+ and +entry+ to be filled. - +node+ Field containing id of node to publish to. - +item-id+ Field may contain id of entry to publish, can be empty. - +entry+ Field should contain multi-line entry content that should be valid XML values for items. This command due to it's complexity cannot be easily executed by TCLMT using default remote script which provides support for basic adhoc commands. Example call using TCLMT: ----- bin/tclmt.sh -u admin@example.com -p admin123 remote pubsub.example.com publish-item example item-1 'Example 1' ----- Example Groovy script to execute create-node command using JAXMPP2 [source,java] ----- import tigase.jaxmpp.j2se.Jaxmpp import tigase.jaxmpp.core.client.AsyncCallback import tigase.jaxmpp.core.client.exceptions.JaxmppException import tigase.jaxmpp.core.client.xmpp.stanzas.Stanza import tigase.jaxmpp.core.client.SessionObject import tigase.jaxmpp.j2se.ConnectionConfiguration import tigase.jaxmpp.core.client.xml.Element import tigase.jaxmpp.core.client.xml.DefaultElement import tigase.jaxmpp.core.client.xmpp.forms.JabberDataElement Jaxmpp jaxmpp = new Jaxmpp(); jaxmpp.with { getConnectionConfiguration().setConnectionType(ConnectionConfiguration.ConnectionType.socket) getConnectionConfiguration().setUserJID("admin@example.com") getConnectionConfiguration().setUserPassword("admin123") } jaxmpp.login(true); def packet = IQ.create(); packet.setAttribute("to", "pubsub.example.com"); Element command = new DefaultElement("command"); command.setXMLNS("http://jabber.org/protocol/commands"); command.setAttribute("node", "create-node"); packet.addChild(command); Element x = new DefaultElement("x"); x.setXMLNS("jabber:x:data"); command.addChild(x); def data = new JabberDataElement(x); data.addTextSingleField("node", "example"); data.addListSingleField("pubsub#node_type", "leaf"); jaxmpp.send(packet, new AsyncCallback() { void onError(Stanza responseStanza, tigase.jaxmpp.core.client.XMPPException.ErrorCondition error) throws JaxmppException { println "received error during processing request"; } void onSuccess(Stanza responseStanza) throws JaxmppException { x = responseStanza.getFirstChild("command").getFirstChid("x"); data = new JabberDataElement(x); def error = data.getField("Error"); println "command executed with result = " + (error ? "failure, error = " + error.getFieldValue() : "success"); } void onTimeout() { println "command timed out" } }); Thread.sleep(30000); jaxmpp.disconnect(); ----- == PubSub Node Presence Protocol *Occupant Use Case* === Log in to Pubsub Node To log in to PubSub Node user must send presence to PubSub component with additional information about node: [source,xml] ----- ----- Component will publish this information in node: [source,xml] ----- ----- And then will send notification with presences of all occupants to new occupant. === Log out from PubSub Node To logout from single node, user must send presence stanza with type unavailable: [source,xml] ----- ----- Component will send events to all occupants as described: [source,xml] ----- ----- If component receives presence stanza with type unavailable without specified node, then component will log out user from all nodes he logged before and publish events. === Retrieving list of all Node Subscribers To retrieve list of node subscribers, node configuration option +tigase#allow_view_subscribers+ must be set to true: [source,xml] ----- http://jabber.org/protocol/pubsub#node_config 1 ----- When option is enabled, each subscriber may get list of subscribers the same way link:http://xmpp.org/extensions/xep-0060.html#owner-subscriptions-retrieve[as owner]. [source,xml] ----- ----- There is extension to filter returned list: [source,xml] ----- ----- In this example will be returned all subscriptions of users from domain "denmark.lit". [[storeFullXMLLastPresence]] == Store Full XML of Last Presence A new feature has been implemented in v7.1.0 that allows Tigase to store a more detailed presence stanza to include timestamps and other information. === Requirements Ensure that +presence-offline+ plugin is enabled in init.properties. To do this, add *+presence-offline* to the *--sm-plugins* line. The following two lines configure options to broadcast probes to offline users. ----- sess-man/plugins-conf/skip-offline=false sess-man/plugins-conf/skip-offline-sys=false ----- Without these lines, Tigase will not send presence probes to users that the server knows to be offline. The full XML presence is stored under the tig_pairs table with a pkey of +last-unavailable-presence+ will look like this: [source,xml] ----- Logged out ----- As you can see, the plugin has added a delay stamp which indicates the last time they were seen online. This may be suppressed by using the following line in your init.properties file. ----- sess-man/plugins-conf/delay-stamp=false ----- You may also limit probe responses only to newly connected resources. ----- sess-man/plugins-conf/probe-full-jid=true ----- When a user logs on, they will receive the same full unavailable presence statements from contacts not logged in. Also the repository entry containing their last unavailable presence will be removed. *NOTE: This will increase traffic with users with many people on their rosters.* ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_62_-_Components_-_E_-_PubSub_-_1_-_Offline_Message_Sink.asciidoc ================================================ [[offlineMessageSink]] = Offline Message Sink :author: Bartosz Malkowski :version: v1.0, October 2015 :date: 2015-10-07 09:36 :toc: :numbered: :website: http://www.tigase.org == Description Messages sent to offline users is published in PubSub node, from where that message is sent to all the node subscribers as a PubSub notification. [source,xml] ----- Hello ----- == Configuration The PubSub node must be created and configured beforehand: === Create node [source.xml] ----- ----- After that is done, you need to add SessionManager as a publisher: === Add sess-man as publisher [source,xml] ----- ----- Finally, the AMP plugin must be configured as well === init.properties configuration [source,bash] ----- sess-man/plugins-conf/amp/msg-pubsub-jid=pubsub.coffeebean.local sess-man/plugins-conf/amp/msg-pubsub-node=message_sink sess-man/plugins-conf/amp/msg-pubsub-publisher=sess-man@coffeebean.local ----- Of course be sure that AMP plugin is in your +--sm-plugins+ line. == Usage Because these sinks use a standard PubSub component, administration of the sink node is identical to any other PubSub node. link:http://www.xmpp.org/extensions/xep-0060[XEP-0060] defines standard PubSub usage and management. === Managing Subscriptions ==== Add new Subscriber [source,xml] ----- ----- ==== Remove Subscriber [source,xml] ----- ----- ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_63_-_Components_-_E_-_PubSub_-_2_-_PubSub_Schema_Changes.asciidoc ================================================ [[PubsubSchemaChanges]] = PubSub Schema Changes :author: :version: v1.0 September, 2015 :date: 2015-30-09 17:28 :toc: :numbered: :website: http://www.tigase.org Tigase PubSub Component is currently version 3.2.0 which is introduced in Tigase server v7.1.0 [[Pubsub3.2.0Changes]] == PubSub 3.2.0 Changes PubSub v 3.2.0 adds a new procedure TigPubSubGetNodeMeta which supports PubSub metadata retrieval while conducting a disco#info query on nodes. You will need to upgrade your database if you are not using v3.2.0 schema. Tigase will report being unable to load PubSub component if you do not have this schema version. The MySQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/revisions/master/entry/database/mysql-pubsub-schema-3.2.0.sql[Here]. The Derby schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/derby-pubsub-schema-3.2.0.sql[Here]. The PostGRESQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/postgresql-pubsub-schema-3.2.0.sql[Here]. The MS SQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/sqlserver-pubsub-schema-3.2.0.sql[Here]. The same files are also included in all distributions of v7.1.0 in +[tigaseroot]/database/+ . All changes to database schema are meant to be backward compatible. For instructions how to manually upgrade the databases, please refer to xref:tigaseServer71[Tigase v7.1.0 Schema Updates section]. [[Pubsub310change]] == PubSub 3.1.0 Changes The PubSub Schema has been streamlined for better resource use, this change affects all users of Tigase. To prepare your database for the new schema, first be sure to create a backup! Then apply the appropriate pubsub schema to your MySQL and it will add the new storage procedure. The MySQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/revisions/master/entry/database/mysql-pubsub-schema-3.1.0.sql[Here]. The Derby schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/derby-pubsub-schema-3.1.0.sql[Here]. The PostGRESQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/postgresql-pubsub-schema-3.1.0.sql[Here]. The MS SQL schema can be found link:https://projects.tigase.org/projects/tigase-pubsub/repository/changes/database/sqlserver-pubsub-schema-3.1.0.sql[Here]. The same files are also included in all distributions of v7.1.0 in +[tigaseroot]/database/+ . All changes to database schema are meant to be backward compatible. == PubSub v3.0.0 Changes To update older installations of Tigase to the PubSub Schema v3.0.0 follow these instructions. Note this should be done before upgrading to PubSub v3.1.0. Step by Step guide. === Prepare Old Database for Upgrade In +database+ directory of Tigase installation you will find SQL files which will prepare old database schema for upgrade using following this naming pattern: +-pubsub-schema-3.0.0-pre-upgrade.sql+ Where ++ can be one of the following: +mysql+, +sqlserver+, ie. for MySQL you will find the file +mysql-pubsub-schema-3.0.0-pre-upgrade.sql+. You need to execute statements from this file on your source database, which will drop old procedures and functions used to access database and also this statements will rename old tables by adding suffix _1 to each of old tables. Example: MySQL:: +mysql -u tigase -p tigase_pubsub < database/mysql-pubsub-schema-3.0.0-pre-upgrade.sql+ MS SQL:: +sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-pubsub-schema-3.0.0-pre-upgrade.sql+ === Update Tigase PubSub Component For this you need to copy the Tigase PubSub Component jar file to jars directory inside Tigase XMPP Server installation directory. It is also recommended to copy files from database directory of Tigase PubSub Component to database directory in Tigase XMPP Server installation directory. If you happen to use one of the the distribution packaged (either installer or -dist-max flavored archive) then all required files are already available - both new schema files will be available in +database/+ directory as well as both versions of PubSub component will be present in +jars/+ directory - PubSub3 as tigase-pubsub.jar and PubSub2 as tigase-pubsub-2.2.0.jar.old (provided for compatibility reasons). === Load New Schema In the +database+ directory you will find files containing new schemas for: - MySQL - +mysql-pubsub-schema-3.0.0.sql+ - PostgreSQL - +postgresql-pubsub-schema-3.0.0.sql+ - MSSQL - +sqlserver-pubsub-schema-3.0.0.sql+ - DerbyDB - +derby-pubsub-schema-3.0.0.sql+ and +pubsub-db-create-derby.sh+ For most databases, with the exception of Derby, you only need to execute statements from the proper file. For example: MySQL:: +mysql -u tigase -p tigase_pubsub < database/mysql-pubsub-schema-3.0.0.sql+ MS SQL:: +sqlcmd -S %servername% -U %root_user% -P %root_pass% -d %database% -i database\sqlserver-pubsub-schema-3.0.0.sql+ PostgreSQL:: +psql -h $DB_HOST -q -U ${USR_NAME} -d $DB_NAME -f database/sqlserver-pubsub-schema-3.0.0.sql+ For DerbyDB you need to execute the +pubsub-db-create-derby.sh+ script and pass proper JDBC URI to database to which you want to load schema (if database does not exist, it will be created). ----- database/pubsub-db-create-derby.sh ----- *NOTE:* It is possible to use same database which was used before - then after upgrade you will have new tables and old tables with _1 suffix. === Execute Migration Utility In the +/database+ directory you will find the +pubsub-db-migrate.sh+ file which you need to execute and pass arguments with JDBC URIs needed to connect to source and destination database. If you used dedicated tables for PubSub you will also need to pass a class name used to access database (value of +pubsub/pubsub-repo-class+ variable from +etc/init.properties+ file). Example for dedicated table used for PubSub: [source,sql] ----- database/pubsub-db-migrate.sh -in-repo-class tigase.pubsub.repository.PubSubDAO -in 'jdbc:mysql://localhost/tigase_pubsub?user=tigase&password=passwd' -out 'jdbc:mysql://localhost/tigase_pubsub?user=tigase&password=passwd' ----- Example for use without dedicated PubSub tables: [source,sql] ----- database/pubsub-db-migrate.sh -in 'jdbc:mysql://localhost/tigase?user=tigase&password=passwd' -out 'jdbc:mysql://localhost/tigase?user=tigase&password=passwd' ----- Example for use with dedicated tables in a Windows environment: [source,sql] ----- database/pubsub-db-migrate.cmd -in-repo-class tigase.pubsub.repository.PubSubDAO -in 'jdbc:sqlserver://\\:;databaseName=;user=tigase;password=tigase;schema=dbo;lastUpdateCount=false' -out 'jdbc:sqlserver://\\:;databaseName=;user=tigase;password=tigase;schema=dbo;lastUpdateCount=false' ----- During execution this utility will report information about migration of PubSub data to the new schema, and the same information will be store in +pubsub_db_migration.log+. === Finish After successful migration you will have all data copied to new tables. Old tables will be renamed by adding suffix _1. After verification that everything works OK, you can delete old tables and it's content as it want be used any more. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_64_-_Components_-_F_-_Server_Monitoring.asciidoc ================================================ [[serverMonitoring]] = Server Monitoring :author: Unknown :version: v1.0 All the documentation and resources related to the Tigase server monitoring. xref:setupRemoteMonitoring[Setting up Remote Monitoring in the Server] xref:retrievingStatisticsFromTheServer[Retrieving Statistics from the Server] ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_65_-_Components_-_F_-_Server_Monitoring_-_1_-_Setting_up_Remote_Monitoring_in_the_Server.asciidoc ================================================ [[setUpRemoteMonitoring]] = Setting Up Remote Monitoring in the Server :author: unknown :version: v1.0 :date: 2010-04-06 21:18 Tigase server can be remotely monitored over following protocols: *JMX/RMI*, *SNMP* and *HTTP*. Even though JMX offers the biggest control and visibility to the server states, all of the monitoring services give the same basic set of the server statistics: - Number of network connections for s2s, c2s and Bosh - Last second, last minute and last hour load for all main components: SM, MR, c2s, s2s, Bosh, MUC and PubSub - System statistics - memory usage (heap and non heap) and the server uptime in milliseconds and human readable text. - Users statistics - number of registered users and number of online user session. JMX/RMI and SNMP servers offer basic security and can restrict access while the HTTP server doesn't offer any access restriction mechanisms. Therefore HTTP monitoring is recommended to operate behind a firewall. The monitoring itself causes very low overhead in terms of the resources and CPU consumption on top of the normal Tigase processing requirements so it can be left on without worrying about performance degradation. *Note.* _This works with the Tigase server from version_ *4.2.0* _or SVN revision_ *1418*. == What You Need Using v7.1.0 and later, statistics binaries are built-in dist-max and no extra files are needed. If you have downloaded -dist file, you will need tigase-extras. To ensure, two files are necessary to run monitoring: . link:https://projects.tigase.org/projects/tigase-extras/files[tigase-extras] or the link:https://projects.tigase.org/projects/tigase-server/repositoryr[current snapshot]. . *jdmkrt.jar* file from link:https://opendmk.java.net/[OpenDMK] project version 5.1 or later. A copy of this jar file in also available in our maven repository: link:http://maven.tigase.org/openDMK/jdmkrt/1.0-b02/[jdmkrt.jar]. Both files should be in the /jars directory. [[monitoring_activation]] == Activation You can either run the Tigase installer and use the configuration wizard to activate the monitoring or edit etc/init.properties file and add following line: [source,bash] ----- --monitoring=jmx:9050,http:9080,snmp:9060 ----- As you see there is only a single line where you put list of monitoring servers you want to activate. Each server is responsible for activation of a different protocol and takes a single parameter - port number. There are following protocols supported right now: - *jmx* - activating monitoring via JMX/RMI - *http* - activating monitoring over HTTP protocol - *snmp* - activating monitoring over SNMP protocol You can have all protocols active at the same time or any combination of them or none. == Security Both JMX and SNMP offer security protection to limit access to monitoring data. The security configuration is a bit different for both. [[monitoring_jmx]] == JMX After the server installation or in the SVN repository you can find 2 files in the *etc/* directory: *jmx.access* and *jmx.password*. - *jmx.access* is a user permission file. You can use it to specify whether the user can access the monitoring data for reading only 'readonly' or with read-write 'readwrite' access. There are example entries in the file already and the content may simply look like: + [source,bash] ----- monitor readonly admin readwrite ----- - *jmx.password* is a user password file. You can set user passwords here and the format again is very simple and the same as for jmx.access. There are example entries already provided for you convenience. Content of the file may look like the example below: + [source,bash] ----- admin admin_pass monitor monitor_pass ----- Using above to files you can control who and how can access the JMX monitoring services. === SNMP Access to SNMP monitoring is controlled using ACL (access control lists) which can be configured in the file *snmp.acl* located in *etc/* directory. It contains lots of detailed instructions how to setup ACL and restrict access per user, host and what kind access is allowed. The simplest possible configuration may look like this: [source,bash] ----- acl = { { communities = public, private access = read-only managers = public.host.com, private.host.com } { communities = admin access = read-write managers = localhost, admin.host.com } } ----- You might also need Tigase MIB definition: link:https://projects.tigase.org/projects/tigase-server/repository/changes/src/main/resources/mib/JVM-MANAGEMENT-MIB.mib[TIGASE-MANAGEMENT-MIB.mib] for the server specific statistics. The MIB contains definition for all the server statistics exposed via SNMP. === HTTP Access the server at example.com:9080 and you will be presented with an Agent View. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_66_-_Components_-_F_-_Server_Monitoring_-_2_-_Retrieving_statistics.asciidoc ================================================ [[retrievingStatisticsFromTheServer]] = Retrieving statistics from the server :author: Daniel Wisnewski :version: v2.0 :date: 2015-13-07 11:22 :toc: :numbered: :website: http://www.tigase.net By default we can retrieve server statistics using XMPP, no additional setup is necessary. == Retrieving statistics using XMPP Accessing statistics over XMPP protocol requires any XMPP client capable of executing link:http://xmpp.org/extensions/xep-0050.html[XEP-0050: Ad-Hoc Commands]. It's essential to remember, that only administrator (a user whose JID is configured as administrative) can access the statistics. == Psi XMPP Client For the purpose of this guide http://psi-im.org/[Psi] client will be used. After successfully configuring and connecting to account with administrative privileges we need to access _Service Discovery_, either from application menu or from context menu of the particular account account: image:images/monitoring_xmpp_1.png[caption="Figure 1: ", title="Access service discovery", alt="roster-discovery", width="233"] In the _Service Discovery_ window we need to find _Server Statistics_ component: image:images/monitoring_xmpp_2.png[caption="Figure 2: ", title="Access statistics component in service discovery", alt="discovery-stats", width="558"] We can either access statistics for all components or select particular component after expanding the tree. To execute ad-hoc command simply double click on the particular node which will open window with statistics: image:images/monitoring_xmpp_3.png[caption="Figure 3: ", title="Server statistics", alt="server-stats", width="456"] In this window, in addition to see the statistics, we can adjust _Stats level_ by selecting desired level from the list and confim by clicking _Finish_. == Retrieving statistics using JMX In order to access statistics over JMX we need to enable support for it in Tigase - xref:monitoring_activation[Monitoring Activation]. Afterwards we can use a number of tools to get to the statistics, for example the following: == JConsole After opening JConsole we either select local process or provide details of the remote process, including IP, port and credentials from *etc/jmx.** files: image:images/monitoring_jmx_jconsole_1.png[caption="Figure 4: JConsole", alt="jconsole", width="754"] Afterwards we navigate to the MBeans tab from where we can access the `tigase.stats` MBean. It offers similar options to XMPP - either accessing statistics for all components or only for particular component as well as adjusting level for which we want to obtain statistics: image:images/monitoring_jmx_jconsole_2.png[caption="Figure 5: JConsole", alt="jconsole", width="967"] == StatsDumper.groovy In order to collect statistics over period of time following groovy script can be used: link:files/StatsDumper.groovy[StatsDumper.groovy]. It's a Simple JMX client that connects to Tigase and periodically saves all statistics to files. It takes following parameters: [source,bash] ---- $ groovy StatsDumper.groovy [hostname] [username] [password] [dir] [port] [delay(ms)] [interval(ms)] [loadhistory(bool)] ---- * hostname - address of the instance * username - JMX username * password - JMX username * dir - directory to which save the files with statistics * port - port on which to make the connection * delay(ms) - initial delay in milliseconds after which statistics should be saved * interval(ms) - interval between each retrieval/saving of statistics * loadhistory(bool) - indicates whether or not load statistics history from server (if such is enabled in Tigase) ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_67_-_Components_-_F_-_Server_Monitoring_-_3_-_EventBus.asciidoc ================================================ [[eventBus]] = Eventbus :author: Bartosz Malkowski :date: 2015-04-09 8:56 :version: v1.0 September 2015 :toc: :numbered: :website: http://www.tigase.org New for Tigase version 7.1.0, is an *eventbus* component to help with monitoring has been implemented. This allows you to set thresholds for certain predefined tasks and you or other JIDs can be sent a message when those thresholds are passed. You can even configure a mailer extension to have an E-mail sent to system administrators to let them know an event has occured! Lets begin with setup and requirements. Eventbus is based on a limited http://www.xmpp.org/extensions/xep-0060.html[PubSub] specification. Events are delivered to subscribers as a normal PubSub notification. Each component or client may subscribe for specific types of events. Only components on cluster nodes are allowed to publish events. == Setup Eventbus is enabled by default on v7.1.0 b4001 and later, no setup needed! == How it Works Events in Eventbus are identified by two elements: name of event and its namespace: [source, xml] ------- 1 ------- Where event name is `EventName` and namespace is `tigase:demo`. Listeners may subscribe for a specific event or for all events with specific a namespace. Because in pubsub, only one node name exists, so we have to add a way to convert the event name and namespace to a node name: [source] ------- nodename = eventname + "|" + namespace ------- So for example, to subscribe to ``, node must be: `EventName|tigase:demo`. If you wish to subscribe to all events with a specific namespace, use an asterisk (`*`) instead of the event name: +*|tigase:demo+. [NOTE] =============================== If client is subscribed to /*|tigase:demo node, then events will not be sent from node /*|tigase:demo, but from the *real* node (in this case: `EventName|tigase:demo`). =============================== [[availableTasks]] == Available Tasks Eventbus monitoring has several pre-defined tasks that can be monitored and set to trigger. What follows is the list of tasks with the options attributed to each task. - *disk-task* - Used to check disk usage. + Available Options . +enabled[B]+ - Enable or disable task, Boolean value. . +period[I]+ - Period of running check, Integer value. . +threshold+ - Percentage of used space on disk, Float value. - *cpu-temp-task* - Used to check CPU temperature. + Available Options . +enabled[B]+ - Enable or disable task, Boolean value. . +period[I]+ - Period of running check, Integer value. . +cpuTempThreshold[I]+ - Temperature threshold of CPU in °C. - *load-checker-task* - Used to check system load. + Available Options . +enabled[B]+ - Enable or disable task, Boolean value. . +period[I]+ - Period of running check, Integer value. . +averageLoadThreshold[L]+ - Average percent load threshold, Long value. - *memory-checker-task* - Used to check memory usage. + Available Options . +enabled[B]+ - Enable or disable task, Boolean value. . +period[I]+ - Period of running check, Integer value. . +maxHeapMemUsagePercentThreshold[I]+ - Alarm when percent of used Heap memory is larger than, Integer value. . +maxNonHeapMemUsagePercentThreshold[I]+ - Alarm when percent of used Non Heap memory is larger than, Integer value. - *logger-task* - Used to transmit log entries depending on level entered. + . +enabled[B]+ - Enable or disable task, Boolean value. . +levelThreshold+ - Minimal log level that will be the threshold. Possible values are SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, and ALL. - *connections-task* - Used to check users disconnections. + *NOTE: The event will be generated only if both thresholds (amount and percentage) will be fulfilled.* + . +enabled[B]+ - Enable or disable task, Boolean value. . +period[I]+ - Period of running check in ms, Integer value. . +thresholdMinimal[I]+ - Minimal amount of disconnected users required to generate alarm. . +threshold[I]+ - Minimal percent of disconnected users required to generate alarm. == Configuration Configuration of the eventbus monitor can be done one of two ways; either by lines in init.properties file, or by sending XMPP stanzas to the server. You may also send XMPP stanzas VIA HTTP REST. XMPP stanza configurations will override ones in init.properties, but they will only last until the server restarts. === init.properties Tasks can be configured in the init.properties file. See xref:availableTasks[available tasks] for the tasks that can be setup. To enable a specific monitor task, use the following line: ----- monitor/$TASKNAME/enabled[B]=true ----- Where monitor is the component name for tigase.monitor.MonitorComponent, and $TASKNAME is one of the xref:availableTasks[available task names]. This format will be the same for other settings for tasks. For example: ----- monitor/$TASKNAME/period[I]=1000 ----- which sets the check period to 1000 milliseconds. *NOTE* Once triggers have been activated, they will become dormant. Think of these as one-shot settings. ==== Subscription Limitations To define list of JIDs allowed to subscribe for events: [source, bash] ----- eventbus/affiliations/allowedSubscribers=francisco@denmark.lit,bernardo@denmark.lit ----- If this is left blank, all users can subscribe. === Configuration via XMPP We can also configure the eventbus monitor component using XMPP stanzas. This allows us to set and change configurations during server runtime. This is done using a series of +iq+ stanzas send to the monitor component. We can query each component for its current settings using the following stanza. [source,xml] ----- ----- The server will return the component current settings which will make things easier if you wish to edit them. In this case, the server has returned the following to us [source,xml] ----- Task Configuration 0 60000 0.8 ----- This tells us that the disk-task setting is not active, has a period of 60000ms, and will trigger when disk usage is over 80%. To send new settings to the monitor component, we can send a similar stanza back to the monitor component. [source,xml] ----- 0 60000 0.8 ----- To which a successful update will give you an XMPP success stanza to let you know everything is set correctly. (Include what the response will be from this setting!) Alternatively, you can update specific settings by editing a single field without adding anything else. For example, if we just wanted to turn the +disk-task+ on we could send the following stanza: [source,xml] ----- 1 ----- To set any other values, do not forget that certain parts may need to be changed, specifically the ** fields. + - Your field type will be defined by the type of variable specified in the xref:availableTasks [Available Tasks] section. + - +var=x task#+ will be followed by the property value taken directly from the xref:availableTasks [Available Tasks] section, minus the data type parameter. == Getting the Message Without a place to send messages to, eventbus will just trigger and shut down. There are two different methods that eventbus can deliver alarm messages and relevant data; XMPP messages and using the mailer extension. === XMPP notification In order to retrieve notifications, a subscription to the +eventbus@tigase.org+ user must be made. Keep in mind that subscriptions are not persistent across server restarts, or triggers. + The eventbus schema is very similar to most XMPP subscription requests but with a few tweaks to differentiate it if you wanted to subscribe to a certain task or all of them. Each task is considered a node, and each node has the following pattern: +eventName|eventXMLNS+. Since each monitoring task has the +tigase:monitor:event+ event XMLNS, we just need to pick the event name from the list of tasks. So like the above example, our event node for the disk task will be +disk-task|tigase:monitor:event+. Applied to an XMPP stanza, it will look something like this: [source,xml] ----- ----- Don't forget to replace $USER_JID with the bare JID of the user you want to receive those messages. You can even have them sent to a MUC or any component with a JID. Available events are as follows: - disk-taskEvent for +disk-task+ - LoggerMonitorEvent for +logger-task+ - HeapMemoryMonitorEvent for +memory-checker-task+ - LoadAverageMonitorEvent for +load-checker-task+ - CPUTempMonitorEvent for +cpu-temp-task+ - UsersDisconnected for +connections-task+ Alternatively, you can also subscribe to all events within the eventbus by using a wildcard * in place of the event XMLNS like this example: [source,xml] ----- ----- === Sample notification from Eventbus [source, xml] ------- 1 ------- [[monitorMailer]] == Mailer Extension Tigase Server Monitor Mailer Extension (TSMME) can send messages from the monitor component to a specified E-mail address so system administrators who are not logged into the XMPP server. For v7.1.0 versions and later, TSMME is already included in your distribution package and no extra installation is needed. For versions older than 7.1.0 TSMME requires two files to operate: - A compiled build of tigase mailer from link:https://projects.tigase.org/projects/tigase-server-ext-mailer/repository[its repository]. Place the compiled .jar file into /jars directory. - javax.mail.jar file which may be downloaded from link:http://java.net/projects/javamail/downloads/download/javax.mail.jar[this link]. Also place this file in the /jars directory. [source,properties] ----- monitor/mailer-smtp-host=mail.tigase.org monitor/mailer-smtp-port=587 monitor/mailer-smtp-username=sender monitor/mailer-smtp-password=******** monitor/mailer-from-address=sender@tigase.org monitor/mailer-to-addresses=receiver@tigase.org,admin@tigase.org ----- - +monitor/mailer-smtp-host+ - SMTP Server hostname. - +monitor/mailer-smtp-port+ - SMTP Server port. - +monitor/mailer-smtp-usernam+ - name of sender account. - +monitor/mailer-smtp-password+ - password of sender account. - +monitor/mailer-from-address+ - sender email address. It will be set in field from in email. - +monitor/mailer-to-addresses+ - comma separated notification receivers email addresses. It is recommended to create a specific e-mail address in your mail server for this purpose only, as the account settings are stored in plaintext without encryption. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_68_-_Components_-_G_-_Server_to_Server_Protocol.asciidoc ================================================ [[v5xs2sps]] = Server to Server Protocol Settings :author: Artur Hefczyc :version: v2.0, June 2014: Reformatted for AsciiDoc. :date: 2010-06-29 21:27 :revision: v2.1 :toc: :numbered: :website: http://tigase.net Tigase server *5.1.0* or later offers new, rewritten from scratch, implementation for s2s communication which allows you to tweak it's configuration to get a better performance in your installation. S2S (or server to server) protocol is enabled by default with optimal settings chosen. There are however, a set of configuration parameters you can adjust the server behavior to achieve optimal performance on your installation. This documents describes following elements of the Tigase server configuration: . Number of concurrent connections to external servers . The connection throughput parameters . Maximum waiting time for packets addressed to external servers and the connection inactivity time . Custom plugins selecting connection to the remote server == Number of Concurrent Connections Normally only one connection to the remote server is required to send XMPP stanza to that server. In some cases however, under a high load, you can get much better throughput and performance if you open multiple connections to the remote server. This is especially true when the remote server works in a cluster mode. Ideally you want to open a connection to each of the cluster nodes on the remote server. This way you can spread the traffic evenly among cluster nodes and improve the performance for s2s connections. Tigase server offers 2 different parameters to tweak the number of concurrent, s2s connections: - 'max-out-total-conns' - the property specifies the maximum outgoing connections the Tigase server opens to any remote XMPP server. This is 'per domain' limit, which means that this limit applies to each of the remote domains Tigase connects to. If it is set to '4' then Tigase opens a maximum of 4 connections to 'jabber.org' plus maximum 4 connections to 'muc.jabber.org' even if this is the same physical server behind the same IP address. + To adjust the limit you have to add following line to the +init.properties+ file: + [source,bash] ----- s2s/max-out-total-conns[I]=2 ----- - 'max-out-per-ip-conns' - the property specifies the maximum outgoing connections Tigase server opens to any remote XMPP server to its single IP address. This too, is 'per domain' limit, which means that this limit applies to each of the remote domains Tigase connects to. If it is set to '1', and the above limit is set to '4', and the remote server is visible behind 1 IP address, then Tigase opens a maximum of 1 connection to 'jabber.org' plus a maximum of 1 connection to 'muc.jabber.org' and other subdomains. + To adjust the limit you have to add following line to the init.properties file: + [source,bash] ----- s2s/max-out-per-ip-conns[I]=2 ----- == Connection Throughput Of course everybody wants his server to run with maximum throughput. This comes with a cost on resources, usually increased memory usage. This is especially important if you have large number of s2s connections on your installations. High throughput means lots of memory for network buffers for every single s2s connection. You may soon run out of all available memory. There is one configuration property which allows you to adjust the network buffers for s2s connections to lower your memory usage or increase data throughput for s2s communication. More details about are available in the init.properties guide under the link to +--net-buff-high-throughput+ property description. == Maximum Packet Waiting Time and Connection Inactivity Time There are 2 timeouts you can set for the component controlling s2s communication. - 'max-packet-waiting-time' - this sets the maximum time for the packets waiting for sending to some remote server. Sometimes, due to networking problems or DNS problems it might be impossible to send message to remote server right away. Establishing a new connection may take time or there might be communication problems between servers or perhaps the remote server is restarted. Tigase will try a few times to connect to the remote server before giving up. This parameter specifies how long the packet is waiting for sending before it is returned to the sender with an error. The timeout is specified in seconds: + [source,bash] ----- s2s/max-packet-waiting-time[L]=420 ----- - 'max-inactivity-time' - this parameters specifies the maximum s2s connection inactivity time before it is closed. If a connection is not in use for a long time, it doesn't make sense to keep it open and tie resources up. Tigase closes s2s connection after specified period of time and reconnects when it is necessary. The timeout is specified in seconds: + [source,bash] ----- s2s/max-inactivity-time[L]=900 ----- == Custom Plugin: Selecting s2s Connection Sometimes for very large installations you may want to set larger number of s2s connections to remote servers, especially if they work in cluster of several nodes. In such a case you can also have a control over XMPP packets distribution among s2s connections to a single remote server. This piece of code is pluggable and you can write your own connection selector. It is enough to implement 'S2SConnectionSelector' interface and set your class name in the configuration using following parameter in +init.properties+ file: [source,bash] ----- s2s/s2s-conn-selector=YourSelectorImplementation ----- The default selector picks connections randomly. ================================================ FILE: tigase-server 7.1.0/modules/documentation/adminguide/asciidoc/text/Admin_Guide_69_-_Components_-_H_-_MUC.asciidoc ================================================ [[tigaseMUC]] = Tigase MUC Component :author: not known :version: v1.0 October 2015 :date: 2015-10-01 15:00 :toc: :numbered: :website: http://www.tigase.org Tigase MUC component is included in all Tigase distributions, to enable MUCs have the following lines in your +init.properties+ file: ----- --comp-name-4 = muc --comp-class-4 = tigase.muc.MUCComponent ----- == Configuration Options - *room-log-directory* + Directory to store chat logs ----- muc/room-log-directory=/var/log/muc/ ----- - *message-filter-enabled* + To disable filter and allow MUC transfer all subelements in set: ----- muc/message-filter-enabled[B]=false ----- For example, this allows users to send XHTML stanzas through MUC chatrooms on your server. - *presence-filter-enabled* + To disable filter and allow MUC transfer all subelements in set: ----- muc/presence-filter-enabled[B]=false ----- - *search-ghosts-every-minute* + To enable pinging occupants every minute ----- muc/search-ghosts-every-minute[B]=true ----- - *ghostbuster-enabled* + To disable active searching of ghosts in MUC Rooms: ----- muc/ghostbuster-enabled[B]=false ----- - *muc-allow-chat-states* + To allow transfer of chat-states in MUC messages: ----- muc/muc-allow-chat-states[B]=true ----- - *muc-lock-new-room* + To turn off default locking newly created rooms: ----- muc/muc-lock-new-room[B]=false ----- By default new room will be locked until owner submit room configuration. - *muc-multi-item-allowed* To disable joining from few resources to sinlge nickname: ----- muc/muc-multi-item-allowed[B]=false ----- === History Providers Parameters - *history-db* + Database type. By default the same what is used as User Repository in Server. Provided types: +derby+, +mysql+, +memory+, +pgsql+, +sqlserver+, +none+. ----- muc/history-db=none ----- - *history-db-uri* + URI for database, if should be used different than default from Tigase Server: ----- muc/history-db-uri=jdbc:derby:/database/tigasedbmuc ----- === Public log - *muc-logger-class* + To set custom class for MUC logger: ----- muc/muc-logger-class=com.example.CustomLogger ----- Class must implment interface +tigase.muc.logger.MucLogger+. === Modules Each module can be configured to use custom implementation by including it in the init.properties, the defaults are as follows: [source,properties] ----- muc/modules/jabber:iq:version[S]=tigase.component.modules.impl.JabberVersionModule muc/modules/owner[S]=tigase.muc.modules.RoomConfigurationModule muc/modules/presences[S]=tigase.muc.modules.PresenceModuleImpl muc/modules/groupchat[S]=tigase.muc.modules.GroupchatMessageModule muc/modules/invitations[S]=tigase.muc.modules.MediatedInvitationModule muc/modules/urn:xmpp:ping[S]=tigase.component.modules.impl.XmppPingModule muc/modules/unique[S]=tigase.muc.modules.UniqueRoomNameModule muc/modules/disco[S]=tigase.muc.modules.DiscoveryModule muc/modules/iqforwarder[S]=tigase.muc.modules.IqStanzaForwarderModule muc/modules/admin[S]=tigase.muc.modules.ModeratorModule muc/modules/privatemessages[S]=tigase.muc.modules.PrivateMessageModule muc/modules/commands[S]=tigase.component.modules.impl.AdHocCommandModule ----- [[mucRoomConfig]] === Room Configuration options In addition to the default Room configuration options defined in the MUC specification Tigase offers following as well: Tigase MUC Options:: - tigase#presence_delivery_logic - allows configuring logic determining which presence should be used by occupant in the room while using multiple-resource connections under one nickname, following options are available: * PREFERE_PRIORITY * PREFERE_LAST - tigase#presence_filtering - (boolean) when enabled broadcasts presence only to selected affiliation groups - tigase#presence_filtered_affiliations - when enabled tigase#presence_filtering is enabled one can select affiliation which should receive presences, following are possible to select from: * owner * admin * member * none * outcast - muc#roomconfig_maxusers - Allows configuring of maximum users of room. Configuring default room configuration in init.properties:: ----- muc/default_room_config/