Skip to content

Commit 60b0475

Browse files
committed
feat: bypass Netdata Cloud sign-in which is required to access dashboard features
1 parent aa40d38 commit 60b0475

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Cre: https://github.com/orgs/community/discussions/153608#discussioncomment-12453674
2+
name: Sync Fork with Upstream
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Runs daily at midnight UTC
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Configure Git
13+
run: |
14+
git config --global user.email "994931+Zarloc@users.noreply.github.com"
15+
git config --global user.name "Zarloc"
16+
17+
- name: Checkout Forked Repository
18+
uses: actions/checkout@v6
19+
with:
20+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
21+
fetch-depth: 0
22+
23+
- name: Sync Upstream & Apply Patch
24+
run: |
25+
# 1. Store the workflow file content in an environment variable for later use
26+
# We need to do this before we reset the branch, otherwise the file will be lost and we won't be able to add it back in the commit
27+
export SYNC_UPSTREAM=$(cat .github/workflows/sync-upstream.yml)
28+
29+
# 2. Fetch Upstream
30+
git remote add upstream https://github.com/netdata/netdata.git
31+
git fetch upstream master
32+
33+
# 3. Hard Reset: Wipe local history to match Upstream exactly
34+
# This removes yesterday's patch commit so we don't get conflicts
35+
git checkout master
36+
git reset --hard upstream/master
37+
38+
# 4. Apply the Hack (sed)
39+
echo "Applying auth bypass patch..."
40+
sed -i 's/return ((user & endpoint) == endpoint);/return true;/' src/web/api/http_auth.h
41+
42+
# 5. Recreate the workflow file (because we reset the branch, we lost the file, so we need to add it back before committing)
43+
echo "Recreating workflow file..."
44+
echo "$SYNC_UPSTREAM" > .github/workflows/sync-upstream.yml
45+
46+
# 6. Commit the changes
47+
git add src/web/api/http_auth.h
48+
git add .github/workflows/sync-upstream.yml
49+
git commit -m "feat: bypass Netdata Cloud sign-in which is required to access dashboard features"
50+
51+
# 7. Force Push
52+
# We force push because we rewrote history (replaced yesterday's commit with today's)
53+
git push origin master --force

src/web/api/http_auth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ time_t bearer_create_token(nd_uuid_t *uuid, HTTP_USER_ROLE user_role, HTTP_ACCES
1515
bool web_client_bearer_token_auth(struct web_client *w, const char *v);
1616

1717
static inline bool http_access_user_has_enough_access_level_for_endpoint(HTTP_ACCESS user, HTTP_ACCESS endpoint) {
18-
return ((user & endpoint) == endpoint);
18+
return true;
1919
}
2020

2121
#endif //NETDATA_HTTP_AUTH_H

0 commit comments

Comments
 (0)