Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tools][server] Environment variables for sc-server host and port #453

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NikitaZotov
Copy link
Member

@NikitaZotov NikitaZotov commented Jan 13, 2025

Now there is no problem to specify host and port for sc-server in docker-compose.yml in projects.


Important

Add environment variables SC_SERVER_HOST and SC_SERVER_PORT for sc-server configuration, with updates to documentation and source code.

  • Environment Variables:
    • Introduce SC_SERVER_HOST and SC_SERVER_PORT for sc-server configuration in docker-compose.yml and sc_server_module.cpp.
    • Default values are 127.0.0.1 for host and 8090 for port if not set.
  • Documentation:
    • Update changelog.md and sc_machine.md to include new environment variables.
  • Code Changes:
    • Modify sc_server_module.cpp to read host and port from environment variables.
    • Update log message in sc_server.cpp to reflect "Host" instead of "Host name".

This description was created by Ellipsis for 768edc8. It will automatically update as commits are pushed.

@NikitaZotov NikitaZotov self-assigned this Jan 13, 2025
@NikitaZotov NikitaZotov added 0.10.0 sc-server Changes in sc-server module labels Jan 13, 2025
@NikitaZotov NikitaZotov added this to the 0.10.0 milestone Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.69%. Comparing base (1424e78) to head (203702e).
Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
- Coverage   95.70%   95.69%   -0.02%     
==========================================
  Files         237      237              
  Lines       26965    26971       +6     
  Branches     1863     1865       +2     
==========================================
+ Hits        25808    25809       +1     
- Misses       1157     1162       +5     

@NikitaZotov
Copy link
Member Author

@ellipsis review this

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 768edc8 in 2 minutes and 5 seconds

More details
  • Looked at 115 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. sc-tools/sc-server/src/sc_server_module.cpp:27
  • Draft comment:
    Use nullptr instead of null_ptr for checking null pointers.
  if (port != nullptr)
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_aFcRgB3hjL7iyJRw


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

sc-tools/sc-server/src/sc_server_module.cpp Outdated Show resolved Hide resolved

This comment was marked as duplicate.

ellipsis-dev bot added a commit that referenced this pull request Jan 14, 2025
…nment variables for sc-server host and port );
Copy link

ellipsis-dev bot commented Jan 14, 2025

@NikitaZotov, I have addressed your comments in pull request #455


You can configure Ellipsis to address comments with a direct commit or a side PR, see docs.


⚠️ Tried to reply to a comment by @NikitaZotov, but it looks like that comment was deleted, so replying here instead. Here's what the original comment said:

@NikitaZotov: @ellipsis fix this

ellipsis-dev bot added a commit that referenced this pull request Jan 14, 2025
…nment variables for sc-server host and port );
ellipsis-dev bot added a commit that referenced this pull request Jan 14, 2025
…nment variables for sc-server host and port );
Copy link
Member

@kilativ-dotcom kilativ-dotcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works ok, but need to resolve comments
image

@@ -21,7 +21,7 @@ ScServer::ScServer(std::string hostName, size_t port)

{
LogMessage(ScServerErrorLevel::info, "Socket data:");
LogMessage(ScServerErrorLevel::info, "\tHost name: " + m_hostName);
LogMessage(ScServerErrorLevel::info, "\tHost: " + m_hostName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if message is changed to "Host", shouldn't m_hostName be changed to m_host as well?

// removed.
// TODO(NikitaZotov): Configure all platform-dependent components from kb.

sc_char const * host = std::getenv("SC_SERVER_HOST");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be tested in some way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.10.0 sc-server Changes in sc-server module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants