Skip to content

Commit 5a629da

Browse files
authored
Merge pull request #4122 from rudransh-shrivastava/feature/nestbot-ai-assistant-sync-main
Sync feature/nestbot-ai-assistant with main
2 parents d7e2725 + 98f7409 commit 5a629da

1,054 files changed

Lines changed: 70575 additions & 13903 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.

.bake.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# mbake configuration file
2+
3+
debug = false
4+
gnu_error_format = true
5+
verbose = false
6+
wrap_error_messages = false
7+
8+
[formatter]
9+
align_across_comments = false
10+
align_variable_assignments = false
11+
auto_insert_phony_declarations = false
12+
ensure_final_newline = true
13+
fix_missing_recipe_tabs = true
14+
group_phony_declarations = false
15+
indent_nested_conditionals = false
16+
max_consecutive_empty_lines = 2
17+
max_line_length = 120
18+
normalize_empty_lines = true
19+
normalize_line_continuations = true
20+
phony_at_top = false
21+
remove_trailing_whitespace = true
22+
space_after_colon = true
23+
space_around_assignment = true
24+
space_before_colon = false
25+
tab_width = 2

.codecov.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
comment:
5+
layout: reach, diff, flags, files, footer
6+
behavior: default
7+
require_changes: false
8+
9+
coverage:
10+
status:
11+
project:
12+
default:
13+
target: auto
14+
threshold: 1%
15+
base: auto
16+
backend:
17+
flags:
18+
- backend
19+
target: 95%
20+
threshold: 1%
21+
base: auto
22+
frontend:
23+
flags:
24+
- frontend
25+
target: 95%
26+
threshold: 1%
27+
base: auto
28+
patch:
29+
default:
30+
target: auto
31+
threshold: 0%
32+
backend:
33+
flags:
34+
- backend
35+
target: auto
36+
threshold: 0%
37+
frontend:
38+
flags:
39+
- frontend
40+
target: auto
41+
threshold: 0%
42+
43+
fixes:
44+
- /app/::frontend/
45+
- /home/owasp/::backend/
46+
47+
flags:
48+
backend:
49+
paths:
50+
- backend/
51+
carryforward: true
52+
frontend:
53+
paths:
54+
- frontend/
55+
carryforward: true

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ labels: ['bug']
66
assignees: ''
77
---
88

9+
Community & Support: [LinkedIn Group](https://www.linkedin.com/groups/14656108/) · [Slack #project-nest](https://owasp.slack.com/archives/project-nest)
10+
11+
Active project leaders: Arkadii Yakovets -- [GitHub](https://github.com/arkid15r/) · [LinkedIn](https://www.linkedin.com/in/arkid15r/) · [Slack](https://owasp.slack.com/team/U060W3NKLTF); Kate Golovanova -- [GitHub](https://github.com/kasya/) · [LinkedIn](https://www.linkedin.com/in/kate-golovanova/) · [Slack](https://owasp.slack.com/team/U07PWB1JZ6Z)
12+
13+
[Contributing](https://github.com/owasp/nest/blob/main/CONTRIBUTING.md) · [Code of Conduct](https://github.com/owasp/nest/blob/main/CODE_OF_CONDUCT.md) · [GSoC Mentors](https://github.com/owasp/nest/blob/main/MENTORS.md)
14+
15+
---
16+
917
**Describe the bug**
1018
A clear and concise description of what the bug is.
1119

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ contact_links:
33
- name: Got questions about OWASP Nest? We're here to help!
44
url: https://owasp.slack.com/archives/project-nest
55
about: 'Join our OWASP Slack channel #project-nest'
6+
- name: Connect with the OWASP Nest community on LinkedIn
7+
url: https://www.linkedin.com/groups/14656108/
8+
about: Join our LinkedIn group

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ labels: ['enhancement']
66
assignees: ''
77
---
88

9+
Community & Support: [LinkedIn Group](https://www.linkedin.com/groups/14656108/) · [Slack #project-nest](https://owasp.slack.com/archives/project-nest)
10+
11+
Active project leaders: Arkadii Yakovets -- [GitHub](https://github.com/arkid15r/) · [LinkedIn](https://www.linkedin.com/in/arkid15r/) · [Slack](https://owasp.slack.com/team/U060W3NKLTF); Kate Golovanova -- [GitHub](https://github.com/kasya/) · [LinkedIn](https://www.linkedin.com/in/kate-golovanova/) · [Slack](https://owasp.slack.com/team/U07PWB1JZ6Z)
12+
13+
[Contributing](https://github.com/owasp/nest/blob/main/CONTRIBUTING.md) · [Code of Conduct](https://github.com/owasp/nest/blob/main/CODE_OF_CONDUCT.md) · [GSoC Mentors](https://github.com/owasp/nest/blob/main/MENTORS.md)
14+
15+
---
16+
917
**Is your feature request related to a problem? Please describe.**
1018
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1119

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## STOP AND READ BEFORE SUBMITTING! REMOVE THIS PARAGRAPH BEFORE OPENING THE PR
32

43
Thank you for your interest in contributing to OWASP Nest!

.github/ansible/.ansible-lint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
profile: production

.github/ansible/inventory.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,3 @@ nest:
1111
ansible_python_interpreter: /usr/bin/python3
1212
ansible_ssh_private_key_file: "{{ lookup('env', 'PROXY_SSH_PRIVATE_KEY_PATH') }}"
1313
ansible_user: proxy
14-
15-
staging_nest:
16-
ansible_host: "{{ lookup('env', 'NEST_HOST_IP_ADDRESS') }}"
17-
ansible_python_interpreter: /usr/bin/python3
18-
ansible_ssh_private_key_file: "{{ lookup('env', 'NEST_SSH_PRIVATE_KEY_PATH') }}"
19-
ansible_user: staging
20-
21-
staging_nest_proxy:
22-
ansible_host: "{{ lookup('env', 'PROXY_HOST_IP_ADDRESS') }}"
23-
ansible_python_interpreter: /usr/bin/python3
24-
ansible_ssh_private_key_file: "{{ lookup('env', 'PROXY_SSH_PRIVATE_KEY_PATH') }}"
25-
ansible_user: proxy
Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- name: Deploy Nest to Production
1+
- name: Deploy Nest to Production # yamllint disable-line rule:indentation
22
hosts: production_nest
33
tasks:
44
- name: Copy docker-compose.yaml
@@ -8,28 +8,36 @@
88
mode: '0644'
99

1010
- name: Sync Makefile structure
11-
ansible.builtin.synchronize:
11+
ansible.posix.synchronize:
1212
src: '{{ github_workspace }}/'
13-
dest: '~/'
14-
recursive: yes
13+
dest: ~/
14+
recursive: true
1515
rsync_opts:
16-
- '--include=*/'
17-
- '--include=Makefile'
18-
- '--include=*/Makefile'
19-
- '--include=*/**/Makefile'
20-
- '--include=*/**/**/Makefile'
21-
- '--exclude=*'
22-
23-
- name: Update backend makefile for the production environment
24-
shell:
25-
cmd: sed -i 's/\bnest-backend\b/production-nest-backend/' ~/backend/Makefile
16+
- --include=*/
17+
- --include=Makefile
18+
- --include=*/Makefile
19+
- --include=*/**/Makefile
20+
- --include=*/**/**/Makefile
21+
- --exclude=*
2622

27-
- name: Update frontend makefile for the production environment
28-
shell:
29-
cmd: sed -i 's/\bnest-frontend\b/production-nest-frontend/' ~/frontend/Makefile
23+
- name: Update Makefiles for production environment
24+
ansible.builtin.command:
25+
argv:
26+
- sed
27+
- -i
28+
- '{{ item.sed_expr }}'
29+
- '{{ item.path }}'
30+
loop:
31+
- sed_expr: /e2e-\|fuzz-/! s/\bnest-backend\b/production-nest-backend/g
32+
path: '{{ ansible_env.HOME }}/backend/Makefile'
33+
- sed_expr: /e2e-\|fuzz-/! s/\bnest-db\b/production-nest-db/g
34+
path: '{{ ansible_env.HOME }}/backend/Makefile'
35+
- sed_expr: s/\bnest-frontend\b/production-nest-frontend/g
36+
path: '{{ ansible_env.HOME }}/frontend/Makefile'
37+
changed_when: false
3038

3139
- name: Copy secrets
32-
copy:
40+
ansible.builtin.copy:
3341
src: '{{ github_workspace }}/{{ item }}'
3442
dest: ~/
3543
mode: '0400'
@@ -42,7 +50,7 @@
4250

4351
- name: Clean up secrets
4452
delegate_to: localhost
45-
file:
53+
ansible.builtin.file:
4654
path: '{{ github_workspace }}/{{ item }}'
4755
state: absent
4856
loop:
@@ -51,28 +59,32 @@
5159
- .env.db
5260
- .env.frontend
5361
- .github.pem
54-
run_once: true
5562

5663
- name: Copy crontab
57-
copy:
64+
ansible.builtin.copy:
5865
src: '{{ github_workspace }}/cron/production'
5966
dest: /tmp/production_crontab
6067
mode: '0600'
6168

6269
- name: Install crontab
6370
ansible.builtin.command:
6471
cmd: crontab /tmp/production_crontab
72+
changed_when: false
6573

6674
- name: Restart services
67-
shell:
75+
ansible.builtin.command:
6876
cmd: docker compose up -d --pull always
77+
changed_when: false
6978

7079
- name: Prune docker images
71-
shell:
80+
ansible.builtin.command:
7281
cmd: docker image prune -f
82+
changed_when: false
7383

7484
- name: Index data
75-
async: 1800 # 30 minutes
85+
async: 1800 # 30 minutes
7686
poll: 0
77-
shell: |
87+
# Shell required for stdout/stderr redirect to log file.
88+
ansible.builtin.shell: |
7889
make index-data > /var/log/nest/production/index-data.log 2>&1
90+
changed_when: false
Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
- name: Deploy Production Nest Proxy
2-
hosts: production_nest_proxy
3-
tasks:
4-
- name: Copy proxy configuration files
5-
copy:
6-
src: '{{ github_workspace }}/proxy/{{ item }}'
7-
dest: ~/
8-
mode: '0644'
9-
loop:
10-
- blocked_ips.conf
11-
- cloudflare_realip.conf
12-
- headers.conf
13-
- production.conf
14-
- proxy_cache.conf
15-
- redirects.conf
1+
- name: Deploy Production Nest Proxy # yamllint disable-line rule:indentation
2+
hosts: production_nest_proxy
3+
tasks:
4+
- name: Copy proxy configuration files
5+
ansible.builtin.copy:
6+
src: '{{ github_workspace }}/proxy/{{ item }}'
7+
dest: ~/
8+
mode: '0644'
9+
loop:
10+
- blocked_ips.conf
11+
- cloudflare_realip.conf
12+
- headers.conf
13+
- production.conf
14+
- proxy_cache.conf
15+
- redirects.conf
1616

17-
- name: Copy docker compose file
18-
copy:
19-
src: '{{ github_workspace }}/docker-compose/proxy/compose.yaml'
20-
dest: ~/docker-compose.yaml
21-
mode: '0644'
17+
- name: Copy docker compose file
18+
ansible.builtin.copy:
19+
src: '{{ github_workspace }}/docker-compose/proxy/compose.yaml'
20+
dest: ~/docker-compose.yaml
21+
mode: '0644'
2222

23-
- name: Restart services
24-
shell:
25-
cmd: docker compose up -d --pull always && docker compose restart
23+
- name: Pull and start services
24+
ansible.builtin.command:
25+
cmd: docker compose up -d --pull always
26+
args:
27+
chdir: '{{ ansible_env.HOME }}'
28+
changed_when: false
2629

27-
- name: Prune docker images
28-
shell:
29-
cmd: docker image prune -f
30+
- name: Restart services
31+
ansible.builtin.command:
32+
cmd: docker compose restart
33+
args:
34+
chdir: '{{ ansible_env.HOME }}'
35+
changed_when: false
36+
37+
- name: Prune docker images
38+
ansible.builtin.command:
39+
cmd: docker image prune -f
40+
changed_when: false

0 commit comments

Comments
 (0)