-
Notifications
You must be signed in to change notification settings - Fork 39
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
Conversation
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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@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. |
...with the value retained in the config file per #760
Closes #760