Closes WAVE-423 - replaces wave's custom config framework with typesafe config.
Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/80369760 Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/80369760 Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/80369760 Branch: refs/heads/master Commit: 8036976061469f48c830024f17f1a3b0bb8dbad7 Parents: 1b8ce7c Author: Yuri Zelikov <[email protected]> Authored: Mon Apr 6 22:25:02 2015 +0300 Committer: Yuri Zelikov <[email protected]> Committed: Tue Apr 7 23:09:55 2015 +0300 ---------------------------------------------------------------------- .gitignore | 5 + .settings/org.eclipse.jdt.core.prefs | 67 ++-- .settings/org.eclipse.jdt.ui.prefs | 5 +- build.xml | 14 +- reference.conf | 257 ++++++++++++++++ run-server.bat | 6 - run-server.sh | 6 - server-config.xml | 161 +--------- server.config.example | 228 -------------- server.federation.config | 22 -- server.federation.config.example | 72 ----- .../waveprotocol/box/server/CoreSettings.java | 304 ------------------- .../box/server/CoreSettingsNames.java | 27 ++ .../box/server/DataMigrationTool.java | 106 +------ .../waveprotocol/box/server/SearchModule.java | 24 +- src/org/waveprotocol/box/server/ServerMain.java | 119 +++----- .../waveprotocol/box/server/ServerModule.java | 8 +- src/org/waveprotocol/box/server/StatModule.java | 5 +- .../box/server/executor/ExecutorsModule.java | 98 +++--- .../server/persistence/PersistenceModule.java | 26 +- .../persistence/file/FileAccountStore.java | 51 ++-- .../persistence/file/FileAttachmentStore.java | 26 +- .../server/persistence/file/FileDeltaStore.java | 12 +- .../persistence/file/FileSignerInfoStore.java | 51 ++-- .../persistence/lucene/FSIndexDirectory.java | 7 +- .../box/server/robots/ProfileFetcherModule.java | 8 +- .../box/server/robots/RobotApiModule.java | 6 +- .../server/robots/RobotRegistrationServlet.java | 11 +- .../robots/agent/AbstractBaseRobotAgent.java | 40 ++- .../robots/agent/AbstractCliRobotAgent.java | 24 +- .../robots/agent/passwd/PasswordAdminRobot.java | 63 ++-- .../agent/registration/RegistrationRobot.java | 27 +- .../robots/agent/welcome/WelcomeRobot.java | 12 +- .../operations/GravatarProfilesFetcher.java | 18 +- .../robots/operations/ImportDeltasService.java | 4 +- .../box/server/rpc/AttachmentServlet.java | 41 +-- .../box/server/rpc/AuthenticationServlet.java | 63 ++-- .../box/server/rpc/ServerRpcProvider.java | 103 +++---- .../box/server/rpc/UserRegistrationServlet.java | 27 +- .../box/server/rpc/WaveClientServlet.java | 43 ++- .../waveserver/CertificateManagerImpl.java | 31 +- .../LucenePerUserWaveViewHandlerImpl.java | 70 ++--- .../waveserver/NonSigningSignatureHandler.java | 4 +- .../waveserver/SigningSignatureHandler.java | 23 +- .../waveserver/SimpleSearchProviderImpl.java | 4 +- .../waveserver/SolrSearchProviderImpl.java | 28 +- .../server/waveserver/SolrWaveIndexerImpl.java | 11 +- .../box/server/waveserver/WaveMap.java | 28 +- .../box/server/waveserver/WaveServerModule.java | 65 ++-- .../wave/federation/FederationSettings.java | 82 ----- .../xmpp/ComponentPacketTransport.java | 23 +- .../wave/federation/xmpp/RemoteDisco.java | 8 +- .../wave/federation/xmpp/XmppDisco.java | 57 ++-- .../federation/xmpp/XmppFederationHost.java | 35 +-- .../xmpp/XmppFederationHostForDomain.java | 14 +- .../federation/xmpp/XmppFederationRemote.java | 65 ++-- .../wave/federation/xmpp/XmppManager.java | 30 +- .../wave/util/settings/Setting.java | 37 --- .../wave/util/settings/SettingsBinder.java | 198 ------------ .../persistence/file/AccountStoreTest.java | 4 +- .../persistence/file/AttachmentStoreTest.java | 4 +- .../persistence/file/CertPathStoreTest.java | 3 +- .../server/persistence/file/DeltaStoreTest.java | 4 +- .../robots/agent/AbstractRobotAgentTest.java | 2 +- .../server/rpc/AuthenticationServletTest.java | 13 +- .../waveprotocol/box/server/rpc/RpcTest.java | 25 +- .../server/rpc/UserRegistrationServletTest.java | 16 +- .../waveserver/CertificateManagerImplTest.java | 10 +- .../LucenePerUserWaveViewProviderTest.java | 2 +- .../SimpleSearchProviderImplTest.java | 11 +- .../box/server/waveserver/WaveMapTest.java | 2 +- .../box/server/waveserver/WaveServerTest.java | 7 +- .../wave/federation/xmpp/MockDisco.java | 24 +- .../wave/federation/xmpp/RoundTripTest.java | 15 +- .../wave/federation/xmpp/XmppDiscoTest.java | 32 +- .../xmpp/XmppFederationHostForDomainTest.java | 12 +- .../xmpp/XmppFederationRemoteTest.java | 38 ++- 77 files changed, 1079 insertions(+), 2155 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 42c8e03..05d35c1 100755 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,8 @@ war/WEB-INF /src/org/waveprotocol/box/server/rpc/atmosphere/atmosphere-min.js /src/org/waveprotocol/box/server/rpc/atmosphere/atmosphere.js .DS_Store +.idea +*.iml +*.eml +.settings/ + http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/.settings/org.eclipse.jdt.core.prefs ---------------------------------------------------------------------- diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 280d9fb..178176e 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,3 @@ -#Wed Sep 29 11:07:04 EST 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 @@ -7,42 +6,45 @@ org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration= org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=48 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 org.eclipse.jdt.core.formatter.blank_lines_after_package=1 org.eclipse.jdt.core.formatter.blank_lines_before_field=0 org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 org.eclipse.jdt.core.formatter.blank_lines_before_package=0 org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line @@ -51,10 +53,11 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false org.eclipse.jdt.core.formatter.comment.format_block_comments=true org.eclipse.jdt.core.formatter.comment.format_header=false @@ -62,17 +65,23 @@ org.eclipse.jdt.core.formatter.comment.format_html=true org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true org.eclipse.jdt.core.formatter.comment.format_line_comments=true org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true org.eclipse.jdt.core.formatter.comment.indent_root_tags=true org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true org.eclipse.jdt.core.formatter.compact_else_if=true org.eclipse.jdt.core.formatter.continuation_indentation=2 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on org.eclipse.jdt.core.formatter.force_if_else_statement_brace=false org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true @@ -82,19 +91,27 @@ org.eclipse.jdt.core.formatter.indent_empty_lines=false org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=8 +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=2 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert @@ -132,10 +149,11 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert @@ -150,12 +168,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert @@ -164,7 +184,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert @@ -179,6 +199,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert @@ -206,6 +227,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -234,6 +256,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert @@ -243,6 +266,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -256,13 +280,13 @@ org.eclipse.jdt.core.formatter.join_lines_in_comments=true org.eclipse.jdt.core.formatter.join_wrapped_lines=true org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.lineSplit=100 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=2 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false org.eclipse.jdt.core.formatter.sort_member_annotations=false @@ -271,12 +295,15 @@ org.eclipse.jdt.core.formatter.sort_parameter_annotations=false org.eclipse.jdt.core.formatter.sort_type_annotations=false org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=false org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/.settings/org.eclipse.jdt.ui.prefs ---------------------------------------------------------------------- diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index d34cf38..ac7039e 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -1,7 +1,6 @@ -#Fri Sep 03 16:36:23 EST 2010 eclipse.preferences.version=1 -formatter_profile=_Wave Protocol Format -formatter_settings_version=11 +formatter_profile=_WaveStyle +formatter_settings_version=12 org.eclipse.jdt.ui.ignorelowercasenames=true org.eclipse.jdt.ui.importorder=com.google;com;edu;freemarker;junit;net;org;java;javax; org.eclipse.jdt.ui.ondemandthreshold=99 http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index 52000a0..1e721d4 100644 --- a/build.xml +++ b/build.xml @@ -264,6 +264,7 @@ <include name="**/*.html"/> <include name="**/*.properties"/> <include name="**/*.proto"/> + <include name="**/*.conf"/> </fileset> </copy> @@ -543,13 +544,7 @@ Server ======--> - <target name="check-server-config" description="Checks server configuration is available"> - <available file="server.config" property="server.config.present"/> - <fail message="You need to copy server.config.example to server.config and edit it." - unless="server.config.present"/> - </target> - - <target name="run-server" depends="compile, check-server-config" + <target name="run-server" depends="compile" description="Runs Wave in a Box server"> <java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain"> <classpath> @@ -560,11 +555,10 @@ </classpath> <jvmarg value="-Dorg.eclipse.jetty.LEVEL=DEBUG"/> <jvmarg value="-Djava.security.auth.login.config=jaas.config"/> - <jvmarg value="-Dwave.server.config=server.config"/> </java> </target> - <target name="debug-server" depends="compile, check-server-config" + <target name="debug-server" depends="compile" description="Runs Wave in a Box server with debugging"> <java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain"> <classpath> @@ -1064,7 +1058,6 @@ <url url="http://people.apache.org/repo/m1-ibiblio-rsync-repository/javax.jdo/jars/jdo2-api-2.2.jar" /> <url url="http://central.maven.org/maven2/org/jdom/jdom/1.1.3/jdom-1.1.3.jar" /> <url url="http://central.maven.org/maven2/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar" /> - <url url="http://central.maven.org/maven2/jline/jline/0.9.94/jline-0.9.94.jar" /> <url url="http://central.maven.org/maven2/joda-time/joda-time/1.6/joda-time-1.6.jar" /> <url url="http://central.maven.org/maven2/org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0.jar" /> @@ -1082,6 +1075,7 @@ <url url="http://archiva.comunes.org/repository/comunes-snapshots/cc/kune/gwt-initials-avatars-shared/1.0-SNAPSHOT/gwt-initials-avatars-shared-1.0-20140324.102812-16.jar" /> <url url="http://archiva.comunes.org/repository/comunes-snapshots/cc/kune/gwt-initials-avatars-shared/1.0-SNAPSHOT/gwt-initials-avatars-shared-1.0-20140324.102812-16-sources.jar" /> <url url="http://archiva.comunes.org/repository/comunes-snapshots/cc/kune/gwt-initials-avatars-server/1.0-SNAPSHOT/gwt-initials-avatars-server-1.0-20140324.102825-10.jar" /> + <url url="http://central.maven.org/maven2/com/typesafe/config/1.2.1/config-1.2.1.jar" /> </get> <get dest="${lib.runtime}/whack_1_0_0.zip" usetimestamp="true" skipexisting="true"> <url url="http://www.igniterealtime.org/downloadServlet?filename=whack/whack_1_0_0.zip" /> http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/reference.conf ---------------------------------------------------------------------- diff --git a/reference.conf b/reference.conf new file mode 100644 index 0000000..04753c4 --- /dev/null +++ b/reference.conf @@ -0,0 +1,257 @@ +# 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. + +# Configuration for the Wave in a Box server + + +core { + # Domain name of the wave server. + wave_server_domain : "local.net" + + # A comma separated list of address on which to listen for connections. + # Each address is a comma separated host:port pair. + http_frontend_addresses : ["localhost:9898"] + + # The public address - a comma separated host:port pair, i.e. example.com:80 + http_frontend_public_address : "" + + # An optional host:port address on which to listen for websocket connections. + # Defaults to http_websocket_public_address. + # If no value is set for http_websocket_public_address it defaults to the first address specified + # by http_frontend_public_address. + http_websocket_public_address : "" + + # An optional host:port address for which the client is told to attempt websocket connections. + # If no value is set for http_websocket_presented_address it defaults to http_websocket_public_address. + http_websocket_presented_address : "" + + # The address of Apache Shindig gadgets server patched to support Wave gadgets. + # See https://cwiki.apache.org/confluence/display/WAVE/Gadgets+with+your+own+Gadget+Server + gadget_server_hostname : "gmodules.com" + + # The gadget serer port. + gadget_server_port : 80 + + # A comma separated list of webApp source directories + resource_bases : ["./war"] + + # Settings for the different persistence stores. Currently supported: memory, file, mongodb. + signer_info_store_type : file + + # The location where signer info certificate data is stored on disk. This should be changed. + # Note: This is only used when using the file signer info store. It is ignored + # for other data store types. + signer_info_store_directory : _certificates + + # Currently supported attachment types: mongodb, disk + attachment_store_type : disk + + # The location where attachments are stored on disk. This should be changed. + # Note: This is only used when using the disk attachment store. It is ignored + # for other data store types. + attachment_store_directory : _attachments + + # Directory that holds the thumbnails for attachments. + # Icon must be in PNG format, and named as MIME type with replacing '/' to '_'. + # For example thumbnail file for ZIP format (MIME type application/zip) must be named application_zip. + thumbnail_patterns_directory : _thumbnail_patterns + + # Currently supported account store types: fake, memory, file, mongodb + account_store_type : file + + # The location where accounts are stored on disk. This should be changed. + # Note: This is only used when using the file account store. It is ignored + # for other data store types. + account_store_directory : _accounts + + # Currently supported delta store types: memory, file, mongodb. + # Note: file system support is experimental. Your server may crash. And the file format is + # not stable and shouldn't be relied upon for long-term storage yet; upcoming changes will + # require you to blow away your data. + delta_store_type : file + + # The location where deltas are stored on disk. This should be changed. + # Note: This is only used when using the file delta store. It is ignored + # for other data store types. + delta_store_directory : _deltas + + # The location where user sessions are persisted on disk. This allow to restore user sessions + # between restarts. + sessions_store_directory : _sessions + + # Currently supported search types: memory, lucene, solr. + search_type : memory + + # The location where search indexes are stored on disk. + # Note: This is only used when using the lucene search type. It is ignored + # for other search types. + index_directory : _indexes + + # Currently supported profile fetcher types: gravatar, initials. + profile_fetcher_type : initials + + # The Solr endpoint url. + solr_base_url : "http://localhost:8983/solr" + + # Enables server side profiling. To display the stats press ctrl+alt+ctrl in the web client. + # Default value: true + enable_profiling : true + + # Mongodb connection options + # Only used if some of the *_store_type properties are set to 'mongodb' + + # Server's host name or IP address. + mongodb_host : "127.0.0.1" + + # Server's port. Default value: 27017 + mongodb_port : 27017 + + # Database's name. Default name: wiab + mongodb_database : wiab +} + +network { + # Max age of session cookie in seconds. + # -1 means cookie lives in the browser current session only. + session_cookie_max_age : -1 + + # The time in ms that the websocket connection can be idle before closing + websocket_max_idle_time : 0 + + # Maximum websocket message size to be received in MB + websocket_max_message_size : 2 +} + +administration { + # Note: the default value for admin is an invalid user id that cannot be registered. + # To become an admin: Register a user and set its address as the value below. + # Admin has a privilege to change passwords of other users using an agent robot. + admin_user : "@" + + # The wave id of the welcome template wave. (Without domain, for example: w+Fxjs_-ZPmmA). + # If filled in then a copy of this wave (actually only the root blip) will be + # automatically added to the inbox of every new user. + welcome_wave_id : "" + + # Set true to prevent anyone registering on your server. + # When true, only the admin user can use the RegistrationRobot to add new accounts + disable_registration : false + + # Disable login page - useful to force x509-only authentication + disable_loginpage : false + + # Google Analytics account. + analytics_account : "" +} + +threads { + # The number of threads to listen on wavelet updates. Default value: 1 + listener_executor_thread_count : 1 + + # The number of threads for loading wavelets. Default value: 1 + wavelet_load_executor_thread_count : 1 + + # The number of threads to persist deltas. Default value: 1 + delta_persist_executor_thread_count : 1 + + # The number of threads to perform post wavelet loading logic. Default value: 1 + storage_continuation_executor_thread_count : 1 + + # The number of threads for looking up the wavelet ids + # while creating a list of all wavelets in the persistent storage. Default value: 1 + lookup_executor_thread_count : 1 + + # The number of threads for making search/update requests to Solr. Default value: 1 + solr_thread_count : 1 + + # The number of threads for making for retrieving contacts. + contact_executor_thread_count : 1 +} + +security { + # Enable SSL for all address/port combinations listed (makes the next 2 settings non-optional). + enable_ssl : false + + # Path to keystore containg the ssl certificates to server + # Note: this is only used when enable_ssl set to true. + ssl_keystore_path : wiab.ks + + # Password to the keystore. + # Note: this is only used when enable_ssl set to true. + ssl_keystore_password : changeme + + # Enable client x509 cert. authentication? + enable_clientauth : false + + # Domain of the email to look for as email field of x509 client auth certificates when using client authentication + clientauth_cert_domain : "" +} + +federation { + # Federation Configuration for the Wave in a Box server + enable_federation : false + + # These will probably need to be changed + xmpp_server_secret : secret + + # The PKCS#8-PEM-encoded private key. + certificate_private_key : "local.net.key" + + # The list of file names that have the certificates of this signer. + # The first file name must have the signer's target certificate. The certificates can be DER or PEM encoded. + # The order of certificates is important. Place intermediate certs + # after "${wave_server_domain}.crt". Please refer to + # http://www.waveprotocol.org/federation/certificates + # for more details. + certificate_files : ["local.net.crt","sub.class1.server.ca.pem","ca.pem"] + + # The domain for which the certificate was issued. + certificate_domain : "local.net" + + xmpp_component_name : wave + + # This server's local JID + xmpp_jid : "wave.local.net" + + xmpp_server_description : "Wave in a Box" + + disco_info_category : "collaboration" + + disco_info_type : "apache-wave" + + xmpp_server_hostname : "local.net" + + xmpp_server_component_port : 5275 + + # How long to cache failed disco results. + xmpp_disco_failed_expiry : 300s + + # How long to cache successful disco results. + xmpp_disco_successful_expiry : 7200s + + disco_expiration : 6h + + # Set XMPP_SERVER_IP to localhost if the XMPP and Wave in a Box servers are + # running on the same host + xmpp_server_ip : localhost + + # Set true to disable the verification of signed deltas + waveserver_disable_verification : true + + # Set true to disable the verification of signers (certificates) + waveserver_disable_signer_verification : true +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/run-server.bat ---------------------------------------------------------------------- diff --git a/run-server.bat b/run-server.bat index 78c9fbf..f70f6d3 100644 --- a/run-server.bat +++ b/run-server.bat @@ -14,12 +14,6 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "server.config" ( - echo "You need to copy server.config.example to server.config and edit it. Or run: 'ant -f server-config.xml' to generate the file automatically." - pause - exit 1 -) - for /F "tokens=1* delims==" %%A IN (build.properties) DO ( IF "%%A"=="waveinabox.version" set WAVEINABOX_VERSION=%%B IF "%%A"=="name" set NAME=%%B http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/run-server.sh ---------------------------------------------------------------------- diff --git a/run-server.sh b/run-server.sh index 3ee3eb4..f733bad 100755 --- a/run-server.sh +++ b/run-server.sh @@ -19,12 +19,6 @@ # This script will start the Wave in a Box server. -# Make sure the config file exists. -if [ ! -e server.config ]; then - echo "You need to copy server.config.example to server.config and edit it. Or run: 'ant -f server-config.xml' to generate the file automatically." - exit 1 -fi - # The version of Wave in a Box, extracted from the build.properties file WAVEINABOX_VERSION=`sed "s/[\\t ]*=[\\t ]*/=/g" build.properties | grep ^waveinabox.version= | cut -f2 -d=` NAME=`sed "s/[\\t ]*=[\\t ]*/=/g" build.properties | grep ^name= | cut -f2 -d=` http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/server-config.xml ---------------------------------------------------------------------- diff --git a/server-config.xml b/server-config.xml index 30b33c2..fa80815 100644 --- a/server-config.xml +++ b/server-config.xml @@ -16,57 +16,10 @@ * specific language governing permissions and limitations * under the License. --> -<project name="server config" basedir="." default="server-config"> +<project name="server config" basedir="." default="prosody-config"> <description>Creates the server configuration file.</description> - <!-- Properties for server.config --> <property name="wave_server_domain" value="local.net" /> - <property name="http_frontend_public_address" value="localhost:9898" /> - <property name="http_websocket_public_address" value="${http_frontend_public_address}" /> - <property name="http_websocket_presented_address" value="${http_frontend_public_address}" /> - <property name="http_frontend_addresses" value="${http_frontend_public_address}" /> - <property name="resource_bases" value="./war" /> - <property name="signer_info_store_type" value="file" /> - <property name="attachment_store_type" value="disk" /> - <property name="account_store_type" value="file" /> - <property name="delta_store_type" value="file" /> - <property name="signer_info_store_directory" value="_certificates" /> - <property name="attachment_store_directory" value="_attachments" /> - <property name="account_store_directory" value="_accounts" /> - <property name="delta_store_directory" value="_deltas" /> - <property name="sessions_store_directory" value="_sessions" /> - <property name="session_cookie_max_age" value="-1" /> - <property name="websocket_max_message_size" value="2" /> - <property name="websocket_max_idle_time" value="0" /> - <property name="admin_user" value="@${wave_server_domain}" /> - <property name="welcome_wave_id" value="" /> - <property name="listener_executor_thread_count" value="1" /> - <property name="wavelet_load_executor_thread_count" value="1" /> - <property name="delta_persist_executor_thread_count" value="1" /> - <property name="storage_continuation_executor_thread_count" value="1" /> - <property name="lookup_executor_thread_count" value="1" /> - <property name="robot_connection_thread_count" value="10" /> - <property name="robot_gateway_thread_count" value="10" /> - <property name="solr_thread_count" value="1" /> - <property name="disable_registration" value="false" /> - <property name="enable_ssl" value="false" /> - <property name="ssl_keystore_path" value="wiab.ks" /> - <property name="ssl_keystore_password" value="changeme" /> - <property name="enable_clientauth" value="false" /> - <property name="clientauth_cert_domain" value="" /> - <property name="disable_loginpage" value="false" /> - <property name="search_type" value="lucene" /> - <property name="index_directory" value="_indexes" /> - <property name="thumbnail_patterns_directory" value="thumbnail_patterns" /> - <property name="analytics_account" value="" /> - <property name="profile_fetcher_type" value="gravatar" /> - <property name="enable_profiling" value="true" /> - <property name="solr_base_url" value="http://localhost:8983/solr" /> - <property name="mongodb_host" value="127.0.0.1" /> - <property name="mongodb_port" value="27017" /> - <property name="mongodb_database" value="wiab" /> - - <!-- Properties for server.federation.config --> <property name="xmpp_server_secret" value="opensesame" /> <property name="certificate_private_key" value="${wave_server_domain}.key" /> <property name="certificate_files" value="${wave_server_domain}.crt,sub.class1.server.ca.pem,ca.pem" /> @@ -82,116 +35,10 @@ <property name="waveserver_disable_verification" value="false" /> <property name="waveserver_disable_signer_verification" value="false" /> - <target name="create-folders"> - <mkdir dir="${signer_info_store_directory}" /> - <mkdir dir="${attachment_store_directory}" /> - <mkdir dir="${account_store_directory}" /> - <mkdir dir="${delta_store_directory}" /> - <mkdir dir="${sessions_store_directory}" /> - </target> - - <target name="server-config" depends="create-folders" - description="Run to create the server configuration file. - You can pass custom values, for example: - ant -f server-config.xml -Dwave_server_domain=example.com"> - <echo>Generating server.config</echo> - <copy file="server.config" - tofile="server.config.old" - overwrite="true" - failonerror="false" /> - <copy file="server.config.example" tofile="server.config" overwrite="true"> - <filterchain> - <replacetokens> - <token key="WAVE_SERVER_DOMAIN" value="${wave_server_domain}" /> - <token key="HTTP_FRONTEND_PUBLIC_ADDRESS" - value="${http_frontend_public_address}" /> - <token key="HTTP_WEBSOCKET_PUBLIC_ADDRESS" - value="${http_websocket_public_address}" /> - <token key="HTTP_WEBSOCKET_PRESENTED_ADDRESS" - value="${http_websocket_presented_address}" /> - <token key="HTTP_FRONTEND_ADDRESSES" - value="${http_frontend_addresses}" /> - <token key="RESOURCE_BASES" value="${resource_bases}" /> - <token key="SIGNER_INFO_STORE_TYPE" value="${signer_info_store_type}" /> - <token key="ATTACHMENT_STORE_TYPE" value="${attachment_store_type}" /> - <token key="ACCOUNT_STORE_TYPE" value="${account_store_type}" /> - <token key="DELTA_STORE_TYPE" value="${delta_store_type}" /> - <token key="SIGNER_INFO_STORE_DIRECTORY" - value="${signer_info_store_directory}" /> - <token key="ATTACHMENT_STORE_DIRECTORY" - value="${attachment_store_directory}" /> - <token key="ACCOUNT_STORE_DIRECTORY" - value="${account_store_directory}" /> - <token key="DELTA_STORE_DIRECTORY" value="${delta_store_directory}" /> - <token key="SESSIONS_STORE_DIRECTORY" value="${sessions_store_directory}" /> - <token key="SESSION_COOKIE_MAX_AGE" value="${session_cookie_max_age}" /> - <token key="WEBSOCKET_MAX_MESSAGE_SIZE" value="${websocket_max_message_size}" /> - <token key="WEBSOCKET_MAX_IDLE_TIME" value="${websocket_max_idle_time}" /> - <token key="ADMIN_USER" value="${admin_user}" /> - <token key="WELCOME_WAVE_ID" value="${welcome_wave_id}" /> - <token key="LISTENER_EXECUTOR_THREAD_COUNT" value="${listener_executor_thread_count}" /> - <token key="WAVELET_LOAD_EXECUTOR_THREAD_COUNT" value="${wavelet_load_executor_thread_count}" /> - <token key="DELTA_PERSIST_EXECUTOR_THREAD_COUNT" value="${delta_persist_executor_thread_count}" /> - <token key="STORAGE_CONTINUATION_EXECUTOR_THREAD_COUNT" value="${storage_continuation_executor_thread_count}" /> - <token key="LOOKUP_EXECUTOR_THREAD_COUNT" value="${lookup_executor_thread_count}" /> - <token key="ROBOT_CONNECTION_THREAD_COUNT" value="${robot_connection_thread_count}" /> - <token key="ROBOT_GATEWAY_THREAD_COUNT" value="${robot_gateway_thread_count}" /> - <token key="SOLR_THREAD_COUNT" value="${solr_thread_count}" /> - <token key="DISABLE_REGISTRATION" value="${disable_registration}" /> - <token key="ENABLE_SSL" value="${enable_ssl}" /> - <token key="SSL_KEYSTORE_PATH" value="${ssl_keystore_path}" /> - <token key="SSL_KEYSTORE_PASSWORD" value="${ssl_keystore_password}" /> - <token key="ENABLE_CLIENTAUTH" value="${enable_clientauth}" /> - <token key="CLIENTAUTH_CERT_DOMAIN" value="${clientauth_cert_domain}" /> - <token key="DISABLE_LOGINPAGE" value="${disable_loginpage}" /> - <token key="SEARCH_TYPE" value="${search_type}" /> - <token key="INDEX_DIRECTORY" value="${index_directory}" /> - <token key="ANALYTICS_ACCOUNT" value="${analytics_account}" /> - <token key="THUMBNAIL_PATTERNS_DIRECTORY" value="${thumbnail_patterns_directory}" /> - <token key="PROFILE_FETCHER_TYPE" value="${profile_fetcher_type}" /> - <token key="ENABLE_PROFILING" value="${enable_profiling}" /> - <token key="SOLR_BASE_URL" value="${solr_base_url}" /> - <token key="MONGODB_HOST" value="${mongodb_host}" /> - <token key="MONGODB_PORT" value="${mongodb_port}" /> - <token key="MONGODB_DATABASE" value="${mongodb_database}" /> - </replacetokens> - </filterchain> - </copy> - </target> - - <target name="server-federation-config" depends="server-config" - description="Run to create both the server and federation configuration files. - ant -f server-config.xml server-federation-config -Dserver_federation_config=server.federation.config"> - <echo>Generating federation.server.config</echo> - <copy file="server.federation.config" - tofile="server.federation.config.old" - overwrite="true" - failonerror="false" /> - <copy file="server.federation.config.example" tofile="server.federation.config" overwrite="true"> - <filterchain> - <replacetokens> - <token key="XMPP_SERVER_SECRET" value="${xmpp_server_secret}" /> - <token key="CERTIFICATE_PRIVATE_KEY" value="${certificate_private_key}" /> - <token key="CERTIFICATE_FILES" value="${certificate_files}" /> - <token key="CERTIFICATE_DOMAIN" value="${certificate_domain}" /> - <token key="XMPP_COMPONENT_NAME" value="${xmpp_component_name}" /> - <token key="XMPP_JID" value="${xmpp_jid}" /> - <token key="XMPP_SERVER_DESCRIPTION" value="${xmpp_server_description}" /> - <token key="XMPP_SERVER_HOSTNAME" value="${xmpp_server_hostname}" /> - <token key="XMPP_SERVER_COMPONENT_PORT" value="${xmpp_server_component_port}" /> - <token key="XMPP_SERVER_PING" value="${xmpp_server_ping}" /> - <token key="XMPP_SERVER_IP" value="${xmpp_server_ip}" /> - <token key="WAVESERVER_DISABLE_VERIFICATION" value="${waveserver_disable_verification}" /> - <token key="WAVESERVER_DISABLE_SIGNER_VERIFICATION" - value="${waveserver_disable_signer_verification}" /> - </replacetokens> - </filterchain> - </copy> - </target> - <target name="prosody-config" depends="server-federation-config" - description="Run to create the server, federation and prosody configuration files. - ant -f server-config.xml server-federation-config prosody-config -Dserver_federation_config=server.federation.config"> + <target name="prosody-config" + description="Run to create the prosody configuration files. + ant -f server-config.xml prosody-config"> <echo>Generating ${certificate_domain}.cfg.lua</echo> <copy file="${certificate_domain}.cfg.lua" tofile="${certificate_domain}.cfg.lua.old" http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/server.config.example ---------------------------------------------------------------------- diff --git a/server.config.example b/server.config.example deleted file mode 100644 index bc25193..0000000 --- a/server.config.example +++ /dev/null @@ -1,228 +0,0 @@ -# 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. - -# Core Configuration for the Wave in a Box server -# -# Run "ant -f server-config.xml" to generate the server.config file automatically. -# To override default values pass them to the ant script. For example -# to override wave_server_domain run: ant -f server-config.xml -Dwave_server_domain=example.com - - -# Domain name of the wave server -# Default value: local.net -wave_server_domain = @WAVE_SERVER_DOMAIN@ - -# A comma separated list of address on which to listen for connections. -# Each address is a comma separated host:port pair. -# Default value: localhost:9898 -http_frontend_public_address = @HTTP_FRONTEND_PUBLIC_ADDRESS@ - -# A optional host:port address on which to listen for websocket connections. -# If no value is set for http_websocket_public_address it defaults to the first address specified -# by http_frontend_public_address. -# Default value: localhost:9898 -http_websocket_public_address = @HTTP_WEBSOCKET_PUBLIC_ADDRESS@ - -# An optional host:port address for which the client is told to attempt websocket connections. -# If no value is set for http_websocket_presented_address it defaults to http_websocket_public_address -# Default value: localhost:9898 -http_websocket_presented_address = @HTTP_WEBSOCKET_PRESENTED_ADDRESS@ - -# Default value: values passed to http_frontend_public_address. -http_frontend_addresses = @HTTP_FRONTEND_ADDRESSES@ - -# A comma separated list of webApp source directories -# Default value: ./war -resource_bases = @RESOURCE_BASES@ - -### Server-specific variables -### - -# Settings for the different persistence stores. Currently supported: memory, file, mongodb -# Default value: memory -signer_info_store_type = @SIGNER_INFO_STORE_TYPE@ - -# The location where signer info certificate data is stored on disk. This should be changed. -# Note: This is only used when using the file signer info store. It is ignored -# for other data store types. -# Default value: _certificates -signer_info_store_directory = @SIGNER_INFO_STORE_DIRECTORY@ - -# Currently supported attachment types: mongodb, disk -# Default value: disk -attachment_store_type = @ATTACHMENT_STORE_TYPE@ - -# The location where attachments are stored on disk. This should be changed. -# Note: This is only used when using the disk attachment store. It is ignored -# for other data store types. -attachment_store_directory = @ATTACHMENT_STORE_DIRECTORY@ - -# Currently supported account store types: fake, memory, file, mongodb -# Default value: memory -account_store_type = @ACCOUNT_STORE_TYPE@ - -# The location where accounts are stored on disk. This should be changed. -# Note: This is only used when using the file account store. It is ignored -# for other data store types. -# Default value: _accounts -account_store_directory = @ACCOUNT_STORE_DIRECTORY@ - -# Currently supported delta store types: memory, file, mongodb. -# Note: file system support is experimental. Your server may crash. And the file format is -# not stable and shouldn't be relied upon for long-term storage yet; upcoming changes will -# require you to blow away your data. -# Default value: memory -delta_store_type = @DELTA_STORE_TYPE@ - -# The location where deltas are stored on disk. This should be changed. -# Note: This is only used when using the file delta store. It is ignored -# for other data store types. -# Default value: _deltas -delta_store_directory = @DELTA_STORE_DIRECTORY@ - -# The location where user sessions are persisted on disk. This allow to restore user sessions -# between restarts. -# Default value: _sessions -sessions_store_directory = @SESSIONS_STORE_DIRECTORY@ - -# Max age of session cookie in seconds. -# -1 means cookie lives in the browser current session only. -# Default value: -1 -session_cookie_max_age = @SESSION_COOKIE_MAX_AGE@ - -# The time in ms that the websocket connection can be idle before closing -# Default value: 0 -websocket_max_idle_time = @WEBSOCKET_MAX_IDLE_TIME@ - -# Maximum websocket message size to be received in MB -# Default value: 2 -websocket_max_message_size = @WEBSOCKET_MAX_MESSAGE_SIZE@ - -# Note: the default value for admin is an invalid user id that cannot be registered. -# To become an admin: Register a user and set its address as the value below. -# Admin has a privilege to change passwords of other users using an agent robot. -# Default value: @${wave_server_domain} -admin_user = @ADMIN_USER@ - -# The wave id of the welcome template wave. (Without domain, for example: w+Fxjs_-ZPmmA). -# If filled in then a copy of this wave (actually only the root blip) will be -# automatically added to the inbox of every new user. -# Default value: "" (empty) -welcome_wave_id = @WELCOME_WAVE_ID@ - -# The number of threads to listen on wavelet updates. Default value: 1 -listener_executor_thread_count = @LISTENER_EXECUTOR_THREAD_COUNT@ - -# The number of threads for loading wavelets. Default value: 1 -wavelet_load_executor_thread_count = @WAVELET_LOAD_EXECUTOR_THREAD_COUNT@ - -# The number of threads to persist deltas. Default value: 1 -delta_persist_executor_thread_count = @DELTA_PERSIST_EXECUTOR_THREAD_COUNT@ - -# The number of threads to perform post wavelet loading logic. Default value: 1 -storage_continuation_executor_thread_count = @STORAGE_CONTINUATION_EXECUTOR_THREAD_COUNT@ - -# The number of threads for looking up the wavelet ids -# while creating a list of all wavelets in the persistent storage. Default value: 1 -lookup_executor_thread_count = @LOOKUP_EXECUTOR_THREAD_COUNT@ - -# The number of threads for making search/update requests to Solr. Default value: 1 -solr_thread_count = @SOLR_THREAD_COUNT@ - -# To enable federation, edit the server.federation.config file and include it here. -# Or run ant -f server-config.xml server-federation-config -# If not using the server-config.xml ant script - it is possible just to comment the line. -include = server.federation.config - -# These two parameters MUST appear in this file AFTER the above include of the -# federation config file. This is necesary so that the federation config file -# can override these two values. - -# Set true to disable the verification of signed deltas -waveserver_disable_verification = true - -# Set true to disable the verification of signers (certificates) -waveserver_disable_signer_verification = true - -# Set true to prevent anyone registering on your server. -# When true, only the admin user can use the RegistrationRobot to add new accounts -# Default value: false -disable_registration = @DISABLE_REGISTRATION@ - -# Enable SSL for all address/port combinations listed (makes the next 2 settings non-optional). -# Default value: false -enable_ssl = @ENABLE_SSL@ - -# Path to keystore containg the ssl certificates to server -# Note: this is only used when enable_ssl set to true. -ssl_keystore_path = @SSL_KEYSTORE_PATH@ - -# Password to the keystore. -# Note: this is only used when enable_ssl set to true. -ssl_keystore_password = @SSL_KEYSTORE_PASSWORD@ - -# Enable client x509 cert. authentication? -enable_clientauth = @ENABLE_CLIENTAUTH@ - -# Domain of the email to look for as email field of x509 client auth certificates when using client authentication -clientauth_cert_domain = @CLIENTAUTH_CERT_DOMAIN@ - -# Disable login page to force x509-only authentication -disable_loginpage = @DISABLE_LOGINPAGE@ - -# Currently supported search types: memory, lucene, solr. -# Default value: lucene. -search_type = @SEARCH_TYPE@ - -# The location where search indexes are stored on disk. -# Note: This is only used when using the lucene search type. It is ignored -# for other search types. -# Default value: _indexes -index_directory = @INDEX_DIRECTORY@ - - # Google Analytics account. - # Default value: empty -analytics_account = @ANALYTICS_ACCOUNT@ - -# Directory that holds the thumbnails for attachments. -# Icon must be in PNG format, and named as MIME type with replacing '/' to '_'. -# For example thumbnail file for ZIP format (MIME type application/zip) must be named application_zip. -thumbnail_patterns_directory = @THUMBNAIL_PATTERNS_DIRECTORY@ - -# Enables server side profiling. To display the stats press ctrl+alt+ctrl in the web client. -# Default value: true -enable_profiling = @ENABLE_PROFILING@ - -# Currently supported profile fetcher types: gravatar, initials. -# Default value: gravatar. -profile_fetcher_type = @PROFILE_FETCHER_TYPE@ - -# The Solr endpoint url. -# Default value: http://localhost:8983/solr -solr_base_url = @SOLR_BASE_URL@ - -# Mongodb connection options -# Only used if some of the *_store_type properties are set to 'mongodb' - -# Server's host name or IP address. Default value: 127.0.0.1 -mongodb_host = @MONGODB_HOST@ - -# Server's port. Default value: 27017 -mongodb_port = @MONGODB_PORT@ - -# Database's name. Default name: wiab -mongodb_database = @MONGODB_DATABASE@ http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/server.federation.config ---------------------------------------------------------------------- diff --git a/server.federation.config b/server.federation.config deleted file mode 100644 index de69730..0000000 --- a/server.federation.config +++ /dev/null @@ -1,22 +0,0 @@ -# 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. - -# Empty place holder for the federation config. -# To configure federation settings replace this file with contents of server.federation.config.example -# and edit to adjust to your configuration. -# Or you can generate both federation and regular server configuration by running -# ant -f server-config.xml server-federation-config -D<overridden properties> http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/server.federation.config.example ---------------------------------------------------------------------- diff --git a/server.federation.config.example b/server.federation.config.example deleted file mode 100644 index f0c8d82..0000000 --- a/server.federation.config.example +++ /dev/null @@ -1,72 +0,0 @@ -# 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. - -# Federation Configuration for the Wave in a Box server -# -# Run "ant -f server-config.xml server-federation-config -Dserver_federation_config=server.federation.config" -# to generate the server.federation.config and server.config files automatically. -# To override default values pass them to the ant script. For example -# to override xmpp_server_secret pass to the ant: -Dxmpp_server_secret=yoursecret - -# These will probably need to be changed -xmpp_server_secret = @XMPP_SERVER_SECRET@ -# Default value: ${wave_server_domain}.key -certificate_private_key = @CERTIFICATE_PRIVATE_KEY@ - -# The order of certificates is important. Place intermediate certs -# after "${wave_server_domain}.crt". Please refer to -# http://www.waveprotocol.org/federation/certificates -# for more details. -# Default value: ${wave_server_domain}.crt,sub.class1.server.ca.pem,ca.pem -certificate_files = @CERTIFICATE_FILES@ - -# These should be okay to leave alone -enable_federation = true - -# Default value: ${wave_server_domain} -certificate_domain = @CERTIFICATE_DOMAIN@ - -# Default value: wave -xmpp_component_name = @XMPP_COMPONENT_NAME@ - -# Default value: ${xmpp_component_name}.${wave_server_domain} -xmpp_jid = @XMPP_JID@ - -# Default value: "Wave in a Box" -xmpp_server_description = @XMPP_SERVER_DESCRIPTION@ - -# Default value: ${wave_server_domain} -xmpp_server_hostname = @XMPP_SERVER_HOSTNAME@ - -# Default value: 5275 -xmpp_server_component_port = @XMPP_SERVER_COMPONENT_PORT@ - -# Default value: wavesandbox.com -xmpp_server_ping = @XMPP_SERVER_PING@ - -# Set XMPP_SERVER_IP to localhost if the XMPP and Wave in a Box servers are -# running on the same host -# Default value: ${xmpp_server_hostname} -xmpp_server_ip = @XMPP_SERVER_IP@ - -# Set true to disable the verification of signed deltas -# Default value: false -waveserver_disable_verification = @WAVESERVER_DISABLE_VERIFICATION@ - -# Set true to disable the verification of signers (certificates) -# Default value: false -waveserver_disable_signer_verification = @WAVESERVER_DISABLE_SIGNER_VERIFICATION@ http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/src/org/waveprotocol/box/server/CoreSettings.java ---------------------------------------------------------------------- diff --git a/src/org/waveprotocol/box/server/CoreSettings.java b/src/org/waveprotocol/box/server/CoreSettings.java deleted file mode 100644 index 5fbd345..0000000 --- a/src/org/waveprotocol/box/server/CoreSettings.java +++ /dev/null @@ -1,304 +0,0 @@ -/** - * 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. - */ - -package org.waveprotocol.box.server; - -import org.waveprotocol.wave.util.settings.Setting; - -import java.util.List; - -/** - * Core Wave in a Box settings - */ -public class CoreSettings { - public static final String WAVE_SERVER_DOMAIN = "wave_server_domain"; - public static final String HTTP_FRONTEND_PUBLIC_ADDRESS = "http_frontend_public_address"; - public static final String HTTP_WEBSOCKET_PUBLIC_ADDRESS = "http_websocket_public_address"; - public static final String HTTP_WEBSOCKET_PRESENTED_ADDRESS = "http_websocket_presented_address"; - public static final String HTTP_FRONTEND_ADDRESSES = "http_frontend_addresses"; - public static final String RESOURCE_BASES = "resource_bases"; - public static final String WAVESERVER_DISABLE_VERIFICATION = "waveserver_disable_verification"; - public static final String WAVESERVER_DISABLE_SIGNER_VERIFICATION = - "waveserver_disable_signer_verification"; - public static final String ENABLE_FEDERATION = "enable_federation"; - public static final String SIGNER_INFO_STORE_TYPE = "signer_info_store_type"; - public static final String SIGNER_INFO_STORE_DIRECTORY = "signer_info_store_directory"; - public static final String ATTACHMENT_STORE_TYPE = "attachment_store_type"; - public static final String ATTACHMENT_STORE_DIRECTORY = "attachment_store_directory"; - public static final String ACCOUNT_STORE_TYPE = "account_store_type"; - public static final String ACCOUNT_STORE_DIRECTORY = "account_store_directory"; - public static final String DELTA_STORE_TYPE = "delta_store_type"; - public static final String DELTA_STORE_DIRECTORY = "delta_store_directory"; - public static final String SESSIONS_STORE_DIRECTORY = "sessions_store_directory"; - public static final String SESSION_COOKIE_MAX_AGE = "session_cookie_max_age"; - public static final String WEBSOCKET_MAX_MESSAGE_SIZE = "websocket_max_message_size"; - public static final String WEBSOCKET_MAX_IDLE_TIME = "websocket_max_idle_time"; - public static final String GADGET_SERVER_HOSTNAME = "gadget_server_hostname"; - public static final String GADGET_SERVER_PORT = "gadget_server_port"; - public static final String GADGET_SERVER_PATH = "gadget_server_path"; - public static final String ADMIN_USER = "admin_user"; - public static final String WELCOME_WAVE_ID = "welcome_wave_id"; - public static final String LISTENER_EXECUTOR_THREAD_COUNT = "listener_executor_thread_count"; - public static final String WAVELET_LOAD_EXECUTOR_THREAD_COUNT = "wavelet_load_executor_thread_count"; - public static final String DELTA_PERSIST_EXECUTOR_THREAD_COUNT = "delta_persist_executor_thread_count"; - public static final String STORAGE_CONTINUATION_EXECUTOR_THREAD_COUNT = "storage_continuation_executor_thread_count"; - public static final String LOOKUP_EXECUTOR_THREAD_COUNT = "lookup_executor_thread_count"; - public static final String ROBOT_CONNECTION_THREAD_COUNT = "robot_connection_thread_count"; - public static final String ROBOT_GATEWAY_THREAD_COUNT = "robot_gateway_thread_count"; - public static final String SOLR_THREAD_COUNT = "solr_thread_count"; - public static final String DISABLE_REGISTRATION = "disable_registration"; - public static final String ENABLE_SSL = "enable_ssl"; - public static final String SSL_KEYSTORE_PATH = "ssl_keystore_path"; - public static final String SSL_KEYSTORE_PASSWORD = "ssl_keystore_password"; - public static final String ENABLE_CLIENTAUTH = "enable_clientauth"; - public static final String CLIENTAUTH_CERT_DOMAIN = "clientauth_cert_domain"; - public static final String DISABLE_LOGINPAGE = "disable_loginpage"; - public static final String SEARCH_TYPE = "search_type"; - public static final String INDEX_DIRECTORY = "index_directory"; - public static final String ANALYTICS_ACCOUNT = "analytics_account"; - public static final String THUMBNAIL_PATTERNS_DIRECTORY = "thumbnail_patterns_directory"; - public static final String PROFILE_FETCHER_TYPE = "profile_fetcher_type"; - public static final String ENABLE_PROFILING = "enable_profiling"; - public static final String MONGODB_HOST = "mongodb_host"; - public static final String MONGODB_PORT = "mongodb_port"; - public static final String MONGODB_DATABASE = "mongodb_database"; - public static final String SOLR_BASE_URL = "solr_base_url"; - - @Setting(name = WAVE_SERVER_DOMAIN) - private static String waveServerDomain; - - @Setting(name = HTTP_FRONTEND_PUBLIC_ADDRESS, defaultValue = "localhost:9898", - description = "The server's public address.") - private static String httpFrontEndPublicAddress; - - @Setting(name = HTTP_WEBSOCKET_PUBLIC_ADDRESS, defaultValue = "localhost:9898", - description = "The server's websocket public address.") - private static String httpWebsocketPublicAddress; - - @Setting(name = HTTP_WEBSOCKET_PRESENTED_ADDRESS, defaultValue = "localhost:9898", - description = "The presented server's websocket address.") - private static String httpWebsocketPresentedAddress; - - @Setting(name = HTTP_FRONTEND_ADDRESSES, defaultValue = "localhost:9898", - description = "A comman seperated list of address on which to listen for connections." - + " Each address is a host or ip and port seperated by a colon.") - private static List<String> httpFrontEndAddresses; - - @Setting(name = RESOURCE_BASES, defaultValue = "./war", - description = "The server's resource base directory list.") - private static List<String> resourceBases; - - @Setting(name = WAVESERVER_DISABLE_VERIFICATION) - private static boolean waveserverDisableVerification; - - @Setting(name = WAVESERVER_DISABLE_SIGNER_VERIFICATION) - private static boolean waveserverDisableSignerVerification; - - @Setting(name = ENABLE_FEDERATION, defaultValue = "false") - private static boolean enableFederation; - - @Setting(name = SIGNER_INFO_STORE_TYPE, - description = "Type of persistence to use for the SignerInfo Storage", - defaultValue = "memory") - private static String signerInfoStoreType; - - @Setting(name = SIGNER_INFO_STORE_DIRECTORY, - description = "Location on disk where the signer info store lives. Must be writeable by the " - + "wave-in-a-box process. Only used by file-based signer info store.", - defaultValue = "_certificates") - private static String signerInfoStoreDirectory; - - @Setting(name = ATTACHMENT_STORE_TYPE, - description = "Type of persistence store to use for attachments", defaultValue = "disk") - private static String attachmentStoreType; - - @Setting(name = ATTACHMENT_STORE_DIRECTORY, - description = "Location on disk where the attachment store lives. Must be writeable by the " - + "fedone process. Only used by disk-based attachment store.", - defaultValue = "_attachments") - private static String attachmentStoreDirectory; - - @Setting(name = ACCOUNT_STORE_TYPE, - description = "Type of persistence to use for the accounts", defaultValue = "memory") - private static String accountStoreType; - - @Setting(name = ACCOUNT_STORE_DIRECTORY, - description = "Location on disk where the account store lives. Must be writeable by the " - + "wave-in-a-box process. Only used by file-based account store.", - defaultValue = "_accounts") - private static String accountStoreDirectory; - - @Setting(name = DELTA_STORE_TYPE, - description = "Type of persistence to use for the deltas", defaultValue = "memory") - private static String deltaStoreType; - - @Setting(name = DELTA_STORE_DIRECTORY, - description = "Location on disk where the delta store lives. Must be writeable by the " - + "wave-in-a-box process. Only used by file-based account store.", - defaultValue = "_deltas") - private static String deltaStoreDirectory; - - @Setting(name = SESSIONS_STORE_DIRECTORY, - description = "Location on disk where the user sessions are persisted. Must be writeable by the " - + "wave-in-a-box process.", - defaultValue = "_sessions") - private static String sessionsStoreDirectory; - - @Setting(name = SESSION_COOKIE_MAX_AGE, - description = "Max age of session cookie in seconds. " - + "-1 means cookie lives in the browser current session only", defaultValue = "-1") - private static int sessionCookieMaxAge; - - @Setting(name = WEBSOCKET_MAX_IDLE_TIME, - description = "The time in ms that the websocket connection can be idle before closing", defaultValue = "0") - private static int websocketMaxIdleTime; - - @Setting(name = WEBSOCKET_MAX_MESSAGE_SIZE, - description = "Maximum websocket message size to be received in MB", defaultValue = "2") - private static int websocketMaxMessageSize; - - @Setting(name = GADGET_SERVER_HOSTNAME, description = "The hostname of the gadget server.", - defaultValue = "gmodules.com") - private static String gadgetServerHostname; - - @Setting(name = GADGET_SERVER_PORT, description = "The port of the gadget server.", - defaultValue = "80") - private static int gadgetServerPort; - - @Setting(name = GADGET_SERVER_PATH, description = "The URL path of the gadget server.", - defaultValue = "/gadgets") - private static String gadgetServerPath; - - @Setting(name = ADMIN_USER, description = "The admin user id for this server.", - defaultValue = "@example.com") - private static String adminUser; - - @Setting(name = WELCOME_WAVE_ID, description = "The welcome wave id.", - defaultValue = "") - private static String welcomeWaveId; - - @Setting(name = LISTENER_EXECUTOR_THREAD_COUNT, - description = "The number of threads to process wavelet updates.", - defaultValue = "1") - private static int listenerExecutorThreadCount; - - @Setting(name = WAVELET_LOAD_EXECUTOR_THREAD_COUNT, - description = "The number of threads for loading wavelets.", - defaultValue = "1") - private static int waveletLoadExecutorThreadCount; - - @Setting(name = DELTA_PERSIST_EXECUTOR_THREAD_COUNT, - description = "The number of threads to persist deltas.", - defaultValue = "1") - private static int deltaPersistExecutorThreadCount; - - @Setting(name = STORAGE_CONTINUATION_EXECUTOR_THREAD_COUNT, - description = "The number of threads to perform post wavelet loading logic.", - defaultValue = "1") - private static int storageContinuationExecutorThreadCount; - - @Setting(name = LOOKUP_EXECUTOR_THREAD_COUNT, - description = "The number of threads to perform post wavelet loading logic.", - defaultValue = "1") - private static int lookupExecutorThreadCount; - - @Setting(name = ROBOT_CONNECTION_THREAD_COUNT, - description = "The number of threads to perform robot client requests.", - defaultValue = "10") - private static int robotConnectionThreadCount; - - @Setting(name = ROBOT_GATEWAY_THREAD_COUNT, - description = "The number of threads to handle any updates for robots.", - defaultValue = "10") - private static int robotGatewayThreadCount; - - @Setting(name = SOLR_THREAD_COUNT, - description = "The number of threads to make search/update requests to Solr.", - defaultValue = "1") - private static int solrThreadCount; - - @Setting(name = DISABLE_REGISTRATION, - description = "Prevents the register page from being available to anyone", defaultValue = "false") - private static boolean disableRegistration; - - @Setting(name = ENABLE_SSL, - description = "Enables SSL protocol on all address/port combinations", defaultValue = "false") - private static boolean enableSsl; - - @Setting(name = SSL_KEYSTORE_PATH, - description = "Path to the keystore containing SSL certificase to server", defaultValue = "./wiab.ks") - private static String sslKeystorePath; - - @Setting(name = SSL_KEYSTORE_PASSWORD, - description = "Password to the SSL keystore", defaultValue = "") - private static String sslKeystorePassword; - - @Setting(name = ENABLE_CLIENTAUTH, - description = "Enable x509 certificated based authentication", defaultValue = "false") - private static boolean enableClientAuth; - - @Setting(name = CLIENTAUTH_CERT_DOMAIN, - description = "Domain of email address in x509 cert", defaultValue = "") - private static String clientAuthCertDomain; - - @Setting(name = DISABLE_LOGINPAGE, - description = "Disable login page to force x509 only", defaultValue = "false") - private static boolean disableLoginPage; - - @Setting(name = INDEX_DIRECTORY, - description = "Location on disk where the index is persisted", defaultValue = "_indexes") - private static String indexDirectory; - - @Setting(name = SEARCH_TYPE, - description = "The wave search type", defaultValue = "lucene") - private static String searchType; - - @Setting(name = ANALYTICS_ACCOUNT, description = "Google analytics id") - private static String analyticsAccount; - - @Setting(name = THUMBNAIL_PATTERNS_DIRECTORY, - description = "Thumbnail patterns directory", - defaultValue = "") - private static String thumbnailPatternsDirectory; - - @Setting(name = PROFILE_FETCHER_TYPE, - description = "The wave profile fetcher used", defaultValue = "gravatar") - private static String profileFetcherType; - - @Setting(name = ENABLE_PROFILING, - description = "Enable profiling statistic", - defaultValue = "false") - private static boolean enableProfiling; - - @Setting(name = MONGODB_HOST, description = "The host address for the MongoDB server", - defaultValue = "127.0.0.1") - private static String mongoDBhost; - - @Setting(name = MONGODB_PORT, description = "The port number of the MongoDB server", - defaultValue = "27017") - private static String mongoDBport; - - @Setting(name = MONGODB_DATABASE, description = "The database name used in the MongoDB server", - defaultValue = "wiab") - private static String mongoDBdatabase; - - @Setting(name = SOLR_BASE_URL, description = "The Solr base url", - defaultValue = "http://localhost:8983/solr") - private static String solrBaseUrl; -} http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/src/org/waveprotocol/box/server/CoreSettingsNames.java ---------------------------------------------------------------------- diff --git a/src/org/waveprotocol/box/server/CoreSettingsNames.java b/src/org/waveprotocol/box/server/CoreSettingsNames.java new file mode 100644 index 0000000..9179951 --- /dev/null +++ b/src/org/waveprotocol/box/server/CoreSettingsNames.java @@ -0,0 +1,27 @@ +/** + * 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. + */ + + /** + * @author [email protected](Yuri Zelikov) + */ +package org.waveprotocol.box.server; + +public interface CoreSettingsNames { + String WAVE_SERVER_DOMAIN = "wave_server_domain"; +} http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/80369760/src/org/waveprotocol/box/server/DataMigrationTool.java ---------------------------------------------------------------------- diff --git a/src/org/waveprotocol/box/server/DataMigrationTool.java b/src/org/waveprotocol/box/server/DataMigrationTool.java index 32e0d50..0ec107b 100644 --- a/src/org/waveprotocol/box/server/DataMigrationTool.java +++ b/src/org/waveprotocol/box/server/DataMigrationTool.java @@ -22,17 +22,14 @@ package org.waveprotocol.box.server; import com.google.inject.AbstractModule; import com.google.inject.Guice; import com.google.inject.Injector; -import com.google.inject.Key; import com.google.inject.Module; -import com.google.inject.name.Names; - +import com.typesafe.config.Config; +import com.typesafe.config.ConfigFactory; import org.waveprotocol.box.server.persistence.PersistenceModule; import org.waveprotocol.box.server.persistence.migration.DeltaMigrator; import org.waveprotocol.box.server.waveserver.DeltaStore; -import org.waveprotocol.wave.util.logging.Log; -import org.waveprotocol.wave.util.settings.Setting; -import java.lang.reflect.Field; +import java.io.File; import java.util.HashMap; import java.util.Map; @@ -47,21 +44,17 @@ import java.util.Map; */ public class DataMigrationTool { - private static final Log LOG = Log.get(DataMigrationTool.class); - - - private static void runDeltasMigration(Injector sourceInjector, Injector targetInjector) { // We can migrate data from-to any store type, // but it is not allowed migrate from-to the same type String sourceDeltaStoreType = sourceInjector - .getInstance(Key.get(String.class, Names.named(CoreSettings.DELTA_STORE_TYPE))); + .getInstance(Config.class).getString("core.delta_store_type"); String targetDeltaStoreType = targetInjector - .getInstance(Key.get(String.class, Names.named(CoreSettings.DELTA_STORE_TYPE))); + .getInstance(Config.class).getString("core.delta_store_type"); if (sourceDeltaStoreType.equalsIgnoreCase(targetDeltaStoreType)) usageError("Source and Target Delta store types must be different"); @@ -75,98 +68,27 @@ public class DataMigrationTool { } - private static Map<Setting, Field> getCoreSettings() { - - // Get all method fields - Field[] coreSettingFields = CoreSettings.class.getDeclaredFields(); - - // Filter only annotated fields - Map<Setting, Field> settings = new HashMap<Setting, Field>(); - - for (Field f : coreSettingFields) { - if (f.isAnnotationPresent(Setting.class)) { - Setting setting = f.getAnnotation(Setting.class); - settings.put(setting, f); - } - } - - return settings; - - } - private static Module bindCmdLineSettings(String cmdLineProperties) { // Get settings from cmd line, e.g. // Key = delta_store_type // Value = mongodb - final Map<String, String> propertyMap = new HashMap<String, String>(); + final Map<String, String> propertyMap = new HashMap<>(); for (String arg : cmdLineProperties.split(",")) { String[] argTokens = arg.split("="); propertyMap.put(argTokens[0], argTokens[1]); } - // Validate settings against CoreSettings - final Map<Setting, Field> coreSettings = getCoreSettings(); - - // Set a suitable map to match cmd line settings - final Map<String, Setting> propertyToSettingMap = new HashMap<String, Setting>(); - for (Setting s : coreSettings.keySet()) { - propertyToSettingMap.put(s.name(), s); - } - - for (String propertyKey : propertyMap.keySet()) { - if (!propertyToSettingMap.containsKey(propertyKey)) - usageError("Wrong setting '" + propertyKey + "'"); - } - - - return new AbstractModule() { @Override protected void configure() { - - // We must iterate the settings when binding. - // Note: do not collapse these loops as that will damage - // early error detection. The runtime is still O(n) in setting count. - for (Map.Entry<Setting, Field> entry : coreSettings.entrySet()) { - - Setting setting = entry.getKey(); - Class<?> type = entry.getValue().getType(); - String value = - propertyMap.containsKey(setting.name()) ? propertyMap.get(setting.name()) : setting - .defaultValue(); - if (int.class.equals(type)) { - // Integer defaultValue = null; - // if (!setting.defaultValue().isEmpty()) { - // defaultValue = Integer.parseInt(setting.defaultValue()); - // } - bindConstant().annotatedWith(Names.named(setting.name())).to(Integer.parseInt(value)); - } else if (boolean.class.equals(type)) { - // Boolean defaultValue = null; - // if (!setting.defaultValue().isEmpty()) { - // defaultValue = Boolean.parseBoolean(setting.defaultValue()); - // } - bindConstant().annotatedWith(Names.named(setting.name())).to( - Boolean.parseBoolean(value)); - } else if (String.class.equals(type)) { - bindConstant().annotatedWith(Names.named(setting.name())).to(value); - } else { - /** Not supported **/ - /* - * String[] value = config.getStringArray(setting.name()); if - * (value.length == 0 && !setting.defaultValue().isEmpty()) { value - * = setting.defaultValue().split(","); } bind(new - * TypeLiteral<List<String>>() - * {}).annotatedWith(Names.named(setting.name())) - * .toInstance(ImmutableList.copyOf(value)); - */ - } - } + Config config = ConfigFactory.load().withFallback( + ConfigFactory.parseFile(new File("application.conf")).withFallback( + ConfigFactory.parseFile(new File("reference.conf")))); + bind(Config.class).toInstance(ConfigFactory.parseMap(propertyMap).withFallback(config)); } - - }; } @@ -180,9 +102,11 @@ public class DataMigrationTool { System.out.println("Use: DataMigrationTool <data type> <source options> <target options>\n"); System.out.println("supported data types : deltas"); System.out - .println("source options example : delta_store_type=file,delta_store_directory=./_deltas"); + .println("source options example : core.delta_store_type=file," + + "core.delta_store_directory=_deltas"); System.out - .println("target options example : delta_store_type=mongodb,mongodb_host=127.0.0.1,mongodb_port=27017,mongodb_database=wiab"); + .println("target options example : core.delta_store_type=mongodb," + + "core.mongodb_host=127.0.0.1,core.mongodb_port=27017,core.mongodb_database=wiab"); System.exit(1); } @@ -205,10 +129,8 @@ public class DataMigrationTool { if (dataType.equals("deltas")) { - runDeltasMigration(sourceInjector, targetInjector); - } else { usageError("Wrong data type"); }
