Skip to content

Commit 1e532f7

Browse files
committed
initial commit
0 parents  commit 1e532f7

236 files changed

Lines changed: 54490 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Git and local artifacts
2+
.git
3+
.gitignore
4+
*.db
5+
*.db-wal
6+
*.db-shm
7+
/data/
8+
scrumboy.exe
9+
scrumboy*.tar
10+
nas_deploy.bat
11+
12+
# Docs and scripts not needed in image
13+
*.md
14+
*.bat
15+
.github/
16+
17+
# IDE and tools
18+
.tools
19+
*.exe
20+
21+
# Node (used only in CI to build frontend; dist/ is committed or built in CI)
22+
internal/httpapi/web/node_modules
23+
internal/httpapi/web/package.json
24+
internal/httpapi/web/package-lock.json
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Build and Push to GHCR
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [ main, master ]
10+
workflow_dispatch:
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
16+
concurrency:
17+
group: docker-publish
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-22.04
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
# Required: Go binary embeds web/** at build time; Docker context must include built dist/
32+
- name: Build frontend
33+
run: |
34+
cd internal/httpapi/web
35+
npm install
36+
npx tsc
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Log in to GitHub Container Registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Extract metadata (tags, labels) for Docker
49+
id: meta
50+
uses: docker/metadata-action@v5
51+
with:
52+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
tags: |
54+
type=ref,event=branch
55+
type=ref,event=pr
56+
type=semver,pattern={{version}}
57+
type=semver,pattern={{major}}.{{minor}}
58+
type=sha,prefix=sha-
59+
type=raw,value=latest,enable={{is_default_branch}}
60+
61+
- name: Build and push Docker image
62+
uses: docker/build-push-action@v5
63+
with:
64+
context: .
65+
push: ${{ github.event_name != 'pull_request' }}
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
cache-from: type=gha
69+
cache-to: type=gha,mode=max
70+
71+
- name: Set package visibility to private
72+
if: github.event_name != 'pull_request'
73+
run: |
74+
REPO_NAME="${{ github.event.repository.name }}"
75+
OWNER="${{ github.repository_owner }}"
76+
77+
# Wait a few seconds for package to be registered
78+
echo "Waiting for package to be registered..."
79+
sleep 5
80+
81+
# Retry logic - try up to 3 times
82+
MAX_RETRIES=3
83+
RETRY_COUNT=0
84+
SUCCESS=false
85+
86+
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ "$SUCCESS" = false ]; do
87+
RETRY_COUNT=$((RETRY_COUNT + 1))
88+
echo "Attempt $RETRY_COUNT of $MAX_RETRIES..."
89+
90+
# Try org endpoint first
91+
ORG_RESPONSE=$(curl -s -w "\n%{http_code}" -X PATCH \
92+
-H "Accept: application/vnd.github+json" \
93+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
94+
-H "X-GitHub-Api-Version: 2022-11-28" \
95+
"https://api.github.com/orgs/${OWNER}/packages/container/${REPO_NAME}" \
96+
-d '{"visibility":"private"}')
97+
98+
HTTP_CODE=$(echo "$ORG_RESPONSE" | tail -n1)
99+
RESPONSE_BODY=$(echo "$ORG_RESPONSE" | sed '$d')
100+
101+
if [ "$HTTP_CODE" = "404" ]; then
102+
# Try user endpoint
103+
echo "Org endpoint returned 404, trying user endpoint..."
104+
USER_RESPONSE=$(curl -s -w "\n%{http_code}" -X PATCH \
105+
-H "Accept: application/vnd.github+json" \
106+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
107+
-H "X-GitHub-Api-Version: 2022-11-28" \
108+
"https://api.github.com/users/${OWNER}/packages/container/${REPO_NAME}" \
109+
-d '{"visibility":"private"}')
110+
111+
USER_HTTP_CODE=$(echo "$USER_RESPONSE" | tail -n1)
112+
USER_RESPONSE_BODY=$(echo "$USER_RESPONSE" | sed '$d')
113+
114+
if [ "$USER_HTTP_CODE" = "200" ] || [ "$USER_HTTP_CODE" = "204" ]; then
115+
echo "Package visibility set to private via user endpoint"
116+
SUCCESS=true
117+
elif [ "$USER_HTTP_CODE" = "404" ] && [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
118+
echo "Package not found yet, waiting 3 seconds before retry..."
119+
sleep 3
120+
else
121+
echo "Error setting package visibility via user endpoint:"
122+
echo "HTTP Code: $USER_HTTP_CODE"
123+
echo "Response: $USER_RESPONSE_BODY"
124+
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
125+
echo "Max retries reached. Package may not exist yet, but this is non-fatal."
126+
echo "Note: Packages in private repos are private by default."
127+
fi
128+
fi
129+
elif [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "204" ]; then
130+
echo "Package visibility set to private via org endpoint"
131+
SUCCESS=true
132+
elif [ "$HTTP_CODE" = "404" ] && [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
133+
echo "Package not found yet, waiting 3 seconds before retry..."
134+
sleep 3
135+
else
136+
echo "Error setting package visibility via org endpoint:"
137+
echo "HTTP Code: $HTTP_CODE"
138+
echo "Response: $RESPONSE_BODY"
139+
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
140+
echo "Max retries reached. Package may not exist yet, but this is non-fatal."
141+
echo "Note: Packages in private repos are private by default."
142+
fi
143+
fi
144+
done
145+
146+
if [ "$SUCCESS" = false ]; then
147+
echo "Warning: Could not set package visibility, but package is private by default in private repos."
148+
echo "You can manually verify/update visibility in GitHub Packages settings."
149+
fi

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Data and DB (self-hosted instance data)
2+
/data/
3+
*.db
4+
*.db-wal
5+
*.db-shm
6+
7+
# Build and tooling
8+
/.tools/
9+
/dist/
10+
# Go / Windows build outputs (never commit binaries)
11+
*.exe
12+
# Unix binary at repo root only (do not use bare "scrumboy" — that ignores cmd/scrumboy/)
13+
/scrumboy
14+
nas_deploy.bat
15+
scrumboy*.tar
16+
17+
# Local 2FA encryption key (do not commit)
18+
scrumboy.env
19+
20+
# TLS dev certs (mkcert; do not commit)
21+
cert.pem
22+
key.pem
23+
24+
# Dependencies (npm install / go mod download on clone)
25+
node_modules/
26+
27+
# IDE and OS junk (optional but keeps diffs clean)
28+
.cursor/
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
.DS_Store
34+
Thumbs.db
35+
36+
# Test and coverage artifacts
37+
coverage.out
38+
*.cover
39+
*.test

CLA.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributor License Agreement (CLA)
2+
3+
Thank you for your interest in contributing to Scrumboy. To ensure the project can accept and use your contributions, we ask that you agree to the following terms.
4+
5+
## Agreement
6+
7+
By submitting a contribution (including but not limited to code, documentation, design, or other content) to the Scrumboy project, you agree to grant the Scrumboy maintainers the following rights:
8+
9+
1. **License grant.** You grant the Scrumboy maintainers a perpetual, irrevocable, worldwide, non-exclusive, royalty-free license to use, modify, reproduce, distribute, sublicense, and relicense your contribution in any form and under the GNU Affero General Public License v3 and, if needed, under other licenses used by the Scrumboy project (such as commercial or dual-license distributions).
10+
11+
## Note on Licensing:
12+
13+
Scrumboy uses an open-core model. The core project is open source under the AGPL-3.0 license and will will remain publicly available under the AGPL-3.0 license. The CLA allows the maintainers to distribute the software under additional licenses (for example enterprise or commercial editions) while continuing to maintain the open source core.
14+
15+
16+
2. **Copyright retention.** You retain copyright in your contribution. This agreement does not transfer ownership of your work; it only grants the rights described above.
17+
18+
3. **Representation.** You represent that you have the right to grant these rights, that your contribution is your original work (or that you have the right to submit it), and that your contribution does not violate any third party’s rights.
19+
20+
21+
22+
## How to sign
23+
24+
You indicate your acceptance of this agreement by submitting a pull request to the Scrumboy repository. Your first contribution will be considered your signature. If you contribute on behalf of an organization, you represent that you have authority to bind that organization to these terms.
25+
26+
## Questions
27+
28+
If you have questions about this agreement, please open an issue in the repository before contributing.

CODE_OF_CONDUCT.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
This Code of Conduct applies to all Scrumboy community spaces, including GitHub issues, pull requests, discussions, and project communication channels.
4+
5+
## Our Pledge
6+
7+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
8+
9+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
10+
11+
## Our Standards
12+
13+
Examples of behavior that contributes to a positive environment for our community include:
14+
15+
* Demonstrating empathy and kindness toward other people
16+
* Being respectful of differing opinions, viewpoints, and experiences
17+
* Giving and gracefully accepting constructive feedback
18+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
19+
* Focusing on what is best not just for us as individuals, but for the overall community
20+
21+
Examples of unacceptable behavior include:
22+
23+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
24+
* Trolling, insulting or derogatory comments, and personal or political attacks
25+
* Public or private harassment
26+
* Publishing others' private information, such as a physical or email address, without their explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a professional setting
28+
29+
## Enforcement Responsibilities
30+
31+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
32+
33+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
34+
35+
## Scope
36+
37+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
38+
39+
## Enforcement
40+
41+
Please report incidents by contacting the repository maintainers directly via GitHub. All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78+
79+
[homepage]: https://www.contributor-covenant.org
80+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81+
[Mozilla CoC]: https://github.com/mozilla/diversity
82+
[FAQ]: https://www.contributor-covenant.org/faq
83+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)