mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-27 14:05:50 +00:00
Compare commits
8 Commits
fix-ips-fi
...
nd-use-git
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa4ad19f9b | ||
|
|
ee71cd74cf | ||
|
|
e2b7b18c1d | ||
|
|
525f96aa43 | ||
|
|
430155587e | ||
|
|
49c1e337e8 | ||
|
|
c5972875c4 | ||
|
|
f8bdb57f2e |
2
.github/workflows/xahau-ga-macos.yml
vendored
2
.github/workflows/xahau-ga-macos.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- Ninja
|
- Ninja
|
||||||
configuration:
|
configuration:
|
||||||
- Debug
|
- Debug
|
||||||
runs-on: macos-15
|
runs-on: macos-15-xlarge
|
||||||
env:
|
env:
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
# Bump this number to invalidate all caches globally.
|
# Bump this number to invalidate all caches globally.
|
||||||
|
|||||||
10
.github/workflows/xahau-ga-nix.yml
vendored
10
.github/workflows/xahau-ga-nix.yml
vendored
@@ -19,14 +19,6 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- name: escape double quotes
|
|
||||||
id: escape
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
||||||
run: |
|
|
||||||
ESCAPED_PR_TITLE="${PR_TITLE//\"/\\\"}"
|
|
||||||
echo "title=${ESCAPED_PR_TITLE}" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Generate build matrix
|
- name: Generate build matrix
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
shell: python
|
shell: python
|
||||||
@@ -110,7 +102,7 @@ jobs:
|
|||||||
ref = "${{ github.ref }}"
|
ref = "${{ github.ref }}"
|
||||||
base_ref = "${{ github.base_ref }}" # For PRs, this is the target branch
|
base_ref = "${{ github.base_ref }}" # For PRs, this is the target branch
|
||||||
event_name = "${{ github.event_name }}"
|
event_name = "${{ github.event_name }}"
|
||||||
pr_title = """${{ steps.escape.outputs.title }}"""
|
pr_title = """${{ github.event.pull_request.title }}"""
|
||||||
pr_head_sha = "${{ github.event.pull_request.head.sha }}"
|
pr_head_sha = "${{ github.event.pull_request.head.sha }}"
|
||||||
|
|
||||||
# Get commit message - for PRs, fetch via API since head_commit.message is empty
|
# Get commit message - for PRs, fetch via API since head_commit.message is empty
|
||||||
|
|||||||
@@ -484,61 +484,44 @@ OverlayImpl::start()
|
|||||||
m_peerFinder->setConfig(config);
|
m_peerFinder->setConfig(config);
|
||||||
m_peerFinder->start();
|
m_peerFinder->start();
|
||||||
|
|
||||||
auto addIps = [this](std::vector<std::string> ips, bool fixed) {
|
auto addIps = [&](std::vector<std::string> bootstrapIps) -> void {
|
||||||
beast::Journal const& j = app_.journal("Overlay");
|
beast::Journal const& j = app_.journal("Overlay");
|
||||||
for (auto& ip : ips)
|
for (auto& ip : bootstrapIps)
|
||||||
{
|
{
|
||||||
std::size_t pos = ip.find('#');
|
std::size_t pos = ip.find('#');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
ip.erase(pos);
|
ip.erase(pos);
|
||||||
|
|
||||||
JLOG(j.trace())
|
JLOG(j.trace()) << "Found boostrap IP: " << ip;
|
||||||
<< "Found " << (fixed ? "fixed" : "bootstrap") << " IP: " << ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_resolver.resolve(
|
m_resolver.resolve(
|
||||||
ips,
|
bootstrapIps,
|
||||||
[this, fixed](
|
[&](std::string const& name,
|
||||||
std::string const& name,
|
|
||||||
std::vector<beast::IP::Endpoint> const& addresses) {
|
std::vector<beast::IP::Endpoint> const& addresses) {
|
||||||
|
std::vector<std::string> ips;
|
||||||
|
ips.reserve(addresses.size());
|
||||||
beast::Journal const& j = app_.journal("Overlay");
|
beast::Journal const& j = app_.journal("Overlay");
|
||||||
std::string const base("config: ");
|
|
||||||
|
|
||||||
std::vector<beast::IP::Endpoint> eps;
|
|
||||||
eps.reserve(addresses.size());
|
|
||||||
for (auto const& addr : addresses)
|
for (auto const& addr : addresses)
|
||||||
{
|
{
|
||||||
auto ep = addr.port() == 0 ? addr.at_port(DEFAULT_PEER_PORT)
|
std::string addrStr = addr.port() == 0
|
||||||
: addr;
|
? to_string(addr.at_port(DEFAULT_PEER_PORT))
|
||||||
JLOG(j.trace())
|
: to_string(addr);
|
||||||
<< "Parsed " << (fixed ? "fixed" : "bootstrap")
|
JLOG(j.trace()) << "Parsed boostrap IP: " << addrStr;
|
||||||
<< " IP: " << ep;
|
ips.push_back(addrStr);
|
||||||
eps.push_back(ep);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eps.empty())
|
std::string const base("config: ");
|
||||||
return;
|
if (!ips.empty())
|
||||||
|
m_peerFinder->addFallbackStrings(base + name, ips);
|
||||||
if (fixed)
|
|
||||||
{
|
|
||||||
m_peerFinder->addFixedPeer(base + name, eps);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::vector<std::string> strs;
|
|
||||||
strs.reserve(eps.size());
|
|
||||||
for (auto const& ep : eps)
|
|
||||||
strs.push_back(to_string(ep));
|
|
||||||
m_peerFinder->addFallbackStrings(base + name, strs);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!app_.config().IPS.empty())
|
if (!app_.config().IPS.empty())
|
||||||
addIps(app_.config().IPS, false);
|
addIps(app_.config().IPS);
|
||||||
|
|
||||||
if (!app_.config().IPS_FIXED.empty())
|
if (!app_.config().IPS_FIXED.empty())
|
||||||
addIps(app_.config().IPS_FIXED, true);
|
addIps(app_.config().IPS_FIXED);
|
||||||
|
|
||||||
auto const timer = std::make_shared<Timer>(*this);
|
auto const timer = std::make_shared<Timer>(*this);
|
||||||
std::lock_guard lock(mutex_);
|
std::lock_guard lock(mutex_);
|
||||||
|
|||||||
Reference in New Issue
Block a user