Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev(debug): complete dev environment to debug/code easily #68

Merged
merged 21 commits into from
Jun 8, 2024

Conversation

yarysp
Copy link
Contributor

@yarysp yarysp commented May 16, 2024

To help develop reNgine I've made 2 environments :

  • docker-compose.dev.yml :
    This docker compose set up all the things to activate debug tools : Django debug toolbar, remote debug (disabled by default) via VSCode/Python Debugger extensions, more debug information for Celery in make logs
    It uses Django development server
    If you activate Remote debug, there are 2 behaviors, depending on whether you are debugging the webUI or the tasks
    • webUI : Attach the VSCode debugguer to the 5678 port, set a break point, browse on the webUI, it stops when the breakpoint is reached
    • Celery : It goes in monotask, only 1 concurrency thread.
      And when you launch task from the webUI, it hangs on the first line of the InitiateScan or InitiateSubscan tasks and wait for the VSCode debugger to attach to 5679 port to step debug inside the task

image

  • docker-compose.yml
    This one is the production environment, it uses gunicorn as web server instead of the Django development server

I've added the necessary command in MakeFile to easily startup dev or prod environment

To start dev

make dev_up

To start prod

make up

To restart in dev from prod

make down
make dev_up

To restart in prod from dev

make dev_down
make up

@yarysp yarysp changed the title Complete dev environment to debug/code easily (debug): Complete dev environment to debug/code easily May 16, 2024
@yarysp yarysp changed the title (debug): Complete dev environment to debug/code easily dev(debug): Complete dev environment to debug/code easily May 16, 2024
@yarysp yarysp marked this pull request as draft May 16, 2024 21:12
@yarysp yarysp marked this pull request as draft May 16, 2024 21:12
@yarysp yarysp self-assigned this May 21, 2024
@yarysp yarysp added the enhancement New feature or request label May 21, 2024
@psyray psyray marked this pull request as ready for review May 27, 2024 22:01
@psyray
Copy link
Contributor

psyray commented May 27, 2024

Tests done, all is working well

Django debug toolbar
image

@psyray psyray requested a review from AnonymousWP May 27, 2024 22:07
@AnonymousWP AnonymousWP changed the title dev(debug): Complete dev environment to debug/code easily dev(debug): complete dev environment to debug/code easily May 29, 2024
Copy link
Member

@AnonymousWP AnonymousWP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Just a few nitpicks.

Makefile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
psyray and others added 2 commits June 3, 2024 16:06
Co-authored-by: Anonymoussaurus <50231698+AnonymousWP@users.noreply.github.com>
install.sh Outdated Show resolved Hide resolved
@AnonymousWP
Copy link
Member

If there's an issue of this feature, then please link it.

@psyray
Copy link
Contributor

psyray commented Jun 7, 2024

PR rebased on latest master version
Ready to merge

Copy link
Member

@AnonymousWP AnonymousWP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnonymousWP AnonymousWP merged commit bf61bed into Security-Tools-Alliance:master Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants