Skip to content

Commit

Permalink
Merge pull request #1460 from edissyum/dev
Browse files Browse the repository at this point in the history
3.3.0
  • Loading branch information
nathan30 authored Sep 3, 2024
2 parents 4742383 + ae9406e commit 5b0de5f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
7 changes: 5 additions & 2 deletions install/create_custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/instance/referencial/' WHERE docserver_id = 'REFERENTIALS_PATH'" "$databaseName"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/data/MailCollect/' WHERE docserver_id = 'MAILCOLLECT_BATCHES'" "$databaseName"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/bin/scripts/splitter_metadata/' WHERE docserver_id = 'SPLITTER_METADATA_PATH'" "$databaseName"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/bin/scripts/splitter_methods/' WHERE docserver_id = 'SPLITTER_METHODS_PATH'" "$databaseName"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path=REPLACE(path, '//' , '/')" "$databaseName"

####################
Expand All @@ -255,7 +256,7 @@ mkdir -p $customPath/instance/referencial/
mkdir -p $customPath/data/{log,MailCollect,tmp,exported_pdf,exported_pdfa}/
mkdir -p $customPath/data/log/Supervisor/
touch $customPath/data/log/OpenCapture.log
mkdir -p $customPath/bin/scripts/{verifier_workflows,splitter_workflows,MailCollect,ai}/
mkdir -p $customPath/bin/scripts/{verifier_workflows,splitter_workflows,splitter_metadata,splitter_methods,MailCollect,ai}/
mkdir -p $customPath/bin/scripts/ai/{splitter,verifier}
mkdir -p $customPath/src/backend/
touch $customPath/config/secret_key
Expand Down Expand Up @@ -302,7 +303,9 @@ cp $defaultPath/bin/scripts/purge_splitter.sh.default "$defaultPath/custom/$cust
cp $defaultPath/bin/scripts/purge_verifier.sh.default "$defaultPath/custom/$customId/bin/scripts/purge_verifier.sh"
cp $defaultPath/bin/ldap/config/config.ini.default "$defaultPath/custom/$customId/bin/ldap/config/config.ini"
cp $defaultPath/instance/config/config.ini.default "$defaultPath/custom/$customId/config/config.ini"
cp -r $defaultPath/bin/scripts/splitter_metadata "$defaultPath/custom/$customId/bin/scripts/"

cp -r $defaultPath/bin/scripts/splitter_methods/* "$defaultPath/custom/$customId/bin/scripts/splitter_methods/"
cp -r $defaultPath/bin/scripts/splitter_metadata/* "$defaultPath/custom/$customId/bin/scripts/splitter_metadata/"

sed -i "s#§§CUSTOM_ID§§#$customId#g" "$defaultPath/custom/$customId/config/config.ini"
sed -i "s#§§CUSTOM_ID§§#$customId#g" "$defaultPath/custom/$customId/src/backend/process_queue_verifier.py"
Expand Down
7 changes: 5 additions & 2 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ mkdir -p $customPath/bin/ldap/config/
mkdir -p $customPath/instance/referencial/
mkdir -p $customPath/data/{log,MailCollect,tmp,exported_pdf,exported_pdfa}/
mkdir -p $customPath/data/log/Supervisor/
mkdir -p $customPath/bin/scripts/{verifier_workflows,splitter_workflows,MailCollect,ai}/
mkdir -p $customPath/bin/scripts/{verifier_workflows,splitter_workflows,splitter_metadata,splitter_methods,MailCollect,ai}/
mkdir -p $customPath/bin/scripts/ai/{splitter,verifier}/
mkdir -p $customPath/src/backend/
touch $customPath/config/secret_key
Expand Down Expand Up @@ -394,6 +394,7 @@ export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname"
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/instance/referencial/' WHERE docserver_id = 'REFERENTIALS_PATH'" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/data/MailCollect/' WHERE docserver_id = 'MAILCOLLECT_BATCHES'" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/bin/scripts/splitter_metadata/' WHERE docserver_id = 'SPLITTER_METADATA_PATH'" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path='$customPath/bin/scripts/splitter_methods/' WHERE docserver_id = 'SPLITTER_METHODS_PATH'" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH
export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE docservers SET path=REPLACE(path, '//' , '/')" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH

export PGPASSWORD=$databasePassword && psql -U"$databaseUsername" -h"$hostname" -p"$port" -c "UPDATE workflows SET input=REPLACE(input::TEXT, '/var/share/', '/var/share/$customId/')::JSONB" "$databaseName" >>$INFOLOG_PATH 2>>$ERRORLOG_PATH
Expand Down Expand Up @@ -489,7 +490,9 @@ cp $defaultPath/bin/scripts/load_referencial.sh.default "$defaultPath/custom/$cu
cp $defaultPath/bin/scripts/purge_splitter.sh.default "$defaultPath/custom/$customId/bin/scripts/purge_splitter.sh"
cp $defaultPath/bin/scripts/purge_verifier.sh.default "$defaultPath/custom/$customId/bin/scripts/purge_verifier.sh"
cp $defaultPath/bin/scripts/load_users.sh.default "$defaultPath/custom/$customId/bin/scripts/load_users.sh"
cp -r $defaultPath/bin/scripts/splitter_metadata "$defaultPath/custom/$customId/bin/scripts/"

cp -r $defaultPath/bin/scripts/splitter_methods/* "$defaultPath/custom/$customId/bin/scripts/splitter_methods/"
cp -r $defaultPath/bin/scripts/splitter_metadata/* "$defaultPath/custom/$customId/bin/scripts/splitter_metadata/"

sed -i "s#§§CUSTOM_ID§§#$customId#g" "$defaultPath/custom/$customId/config/config.ini"
sed -i "s#§§CUSTOM_ID§§#$customId#g" "$defaultPath/custom/$customId/src/backend/process_queue_verifier.py"
Expand Down
20 changes: 10 additions & 10 deletions install/migration_bash/3.3.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ apache2Path="/etc/apache2/sites-available/"

#####################
# Add HSTS and X-Content-Type to apache2 configuration
#sed -i "s|<Directory|Header always set Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\"\n Header always set X-Content-Type-Options: nosniff\n\n <Directory|" $apache2Path/opencapture.conf
sed -i "s|<Directory|Header always set Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\"\n Header always set X-Content-Type-Options: nosniff\n\n <Directory|" $apache2Path/opencapture.conf

#####################
# Add ErrorDocument to apache2 configuration
#sed -i "s|<VirtualHost|ErrorDocument 400 /src/assets/error_pages/400.html\nErrorDocument 401 /src/assets/error_pages/401.html\nErrorDocument 403 /src/assets/error_pages/403.html\nErrorDocument 404 /src/assets/error_pages/404.html\nErrorDocument 500 /src/assets/error_pages/500.html\nErrorDocument 501 /src/assets/error_pages/501.html\nErrorDocument 502 /src/assets/error_pages/502.html\nErrorDocument 503 /src/assets/error_pages/503.html\nErrorDocument 504 /src/assets/error_pages/504.html\n\n<VirtualHost|" $apache2Path/opencapture.conf
sed -i "s|<VirtualHost|ErrorDocument 400 /src/assets/error_pages/400.html\nErrorDocument 401 /src/assets/error_pages/401.html\nErrorDocument 403 /src/assets/error_pages/403.html\nErrorDocument 404 /src/assets/error_pages/404.html\nErrorDocument 500 /src/assets/error_pages/500.html\nErrorDocument 501 /src/assets/error_pages/501.html\nErrorDocument 502 /src/assets/error_pages/502.html\nErrorDocument 503 /src/assets/error_pages/503.html\nErrorDocument 504 /src/assets/error_pages/504.html\n\n<VirtualHost|" $apache2Path/opencapture.conf

#####################
# Update default referencial JSON file
opencapturePath="/var/www/html/opencapture/"
cd $opencapturePath

#SECTIONS=$(crudini --get $opencapturePath/custom/custom.ini | sed 's/:.*//')
#for custom_name in ${SECTIONS[@]}; do
# custom_name=${custom_name//[\.\-]/_}
# custom_name=$(echo "$custom_name" | tr "[:upper:]" "[:lower:]")
# cp $opencapturePath/instance/referencial/default_referencial_supplier_index.json.default $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier_index.json 2>/dev/null
# rm -f $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier.ods
# touch $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier.csv
#done
SECTIONS=$(crudini --get $opencapturePath/custom/custom.ini | sed 's/:.*//')
for custom_name in ${SECTIONS[@]}; do
custom_name=${custom_name//[\.\-]/_}
custom_name=$(echo "$custom_name" | tr "[:upper:]" "[:lower:]")
cp $opencapturePath/instance/referencial/default_referencial_supplier_index.json.default $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier_index.json 2>/dev/null
rm -f $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier.ods
touch $opencapturePath/custom/$custom_name/instance/referencial/default_referencial_supplier.csv
done

#####################
# Update attachments docservers path
Expand Down
8 changes: 4 additions & 4 deletions install/pip-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PyJWT==2.9.0
flask==3.0.3
pypdf==4.3.1
numpy==1.26.4
pyheif==0.7.1
pyheif==0.8.0
deskew==1.5.1
pyzbar==0.1.9
qrcode==7.4.2
Expand All @@ -29,12 +29,12 @@ xlsxwriter==3.2.0
pdf2image==1.17.0
gitpython==3.1.43
imap-tools==1.7.2
flask_cors==4.0.1
flask_cors==5.0.0
fs-watcher==1.0.11
Flask-Babel==4.0.0
schwifty==2024.8.1
schwifty==2024.9.0
python-bidi==0.6.0
ultralytics==8.2.83
ultralytics==8.2.86
pytesseract==0.3.13
configparser==7.1.0
scikit-learn==1.5.1
Expand Down

0 comments on commit 5b0de5f

Please sign in to comment.