add: rewriter logic and tests #1

Merged
charles merged 1 commits from work into main 2025-03-31 18:56:45 +00:00
Owner
No description provided.
charles added 1 commit 2025-03-30 05:47:35 +00:00
charles force-pushed work from 5570497d62 to 5f44cb2f4e 2025-03-30 05:57:42 +00:00 Compare
Author
Owner

The goal is to take a file like this:

stream {
        upstream ssh {
                server 34.125.171.73:30005;
        }
        server {
                listen 2222;
                proxy_pass ssh;
        }
}

and run the rewriter logic (with rewrite_string=34.125.171.73, a set of replacements (say, 192.168.0.1,192.168.0.2), and get:

stream {
        upstream ssh {
                server 192.168.0.1:30005;
                server 192.168.0.2:30005;
        }
        server {
                listen 2222;
                proxy_pass ssh;
        }
}
The goal is to take a file like this: ``` stream { upstream ssh { server 34.125.171.73:30005; } server { listen 2222; proxy_pass ssh; } } ``` and run the rewriter logic (with `rewrite_string=34.125.171.73`, a set of replacements (say, `192.168.0.1,192.168.0.2`), and get: ``` stream { upstream ssh { server 192.168.0.1:30005; server 192.168.0.2:30005; } server { listen 2222; proxy_pass ssh; } } ```
charles force-pushed work from 5f44cb2f4e to 99dc71ca40 2025-03-30 06:04:00 +00:00 Compare
charles force-pushed work from 99dc71ca40 to 092658b039 2025-03-30 07:11:11 +00:00 Compare
charles merged commit 30c50fcd55 into main 2025-03-31 18:56:45 +00:00
charles deleted branch work 2025-03-31 18:56:46 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: charles/skubelb#1
No description provided.