Skip to content

Commit

Permalink
Merge branch 'main' into openchris-taxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenChris authored Jan 17, 2025
2 parents 6beb873 + c0518c1 commit e7c92b1
Show file tree
Hide file tree
Showing 522 changed files with 13,701 additions and 1,759 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,20 @@ jobs:
# see https://stackoverflow.com/a/60984318/2886726
run: |
git ls-files taxonomies/ | xargs -I{} git log -1 --date=format:%Y%m%d%H%M.%S --format='touch -t %ad "{}"' "{}" | bash
- name: Rebuild taxonomies
- name: Rebuild taxonomies for Open Food Facts (off)
run: make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Beauty Facts (obf)
run: |
source env/setenv.sh obf
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Products Facts (opf)
run: |
source env/setenv.sh opf
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Pet Food Facts (opff)
run: |
source env/setenv.sh opff
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
check_perl:
name: 🐪 Check Perl
Expand Down Expand Up @@ -229,3 +241,17 @@ jobs:
run: make livecheck || ( tail -n 300 logs/apache2/*error*log; docker compose logs; false )
- name: test clean
run: make hdown

test_deployment:
name: 🦾 Some test of deployment tools
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: verify apache2 envvars is correct
run: |
env/setenv.sh off;
sh -c ". conf/apache-2.4/off-envvars"
sh -c "APACHE_CONFDIR=/etc/apache2-priority; . conf/apache-2.4/off-envvars"
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## [2.55.0](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.54.0...v2.55.0) (2025-01-17)


### Features

* determine packaging components in contact with food ([#11238](https://github.com/openfoodfacts/openfoodfacts-server/issues/11238)) ([c5cda35](https://github.com/openfoodfacts/openfoodfacts-server/commit/c5cda35c36d0e2aaf353d286cf9f40f27ff0dc86))
* serve content without header and footer for mobile app ([#11245](https://github.com/openfoodfacts/openfoodfacts-server/issues/11245)) ([662a96b](https://github.com/openfoodfacts/openfoodfacts-server/commit/662a96b167d13add3ed1c380c0236f627ecc75c9))


### Bug Fixes

* Green-Score attributes/panels titles and subtitles ([#11244](https://github.com/openfoodfacts/openfoodfacts-server/issues/11244)) ([1eb84a5](https://github.com/openfoodfacts/openfoodfacts-server/commit/1eb84a5c26b0f5320a65bbb92656819d8e449df6))
* more positive messages for Nova 4 ([#11231](https://github.com/openfoodfacts/openfoodfacts-server/issues/11231)) ([79e63cd](https://github.com/openfoodfacts/openfoodfacts-server/commit/79e63cd2ecf5ab4a74c134ba977ef4150b0cff3b))
* Update fundraiser text to 2025 ([#11248](https://github.com/openfoodfacts/openfoodfacts-server/issues/11248)) ([b88f43e](https://github.com/openfoodfacts/openfoodfacts-server/commit/b88f43e2506325b7a11e20ed6086985a326a1369))

## [2.54.0](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.53.0...v2.54.0) (2025-01-10)


### Features

* gzip js, css, SVG icons assets ([#11208](https://github.com/openfoodfacts/openfoodfacts-server/issues/11208)) ([c0a5275](https://github.com/openfoodfacts/openfoodfacts-server/commit/c0a5275dcf73da40ecb9c1fb3d3d01dcbea9b4cb))


### Bug Fixes

* "NutriScore V2" SVGs with blank space ([#11218](https://github.com/openfoodfacts/openfoodfacts-server/issues/11218)) ([38d79e8](https://github.com/openfoodfacts/openfoodfacts-server/commit/38d79e81a6b2639b1e79744a6ec9e6c9d2db6eb3))
* avoid crash in display_orgs_table when org.created_t is not set, fix permission ([#11203](https://github.com/openfoodfacts/openfoodfacts-server/issues/11203)) ([765d796](https://github.com/openfoodfacts/openfoodfacts-server/commit/765d7965422cc836cd785e7a896548e89782f4cc))
* greenscore attribute with old ecoscore_data ([#11212](https://github.com/openfoodfacts/openfoodfacts-server/issues/11212)) ([4f596ad](https://github.com/openfoodfacts/openfoodfacts-server/commit/4f596ad3fda8393a89797d188168c36a870f56b6))
* Invalid OFF dark icon ([#11206](https://github.com/openfoodfacts/openfoodfacts-server/issues/11206)) ([f63daa8](https://github.com/openfoodfacts/openfoodfacts-server/commit/f63daa8b1da31483c79f8bfd1e832865dbd898b4))
* Nutripatrol url trailing slash removal regex ([#11204](https://github.com/openfoodfacts/openfoodfacts-server/issues/11204)) ([f42f8dd](https://github.com/openfoodfacts/openfoodfacts-server/commit/f42f8ddfb45e7d4172b11488b5bd8830133345c1))
* Nutriscore for fresh herbs ([#11112](https://github.com/openfoodfacts/openfoodfacts-server/issues/11112)) ([cdd7cf5](https://github.com/openfoodfacts/openfoodfacts-server/commit/cdd7cf5f14c4ac82704da4921c9b05bd7582dac6))
* Remove irrelevant things in Config_obf.pm ([c5d448d](https://github.com/openfoodfacts/openfoodfacts-server/commit/c5d448de8ad15dd7d7d1fc805f97d56f0fcadb9f))
* Remove irrelevant things in the Open Beauty Facts config ([#11195](https://github.com/openfoodfacts/openfoodfacts-server/issues/11195)) ([c5d448d](https://github.com/openfoodfacts/openfoodfacts-server/commit/c5d448de8ad15dd7d7d1fc805f97d56f0fcadb9f))
* remove warning in Display.pm related to Environmental Scoring ([#11172](https://github.com/openfoodfacts/openfoodfacts-server/issues/11172)) ([176fe9e](https://github.com/openfoodfacts/openfoodfacts-server/commit/176fe9eed7247fe155769b242e0bcdb860343ffb))
* Removing irrelevant fields in the Open Products Facts config ([4583ed2](https://github.com/openfoodfacts/openfoodfacts-server/commit/4583ed21f8e656f289e9ecd579ba6150db6f9646))
* Removing irrelevant fields in the Open Products Facts config ([#11202](https://github.com/openfoodfacts/openfoodfacts-server/issues/11202)) ([4583ed2](https://github.com/openfoodfacts/openfoodfacts-server/commit/4583ed21f8e656f289e9ecd579ba6150db6f9646))
* typo in ecoscore redirect ([#11213](https://github.com/openfoodfacts/openfoodfacts-server/issues/11213)) ([85fd575](https://github.com/openfoodfacts/openfoodfacts-server/commit/85fd5752f1f6954eb71eee4e2d340aea078239db))
* use ecoscore data when greenscore not available ([#11197](https://github.com/openfoodfacts/openfoodfacts-server/issues/11197)) ([5ae1273](https://github.com/openfoodfacts/openfoodfacts-server/commit/5ae1273c83babd0dfc0681707599c529f74a0047))
* warnings in producers tests ([#11190](https://github.com/openfoodfacts/openfoodfacts-server/issues/11190)) ([0588976](https://github.com/openfoodfacts/openfoodfacts-server/commit/05889765c863cfe72530c88c11774b571df8f85b))

## [2.53.0](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.52.0...v2.53.0) (2025-01-06)


Expand Down
2 changes: 1 addition & 1 deletion cgi/display_org_table.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
display_error_and_exit($request_ref, $Lang{error_no_permission}{$lc}, 401);
}

if ((not $request_ref->{admin}) or (not $User{pro_moderator})) {
if ((not $request_ref->{admin}) and (not $User{pro_moderator})) {
$log->debug("user does not have permission to view organisation list", {User_id => $User_id}) if $log->is_debug();
display_error_and_exit($request_ref, $Lang{error_no_permission}{$lc}, 403);
}
Expand Down
3 changes: 2 additions & 1 deletion conf/apache-2.4/modperl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PerlPassEnv CROWDIN_PROJECT_KEY
PerlPassEnv GEOLITE2_PATH
PerlPassEnv POSTGRES_USER
PerlPassEnv POSTGRES_PASSWORD
PerlPassEnv LOG4PERL_CONF
PerlPassEnv LOG_LEVEL_ROOT
PerlPassEnv LOG_LEVEL_MONGODB
PerlPassEnv LOG_LEVEL_RATE_LIMITER
Expand All @@ -31,4 +32,4 @@ PerlPassEnv RATE_LIMITER_BLOCKING_ENABLED
PerlPassEnv ODOO_CRM_URL
PerlPassEnv ODOO_CRM_DB
PerlPassEnv ODOO_CRM_USER
PerlPassEnv ODOO_CRM_PASSWORD
PerlPassEnv ODOO_CRM_PASSWORD
12 changes: 12 additions & 0 deletions conf/apache-2.4/mpm_prefork.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# prefork MPM

<IfModule mpm_prefork_module>
StartServers ${APACHE_MPM_START_SERVERS}
MinSpareServers ${APACHE_MPM_MIN_SPARSE_SERVERS}
MaxSpareServers ${APACHE_MPM_MAX_SPARSE_SERVERS}
MaxRequestWorkers ${APACHE_MPM_MAX_REQUEST_WORKERS}
ServerLimit ${APACHE_MPM_SERVER_LIMIT}
MaxConnectionsPerChild ${APACHE_MPM_MAX_CONN_PER_CHILD}
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
75 changes: 75 additions & 0 deletions conf/apache-2.4/off-envvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This file override the envvars of apache2
# It is an important place to tweak apache2 through environment variables
# and put some logic in them

# It will use variables
# that are set in env.<server name>
# And also the instance name

# SUFFIX can be used to tweak settings according to the instance name
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
APACHE_INSTANCE=${APACHE_CONFDIR##/etc/apache2-}
else
SUFFIX=
APACHE_INSTANCE=
fi

# we will first source the standard envvars file (if it exists)
if [ -f /etc/apache2${SUFFIX}/envvars ];
then
. /etc/apache2/envvars
fi

# now we can set our specific settings

# we use off user instead of www-data
export APACHE_RUN_USER=off
export APACHE_RUN_GROUP=off

# port - standard or priority
export APACHE2_PORT=8001
if [ "$APACHE_INSTANCE" = "priority" ]
then
export APACHE2_PORT=8002
fi

APP_DIR=/srv/$PRODUCT_OPENER_FLAVOR_SHORT

LOG4PERL_CONF=$APP_DIR/conf/$PRODUCT_OPENER_FLAVOR_SHORT-log.conf
if [ -n "$APACHE_INSTANCE" ]
then
export LOG4PERL_CONF=$APP_DIR/conf/$PRODUCT_OPENER_FLAVOR_SHORT-$APACHE_INSTANCE-log.conf
fi

# MPM settings -----------

# StartServers: number of server processes to start
export APACHE_MPM_START_SERVERS=2
# MaxRequestWorkers: maximum number of server processes allowed to start
export APACHE_MPM_MAX_REQUEST_WORKERS=20
# MaxConnectionsPerChild: maximum number of requests a server process serves
# keep this a bit low to avoid memory issues
export APACHE_MPM_MAX_CONN_PER_CHILD=100
# specific MPM settings
if [ "$PRODUCT_OPENER_FLAVOR_SHORT" = "off" ]
then
export APACHE_MPM_START_SERVERS=5
export APACHE_MPM_MAX_REQUEST_WORKERS=25
if [ "$INSTANCE_NAME" = "priority" ]
then
export APACHE_MPM_MAX_REQUEST_WORKERS=50
fi
fi
if [ "$PRODUCT_OPENER_FLAVOR_SHORT" = "off-pro" ]
then
export APACHE_MPM_MAX_REQUEST_WORKERS=10
fi
# MinSpareServers: minimum number of server processes which are kept spare
# we use StartServers value
export APACHE_MPM_MIN_SPARSE_SERVERS=${APACHE_MPM_START_SERVERS}
# MaxSpareServers: maximum number of server processes which are kept spare
# we use MinSpareServers * 2
export APACHE_MPM_MAX_SPARSE_SERVERS=$((APACHE_MPM_MIN_SPARSE_SERVERS * 2))
# corresponds to max request workers + sparse servers
export APACHE_MPM_SERVER_LIMIT=$((APACHE_MPM_MAX_REQUEST_WORKERS + APACHE_MPM_MAX_SPARSE_SERVERS))
17 changes: 0 additions & 17 deletions conf/apache-2.4/off-mpm_prefork.conf

This file was deleted.

7 changes: 0 additions & 7 deletions conf/apache-2.4/off-ports.conf

This file was deleted.

16 changes: 0 additions & 16 deletions conf/apache-2.4/off-pro-mpm_prefork.conf

This file was deleted.

7 changes: 0 additions & 7 deletions conf/apache-2.4/off-pro-ports.conf

This file was deleted.

7 changes: 0 additions & 7 deletions conf/apache-2.4/opf-ports.conf

This file was deleted.

7 changes: 0 additions & 7 deletions conf/apache-2.4/opff-ports.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8002
# APACHE2_PORT has to be passed using -D directive in systemd/apache2.service.d/override.conf
Listen ${APACHE2_PORT}

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
4 changes: 2 additions & 2 deletions conf/apache-2.4/sites-available/obf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Require all granted
<VirtualHost *>
DocumentRoot /srv/obf/html
ServerName openbeautyfacts.org
ErrorLog /srv/obf/logs/error_log
CustomLog /srv/obf/logs/access_log proxy
ErrorLog /srv/obf/logs/error_log_${APACHE2_PORT}
CustomLog /srv/obf/logs/access_log_${APACHE2_PORT} proxy
LogLevel warn
ScriptAlias /cgi/ "/srv/obf/cgi/"

Expand Down
4 changes: 2 additions & 2 deletions conf/apache-2.4/sites-available/off-pro.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Require all granted
<VirtualHost *>
DocumentRoot /srv/off-pro/html
ServerName pro.openfoodfacts.org
ErrorLog /srv/off-pro/logs/error_log
CustomLog /srv/off-pro/logs/access_log proxy
ErrorLog /srv/off-pro/logs/error_log_${APACHE2_PORT}
CustomLog /srv/off-pro/logs/access_log_${APACHE2_PORT} proxy
LogLevel warn
ScriptAlias /cgi/ "/srv/off-pro/cgi/"

Expand Down
4 changes: 2 additions & 2 deletions conf/apache-2.4/sites-available/off.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Require all granted
<VirtualHost *>
DocumentRoot /srv/off/html
ServerName openfoodfacts.org
ErrorLog /srv/off/logs/error_log
CustomLog /srv/off/logs/access_log proxy
ErrorLog /srv/off/logs/error_log_${APACHE2_PORT}
CustomLog /srv/off/logs/access_log_${APACHE2_PORT} proxy
LogLevel warn
ScriptAlias /cgi/ "/srv/off/cgi/"

Expand Down
4 changes: 2 additions & 2 deletions conf/apache-2.4/sites-available/opf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Require all granted
<VirtualHost *>
DocumentRoot /srv/opf/html
ServerName openproductsfacts.org
ErrorLog /srv/opf/logs/error_log
CustomLog /srv/opf/logs/access_log proxy
ErrorLog /srv/opf/logs/error_log_${APACHE2_PORT}
CustomLog /srv/opf/logs/access_log_${APACHE2_PORT} proxy
LogLevel warn
ScriptAlias /cgi/ "/srv/opf/cgi/"

Expand Down
4 changes: 2 additions & 2 deletions conf/apache-2.4/sites-available/opff.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Require all granted
<VirtualHost *>
DocumentRoot /srv/opff/html
ServerName openpetfoodfacts.org
ErrorLog /srv/opff/logs/error_log
CustomLog /srv/opff/logs/access_log combined
ErrorLog /srv/opff/logs/error_log_${APACHE2_PORT}
CustomLog /srv/opff/logs/access_log_${APACHE2_PORT} combined
LogLevel warn
ScriptAlias /cgi/ "/srv/opff/cgi/"

Expand Down
2 changes: 1 addition & 1 deletion conf/etc-default/prometheus-apache-exporter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set the command-line arguments to pass to the server.
ARGS='-scrape_uri http://127.0.0.1:8004/server-status/?auto'
ARGS='-scrape_uri http://127.0.0.1:8001/server-status/?auto'

#Usage of prometheus-apache-exporter:
# -host_override string
Expand Down
16 changes: 16 additions & 0 deletions conf/etc-default/prometheus-apache-priority-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set the command-line arguments to pass to the server.
# we use a different port than the standard exporter
ARGS='-telemetry.address :9118 -scrape_uri http://127.0.0.1:8002/server-status/?auto'

#Usage of prometheus-apache-exporter:
# -host_override string
# Override for HTTP Host header; empty string for no override.
# -insecure
# Ignore server certificate if using https.
# -scrape_uri string
# URI to apache stub status page. (default
# "http://localhost/server-status/?auto")
# -telemetry.address string
# Address on which to expose metrics. (default ":9117")
# -telemetry.endpoint string
# Path under which to expose metrics. (default "/metrics")
2 changes: 1 addition & 1 deletion conf/nginx/sites-available/howmuchsugar
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Site-Name $howmuchsugar_name;
proxy_set_header X-Site-Lang $howmuchsugar_lang;
proxy_pass http://127.0.0.1:8004;
proxy_pass http://127.0.0.1:8001;
}
}
4 changes: 2 additions & 2 deletions conf/nginx/sites-available/obf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ server {
access_log /var/log/nginx/proxy-obf-access.log proxied_requests buffer=256K flush=1s;
error_log /var/log/nginx/proxy-obf-error.log;

proxy_pass http://127.0.0.1:8002/cgi/display.pl?;
proxy_pass http://127.0.0.1:8001/cgi/display.pl?;
}

location /cgi/ {
Expand All @@ -137,7 +137,7 @@ server {
access_log /var/log/nginx/proxy-obf-access.log proxied_requests buffer=256K flush=1s;
error_log /var/log/nginx/proxy-obf-error.log;

proxy_pass http://127.0.0.1:8002;
proxy_pass http://127.0.0.1:8001;
}
}

Loading

0 comments on commit e7c92b1

Please sign in to comment.