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

Ux for new developers #1071

Merged
merged 14 commits into from
Jun 17, 2024
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and [building easy-to-read messages ready to be sent to the scanned organization

If you want to use additional modules that weren't included here due to non-BSD-compatible licenses, browse to the [Artemis-modules-extra](https://github.com/CERT-Polska/Artemis-modules-extra) repository.

If you work as a developer and you want to modify code, you have to do some modifications ⮕ **[Developers](#develop)**
Copy link
Member

Choose a reason for hiding this comment

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

can all these changes be put in one place? e.g. ./scripts/start_develop that runs scripts/start with some tweaks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe create docker-compose.prod.yaml and Dockerfile.prod and put as a variable in scritps/start_develop?

Copy link
Member

Choose a reason for hiding this comment

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

yes, but .dev ;)



**Artemis is experimental software, under active development - use at your own risk.**

To chat about Artemis, join the Discord server:
Expand Down Expand Up @@ -43,9 +46,16 @@ The possibility to automatically prepare such reports enabled us to notify entit
## Screenshots
![Artemis - scan](.github/screenshots/scan.png)

<a name="develop"></a>
## Development
If you want to develop Artemis, remember to change the [Docker Compose file](https://github.com/CERT-Polska/Artemis/blob/main/docker-compose.yaml#L7) so that
If you want to develop Artemis, remember to change the Docker Compose file in two places.
- **[First modification](https://github.com/CERT-Polska/Artemis/blob/main/docker-compose.yaml#L7)** so that
the Artemis image is built locally (from the code you are changing) not downloaded from Docker Hub.
- **[Second modification](https://github.com/CERT-Polska/Artemis/blob/main/docker-compose.yaml#L100)** to do
modifications on the local machine.

To provide reloading entire web app you have to use **[cmd command](https://github.com/CERT-Polska/Artemis/blob/main/docker/Dockerfile#L30)** with *"--reload"* option.
You will be able to see the results of code modifications on the page without reloading the entire container.

### Tests
To run the tests, use:
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ x-artemis-build-or-image:
# not one downloaded from Docker Hub:
#
# build:
# context: .
# dockerfile: docker/Dockerfile
# context: .
# dockerfile: docker/Dockerfile

services:
redis:
Expand Down Expand Up @@ -97,6 +97,8 @@ services:
ports: ["5000:5000"]
restart: always
volumes:
# Add new volume to modify local Artemis source code to see changes on website.
# - ./:/opt
- data-web:/data
- ./docker/karton.ini:/etc/karton/karton.ini:ro
- ./output/autoreporter/:/opt/output/autoreporter
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ COPY "artemis/" "artemis/"
COPY "static/" "static/"
COPY "templates/" "templates/"

# Add "--reload" option to see changes on website without reloading web container.
# CMD ["uvicorn", "artemis.main:app", "--host", "0.0.0.0", "--port", "5000", "--reload"]
CMD ["uvicorn", "artemis.main:app", "--host", "0.0.0.0", "--port", "5000"]
Loading