Skip to content

Commit 2396761

Browse files
feat: UI/UX improvements and security enhancements
- Enhance UI/UX with modern design patterns - Add multiple theme options for customization - Implement additional security validation checks - Integrate authentication testing module - Create GitHub issue and PR templates
1 parent 09e6988 commit 2396761

18 files changed

Lines changed: 429 additions & 1853 deletions

.github/workflows/release.yml

Lines changed: 0 additions & 162 deletions
This file was deleted.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: 📦 Upload Release Assets
2+
3+
# Trigger only on published releases
4+
on:
5+
release:
6+
types: [published]
7+
8+
# Define required permissions for GITHUB_TOKEN
9+
permissions:
10+
contents: write # Required to upload release assets
11+
12+
env:
13+
# Build directory where assets are located
14+
BUILD_DIR: './build'
15+
16+
jobs:
17+
upload-assets:
18+
name: 🚀 Upload Release Assets
19+
runs-on: ubuntu-latest
20+
21+
# Only run for releases on main and release/* branches
22+
if: github.event.release.target_commitish == 'main' || startsWith(github.event.release.target_commitish, 'release/')
23+
24+
steps:
25+
# Step 1: Checkout the repository
26+
- name: 📥 Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 1
30+
31+
# Step 2: Verify build directory exists
32+
- name: 🔍 Verify build directory
33+
run: |
34+
echo "🔍 Checking for build directory: ${{ env.BUILD_DIR }}"
35+
if [ -d "${{ env.BUILD_DIR }}" ]; then
36+
echo "✅ Build directory found"
37+
ls -la "${{ env.BUILD_DIR }}"
38+
else
39+
echo "⚠️ Build directory not found, creating for demonstration"
40+
mkdir -p "${{ env.BUILD_DIR }}"
41+
fi
42+
43+
# Step 3: Check for required asset files
44+
- name: 📋 Check for release assets
45+
id: check_assets
46+
run: |
47+
echo "📋 Checking for required release assets..."
48+
49+
# Initialize found flags
50+
found_deb=false
51+
found_msi=false
52+
found_exe=false
53+
54+
# Check for Debian package
55+
if [ -f "${{ env.BUILD_DIR }}/vaultscope.deb" ]; then
56+
echo "✅ Found: vaultscope.deb"
57+
found_deb=true
58+
else
59+
echo "⚠️ Missing: vaultscope.deb"
60+
fi
61+
62+
# Check for Windows MSI installer
63+
if [ -f "${{ env.BUILD_DIR }}/vaultscope.msi" ]; then
64+
echo "✅ Found: vaultscope.msi"
65+
found_msi=true
66+
else
67+
echo "⚠️ Missing: vaultscope.msi"
68+
fi
69+
70+
# Check for Windows EXE installer
71+
if [ -f "${{ env.BUILD_DIR }}/vaultscope.exe" ]; then
72+
echo "✅ Found: vaultscope.exe"
73+
found_exe=true
74+
else
75+
echo "⚠️ Missing: vaultscope.exe"
76+
fi
77+
78+
# Set outputs for subsequent steps
79+
echo "found_deb=$found_deb" >> $GITHUB_OUTPUT
80+
echo "found_msi=$found_msi" >> $GITHUB_OUTPUT
81+
echo "found_exe=$found_exe" >> $GITHUB_OUTPUT
82+
83+
# Log summary
84+
total_found=0
85+
[ "$found_deb" = true ] && total_found=$((total_found + 1))
86+
[ "$found_msi" = true ] && total_found=$((total_found + 1))
87+
[ "$found_exe" = true ] && total_found=$((total_found + 1))
88+
89+
echo "📊 Summary: $total_found/3 required assets found"
90+
91+
# Step 4: Upload all available assets to release
92+
- name: 📤 Upload release assets
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
tag_name: ${{ github.event.release.tag_name }}
96+
files: |
97+
${{ env.BUILD_DIR }}/vaultscope.deb
98+
${{ env.BUILD_DIR }}/vaultscope.msi
99+
${{ env.BUILD_DIR }}/vaultscope.exe
100+
fail_on_unmatched_files: false
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
104+
# Step 5: Log upload results and summary
105+
- name: 📊 Upload Summary
106+
run: |
107+
echo "📊 Upload Results Summary"
108+
echo "=========================="
109+
echo ""
110+
echo "🎯 Release: ${{ github.event.release.name }}"
111+
echo "🏷️ Tag: ${{ github.event.release.tag_name }}"
112+
echo "🌿 Branch: ${{ github.event.release.target_commitish }}"
113+
echo ""
114+
115+
# Show what was found and attempted to upload
116+
uploaded_count=0
117+
echo "📤 Assets processed:"
118+
119+
if [ "${{ steps.check_assets.outputs.found_deb }}" = "true" ]; then
120+
echo " ✅ vaultscope.deb (Debian package) - uploaded"
121+
uploaded_count=$((uploaded_count + 1))
122+
else
123+
echo " ⏭️ vaultscope.deb (skipped - not found)"
124+
fi
125+
126+
if [ "${{ steps.check_assets.outputs.found_msi }}" = "true" ]; then
127+
echo " ✅ vaultscope.msi (Windows MSI installer) - uploaded"
128+
uploaded_count=$((uploaded_count + 1))
129+
else
130+
echo " ⏭️ vaultscope.msi (skipped - not found)"
131+
fi
132+
133+
if [ "${{ steps.check_assets.outputs.found_exe }}" = "true" ]; then
134+
echo " ✅ vaultscope.exe (Windows EXE installer) - uploaded"
135+
uploaded_count=$((uploaded_count + 1))
136+
else
137+
echo " ⏭️ vaultscope.exe (skipped - not found)"
138+
fi
139+
140+
echo ""
141+
echo "📈 Total uploaded: $uploaded_count/3 assets"
142+
143+
if [ $uploaded_count -gt 0 ]; then
144+
echo "🎉 Release assets uploaded successfully!"
145+
else
146+
echo "⚠️ No assets were uploaded (all files missing)"
147+
fi
148+
149+
echo ""
150+
echo "🔗 Release URL: ${{ github.event.release.html_url }}"
151+
152+
# Step 6: Fail job if no assets were found (optional safeguard)
153+
- name: ❌ Fail if no assets found
154+
if: steps.check_assets.outputs.found_deb == 'false' && steps.check_assets.outputs.found_msi == 'false' && steps.check_assets.outputs.found_exe == 'false'
155+
run: |
156+
echo "❌ ERROR: No release assets found in ${{ env.BUILD_DIR }}"
157+
echo ""
158+
echo "Expected files:"
159+
echo " - vaultscope.deb"
160+
echo " - vaultscope.msi"
161+
echo " - vaultscope.exe"
162+
echo ""
163+
echo "Please ensure your build process creates these files before publishing a release."
164+
exit 1

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
<artifactId>httpclient5</artifactId>
3434
<version>5.2.1</version>
3535
</dependency>
36+
<dependency>
37+
<groupId>org.apache.httpcomponents.core5</groupId>
38+
<artifactId>httpcore5</artifactId>
39+
<version>5.2.1</version>
40+
</dependency>
3641
<dependency>
3742
<groupId>com.fasterxml.jackson.core</groupId>
3843
<artifactId>jackson-databind</artifactId>

src/main/java/dev/cptcr/vaultscope/controller/MainController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void startScan() {
288288
return;
289289
}
290290

291-
scanButton.setDisabled(true);
291+
scanButton.setDisable(true);
292292
scanProgress.setVisible(true);
293293
statusLabel.setText("Initializing security scan...");
294294
vulnerabilities.clear();
@@ -325,7 +325,7 @@ protected void succeeded() {
325325

326326
statusLabel.setText(String.format("Scan completed - Found %d vulnerabilities", vulnerabilities.size()));
327327
scanProgress.setVisible(false);
328-
scanButton.setDisabled(false);
328+
scanButton.setDisable(false);
329329
updateButtonStates();
330330

331331
if (vulnerabilities.isEmpty()) {
@@ -341,7 +341,7 @@ protected void failed() {
341341
Platform.runLater(() -> {
342342
statusLabel.setText("Scan failed");
343343
scanProgress.setVisible(false);
344-
scanButton.setDisabled(false);
344+
scanButton.setDisable(false);
345345
showAlert(Alert.AlertType.ERROR, "Scan Error",
346346
"Failed to complete security scan:\n" + getException().getMessage());
347347
});
@@ -392,11 +392,11 @@ private void toggleTheme() {
392392

393393
private void updateButtonStates() {
394394
boolean hasValidUrl = urlValidator.isValidLocalhostUrl(targetUrlField.getText().trim());
395-
scanButton.setDisabled(!hasValidUrl);
395+
scanButton.setDisable(!hasValidUrl);
396396

397397
boolean hasResults = currentResult != null && !currentResult.getVulnerabilities().isEmpty();
398-
exportJsonButton.setDisabled(currentResult == null);
399-
exportHtmlButton.setDisabled(currentResult == null);
398+
exportJsonButton.setDisable(currentResult == null);
399+
exportHtmlButton.setDisable(currentResult == null);
400400
}
401401

402402
private void showVulnerabilityDetails(Vulnerability vuln) {

0 commit comments

Comments
 (0)