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

chore: Migration of Open Food Facts from off1 (bare metal) to off2 (proxmox) #8827

Merged
merged 140 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
cd8d9a3
chore: html/data is data only
alexgarel Aug 9, 2023
c4aa53c
fix: enable upload of big files
alexgarel Aug 9, 2023
cf0b20f
chore: add some config files
alexgarel Aug 10, 2023
cb9040e
chore: add some config files
alexgarel Aug 10, 2023
19c20ce
chore: wip on a script to verify prod deployment symlinks
alexgarel Aug 9, 2023
26e411c
chore: progress on off2 migration
alexgarel Aug 10, 2023
3c93272
fix: use right location for users_emails.sto
alexgarel Aug 11, 2023
ea734b6
fix: narrow shared volumes between pro and public instance
alexgarel Aug 11, 2023
a004a74
chore: wip on verify symlinks
alexgarel Aug 11, 2023
7d24e4a
refactor: move scripts around
alexgarel Aug 11, 2023
15496f9
fix: simplify carrefour script and prepare to run it directly on off-pro
alexgarel Aug 11, 2023
9ed266d
chore: fix file linking in docker entrypoint
alexgarel Aug 13, 2023
eb104c6
refactor: moved some scripts to obsolete
alexgarel Aug 13, 2023
ddf95c6
feat: introduce a Paths module and use it
alexgarel Aug 13, 2023
20557ae
chore: archived fleurymichon script
alexgarel Aug 14, 2023
12c3fc2
chore: remove duplicate in gitignore
alexgarel Aug 14, 2023
ba9a1b4
chore: Move html/files to html/files_resources
alexgarel Aug 14, 2023
2c14490
chore: files directory does not exists
alexgarel Aug 14, 2023
4c558a3
ci: restore generate perl doc
alexgarel Aug 14, 2023
4dcd9bd
build: fix files creation
alexgarel Aug 14, 2023
5720a35
ci: fix doc generation
alexgarel Aug 14, 2023
ebf503c
ci: fix doc generation
alexgarel Aug 14, 2023
bb6e699
refactor: perltidy
alexgarel Aug 14, 2023
22179c0
refactor: fix per_critic
alexgarel Aug 14, 2023
ee4d70a
chore: push usda old dl script
alexgarel Aug 14, 2023
86ae887
build: remove empty folders to be able to use symlinks in production …
alexgarel Aug 14, 2023
f867a57
build: add more dependencies
alexgarel Aug 14, 2023
ea1c0c7
chore: Empty-Commit to force rebuild
alexgarel Aug 16, 2023
4e30db9
build: add debug on cpanm failure
alexgarel Aug 16, 2023
d07c19b
build: try to fix dependecies in cpanfile
alexgarel Aug 16, 2023
3e88a69
build: build-cache is now considered data
alexgarel Aug 16, 2023
05f5a6f
build: fix typo in Dockerfile
alexgarel Aug 16, 2023
1970c4c
fix: add some config files for off-pro logs
alexgarel Aug 16, 2023
bcd7916
chore: better gitignore
alexgarel Aug 16, 2023
f2d6e3e
ci: fix transient error with codecov action
alexgarel Aug 16, 2023
3b7447e
build: trying to problem with perl dependency
alexgarel Aug 16, 2023
3f1c8f6
build: trying to problem with perl dependency
alexgarel Aug 16, 2023
7e47f88
chore: typos in comments
alexgarel Aug 16, 2023
f5cbc40
build: small refactor in docker-compose
alexgarel Aug 16, 2023
99df954
build: add forgotten external volume creation
alexgarel Aug 16, 2023
440fba0
Merge branch 'main' into off-off2-migration
alexgarel Aug 16, 2023
02c2110
build: fix Dockerfile
alexgarel Aug 16, 2023
a44ea9f
ci: add debug info if make dev fails
alexgarel Aug 17, 2023
8eb5536
build: serve files_resources as files in nginx
alexgarel Aug 17, 2023
ef59889
build: new nginx configuration for production
alexgarel Aug 17, 2023
c2cac5d
chore: add nginx and apache2 conf files
alexgarel Aug 21, 2023
d2a5379
build: added systemd units
alexgarel Aug 21, 2023
249afd5
build: apache2 log rotate configuration
alexgarel Aug 21, 2023
055f30f
Merge branch 'main' into off-off2-migration
alexgarel Aug 22, 2023
492b696
ci: fixing make dev
alexgarel Aug 22, 2023
729c374
chore: add systemctl services for minion andt cloud_vision_ocr
alexgarel Aug 25, 2023
3f5ff87
fix: add failure notification on minion and cloud_vision services
alexgarel Aug 25, 2023
ebee48c
fix: some fixes on paths
alexgarel Aug 29, 2023
5062358
fix: use internal get_remote_proxy_address
alexgarel Aug 29, 2023
d774940
chore: nginx proxy corrections
alexgarel Aug 29, 2023
97b0f68
Merge branch 'main' into off-off2-migration
alexgarel Aug 30, 2023
977e8aa
fix: symlink for data folder
alexgarel Aug 30, 2023
8018ef4
chore: small fixes
alexgarel Aug 30, 2023
d2944ed
fix: fix off.locations-redirects.include location
alexgarel Aug 30, 2023
74ce0f8
refactor: silence criticism ;-)
alexgarel Aug 31, 2023
e6478b9
build: create folders before running first commands
alexgarel Aug 31, 2023
b8f2899
ci: trying to fix tests
alexgarel Aug 31, 2023
0491145
Merge branch 'main' into off-off2-migration
alexgarel Sep 1, 2023
0472f03
ci: fix test run
alexgarel Sep 1, 2023
555f8a1
chore: longer apache timeout
Sep 4, 2023
eb86bc3
chore: new config for madenearme
alexgarel Sep 5, 2023
4ec943f
chore: fix access_log name
alexgarel Sep 8, 2023
30ebff1
chore: use systemd for madenearme generation
alexgarel Sep 8, 2023
7466624
chore: progress on import scripts migration
alexgarel Sep 8, 2023
af31422
fix: fix sugar_check
alexgarel Sep 11, 2023
49167ee
ci: fix spelling in POD
alexgarel Sep 11, 2023
cea1f27
chore: new howmuchsugar configuration
alexgarel Sep 11, 2023
98765e6
chore: small fix in sugar_random
alexgarel Sep 11, 2023
17fd7eb
chore: only one conf and scripts for how much sugar
alexgarel Sep 11, 2023
0bef3ff
chore: fix howmuchsugar config
alexgarel Sep 11, 2023
b94d721
fix: make agena and equadis work on off2 reinstall
alexgarel Sep 14, 2023
4cfed02
fix: off-pro logs config
alexgarel Sep 14, 2023
22f5f61
fix: more evolution of script for off2
alexgarel Sep 14, 2023
1e10c78
chore: porting run_agena3000_import.sh and run_equadis_import.sh to m…
alexgarel Sep 20, 2023
19bef2c
test: add a bash test for imports_utils
alexgarel Sep 20, 2023
c598c76
Merge branch 'main' into off-off2-migration
alexgarel Sep 20, 2023
9abd33c
refactor: perl lint
alexgarel Sep 20, 2023
119c4c6
fix: wip on carrefour script
alexgarel Sep 20, 2023
7fa8814
Merge branch 'main' into off-off2-migration
alexgarel Oct 11, 2023
a53ae6a
fix: disable Missions.pm from writing to lang/xx/texts
alexgarel Oct 16, 2023
bd97e17
fix: put stats files in public data folder
alexgarel Oct 17, 2023
2372f26
refactor: simplify Carrefour import for off2 migration (#9121)
stephanegigandet Oct 17, 2023
706e0ec
test: fix tests
alexgarel Oct 17, 2023
83dbb54
Merge branch 'main' into off-off2-migration
alexgarel Nov 8, 2023
b654ab3
fix: fix images path in run_ocr.py
alexgarel Nov 21, 2023
c9d7d68
build(deps-dev): bump eslint from 8.52.0 to 8.53.0 (#9246)
dependabot[bot] Nov 8, 2023
d5290b3
chore: added acidity (#9266)
aleene Nov 9, 2023
091c9e7
taxonomy: added anses tag in additives, added one allergen (#9265)
benbenben2 Nov 9, 2023
4c0ecde
fix: set caching headers for assetlinks.json (#9270)
stephanegigandet Nov 9, 2023
659933f
build(deps-dev): bump @babel/core from 7.23.0 to 7.23.3 (#9275)
dependabot[bot] Nov 9, 2023
9575800
build(deps): bump @snyk/protect from 1.1238.0 to 1.1242.0 (#9274)
dependabot[bot] Nov 9, 2023
25e3bc0
fix: broken convert_gs1_xml_to_json_in_dir.pl (#9280)
stephanegigandet Nov 10, 2023
c8bc9db
ci: labeler (#9283)
teolemon Nov 10, 2023
b992b8b
build(deps): bump @snyk/protect from 1.1242.0 to 1.1243.0 (#9281)
dependabot[bot] Nov 10, 2023
54f0e90
fix: labeler emojis (#9292)
teolemon Nov 10, 2023
40323d0
fix: merge conflicts (#9286)
teolemon Nov 10, 2023
81797ae
fix: labeler (#9296)
teolemon Nov 12, 2023
3bac8ba
chore: Group dependabot updates (#9299)
hangy Nov 12, 2023
8293a98
fix: quantities starting with a dot .33L (#9284)
stephanegigandet Nov 13, 2023
3340926
fix: parsing of beef meat from animals fed without GMO (#9307)
stephanegigandet Nov 13, 2023
81505b3
chore: cache rule for assetlinks in nginx docker (#9290)
alexgarel Nov 14, 2023
d2fc609
feat: Enable Org Admins to View and Modify Member Admin Status (#8840)
MonalikaPatnaik Nov 14, 2023
3bdcb31
taxonomy: insert AOP Isigny en Bresse creams under proper parent (#9319)
OpenChris Nov 15, 2023
525e600
feat: feat_upd_vlabel_logo (#9318)
benbenben2 Nov 15, 2023
efa54ff
fix: fix_avoid_eiweiss_false_positive_for_allergens (#9317)
benbenben2 Nov 15, 2023
2779afe
feat: add dq error for product quantity above 30kg (#9316)
benbenben2 Nov 15, 2023
72e01f5
taxonomy: update Spanish sentences (processing.txt & preservation.txt…
duhow Nov 15, 2023
f87ea61
build(deps): bump crowdin/github-action from 1.14.1 to 1.15.1 (#9322)
dependabot[bot] Nov 15, 2023
e9c2311
build(deps): bump @snyk/protect from 1.1243.0 to 1.1245.0 (#9314)
dependabot[bot] Nov 15, 2023
850b25a
fix: /.well-known/change-password (#9285)
stephanegigandet Nov 15, 2023
b316583
build(deps-dev): bump the gulp group with 7 updates (#9300)
dependabot[bot] Nov 15, 2023
2cfb2e0
chore: new GS1 field values (#9282)
stephanegigandet Nov 16, 2023
1286560
feat: set max percent of sugar and salt ingredients based on nutritio…
stephanegigandet Nov 16, 2023
63a15a1
taxonomy: German allergen synonyms (#9327)
moon-rabbitOFF Nov 16, 2023
3655f69
fix: count ingredients with specified percent (#9272)
stephanegigandet Nov 16, 2023
aa173f8
taxonomy: added Hass avocado in taxonomy (#9245)
benbenben2 Nov 16, 2023
affed9d
feat: adding German plurals to the oils in Ingredients.pm (#9304)
moon-rabbitOFF Nov 16, 2023
c1f3820
fix: add symbolic links for donation (#9331)
teolemon Nov 17, 2023
72979bd
chore: taxonomy updates week 44 (categories and nutrients) (#9241)
aleene Nov 17, 2023
2a662dc
build(deps): bump @snyk/protect from 1.1245.0 to 1.1248.0 (#9334)
dependabot[bot] Nov 17, 2023
dea0a6b
build(deps): bump crowdin/github-action from 1.15.1 to 1.15.2 (#9335)
dependabot[bot] Nov 17, 2023
97ca515
feat: improvements to parsing of ingredient with labels (#9330)
stephanegigandet Nov 18, 2023
1b6fa53
taxonomy: breaded halloumi (#9338)
moon-rabbitOFF Nov 19, 2023
ac672e5
taxonomy: biscuit mixes (#9341)
moon-rabbitOFF Nov 19, 2023
ad85795
taxonomy: Added unknown Croatian ingredients to the taxonomy (part 8)…
benbenben2 Nov 20, 2023
bbb396e
chore: repairs in categories taxonomy - week 39 (#9061)
aleene Nov 20, 2023
77a3a03
feat: refactor to allow unlimited facets - WIP (#9332)
stephanegigandet Nov 20, 2023
df20e9c
feat: dq_petfood_beauty_brands (#9340)
benbenben2 Nov 20, 2023
1ed9e89
taxonomy: improvements (#9310)
aleene Nov 20, 2023
d919f3c
build(deps): bump @snyk/protect from 1.1248.0 to 1.1249.0 (#9343)
dependabot[bot] Nov 20, 2023
72f2126
build(deps-dev): bump the lint group with 4 updates (#9344)
dependabot[bot] Nov 20, 2023
1ec7e44
fix: fix user in apache2 logrotate
alexgarel Nov 21, 2023
6169c50
Merge branch 'main' into off-off2-migration
alexgarel Nov 21, 2023
899e2d0
build: move attributes svg to a specific dist directory
alexgarel Nov 22, 2023
503cbc4
chore: update tests results
alexgarel Nov 22, 2023
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
7 changes: 3 additions & 4 deletions .github/workflows/generate-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- "docs/**"
- ".github/workflows/generate-doc.yml"
- "mkdocs.yml"
- "html/files/doc/perl/**"
push:
# on merge to main, build and publish
branches: [ "main" ]
Expand Down Expand Up @@ -38,10 +37,10 @@ jobs:

- name: Run generate_perl_html_doc_from_pod.pl
run: |
perl -CS -I lib scripts/generate_perl_html_doc_from_pod.pl && \
# and copy to target directory
rm -rf gh_pages/dev/ref-perl-pod && \
mv html/files/doc/perl gh_pages/dev/ref-perl-pod
mkdir gh_pages/dev/ref-perl-pod && \
cp docs/assets/simple.min.css gh_pages/dev/ref-perl-pod && \
perl -CS -I lib scripts/generate_perl_html_doc_from_pod.pl gh_pages/dev/ref-perl-pod

# DISABLED: in favor of rapidoc
# generating OpenAPI documentation with redocly
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ jobs:
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "openfoodfacts-server/backend:dev"
- name: set right UID and GID in .envrc
run: |
rm -f .envrc
echo "export USER_UID=$(id -u)" >> .envrc
echo "export USER_GID=$(id -g)" >> .envrc
- name: Test make dev
run: |
make dev
make status
- name: Test all is running
run: make livecheck
run: make livecheck || ( tail -n 300 logs/apache2/*error*log; docker-compose logs; false )
- name: test clean
run: make hdown
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
id=$(docker create $image_name)
docker cp -a $id:/opt/product-opener/html/css/dist/ /tmp/frontend-dist/css/
docker cp -a $id:/opt/product-opener/html/images/icons/dist/ /tmp/frontend-dist/icons/
docker cp -a $id:/opt/product-opener/html/images/attributes/dist/ /tmp/frontend-dist/attributes/
docker cp -a $id:/opt/product-opener/html/js/dist/ /tmp/frontend-dist/js/
docker rm -v $id
# make a tar
Expand Down
42 changes: 35 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ po/site-specific
tests/unit/outputs/
tests/integration/outputs/

# local configs, most of them are link to files in conf/ depending on instance
/html/.well-known/apple-*
/log.conf
/minion_log.conf

# data dirs - we shall not mix data and git files, as it makes deployments/updates difficult
/build-cache
/debug
/deleted.images
/dist
/logs
/new_images
/orgs
/products
/tmp
/users
/imports
/lang
/html/dump
/html/files
/html/data
/html/exports
/deleted_private_products
/deleted_products
/deleted_products_images
/export_files

# Images
/html/images/products


# Local files
.DS_Store?
._*
Expand Down Expand Up @@ -46,13 +77,10 @@ html/bower_components
local

# Front build
html/css/dist
html/js/dist
html/images/icons/dist
html/images/attributes/*.svg

# Images
html/images/products/*
/html/css/dist
/html/js/dist
/html/images/icons/dist
/html/images/attributes/dist

# Don't store helm dependencies in our git repo
docker/productopener/charts
Expand Down
33 changes: 27 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,27 @@ RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt set -x && \
apache2 \
apt-utils \
cpanminus \
# being able to build things
g++ \
gcc \
less \
libapache2-mod-perl2 \
# libexpat1-dev \
make \
gettext \
wget \
# images processing
imagemagick \
graphviz \
tesseract-ocr \
# ftp client
lftp \
# some compression utils
gzip \
tar \
unzip \
zip \
# useful to send mail
mailutils \
# perlmagick \
#
# Packages from ./cpanfile:
Expand Down Expand Up @@ -146,7 +156,9 @@ RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt set -x && \
# gnu readline
libreadline-dev \
# IO::AIO needed by Perl::LanguageServer
libperl-dev
libperl-dev \
# needed to build Apache2::Connection::XForwardedFor
libapache2-mod-perl2-dev

# Run www-data user as host user 'off' or developper uid
ARG USER_UID
Expand All @@ -166,7 +178,11 @@ WORKDIR /tmp
COPY ./cpanfile* /tmp/
# Add ProductOpener runtime dependencies from cpan
RUN --mount=type=cache,id=cpanm-cache,target=/root/.cpanm \
cpanm $CPANMOPTS --notest --quiet --skip-satisfied --local-lib /tmp/local/ --installdeps .
# first install some dependencies that are not well handled
cpanm --notest --quiet --skip-satisfied --local-lib /tmp/local/ "Apache::Bootstrap" && \
cpanm $CPANMOPTS --notest --quiet --skip-satisfied --local-lib /tmp/local/ --installdeps . \
# in case of errors show build.log, but still, fail
|| ( for f in /root/.cpanm/work/*/build.log;do echo $f"= start =============";cat $f; echo $f"= end ============="; done; false )

######################
# backend production image stage
Expand All @@ -189,20 +205,25 @@ RUN \
RUN \
mkdir -p var/run/apache2/ && \
chown www-data:www-data var/run/apache2/ && \
for path in data html_data users products product_images orgs new_images logs tmp; do \
for path in data html_data users products product_images orgs logs new_images deleted_products_images reverted_products deleted_private_products translate deleted_products deleted.images import_files tmp build-cache/taxonomies debug; do \
mkdir -p /mnt/podata/${path}; \
done && \
chown www-data:www-data -R /mnt/podata && \
# Create symlinks of data files that are indeed conf data in /mnt/podata (because we currently mix data and conf data)
# NOTE: do not changes those links for they are in a volume, or handle migration in entry-point
for path in data-default external-data emb_codes ingredients madenearme packager-codes po taxonomies templates build-cache; do \
for path in data-default external-data emb_codes ingredients madenearme packager-codes po taxonomies templates; do \
ln -sf /opt/product-opener/${path} /mnt/podata/${path}; \
done && \
# Create some necessary files to ensure permissions in volumes
mkdir -p /opt/product-opener/html/data/ && \
mkdir -p /opt/product-opener/html/data/taxonomies/ && \
mkdir -p /opt/product-opener/html/images/ && \
mkdir -p /opt/product-opener/html/images/products && \
chown www-data:www-data -R /opt/product-opener/html/ && \
# inter services directories (until we get a real solution)
for service in obf off opf opff; do \
mkdir -p /srv/$service; \
chown www-data:www-data -R /srv/$service; \
done && \
# logs dir
mkdir -p /var/log/apache2/ && \
chown www-data:www-data -R /var/log
Expand Down
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ dev: hello build init_backend _up import_sample_data create_mongodb_indexes refr
edit_etc_hosts:
@grep -qxF -- "${HOSTS}" /etc/hosts || echo "${HOSTS}" >> /etc/hosts

create_folders:
# create some folders to avoid having them owned by root (when created by docker compose)
@echo "🥫 Creating folders before docker-compose use them."
mkdir -p logs/apache2 logs/nginx debug || ( whoami; ls -l . ; false )

# TODO: Figure out events => actions and implement live reload
# live_reload:
# @echo "🥫 Installing when-changed …"
Expand Down Expand Up @@ -119,7 +124,7 @@ _up:
${DOCKER_COMPOSE} up -d 2>&1
@echo "🥫 started service at http://openfoodfacts.localhost"

up: build _up
up: build create_folders _up

down:
@echo "🥫 Bringing down containers …"
Expand Down Expand Up @@ -156,7 +161,7 @@ tail:
@echo "🥫 Reading logs (Apache2, Nginx) …"
tail -f logs/**/*

codecov_prepare:
codecov_prepare: create_folders
@echo "🥫 Preparing to run code coverage…"
mkdir -p cover_db
${DOCKER_COMPOSE_TEST} run --rm backend cover -delete
Expand All @@ -173,13 +178,13 @@ coverage_txt:
#----------#
# Services #
#----------#
build_lang:
build_lang: create_folders
@echo "🥫 Rebuild language"
# Run build_lang.pl
# Languages may build taxonomies on-the-fly so include GITHUB_TOKEN so results can be cached
${DOCKER_COMPOSE} run --rm -e GITHUB_TOKEN=${GITHUB_TOKEN} backend perl -I/opt/product-opener/lib -I/opt/perl/local/lib/perl5 /opt/product-opener/scripts/build_lang.pl

build_lang_test:
build_lang_test: create_folders
# Run build_lang.pl in test env
${DOCKER_COMPOSE_TEST} run --rm -e GITHUB_TOKEN=${GITHUB_TOKEN} backend perl -I/opt/product-opener/lib -I/opt/perl/local/lib/perl5 /opt/product-opener/scripts/build_lang.pl

Expand Down Expand Up @@ -243,14 +248,14 @@ lint: lint_perltidy
tests: build_lang_test unit_test integration_test

# add COVER_OPTS='-e HARNESS_PERL_SWITCHES="-MDevel::Cover"' if you want to trigger code coverage report generation
unit_test:
unit_test: create_folders
@echo "🥫 Running unit tests …"
${DOCKER_COMPOSE_TEST} up -d memcached postgres mongodb
${DOCKER_COMPOSE_TEST} run ${COVER_OPTS} -T --rm backend prove -l --jobs ${CPU_COUNT} -r tests/unit
${DOCKER_COMPOSE_TEST} stop
@echo "🥫 unit tests success"

integration_test:
integration_test: create_folders
@echo "🥫 Running integration tests …"
# we launch the server and run tests within same container
# we also need dynamicfront for some assets to exists
Expand All @@ -268,14 +273,15 @@ test-stop:

# usage: make test-unit test=test-name.t
# you can add args= to pass options, like args="-d" to debug
test-unit: guard-test
test-unit: guard-test create_folders
@echo "🥫 Running test: 'tests/unit/${test}' …"
${DOCKER_COMPOSE_TEST} up -d memcached postgres mongodb
${DOCKER_COMPOSE_TEST} run --rm backend perl ${args} tests/unit/${test}

# usage: make test-int test=test-name.t
# to update expected results: make test-int test="test-name.t --update-expected-results"
test-int: guard-test # usage: make test-int test=test-file.t
# you can add args= to pass options, like args="-d" to debug
test-int: guard-test create_folders
@echo "🥫 Running test: 'tests/integration/${test}' …"
${DOCKER_COMPOSE_TEST} up -d memcached postgres mongodb backend dynamicfront incron minion
${DOCKER_COMPOSE_TEST} exec backend perl ${args} tests/integration/${test}
Expand Down Expand Up @@ -386,6 +392,9 @@ create_external_volumes:
# local data
docker volume create --driver=local -o type=none -o o=bind -o device=${DOCKER_LOCAL_DATA}/data ${COMPOSE_PROJECT_NAME}_html_data
docker volume create --driver=local -o type=none -o o=bind -o device=${DOCKER_LOCAL_DATA}/podata ${COMPOSE_PROJECT_NAME}_podata
# note for this one, it should be shared with pro instance in the future
docker volume create --driver=local -o type=none -o o=bind -o device=${DOCKER_LOCAL_DATA}/export_files ${COMPOSE_PROJECT_NAME}_export_files


create_external_networks:
@echo "🥫 Creating external networks (production only) …"
Expand Down
7 changes: 0 additions & 7 deletions build-cache/taxonomies/README.md

This file was deleted.

5 changes: 3 additions & 2 deletions cgi/change_password.pl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use CGI::Carp qw(fatalsToBrowser);

use ProductOpener::Config qw/:all/;
use ProductOpener::Paths qw/:all/;
use ProductOpener::Store qw/:all/;
use ProductOpener::Display qw/:all/;
use ProductOpener::Users qw/:all/;
Expand All @@ -51,7 +52,7 @@
my @errors = ();

if ($ENV{'REQUEST_METHOD'} eq 'POST') {
my $user_file = "$data_root/users/" . get_string_id_for_lang('no_language', $User_id) . '.sto';
my $user_file = "$BASE_DIRS{USERS}/" . get_string_id_for_lang('no_language', $User_id) . '.sto';
my $user_ref = retrieve($user_file);
if (not(defined $user_ref)) {
push @errors, 'undefined user';
Expand Down Expand Up @@ -83,7 +84,7 @@
}
else {
$user_ref->{encrypted_password} = create_password_hash(encode_utf8(decode utf8 => single_param('password')));
store("$data_root/users/$User_id.sto", $user_ref);
store("$BASE_DIRS{USERS}/$User_id.sto", $user_ref);
$template_data_ref->{success} = 1;
}
}
Expand Down
8 changes: 7 additions & 1 deletion cgi/display.pl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@
display_properties($request_ref);
}
elsif (defined $request_ref->{text}) {
display_text($request_ref);
if ($request_ref->{text} =~ /^products_stats/) {
display_stats($request_ref);
}
else {
# note: this also displays the index or index-pro pages
display_text($request_ref);
}
}
elsif (defined $request_ref->{mission}) {
display_mission($request_ref);
Expand Down
3 changes: 2 additions & 1 deletion cgi/import_file_job_status.pl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use CGI::Carp qw(fatalsToBrowser);

use ProductOpener::Config qw/:all/;
use ProductOpener::Paths qw/:all/;
use ProductOpener::Store qw/:all/;
use ProductOpener::Display qw/:all/;
use ProductOpener::Users qw/:all/;
Expand Down Expand Up @@ -75,7 +76,7 @@
}
else {

$import_files_ref = retrieve("$data_root/import_files/${Owner_id}/import_files.sto");
$import_files_ref = retrieve("$BASE_DIRS{IMPORT_FILES}/${Owner_id}/import_files.sto");

if ((not defined $import_files_ref) or (not defined $import_files_ref->{$file_id})) {
$data{error} = "file_id_not_found";
Expand Down
Loading
Loading