Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions infrabox/deploy/build-dashboard-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM node:8.9-alpine
FROM node:20-alpine

CMD /infrabox/context/src/dashboard-client/build.sh
CMD /infrabox/context/src/dashboard-client/build.sh
14 changes: 7 additions & 7 deletions infrabox/test/api/global_tokens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test_list_tokens_initially_empty(self):
def test_list_tokens_only_returns_own_tokens(self):
# Insert a token owned by another user
TestClient.execute("""
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id)
VALUES (%s, 'other token', false, true, %s)
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id, expires_at)
VALUES (%s, 'other token', false, true, %s, NOW() + INTERVAL '30 days')
""", [str(uuid.uuid4()), self.other_user_id])

r = TestClient.get(self.URL, TestClient.get_user_authorization(self.user_id))
Expand Down Expand Up @@ -119,8 +119,8 @@ def test_delete_own_token_removes_from_db(self):
def test_cannot_delete_other_users_token(self):
other_token_id = str(uuid.uuid4())
TestClient.execute("""
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id)
VALUES (%s, 'not yours', false, true, %s)
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id, expires_at)
VALUES (%s, 'not yours', false, true, %s, NOW() + INTERVAL '30 days')
""", [other_token_id, self.other_user_id])

r = TestClient.delete(self.TOKEN_URL % other_token_id,
Expand Down Expand Up @@ -180,8 +180,8 @@ def test_access_log_returns_entries(self):
def test_access_log_enforces_ownership(self):
other_token_id = str(uuid.uuid4())
TestClient.execute("""
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id)
VALUES (%s, 'other log token', false, true, %s)
INSERT INTO global_token (id, description, scope_push, scope_pull, user_id, expires_at)
VALUES (%s, 'other log token', false, true, %s, NOW() + INTERVAL '30 days')
""", [other_token_id, self.other_user_id])
TestClient.execute("""
INSERT INTO global_token_access_log (token_id, path, method, status_code)
Expand All @@ -196,4 +196,4 @@ def test_access_log_nonexistent_token_returns_404(self):
fake_id = str(uuid.uuid4())
r = TestClient.get(self.ACCESS_LOG_URL % fake_id,
headers=TestClient.get_user_authorization(self.user_id))
self.assertEqual(r['status'], 404)
self.assertEqual(r['status'], 404)
13 changes: 6 additions & 7 deletions src/dashboard-client/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
cp -r /infrabox/context/src/dashboard-client /dashboard

echo "## Link cache"
mkdir -p /infrabox/cache/node_modules
cp -r /infrabox/cache/node_modules /dashboard
if [ -d /infrabox/cache/node_modules ]; then
mv /infrabox/cache/node_modules /dashboard/node_modules
else
mkdir -p /dashboard/node_modules
fi

cd /dashboard

Expand All @@ -15,11 +18,7 @@ npm install
echo "## build"
npm run build

echo "## Copy to cache"
rm -rf /infrabox/cache/node_modules
cp -r /dashboard/node_modules /infrabox/cache

echo "## Copy to output"
cp -r /dashboard/dist /infrabox/output

echo "## done"
echo "## done"
1 change: 1 addition & 0 deletions src/dashboard-client/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
process.exit(0)
})
})
Loading