Skip to content

Core mis #340

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

Open
wants to merge 50 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6af3701
Update openimis.json
dborowiecki May 26, 2023
5935c04
Update openimis.json (#142)
May 29, 2023
557d604
CM-97: fixed exception handler to process 401 Unathorized
sniedzielski May 29, 2023
c850615
CM-146: add tasks_management module (#155)
Jun 21, 2023
ba5d920
CM-152: added backend module for reporting in openSearch to coreMIS (…
sniedzielski Jun 25, 2023
c7b52c7
Update openimis.json
dborowiecki May 26, 2023
597d143
Update openimis.json (#142)
May 29, 2023
5b78168
CM-97: fixed exception handler to process 401 Unathorized
sniedzielski May 29, 2023
374df58
CM-146: add tasks_management module (#155)
Jun 21, 2023
faa2a18
CM-152: added backend module for reporting in openSearch to coreMIS (…
sniedzielski Jun 25, 2023
280f365
Merge branch 'coreMIS' of https://github.com/openimis/openimis-be_py …
dborowiecki Jun 27, 2023
6db9890
Merge branch 'develop' into coreMIS
dborowiecki Jul 11, 2023
36861a9
Added payment_cycle and calcrule_social_protection to openimis.josn (…
malinowskikam Jul 25, 2023
8a03a82
added backend 'payroll' module (#165)
sniedzielski Aug 7, 2023
c01cb6b
Merge develop into coreMIS (#169)
malinowskikam Aug 17, 2023
c67e91f
CM-269: Added opensearch dsl library (#181)
sniedzielski Oct 2, 2023
ad981c4
CM-269: added information to README about openSearch (#182)
sniedzielski Oct 2, 2023
55e0c7c
CM-269: fixing openSearch auth settings (#183)
sniedzielski Oct 2, 2023
e22ac9a
CM-446: added deduplication to openIMIS module list in json (#196)
sniedzielski Jan 11, 2024
049821f
added validation rule module (#197)
sniedzielski Jan 19, 2024
e2eb961
enabled individual import demo
malinowskikam Jan 25, 2024
acea8e8
change-individual-branch: change to develop (#200)
Jan 30, 2024
0fff41d
Change individual branch (#201)
Jan 30, 2024
1147d76
Change individual branch (#202)
Jan 30, 2024
c288a37
change branch name (#203)
Jan 30, 2024
fe247e8
OM-503 Added global storage
malinowskikam Feb 9, 2024
c87efa3
Merge pull request #206 from openimis/feature/CM-503
delcroip Feb 9, 2024
ba13c1c
changed branch individual to develop
sniedzielski Feb 19, 2024
a230e09
hotfix: create MEDIAR_ROOT directory (#210)
Feb 27, 2024
2638b9e
CM-855: add grievance_social_protection (#219)
Mar 29, 2024
1c2bee2
CQI-146: config for password policy (#246)
lruzicki May 16, 2024
c48b5fb
CQI: security fixes for password, headers, rate limiter, csrf and loc…
lruzicki Jun 4, 2024
6e9aefa
Remove modules unneeded for a basic social protection MIS setup
weilu Jun 14, 2024
06b55a1
Merge pull request #262 from weilu/rm-non-sp-modules
delcroip Jun 18, 2024
be690af
Update README with instructions to work with psql (#261)
weilu Jun 18, 2024
c7eec0f
Merge branch 'develop' into coreMIS
weilu Jul 9, 2024
e77de52
Fix django.core.exceptions.ImproperlyConfigured:
weilu Jul 11, 2024
9891cc9
Merge pull request #268 from weilu/coreMIS
delcroip Jul 16, 2024
f19a284
removing useless test batch
delcroip Jul 16, 2024
21413b4
Fix default storage backend config (#275)
weilu Jul 17, 2024
c587587
Flag if the current env is unit testing
weilu Aug 12, 2024
a215511
Merge pull request #278 from weilu/unit-test-env
delcroip Aug 12, 2024
fe0571e
hotfix: fixed CI - bumped upload articact to v4 (#285)
sniedzielski Sep 4, 2024
88cc99d
hotfix: fixed CI - bumped download articact to v4 (#288)
sniedzielski Sep 4, 2024
457715d
CM-963: added etl api backend module (#296)
sniedzielski Oct 22, 2024
444645f
hotfix: fixed cache issue
sniedzielski Oct 24, 2024
cfcb04b
Merge pull request #298 from openimis/hotfix-cache
delcroip Oct 24, 2024
59e58b8
OSB-12: added command to load fixture with unknown foreign key
sniedzielski Feb 7, 2025
7c6d9d4
Merge pull request #322 from openimis/OSB-12
delcroip Feb 13, 2025
9362f7d
changes from security audit 2024 November (#336)
sniedzielski Mar 19, 2025
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
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DJANGO_DB_LOG_HANDLER=console
#PHOTO_ROOT_PATH=<photo path>
# 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

PROJECT_NAME=dev
# set up you main domain
#DOMAIN=dev-openimis.org
Expand All @@ -51,6 +51,7 @@ 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

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

Expand All @@ -60,4 +61,4 @@ RATELIMIT_KEY=ip # Key to identify the client; 'ip' means it will use the clien
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
RATELIMIT_SKIP_TIMEOUT=False # Whether to skip rate limiting
30 changes: 15 additions & 15 deletions .github/workflows/ci_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
tar -czf openimis.tar.gz ./openimis ./current-module

- name: Upload compressed site-packages as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: site-packages
path: site-packages.tar.gz

- name: Upload build as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: code-artifacts
path: openimis.tar.gz
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
python-version: '3.10'

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: site-packages
path: /tmp/
Expand All @@ -156,7 +156,7 @@ jobs:
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: code-artifacts
path: /tmp/
Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:
python-version: '3.10'

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: site-packages
path: /tmp/
Expand All @@ -266,7 +266,7 @@ jobs:
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: code-artifacts
path: /tmp/
Expand Down Expand Up @@ -359,7 +359,7 @@ jobs:
python-version: '3.10'

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: site-packages
path: /tmp/
Expand All @@ -370,7 +370,7 @@ jobs:
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV

- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: code-artifacts
path: /tmp/
Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:
cat coverage.xml
- name: Coverage results
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: ./openimis/openIMIS/coverage
Expand All @@ -464,7 +464,7 @@ jobs:
with:
python-version: '3.10'
- name: Download site-packages artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: site-packages
path: /tmp/
Expand All @@ -475,7 +475,7 @@ jobs:
echo "SITE_PACKAGES=$SITE_PACKAGES" >> $GITHUB_ENV

- name: Download code artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: code-artifacts
path: /tmp/
Expand All @@ -498,7 +498,7 @@ jobs:
python -m flake8 $MOD_DIR
- name: Flake8 results upload
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: flake8-report.txt
path: ./openimis/flake8-report.txt
Expand Down Expand Up @@ -530,17 +530,17 @@ jobs:
echo "SONAR_EXCLUSIONS=${{ inputs.SONAR_EXCLUSIONS }}" >> $GITHUB_ENV
fi
- name: Download coverage artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: coverage.xml
path: report
- name: Download flake8 artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: flake8-report.txt
path: report
- name: Download code artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: code-artifacts
path: /tmp/
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/pgsql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Automated CI PSQL testing
# This workflow run automatically for every commit on github it checks the syntax and launch the tests.
# | grep . | uniq -c filters out empty lines and then groups consecutive lines together with the number of occurrences
on:
push:
workflow_dispatch:
inputs:
comment:
description: Just a simple comment to know the purpose of the manual build
required: false

jobs:
build:
runs-on: ubuntu-20.04
services:
pgsql:
image: postgres
env:
DB_HOST: localhost
DB_PORT: 5432
POSTGRES_DB: imis
POSTGRES_USER: postgres
POSTGRES_PASSWORD: GitHub999
ports:
- 5432:5432
# needed because the mssql container does not provide a health check
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python modules-requirements.py openimis.json > modules-requirements.txt
pip install -r modules-requirements.txt


- name: Environment info
run: |
pip list

export DBBRANCH="$([ $GITHUB_REF == 'main' ] && echo "main" || echo "develop")"

if [ ${GITHUB_REF##*/} = "develop" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
echo "Branch ${GITHUB_REF##*/}, usign ${DBBRANCH} branch for database"

git clone --depth 1 --branch $DBBRANCH https://github.com/openimis/database_postgresql.git ./sql

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/postgresql-pgdg.list > /dev/null
sudo apt-get install postgresql-client

- name: Initialize DB
run: |
echo 'set search_path to public' >> ~/.psqlrc
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/00_dump.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/02_aux_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/03_views.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/04_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/05_stored_procs.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/demo_db.sql | grep . | uniq -c

- name: Django tests
run: |
python -V
ls -l
cd openIMIS
ls -l
python manage.py test --keepdb $(jq -r '(.modules[]|.name)' ../openimis.json)
env:
SECRET_KEY: secret
DEBUG: true
DB_ENGINE: django.db.backends.postgresql
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: imis
DB_USER: postgres
DB_PASSWORD: GitHub999
#DEV_SERVER: true
SITE_ROOT: api
51 changes: 27 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
**/.idea
**/venv
**/.venv
**/.env
**/__pycache__
modules-requirements.txt
modules-tests.sh
**/.coverage
**/coverage.xml
**/coverage
**/*.log
**/*.log.*
**/*.mo
openIMIS/locale/en/LC_MESSAGES/django.mo
**/staticfiles
extracted_translations_fe
script/config.py
**/src/*
**/images/insurees
openimis-dev.json
# Except for the runConfigurations folder
!.idea/runConfigurations
**/.vscode
**/.idea
**/venv
**/.venv
**/.env
**/__pycache__
modules-requirements.txt
modules-tests.sh
**/.coverage
**/coverage.xml
**/coverage
**/*.log
**/*.log.*
**/*.mo
openIMIS/file_storage
openIMIS/locale/en/LC_MESSAGES/django.mo
**/staticfiles
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/*
# Ensure all files in runConfigurations are included
!.idea/runConfigurations/*
Loading
Loading