Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
dragos-dobre committed Jun 4, 2024
2 parents a4099c0 + 9b671d0 commit f1129bd
Show file tree
Hide file tree
Showing 32 changed files with 503 additions and 303 deletions.
20 changes: 19 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DJANGO_DB_LOG_HANDLER=console
# Should the database be migrated before start (entrypoint.sh - docker setup). Will be migrated anyway if $SITE_ROOT=api. Comment out for False
DJANGO_MIGRATE=True
# Should the modules be searched for scheduled tasks. Comment out for false
# SCHEDULER_AUTOSTART=True
SCHEDULER_AUTOSTART=True
PROJECT_NAME=dev
NEW_OPENIMIS_HOST=dev-openimis.org
HTTP_PORT=80
Expand All @@ -41,5 +41,23 @@ GW_BRANCH=develop
BE_BRANCH=develop
FE_BRANCH=develop

# Lockout mechanism
LOGIN_LOCKOUT_FAILURE_LIMIT=5 # Allowed login failures before lockout
LOGIN_LOCKOUT_COOLOFF_TIME=5 # Lockout duration in minutes

PASSWORD_MIN_LENGTH=8
PASSWORD_UPPERCASE=1 # Minimum number of uppercase letters
PASSWORD_LOWERCASE=1 # Minimum number of lowercase letters
PASSWORD_DIGITS=1 # Minimum number of digits
PASSWORD_SYMBOLS=1 # Minimum number of symbols
PASSWORD_SPACES=1 # Maximum number of spaces allowed

CSRF_TRUSTED_ORIGINS=http://localhost:3000,http://localhost:8000 # Define the trusted origins for CSRF protection, separated by commas

# Rate limiting settings
RATELIMIT_CACHE=default # The cache alias to use for rate limiting
RATELIMIT_KEY=ip # Key to identify the client; 'ip' means it will use the client's IP address
RATELIMIT_RATE=150/m # Rate limit (150 requests per minute)
RATELIMIT_METHOD=ALL # HTTP methods to rate limit; 'ALL' means all methods
RATELIMIT_GROUP=graphql # Group name for the rate limit
RATELIMIT_SKIP_TIMEOUT=False # Whether to skip rate limiting during c
6 changes: 3 additions & 3 deletions .github/workflows/ci_assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ jobs:
${{ runner.os }}-
- name: Install Python dependencies
working-directory: ./script
run: |
sudo apt-get update
sudo apt-get install jq
python -m pip install --upgrade pip
pip install -r requirements.txt
python modules-requirements.py openimis.json > modules-requirements.txt
pip install -r ../requirements.txt
python modules-requirements.py ../openimis.json > modules-requirements.txt
pip install --no-cache-dir -r modules-requirements.txt
export MODULES=$(jq -r '(.modules[].name)' openimis.json | xargs)
echo $modules
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ jobs:
echo "MODULE_NAME=$MODULE_NAME" >> $GITHUB_ENV
# Add or replace MODULE_NAME module in openimis.json (local version)
echo $(jq --arg name "$MODULE_NAME" 'if [.modules[].name == ($name)]| max then (.modules[] | select(.name == ($name)) | .pip)|="-e ../current-module" else .modules |= .+ [{name:($name), pip:"../current-module"}] end' openimis.json) > openimis.json
echo $(jq --arg name "$MODULE_NAME" 'if [.modules[].name == ($name)]| max then (.modules[] | select(.name == ($name)) | .pip)|="-e ../../current-module" else .modules |= .+ [{name:($name), pip:"../../current-module"}] end' openimis.json) > openimis.json
cat openimis.json
- name: Install Python dependencies
working-directory: ./openimis
working-directory: ./openimis/script
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python modules-requirements.py openimis.json > modules-requirements.txt
pip install -r ../requirements.txt
python modules-requirements.py ../openimis.json > modules-requirements.txt
cat modules-requirements.txt
pip install --no-cache-dir -r modules-requirements.txt
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ extracted_translations_fe
script/config.py
**/src/*
**/images/insurees
openimis-dev.json
# Except for the runConfigurations folder
!.idea/runConfigurations

# Ensure all files in runConfigurations are included
!.idea/runConfigurations/*
47 changes: 47 additions & 0 deletions .idea/runConfigurations/RunTestsWithSetup.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions .idea/runConfigurations/Run_Migrations_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .idea/runConfigurations/Runserver_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .idea/runConfigurations/_CreateTestDB.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .idea/runConfigurations/_TeardownTestDB.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@
},
"justMyCode": true
},
{
"name": "make migration",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/openIMIS/manage.py",
"args": ["makemigrationsy"],
"django": true,
"cwd": "${workspaceRoot}/openIMIS",
"env": {
"DB_DEFAULT": "${input:dbEngine}"
},
"justMyCode": true
},
{
"name": "Start",
"type": "python",
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ WORKDIR /openimis-be

ARG OPENIMIS_CONF_JSON
ENV OPENIMIS_CONF_JSON=${OPENIMIS_CONF_JSON}
RUN python modules-requirements.py openimis.json > modules-requirements.txt && pip install -r modules-requirements.txt

WORKDIR /openimis-be/script
RUN python modules-requirements.py ../openimis.json > modules-requirements.txt && pip install -r modules-requirements.txt
WORKDIR /openimis-be/openIMIS

# Compile messages (Exclude zh_Hans)
Expand Down
36 changes: 0 additions & 36 deletions Dockerfile_win

This file was deleted.

Loading

0 comments on commit f1129bd

Please sign in to comment.