-
Notifications
You must be signed in to change notification settings - Fork 848
YAML: Convert ip_allow.config #4168
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
Conversation
| return w.print("Line {}", mark.line); | ||
| } | ||
|
|
||
| BufferWriter & |
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.
This should probably be moved to bw_std_format.h in a separate PR as it's not specific to this PR.
|
|
||
| } // namespace ts | ||
|
|
||
| namespace YAML |
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.
Need to comment the code, but this is needed in order to pass a TextView to the array operator on a node.
proxy/IPAllow.cc
Outdated
|
|
||
| file_buff = readIntoBuffer(config_file_path, "ip-allow", &file_size); | ||
| std::error_code ec; | ||
| ts::file::path fpath{config_file_path}; |
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.
Change config_file_path from ats_scoped_str to ts::file::path and skip this step?
| @@ -0,0 +1,129 @@ | |||
| /** @file | |||
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.
Why do we need this? If we truly need std::filesystem features, why not use std::filesystem? Don't we have all these types of functionality in libts already ?
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.
std::filesystem is still experimental and I've already found one major difference between the experimental version and the standard version.
I don't think we have any of these in libtsutil currently.
|
Added documentation, updated the default configuration. |
|
I am unable to find anyway to link with |
|
This was a great exercise, because it found a fundamental problem with FreeBSD 11.1. Ask and I believe that upgrading to 11.2 can fix this, and I’m working on that. For ATS v8.0and later, we will have to require fbsd 11.2 or later. |
|
This has been waiting on other PRs that spun out of it, I think it's down to just #4206, after which I'll rebase and do a full submission. |
4f45931 to
02a736a
Compare
|
Rebased and ready for review. |
02a736a to
16003ae
Compare
|
Hmmm, this failed clang-format, but when I tried to update it, |
ec6a5fd to
519bd38
Compare
394bdb5 to
f259b67
Compare
4d63661 to
0debf67
Compare
|
[approve ci] |
85fb362 to
afabf1a
Compare
|
@SolidWallOfCode Can this be rebased? |
afabf1a to
105ef16
Compare
105ef16 to
b8cd666
Compare
|
|
||
| namespace YAML | ||
| { | ||
| template <> struct convert<ts::TextView> { |
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.
Does this need to be TextView ? Can it not be std::string_view?
randall
left a comment
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.
👍
We'll need to move the contents under a top-level key (aka ip_allow:) in another PR.
|
I thought it was already under a top level key, "ip_addr_acl". You mean a different key. |
This is a first pass at converting
ip_allow.configto YAML. The early commits will need to be pulled out in to separate PRs once this is in final form.This allows configuration in the old format or YAML. It guesses the contents based on the first line. If it's "#" or "# ats" then it uses the old format, otherwise it uses YAML.
This still needs documentation updates.
This ended up require the break out of other PRs. The current outstanding one is #4206.
Merged: #4175, #4176, #4149