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

feat: robotoff anonymous questions #7379

Merged
merged 4 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MONGODB_HOST=mongodb
MONGODB_CACHE_SIZE=8 # GB
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=test
ROBOTOFF_URL=http://api:5500 # connect to Robotoff running in separate docker-compose deployment
ROBOTOFF_URL=http://robotoff.openfoodfacts.localhost:5500 # connect to Robotoff running in separate docker-compose deployment
EVENTS_URL=
GOOGLE_CLOUD_VISION_API_KEY=
CROWDIN_PROJECT_IDENTIFIER=
Expand Down
8 changes: 8 additions & 0 deletions docker/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ services:
- ./scss:/opt/product-opener/scss
- ./gulpfile.js:/opt/product-opener/
- ./snyk:/opt/product-opener/
networks:
default:
aliases:
# trick: make it possible for robotoff to reach it internally,
# using localhost domain
- world.openfoodfacts.localhost
- static.openfoodfacts.localhost
- images.openfoodfacts.localhost
mongodb:
# Note: keep it as close a possible to mongodb.yml
image: mongo:4.4
Expand Down
2 changes: 1 addition & 1 deletion templates/web/pages/product/product_page.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<p>→ <a href="[% public_product_url %]">[% lang("product_page_on_the_public_database") %]</a></p>
[% END %]

[% IF (user_id.defined) && (robotoff_url.defined) && (robotoff_url.length > 0) %]
[% IF (robotoff_url.defined) && (robotoff_url.length > 0) %]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's that easy, because robotoff takes care of computing device_id using url.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so for a non logged in OFF website user, how is the device_id computed? is it a hash of the user ip address or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexgarel marked this conversation as resolved.
Show resolved Hide resolved
<robotoff-asker url='[% robotoff_url %]' code='[% code %]' lang='[% lc %]' style='display: none;' caption-yes='[% lang("button_caption_yes") %]' caption-no='[% lang("button_caption_no") %]' caption-skip='[% lang("button_caption_skip") %]'></robotoff-asker>
[% END %]

Expand Down