Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c8f2548
chore(deps): update dependency mkdocs-material to v9.5.45 (#5)
renovate[bot] Nov 20, 2024
08264fc
chore(repo): add guidelines documentations
yyewolf Nov 20, 2024
1ade442
chore(init): init with devenv, cobra, viper and atreugo (#16)
yyewolf Nov 21, 2024
cff4386
chore(init): init front nuxt vue vite nuxt-ui (#15)
NathanCornelie Nov 22, 2024
c1fc80d
chore(ci): move workflows to self hosted instance
yyewolf Nov 23, 2024
9de4907
chore(ci): change preview url
yyewolf Nov 23, 2024
7ab1d83
chore(deps): update pnpm to v9.14.2 (#17)
renovate[bot] Nov 23, 2024
3b4d4cf
feat(back): implement sql, login, tests and doc (#18)
yyewolf Nov 24, 2024
c713a69
chore(deps): pin dependencies (#19)
renovate[bot] Nov 24, 2024
78811f3
chore(deps): update golang docker tag to v1.23.3 (#20)
renovate[bot] Nov 24, 2024
8c0f579
chore(ci): add unit tests for every branches
yyewolf Nov 24, 2024
6826c31
chore(back): copy config as well
yyewolf Nov 24, 2024
fe8c408
fix(deps): update module github.com/stretchr/testify to v1.10.0 (#26)
renovate[bot] Nov 24, 2024
4b5f832
chore(deps): update jamesives/github-pages-deploy-action action to v4…
renovate[bot] Nov 24, 2024
983b08d
feat(back): implement translation (#27)
yyewolf Nov 24, 2024
a824f46
feat(back): improve DX with cors, logs and remove username regex (#31)
yyewolf Nov 25, 2024
1f75fb3
chore(deps): update dependency mkdocs-material to v9.5.46 (#32)
renovate[bot] Nov 25, 2024
e4a1e61
feat(back): use sqlboiler to generate views (#29)
yyewolf Nov 25, 2024
ac7c3f1
chore(deps): update pnpm to v9.14.4 (#33)
renovate[bot] Dec 5, 2024
c82d56f
chore(deps): update jamesives/github-pages-deploy-action action to v4…
renovate[bot] Dec 5, 2024
d9c86ac
chore(deps): update dependency mkdocs-material to v9.5.47 (#35)
renovate[bot] Dec 5, 2024
93f67b7
chore(deps): update mariadb:11.6.2 docker digest to a954759 (#37)
renovate[bot] Dec 5, 2024
9edefba
chore(deps): update actions/cache digest to 1bd1e32 (#38)
renovate[bot] Dec 5, 2024
5d781a7
chore(deps): update phpmyadmin:5.2 docker digest to 3483eea (#39)
renovate[bot] Dec 5, 2024
918644b
chore(deps): update golang:1.23.3 docker digest to e5ca199 (#36)
renovate[bot] Dec 5, 2024
f1c4740
chore(deps): update dependency go to v1.23.4 (#40)
renovate[bot] Dec 7, 2024
73ede2d
chore(deps): update golang docker tag to v1.23.4 (#41)
renovate[bot] Dec 7, 2024
dde85a7
chore(deps): update jamesives/github-pages-deploy-action action to v4…
renovate[bot] Dec 7, 2024
e89b7a5
chore(deps): update dependency six to v1.17.0 (#43)
renovate[bot] Dec 7, 2024
5694452
fix(deps): update module golang.org/x/crypto to v0.30.0 (#44)
renovate[bot] Dec 7, 2024
098ae11
chore(deps): update pnpm to v9.15.0 (#45)
renovate[bot] Dec 7, 2024
50c1cbd
chore(deps): update dependency mkdocs-material to v9.5.48 (#46)
renovate[bot] Dec 9, 2024
c18d7f5
fix(deps): update module github.com/valyala/fasthttp to v1.58.0 (#48)
renovate[bot] Dec 9, 2024
eadd5cf
fix(deps): update dependency @nuxt/ui to v2.20.0 (#47)
renovate[bot] Dec 9, 2024
7e4304d
fix(deps): update module github.com/amacneil/dbmate/v2 to v2.24.0 (#49)
renovate[bot] Dec 11, 2024
0e858fb
chore(deps): update dependency certifi to v2024.12.14 (#53)
renovate[bot] Dec 14, 2024
87b96e2
fix(deps): update module golang.org/x/crypto to v0.31.0 [security] (#52)
renovate[bot] Dec 14, 2024
141e6b0
chore(deps): update golang:1.23.4 docker digest to 7003184 (#51)
renovate[bot] Dec 14, 2024
0a61f96
chore(deps): update dependency mkdocs-material to v9.5.49 (#55)
renovate[bot] Dec 20, 2024
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
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencyDashboard": true,
"automerge": true,
"automergeType": "pr",
"pinDigests": true,
"packageRules": [
{
"matchDepTypes": [
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: 3.x

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
Expand All @@ -42,13 +42,19 @@ jobs:
# Deploy with pr-preview only on PRs
- name: Deploy preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
uses: rossjrw/pr-preview-action@430e3dfc1de8a8ae77e77d862d25676ef9db55d1 # v1
with:
token: ${{ secrets.DEPLOY_TOKEN }}
custom-url: 4ctf.4ts.fr
source-dir: ./docs/site

# Deploy to GitHub Pages only when the main branch
- name: Deploy to GitHub Pages
run : |
cd docs
mkdocs gh-deploy --force
- name: Deploy preview directory
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a # v4.7.2
with:
token: ${{ secrets.DEPLOY_TOKEN }}
folder: ./docs/site
commit-message: Deploy production site 🚀
clean: true
clean-exclude: .gitignore
force: false
30 changes: 30 additions & 0 deletions .github/workflows/golang-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go Unit Tests

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
test:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
with:
go-version: '1.23.3'

- name: Install dependencies
working-directory: ./back
run: go get -v -t -d ./...

- name: Run unit tests
working-directory: ./back
run: go test ./... -v
6 changes: 3 additions & 3 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: self-hosted

steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0 # Required for Semantic Release to access full git history

Expand All @@ -26,7 +26,7 @@ jobs:
ssh-keyscan github.com >> ~/.ssh/known_hosts

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: '20' # Use the latest Node.js version here

Expand Down
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Semantic Release
node_modules
node_modules

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml

# tmp
tmp/

# env
.env
config.yaml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "back/templates/sqlboiler"]
path = back/templates/sqlboiler
url = https://github.com/volatiletech/sqlboiler
79 changes: 79 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Code of Conduct

We are committed to creating an inclusive and welcoming environment for everyone involved in the 4CTF project. By participating in this project, you agree to abide by the following Code of Conduct.

---

## Our Pledge

In the interest of fostering an open and welcoming community, we pledge to:

- Be respectful and inclusive in all interactions.
- Avoid harassment or discrimination of any kind.
- Value different perspectives and experiences.
- Accept constructive criticism graciously.
- Demonstrate empathy and kindness toward others.

---

## Our Standards

Examples of behavior that contribute to a positive environment include:

- Using welcoming and inclusive language.
- Being respectful of differing opinions, viewpoints, and experiences.
- Gracefully accepting constructive criticism.
- Focusing on what is best for the community.
- Showing empathy and care toward other participants.

Examples of unacceptable behavior include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances.
- Trolling, insulting or derogatory comments, and personal or political attacks.
- Public or private harassment.
- Publishing others’ private information, such as physical or electronic addresses, without explicit permission.
- Other conduct that could reasonably be considered inappropriate in a professional setting.

---

## Scope

This Code of Conduct applies both within project spaces (e.g., the repository, issue trackers, and pull requests) and in public spaces when an individual is representing the project or its community.

---

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers via email at **[insert email address]**. All complaints will be reviewed and investigated promptly and fairly.

Project maintainers are obligated to maintain confidentiality regarding the reporter of an incident. Further details of specific enforcement policies may be posted separately.

---

## Enforcement Guidelines

Maintainers will follow these Community Impact Guidelines to determine the consequences for any action they deem in violation of this Code of Conduct:

1. **Correction**
*Community Impact*: A single minor issue.
*Consequence*: A private, written warning with guidance on improving behavior.

2. **Warning**
*Community Impact*: A sustained pattern of inappropriate behavior.
*Consequence*: A warning and temporary restrictions from community interactions.

3. **Temporary Ban**
*Community Impact*: A serious violation or repeated warnings.
*Consequence*: Temporary ban from participation in the project.

4. **Permanent Ban**
*Community Impact*: Severe or repeated violations.
*Consequence*: Permanent removal from the project community.

---

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

For further details, see the [Contributor Covenant FAQ](https://www.contributor-covenant.org/faq/).
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Contributing to 4CTF

We welcome contributions to the 4CTF project! To ensure a smooth process for everyone, please follow the guidelines below.

## Table of Contents

- [Contributing to 4CTF](#contributing-to-4ctf)
- [Table of Contents](#table-of-contents)
- [Code of Conduct](#code-of-conduct)
- [How Can I Contribute?](#how-can-i-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Features](#suggesting-features)
- [Submitting Code](#submitting-code)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Commit Messages](#commit-messages)
- [Examples](#examples)
- [Common Types](#common-types)

---

## Code of Conduct

By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). Be respectful and collaborative!

---

## How Can I Contribute?

### Reporting Bugs

1. Search for existing issues before submitting a new one.
2. Provide detailed steps to reproduce the bug, your environment, and any relevant logs.

### Suggesting Features

1. Open an issue with a clear and descriptive title.
2. Explain the problem and how the feature would address it.

### Submitting Code

1. Fork the repository and clone your fork.
2. Create a new branch from `develop`.
3. Make your changes.
4. Open a pull request (PR) targeting the `develop` branch.

---

## Pull Request Guidelines

1. **Target Branch**: All PRs must point to the `develop` branch. Changes are merged into `main` only for releases.
2. **Branch Naming**: Use descriptive branch names, e.g., `feature/add-something` or `bugfix/fix-issue`.
3. **Description**: Include a clear description of your changes and link to related issues if applicable.
4. **Tests**: Ensure your code is covered by tests if possible.
5. **Review Process**: Wait for at least one approval from a maintainer before merging.

---

## Commit Messages

We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Please structure your commit messages as follows:

```a
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

### Examples

- `feat(api): add endpoint for user registration`
- `fix(ui): resolve button alignment issue on mobile`
- `docs(readme): update contributing section`

### Common Types

- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation changes
- `style`: Code style changes (formatting, no code logic changes)
- `refactor`: Code refactoring (neither fixes a bug nor adds a feature)
- `test`: Adding or updating tests
- `chore`: Maintenance tasks (e.g., updating dependencies)

---

Thank you for contributing to 4CTF! 🎉
49 changes: 49 additions & 0 deletions back/.air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
bin = "/bin/bash -c 'source refresh-env && bin/server serve'"
cmd = "go build -ldflags '-s -w' -o bin/server main.go"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata", "node_modules", "models", "venv"]
exclude_file = []
exclude_regex = ["_test.go", "_templ.go"]
exclude_unchanged = true
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html", "templ", "env"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
main_only = false
time = false

[misc]
clean_on_exit = false

[proxy]
app_port = 0
enabled = false
proxy_port = 0

[screen]
clear_on_rebuild = false
keep_scroll = true
11 changes: 11 additions & 0 deletions back/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MYSQL_USER=rtyop
MYSQL_PASSWORD=rtyop
MYSQL_DATABASE=rtyop
MYSQL_PORT=3306
MYSQL_HOST=127.0.0.1
MYSQL_SCHEMA_FILE=sql/schema.sql
MYSQL_MIGRATIONS_FOLDER=sql/migrations

DATABASE_URL=mysql://rtyop:rtyop@127.0.0.1:3306/rtyop
DBMATE_MIGRATIONS_DIR=sql/migrations
DBMATE_SCHEMA_FILE=sql/schema.sql
Loading