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

kiwix-serve displays both protocol attached ips #704

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

sgourdas
Copy link
Collaborator

@sgourdas sgourdas commented Sep 12, 2024

This changes the logic to use the refactored getBestPublicIps so kiwix-serve can display all attached ips based on the protocol that was requested by the user.

Fixes #703

Relies on kiwix/libkiwix#1132

Copy link
Contributor

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

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

LGTM from a user perspective. Ready for code review.

@veloman-yunkan
Copy link
Collaborator

Ready for code review.

Not yet. Comments from my previous review have not been addressed.

src/server/kiwix-serve.cpp Outdated Show resolved Hide resolved
src/server/kiwix-serve.cpp Outdated Show resolved Hide resolved
@veloman-yunkan
Copy link
Collaborator

Ready for code review.

Not yet. Comments from my previous review have not been addressed.

Oops! It turns out that I failed to publish my review - it was in pending state since last Wednesday :(

src/server/kiwix-serve.cpp Outdated Show resolved Hide resolved
src/server/kiwix-serve.cpp Outdated Show resolved Hide resolved
@kelson42
Copy link
Contributor

@sgourdas Where is the new flex option listed in the usage()?

 -i=<address> --address=<address>        Listen only on the specified IP address. Specify 'ipv4', 'ipv6' or 'all' to listen on all IPv4, IPv6 or both types of addresses, respectively [default: all]

@sgourdas
Copy link
Collaborator Author

@kelson42 the new FLEX enum is an internal use only mode helping to signify, currently, a state where the server should choose the protocol. It is also a good future proof way to help pass information back and forth with the server.

Copy link
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

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

This is mostly ready to merge, but since it depends on a PR in libkiwix, I am playing picky and deferring the approval until the libkiwix PR is merged.

src/server/kiwix-serve.cpp Outdated Show resolved Hide resolved
@kelson42
Copy link
Contributor

kelson42 commented Oct 2, 2024

@sgourdas Does not compile anymore:

he Meson build system
Version: 1.3.2
Source dir: /home/kelson/code/kiwix-tools
Build dir: /home/kelson/code/kiwix-tools/build
Build type: native build
Project name: kiwix-tools
Project version: 3.8.0
C++ compiler for the host machine: c++ (gcc 13.2.0 "c++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0")
C++ linker for the host machine: c++ ld.bfd 2.42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Run-time dependency threads found: YES
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency libzim found: YES 9.2.3
Run-time dependency libkiwix found: YES 14.0.0
Run-time dependency docopt found: YES 0.6.3
Build targets in project: 3

Found ninja-1.11.1 at /usr/bin/ninja
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
ninja: Entering directory `build'
[2/6] Compiling C++ object src/server/kiwix-serve.p/kiwix-serve.cpp.o
FAILED: src/server/kiwix-serve.p/kiwix-serve.cpp.o 
c++ -Isrc/server/kiwix-serve.p -Isrc/server -I../src/server -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -I/usr/include/docopt -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O0 -g '-DKIWIX_TOOLS_VERSION="3.8.0"' -pthread -MD -MQ src/server/kiwix-serve.p/kiwix-serve.cpp.o -MF src/server/kiwix-serve.p/kiwix-serve.cpp.o.d -o src/server/kiwix-serve.p/kiwix-serve.cpp.o -c ../src/server/kiwix-serve.cpp
../src/server/kiwix-serve.cpp: In function ‘int main(int, char**)’:
../src/server/kiwix-serve.cpp:329:5: error: ‘ipMode’ was not declared in this scope
  329 |     ipMode = kiwix::IpMode::ALL;
      |     ^~~~~~
../src/server/kiwix-serve.cpp:332:5: error: ‘ipMode’ was not declared in this scope
  332 |     ipMode = kiwix::IpMode::IPV4;
      |     ^~~~~~
../src/server/kiwix-serve.cpp:335:5: error: ‘ipMode’ was not declared in this scope
  335 |     ipMode = kiwix::IpMode::IPV6;
      |     ^~~~~~
../src/server/kiwix-serve.cpp:379:20: error: ‘ipMode’ was not declared in this scope
  379 |   server.setIpMode(ipMode);
      |                    ^~~~~~
[4/6] Compiling C++ object src/manager/kiwix-manage.p/kiwix-manage.cpp.o
ninja: build stopped: subcommand failed.
kelson@camber:~/code/kiwix-tools$ g++ --version
g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@sgourdas
Copy link
Collaborator Author

sgourdas commented Oct 2, 2024

@kelson42 missed a line. Try again please.

@kelson42
Copy link
Contributor

kelson42 commented Oct 2, 2024

LGTM

@kelson42 kelson42 merged commit e65354a into main Oct 2, 2024
2 of 8 checks passed
@kelson42 kelson42 deleted the feature/serve-all-ips branch October 2, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REGRESSION] kiwix-serve URL helper does not display iPv4 URL anymore
3 participants