diff --git a/conf/nginx/sites-available/off b/conf/nginx/sites-available/off index 9bd879ff40795..f75e7fd69259e 100644 --- a/conf/nginx/sites-available/off +++ b/conf/nginx/sites-available/off @@ -18,12 +18,12 @@ map $uri $apache_port { default 8001; # home pages - "~*/$" 8002; + "~*^/$" 8002; # product read / write (note that nginx does not support direct utf-8) - "~*/(mountaj|m\xc9\x99hsul|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|gynnyrch|produkt|product|product|product|produkto|producto|toode|produkto|produit|produto|term\xc3\xa9k|produk|\xe8\xa3\xbd\xe5\x93\x81|afaris|\xd3\xa9\xd0\xbd\xd1\x96\xd0\xbc|\xec\x83\x9d\xec\x84\xb1\xeb\xac\xbc|berhem|\xe0\xa4\x89\xe0\xa4\xa4\xe0\xa5\x8d\xe0\xa4\xaa\xe0\xa4\xbe\xe0\xa4\xa6\xe0\xa4\xa8|produk|produkt|\xe0\xa4\x89\xe0\xa4\xa4\xe0\xa5\x8d\xe0\xa4\xaa\xe0\xa4\xbe\xe0\xa4\xa6\xe0\xa4\xa8|product|product|product|produkt|produkt|produit|produto|produto|produto|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|product|proizvod|produkto|\xc3\xbcr\xc3\xbcn|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|\xe4\xba\xa7\xe5\x93\x81|\xe7\x94\xa2\xe5\x93\x81|\xe7\x94\xa2\xe5\x93\x81)/" 8002; - "~*/cgi/product.pl" 8002; + "~*^/(mountaj|m\xc9\x99hsul|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|gynnyrch|produkt|product|product|product|produkto|producto|toode|produkto|produit|produto|term\xc3\xa9k|produk|\xe8\xa3\xbd\xe5\x93\x81|afaris|\xd3\xa9\xd0\xbd\xd1\x96\xd0\xbc|\xec\x83\x9d\xec\x84\xb1\xeb\xac\xbc|berhem|\xe0\xa4\x89\xe0\xa4\xa4\xe0\xa5\x8d\xe0\xa4\xaa\xe0\xa4\xbe\xe0\xa4\xa6\xe0\xa4\xa8|produk|produkt|\xe0\xa4\x89\xe0\xa4\xa4\xe0\xa5\x8d\xe0\xa4\xaa\xe0\xa4\xbe\xe0\xa4\xa6\xe0\xa4\xa8|product|product|product|produkt|produkt|produit|produto|produto|produto|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|product|proizvod|produkto|\xc3\xbcr\xc3\xbcn|\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb4\xd1\x83\xd0\xba\xd1\x82|\xe4\xba\xa7\xe5\x93\x81|\xe7\x94\xa2\xe5\x93\x81|\xe7\x94\xa2\xe5\x93\x81)/" 8002; + "~*^/cgi/product.pl" 8002; # product API read / write - "~*/api/v./product/" 8002; + "~*^/api/v./product/" 8002; } # variables definitions for expiry headers are loaded from /etc/nginx/conf.d/expires-no-json-xml.conf @@ -160,8 +160,8 @@ server { real_ip_recursive on; access_log /var/log/nginx/proxy-off-access.log proxied_requests buffer=256K flush=1s; error_log /var/log/nginx/proxy-off-error.log; - - proxy_pass http://127.0.0.1:$apache_port/cgi/display.pl?; + # Note: as soon as we use a variable in proxy_pass, $uri and the rest must be explicit + proxy_pass http://127.0.0.1:$apache_port/cgi/display.pl?$uri$is_args$args; } location /cgi/ { @@ -171,8 +171,8 @@ server { real_ip_recursive on; access_log /var/log/nginx/proxy-off-access.log proxied_requests buffer=256K flush=1s; error_log /var/log/nginx/proxy-off-error.log; - - proxy_pass http://127.0.0.1:$apache_port; + # Note: as soon as we use a variable in proxy_pass, $uri and the rest must be explicit + proxy_pass http://127.0.0.1:$apache_port$uri$is_args$args; } } diff --git a/conf/well-known/off-apple-developer-merchantid-domain-association b/conf/well-known/off-apple-developer-merchantid-domain-association index 2ff95c962810a..6bbc10cd2e635 100644 --- a/conf/well-known/off-apple-developer-merchantid-domain-association +++ b/conf/well-known/off-apple-developer-merchantid-domain-association @@ -1 +1 @@ -7B227073704964223A2239373943394538343346343131343044463144313834343232393232313734313034353044314339464446394437384337313531303944334643463542433731222C2276657273696F6E223A312C22637265617465644F6E223A313536363233343735303036312C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038346333303431343935313964353433363330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313339333033353331333833303331333333323335333735613137306433323334333033353331333633303331333333323335333735613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306265303935373166653731653165373335623535653561666163623463373266656234343566333031383532323263373235313030326236316562643666353530323231303064313862333530613564643664643665623137343630333562313165623263653837636661336536616636636264383338303839306463383263646461613633333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383463333034313439353139643534333633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303338333133393331333733313332333333303561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323062303731303365313430613462386231376262613230316130336163643036396234653431366232613263383066383661383338313435633239373566633131333030613036303832613836343863653364303430333032303434363330343430323230343639306264636637626461663833636466343934396534633035313039656463663334373665303564373261313264376335666538633033303033343464663032323032363764353863393365626233353031333836363062353730373938613064643731313734316262353864626436613138363633353038353431656565393035303030303030303030303030227D \ No newline at end of file +7B227073704964223A2239373943394538343346343131343044463144313834343232393232313734313034353044314339464446394437384337313531303944334643463542433731222C2276657273696F6E223A312C22637265617465644F6E223A313536363233343735303036312C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653333303832303338386130303330323031303230323038346333303431343935313964353433363330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313339333033353331333833303331333333323335333735613137306433323334333033353331333633303331333333323335333735613330356633313235333032333036303335353034303330633163363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353035323466343433313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034633231353737656465626436633762323231386636386464373039306131323138646337623062643666326332383364383436303935643934616634613534313162383334323065643831316633343037653833333331663163353463336637656233323230643662616435643465666634393238393839336537633066313361333832303231313330383230323064333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330343530363038326230363031303530353037303130313034333933303337333033353036303832623036303130353035303733303031383632393638373437343730336132663266366636333733373032653631373037303663363532653633366636643266366636333733373033303334326436313730373036633635363136393633363133333330333233303832303131643036303335353164323030343832303131343330383230313130333038323031306330363039326138363438383666373633363430353031333038316665333038316333303630383262303630313035303530373032303233303831623630633831623335323635366336393631366536333635323036663665323037343638363937333230363336353732373436393636363936333631373436353230363237393230363136653739323037303631373237343739323036313733373337353664363537333230363136333633363537303734363136653633363532303666363632303734363836353230373436383635366532303631373037303663363936333631363236633635323037333734363136653634363137323634323037343635373236643733323036313665363432303633366636653634363937343639366636653733323036663636323037353733363532633230363336353732373436393636363936333631373436353230373036663663363936333739323036313665363432303633363537323734363936363639363336313734363936663665323037303732363136333734363936333635323037333734363137343635366436353665373437333265333033363036303832623036303130353035303730323031313632613638373437343730336132663266373737373737326536313730373036633635326536333666366432663633363537323734363936363639363336313734363536313735373436383666373236393734373932663330333430363033353531643166303432643330326233303239613032376130323538363233363837343734373033613266326636333732366332653631373037303663363532653633366636643266363137303730366336353631363936333631333332653633373236633330316430363033353531643065303431363034313439343537646236666435373438313836383938393736326637653537383530376537396235383234333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306265303935373166653731653165373335623535653561666163623463373266656234343566333031383532323263373235313030326236316562643666353530323231303064313862333530613564643664643665623137343630333562313165623263653837636661336536616636636264383338303839306463383263646461613633333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383463333034313439353139643534333633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303338333133393331333733313332333333303561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323062303731303365313430613462386231376262613230316130336163643036396234653431366232613263383066383661383338313435633239373566633131333030613036303832613836343863653364303430333032303434363330343430323230343639306264636637626461663833636466343934396534633035313039656463663334373665303564373261313264376335666538633033303033343464663032323032363764353863393365626233353031333836363062353730373938613064643731313734316262353864626436613138363633353038353431656565393035303030303030303030303030227D diff --git a/docs/dev/how-to-release.md b/docs/dev/how-to-release.md index e071d6d7d988b..ecd4a7a403c74 100644 --- a/docs/dev/how-to-release.md +++ b/docs/dev/how-to-release.md @@ -23,6 +23,12 @@ corresponding to the service short name (off, opf, etc.) and the version tag. To deploy you need to execute the following steps: 1. merge the Release Please pull request. This will create a new release / version tag on github +1. verify there is no unreleased code on the server: + ```bash + sudo -u off bash + cd /srv/$SERVICE + git status + ``` 1. update the code: ```bash sudo -u off bash @@ -32,7 +38,7 @@ To deploy you need to execute the following steps: ``` 1. verify every needed symlink is in place ```bash - sudo -u off scripts/deploy/verify-deployment.sh $SERVICE + sudo /srv/$SERVICE/scripts/deploy/verify-deployment.sh $SERVICE ``` 1. rebuild taxonomies and lang ```bash @@ -50,6 +56,8 @@ To deploy you need to execute the following steps: ```bash sudo systemctl daemon-reload sudo systemctl restart nginx - sudo systemctl stop apache2 cloud_vision_ocr@$SERVICE.service minion@$SERVICE.service + sudo systemctl stop apache2 cloud_vision_ocr@$SERVICE.service minion@$SERVICE.service; \ sudo systemctl start apache2 cloud_vision_ocr@$SERVICE.service minion@$SERVICE.service + # On off + sudo systemctl stop apache2@priority; sudo systemctl start apache2@priority ``` diff --git a/html/donate/fr.helloasso.html b/html/donate/fr.helloasso.html index 50febdfc2087c..86dd6539ca8d9 100644 --- a/html/donate/fr.helloasso.html +++ b/html/donate/fr.helloasso.html @@ -48,194 +48,10 @@ - - - - - - - -
-
- Logo Open Food Facts -
- -
-
-

Soutenez Open Food Facts pour 2024 !

-

- Open Food Facts est 100% gratuit et indépendant de l'industrie alimentaire. - Nous avons besoin de votre aide pour continuer à développer le projet. -

-
-
- -
-
- Logo Open Food Facts -
- -
- -
-

Soutenez Open Food Facts pour 2024 !

-

- Open Food Facts est 100% gratuit et indépendant de l'industrie alimentaire. - Nous avons besoin de votre aide pour continuer à développer le projet. -

-
- -

Pourquoi donner à Open Food Facts ?

-

- Open Food Facts est le "Wikipedia de l’alimentation", la plus grande base de données libre et ouverte de produits alimentaires du monde entier. - Nous avons commencé Open Food Facts parce que nous croyons que les informations sur ce que - nous mangeons sont d'intérêt public et doivent - être publiques. gratuites et ouvertes. -

- -
-
-
- -
-
-
-

- Lorsque nous avons fondé Open Food Facts, nous avons ouvertement choisi d'en faire une - association à but non-lucratif pour maximiser notre impact, grâce à la gratuité de nos travaux. - Nous avons aussi pris la décision sans appel d'être totalement indépendants - de l'industrie agro-alimentaire, et de refuser tout financement qui pourrait nous biaiser et - corrompre notre mission. -

-

- Nous avons besoin de votre aide pour continuer à faire fonctionner et à développer Open Food Facts. - Merci d'envisager de faire un don pour protéger et soutenir Open Food Facts. -

-

Merci à vous,
- Anca, Éloïse, Florence, Léonore, Marie, Christian, Ludovic, - Sébastien, Vincent et toute l'équipe Open Food Facts. -

-
-
-
-
-

À quoi servent vos dons

- -

- Technologie : Développement, maintenance régulière et serveurs pour suivre la - croissance de la base de données et ajouter de chouettes nouvelles fonctionnalités à - l'application mobile et au site web Open Food Facts. -

- -

- Volontaires et projets : Pour soutenir au mieux la communauté Open Food Facts, - pour collaborer avec des chercheurs, et pour que nos données alimentaires aient le plus - grand impact possible sur notre santé, notre planète et notre société. -

-
-
- Last meeting in Paris -
-
- - -
- -
-
-
-

Le formulaire de don est en cours de chargement.
Vous pouvez aussi y accéder en cliquant ici.

-
- -
-
-
-
+ diff --git a/scripts/deploy/verify-deployment.sh b/scripts/deploy/verify-deployment.sh index 7aeae1b471fb0..3bdbd96d1e79d 100755 --- a/scripts/deploy/verify-deployment.sh +++ b/scripts/deploy/verify-deployment.sh @@ -65,6 +65,7 @@ function check_args { exit -2 fi ZFS_PATH="/mnt/$SERVICE" + OFF_ZFS_PATH="/mnt/off" IS_PRO=$(is_pro "$SERVICE") NON_PRO_SERVICE=$(non_pro_name "$SERVICE") PRO_SERVICE=$NON_PRO_SERVICE"-pro" @@ -79,7 +80,7 @@ function check_args { function compute_services { # systemd services to check for symlinks - SYSTEMD_LINKS+=( email-failures@.service nginx.service.d apache2.service apache2@.service.d prometheus@.service.d cloud_vision_ocr@.service ) + SYSTEMD_LINKS+=( email-failures@.service nginx.service.d apache2.service.d cloud_vision_ocr@.service ) # units that must be active (and enabled) SYSTEMD_UNITS_ACTIVE=( nginx.service apache2.service cloud_vision_ocr@$SERVICE.service ) # units that must be enabled @@ -87,7 +88,7 @@ function compute_services { # priority request on off if [[ $SERVICE = "off" ]] then - SYSTEMD_LINKS+=( prometheus-apache-exporter@.service ) + SYSTEMD_LINKS+=( apache2@.service.d prometheus-apache-exporter@.service ) SYSTEMD_UNITS_ACTIVE+=( apache2@priority.service prometheus-apache-exporter.service prometheus-apache-exporter@priority.service ) fi if [[ -z $IS_PRO ]] @@ -111,7 +112,6 @@ function compute_expected_links { EXPECTED_LINKS["$REPO_PATH/log.conf"]="$REPO_PATH/conf/$SERVICE-log.conf" EXPECTED_LINKS["$REPO_PATH/minion_log.conf"]="$REPO_PATH/conf/$SERVICE-minion_log.conf" # config - EXPECTED_LINKS["$REPO_PATH/lib/ProductOpener/Config.pm"]="$REPO_PATH/lib/ProductOpener/Config_$NON_PRO_SERVICE.pm" EXPECTED_LINKS["$REPO_PATH/po/site-specific"]="$REPO_PATH/po/$SERVICE_LONG_NAME" # off-web EXPECTED_LINKS["$REPO_PATH/lang"]="/srv/openfoodfacts-web/lang" @@ -120,8 +120,9 @@ function compute_expected_links { EXPECTED_LINKS["$REPO_PATH/data"]="$ZFS_PATH/data" EXPECTED_LINKS["$REPO_PATH/orgs"]="$ZFS_PATH/orgs" EXPECTED_LINKS["$REPO_PATH/users"]="$ZFS_PATH/users" - EXPECTED_LINKS["$REPO_PATH/products"]="$ZFS_PATH/products" - EXPECTED_LINKS["$REPO_PATH/html/images/products"]="$ZFS_PATH/images/products" + # image and products are now merges on off zfs storage + EXPECTED_LINKS["$REPO_PATH/products"]="$OFF_ZFS_PATH/products" + EXPECTED_LINKS["$REPO_PATH/html/images/products"]="$OFF_ZFS_PATH/images/products" # public data EXPECTED_LINKS["$REPO_PATH/html/data"]="$ZFS_PATH/html_data" EXPECTED_LINKS["$REPO_PATH/html/exports"]="$ZFS_PATH/html_data/exports" @@ -203,12 +204,9 @@ function compute_expected_links { EXPECTED_LINKS["/etc/apache2/off-envvars"]="$REPO_PATH/conf/apache-2.4/off-envvars" EXPECTED_LINKS["/etc/apache2/mods-available/mpm_prefork.conf"]="$REPO_PATH/conf/apache-2.4/mpm_prefork.conf" EXPECTED_LINKS["/etc/apache2/sites-enabled/$SERVICE.conf"]="$REPO_PATH/conf/apache-2.4/sites-available/$SERVICE.conf" - EXPECTED_LINKS["/etc/apache2-standard"]="/etc/apache-2" - EXPECTED_LINKS["/var/log/apache2-standard"]="/var/log/apache-2" if [[ $SERVICE = "off" ]] then - EXPECTED_LINKS["/etc/apache2-priority"]="/etc/apache-2" - EXPECTED_LINKS["/var/log/apache2-standard"]="/var/log/apache-2" + EXPECTED_LINKS["/etc/apache2-priority"]="/etc/apache2" fi for systemd_unit in {apache2,nginx}.service.d ${SYSTEMD_LINKS[@]} @@ -244,11 +242,11 @@ function check_links { GOT_ERROR=1 if [[ ! -e $target ]] then - >&2 echo "ERROR: link $target does not exist" + >&2 echo "ERROR: link $target does not exist (should link to $destination)" else if [[ ! -e $destination ]] then - >&2 echo "ERROR: link $destination does not exist" + >&2 echo "ERROR: link $destination does not exist (while $target links to it)" else >&2 echo "ERROR: link instead of $target -> $destination, got $(readlink -f $target) instead" fi diff --git a/scripts/gen_users_emails.pl b/scripts/gen_users_emails.pl index 1faacc5b42815..edb667067e9a4 100755 --- a/scripts/gen_users_emails.pl +++ b/scripts/gen_users_emails.pl @@ -38,7 +38,10 @@ my $emails_ref = retrieve("$BASE_DIRS{USERS}/users_emails.sto"); -foreach my $userid (@userids) { +my $i = 0; +my $n = scalar @userids; + +foreach my $userid (sort @userids) { my $user_ref = retrieve_user($userid); if (defined $user_ref) { my $email = $user_ref->{email}; @@ -46,6 +49,11 @@ $emails_ref->{$email} = [$userid]; } } + $i++; + if ($i % 1000 == 0) { + print "$i / $n - $userid\n"; + store("$BASE_DIRS{USERS}/users_emails.sto", $emails_ref); + } } store("$BASE_DIRS{USERS}/users_emails.sto", $emails_ref); diff --git a/scripts/migrations/2024_10_detect_duplicate_products_in_different_flavors.pl b/scripts/migrations/2024_10_detect_duplicate_products_in_different_flavors.pl index aa927469a7cb7..79c68013b66e7 100755 --- a/scripts/migrations/2024_10_detect_duplicate_products_in_different_flavors.pl +++ b/scripts/migrations/2024_10_detect_duplicate_products_in_different_flavors.pl @@ -20,35 +20,42 @@ my %flavor_with_most_data = (); my %flavor_with_most_data_size = (); -foreach my $flavor ("off", "obf", "opf", "opff") { - my $products_collection = get_products_collection({database => $flavor, timeout => $socket_timeout_ms}); +foreach my $obsolete (0, 1) { + foreach my $flavor ("off", "obf", "opf", "opff") { + my $products_collection + = get_products_collection({database => $flavor, obsolete => $obsolete, timeout => $socket_timeout_ms}); - my $cursor = $products_collection->query({}) - ->fields({_id => 1, code => 1, owner => 1, product_name => 1, brands => 1, scans_n => 1}); - $cursor->immortal(1); + my $cursor = $products_collection->query({}) + ->fields({_id => 1, code => 1, owner => 1, product_name => 1, brands => 1, scans_n => 1}); + $cursor->immortal(1); - while (my $product_ref = $cursor->next) { - my $code = $product_ref->{code}; - $flavors{all}{$code}++; - $flavors{$flavor}{$code}++; - # Check which flavor has the biggest product file - my $path = product_path($product_ref); - if (not defined $flavor_with_most_data{$code}) { - $flavor_with_most_data{$code} = $flavor; - $flavor_with_most_data_size{$code} = (-s "/srv/$flavor/products/$path/product.sto") || 0; - } - if (((-s "/srv/$flavor/products/$path/product.sto") || 0) > $flavor_with_most_data_size{$code}) { - $flavor_with_most_data{$code} = $flavor; - $flavor_with_most_data_size{$code} = (-s "/srv/$flavor/products/$path/product.sto") || 0; - } - if (($product_ref->{scans_n} || 0) > ($scans{$code} || 0)) { - $scans{$code} = $product_ref->{scans_n} || 0; - } - if (not defined $product_names{$code}) { - $product_names{$code} = $product_ref->{product_name}; - } - if (not defined $brands{$code}) { - $brands{$code} = $product_ref->{brands}; + while (my $product_ref = $cursor->next) { + my $code = $product_ref->{code}; + $flavors{all}{$code}++; + $flavors{$flavor}{$code}++; + # Check which flavor has the biggest product file + my $path = product_path($product_ref); + if (not defined $flavor_with_most_data{$code}) { + $flavor_with_most_data{$code} = $flavor; + $flavor_with_most_data_size{$code} = (-s "/srv/$flavor/products/$path/product.sto") || 0; + } + if (((-s "/srv/$flavor/products/$path/product.sto") || 0) > $flavor_with_most_data_size{$code}) { + # retrieve the product to check it's not deleted + my $flavor_product_ref = retrieve("/srv/$flavor/products/$path/product.sto"); + if ((defined $flavor_product_ref) and (not $flavor_product_ref->{deleted})) { + $flavor_with_most_data{$code} = $flavor; + $flavor_with_most_data_size{$code} = (-s "/srv/$flavor/products/$path/product.sto") || 0; + } + } + if (($product_ref->{scans_n} || 0) > ($scans{$code} || 0)) { + $scans{$code} = $product_ref->{scans_n} || 0; + } + if (not defined $product_names{$code}) { + $product_names{$code} = $product_ref->{product_name}; + } + if (not defined $brands{$code}) { + $brands{$code} = $product_ref->{brands}; + } } } }