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

Allow custom port specification for replay #761

Merged
merged 4 commits into from
Apr 6, 2022
Merged

Allow custom port specification for replay #761

merged 4 commits into from
Apr 6, 2022

Conversation

machawk1
Copy link
Member

@machawk1 machawk1 commented Apr 5, 2022

...with the value retained in the config file per #760

Closes #760

This approach allows the replay to run on the specified port but
the Link header for mementos does not use this value. It instead
uses the value in the ipwb config. However, we might not want to
overwrite the port in the config for this one-off specification.
Let's see which way @ibnesayeed prefers in #760 before we move
forward in remedying the issue.
@machawk1 machawk1 requested a review from ibnesayeed April 5, 2022 19:39
ipwb/util.py Outdated
@@ -269,6 +269,12 @@ def get_ipwb_replay_config(ipfs_json=None):
return None


def set_ipwb_replay_config_portonly(port):
ipfs_json = read_ipfs_config()
ipfs_json['Ipwb']['Replay']['Port'] = port
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that ipfs_json['Ipwb']['Replay'] will be populated already even on the first run when there is no config file in place? If not, then this might throw an exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! It does throw an exception in this instance. I will update the PR.

ipwb/__main__.py Show resolved Hide resolved
@machawk1 machawk1 requested a review from ibnesayeed April 5, 2022 20:15
@machawk1
Copy link
Member Author

machawk1 commented Apr 5, 2022

@ibnesayeed I redid some of the logic for retaining the port value and made sure to check if ipwb values have been set prior to trying to write to them. Please review.

Copy link
Member

@ibnesayeed ibnesayeed left a comment

Choose a reason for hiding this comment

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

LGTM!

@ibnesayeed
Copy link
Member

@machawk1 perhaps it will also be a good idea to allow specifying custom host along the same lines, but that can happen in a separate PR.

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.

Replay port specified is not used in Proxy mode
2 participants