Skip to content

Commit 5064f8d

Browse files
committed
Initial commit with cleaned history
0 parents  commit 5064f8d

25 files changed

+1344
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '...'
17+
3. Scroll down to '...'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. Linux Arch]
28+
- Kernel version [e.g. 6.10.10-arch1-1]
29+
30+
**Additional context**
31+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Bug Report
4+
url: https://github.com/fam007e/SecurePasswd_MGMT/issues/new?template=bug_report.md
5+
about: File a bug report for the project.
6+
- name: Feature Request
7+
url: https://github.com/fam007e/SecurePasswd_MGMT/issues/new?template=feature_request.md
8+
about: Suggest a new feature for the project.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex: I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Documentation update
15+
16+
## Checklist:
17+
18+
- [ ] My code follows the style guidelines of this project
19+
- [ ] I have performed a self-review of my own code
20+
- [ ] I have commented my code, particularly in hard-to-understand areas
21+
- [ ] I have made corresponding changes to the documentation
22+
- [ ] My changes generate no new warnings
23+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/discord-webhook.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Discord Webhook Notification
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, closed, reopened]
9+
pull_request_review:
10+
types: [submitted, edited, dismissed]
11+
issues:
12+
types: [opened, closed, reopened]
13+
release:
14+
types: [published, edited, released]
15+
check_run:
16+
types: [completed]
17+
check_suite:
18+
types: [completed]
19+
deployment:
20+
types: [created, completed]
21+
22+
jobs:
23+
notify:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Send notification to Discord for Push
27+
if: github.event_name == 'push'
28+
run: |
29+
curl -H "Content-Type: application/json" \
30+
-d "{\"content\": \"New push event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
31+
${{ secrets.DISCORD_WEBHOOK_URL }}
32+
33+
- name: Send notification to Discord for Pull Request
34+
if: github.event_name == 'pull_request'
35+
run: |
36+
curl -H "Content-Type: application/json" \
37+
-d "{\"content\": \"New pull request event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
38+
${{ secrets.DISCORD_WEBHOOK_URL }}
39+
40+
- name: Send notification to Discord for Pull Request Review
41+
if: github.event_name == 'pull_request_review'
42+
run: |
43+
curl -H "Content-Type: application/json" \
44+
-d "{\"content\": \"New pull request review event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
45+
${{ secrets.DISCORD_WEBHOOK_URL }}
46+
47+
- name: Send notification to Discord for Issues
48+
if: github.event_name == 'issues'
49+
run: |
50+
curl -H "Content-Type: application/json" \
51+
-d "{\"content\": \"New issue event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
52+
${{ secrets.DISCORD_WEBHOOK_URL }}
53+
54+
- name: Send notification to Discord for Release
55+
if: github.event_name == 'release'
56+
run: |
57+
curl -H "Content-Type: application/json" \
58+
-d "{\"content\": \"New release event in repository: ${{ github.repository }} by ${{ github.actor }}.\"}" \
59+
${{ secrets.DISCORD_WEBHOOK_URL }}
60+
61+
- name: Send notification to Discord for Check Run
62+
if: github.event_name == 'check_run'
63+
run: |
64+
curl -H "Content-Type: application/json" \
65+
-d "{\"content\": \"New check run completed in repository: ${{ github.repository }}.\"}" \
66+
${{ secrets.DISCORD_WEBHOOK_URL }}
67+
68+
- name: Send notification to Discord for Check Suite
69+
if: github.event_name == 'check_suite'
70+
run: |
71+
curl -H "Content-Type: application/json" \
72+
-d "{\"content\": \"New check suite completed in repository: ${{ github.repository }}.\"}" \
73+
${{ secrets.DISCORD_WEBHOOK_URL }}
74+
75+
- name: Send notification to Discord for Deployment
76+
if: github.event_name == 'deployment'
77+
run: |
78+
curl -H "Content-Type: application/json" \
79+
-d "{\"content\": \"New deployment event in repository: ${{ github.repository }}.\"}" \
80+
${{ secrets.DISCORD_WEBHOOK_URL }}

.github/workflows/issue-slash-cmd.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Close issue on /close
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
jobs:
8+
closeIssueOnClose:
9+
# Skip this job if the comment was created/edited on a PR
10+
if: ${{ !github.event.issue.pull_request }}
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: none
15+
contents: read
16+
17+
steps:
18+
- run: echo "command=false" >> $GITHUB_ENV
19+
20+
- name: Check for /close command
21+
id: check_close_command
22+
run: |
23+
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
24+
echo "command=true" >> $GITHUB_ENV
25+
echo "close_command=true" >> $GITHUB_ENV
26+
echo "reopen_command=false" >> $GITHUB_ENV
27+
else
28+
echo "close_command=false" >> $GITHUB_ENV
29+
fi
30+
31+
- name: Check for /open or /reopen command
32+
id: check_reopen_command
33+
run: |
34+
if [[ "${{ contains(github.event.comment.body, '/open') }}" == "true" ]] || [[ "${{ contains(github.event.comment.body, '/reopen') }}" == "true" ]]; then
35+
echo "command=true" >> $GITHUB_ENV
36+
echo "reopen_command=true" >> $GITHUB_ENV
37+
echo "close_command=false" >> $GITHUB_ENV
38+
else
39+
echo "reopen_command=false" >> $GITHUB_ENV
40+
fi
41+
42+
- name: Check if the user is allowed
43+
id: check_user
44+
if: env.command == 'true'
45+
run: |
46+
ALLOWED_USERS=("fam007e")
47+
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
48+
echo "user=true" >> $GITHUB_ENV
49+
else
50+
echo "user=false" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Close issue if conditions are met
54+
if: env.close_command == 'true' && env.user == 'true'
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
ISSUE_NUMBER: ${{ github.event.issue.number }}
58+
run: |
59+
echo Closing the issue...
60+
if [[ "${{ contains(github.event.comment.body, 'not planned') }}" == "true" ]]; then
61+
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} --reason 'not planned'
62+
else
63+
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
64+
fi
65+
66+
- name: Reopen issue if conditions are met
67+
if: env.reopen_command == 'true' && env.user == 'true'
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
ISSUE_NUMBER: ${{ github.event.issue.number }}
71+
run: |
72+
echo Reopening the issue...
73+
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}

.github/workflows/release.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release SecurePassManager Binary
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/**'
9+
- 'Makefile'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get update && sudo apt-get upgrade -y
22+
sudo apt-get install -y build-essential libssl-dev oathtool liboath0 liboath-dev && sudo apt-get update
23+
24+
- name: Install GitHub CLI
25+
run: |
26+
sudo apt-get install -y gh
27+
28+
- name: Authenticate GitHub CLI
29+
run: |
30+
echo "${{ secrets.SECPASSWD_TOKEN }}" | gh auth login --with-token
31+
32+
- name: Build and Release
33+
run: |
34+
make clean
35+
make
36+
37+
- name: Run
38+
run: |
39+
./securepass --version
40+
./securepass --help
41+
42+
- name: Create release package
43+
run: |
44+
mkdir -p release
45+
cp securepass release/
46+
version=$(./securepass --version | awk '{print $NF}')
47+
tar -czvf release/securepass-${version}.tar.gz release/securepass
48+
49+
- name: Create release
50+
id: create_release
51+
run: |
52+
version=$(./securepass --version | awk '{print $NF}')
53+
changelog=$(git log --oneline --pretty=format:"* %s (%h)" | head -n 20)
54+
echo "Changelog: $changelog" > release/changelog.txt
55+
56+
gh release create "v${version}" release/securepass-${version}.tar.gz release/changelog.txt --title "Release v${version}" --notes "$changelog"
57+
58+
- name: Clean up
59+
run: |
60+
rm -rf release

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Compiled files
2+
*.o
3+
securepass
4+
5+
# Data files
6+
data/*.csv
7+
8+
# Libraries
9+
lib/*
10+
!lib/README.md
11+
12+
# IDE files
13+
.vscode/
14+
.idea/
15+
16+
# OS generated files
17+
.DS_Store
18+
Thumbs.db

0 commit comments

Comments
 (0)