Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

[bug] The API urls still point to api.zotero.org #137

Open
justemu opened this issue Aug 3, 2021 · 2 comments
Open

[bug] The API urls still point to api.zotero.org #137

justemu opened this issue Aug 3, 2021 · 2 comments

Comments

@justemu
Copy link

justemu commented Aug 3, 2021

steps to reproduce:

  1. I have managed to get this docker-compose up following all the steps.
  2. I have finished the db init.
  3. Open the browser http://ip.add.re.ss:8084
    The page failed to load completely, showing only the icon of zotero.
    image
    Please check out he screen shot above. And the problem should be that the zotero api failed to point to localhost. It still tries to fetch resource form api.zotero.org.

supplement to this issue, I have also checked the codes in config.inc. php . The setting of the base url of api seems correct.
image

@justemu
Copy link
Author

justemu commented Aug 5, 2021

There is a file in web-library/src/js/constants/defaults.js .
There reside the api address and other settings of web-library. Hard-hack this file might solve the problem...

export const apiConfig = {
        apiAuthorityPart: 'api.zotero.org',
        retry: 2,
};
export const websiteUrl = 'https://www.zotero.org/';
export const stylesSourceUrl = 'https://www.zotero.org/styles-files/styles.json';
export const streamingApiUrl = 'wss://stream.zotero.org/';
export const translateUrl = 'location' in window ? window.location.origin : '';
export const tinymceRoot = '/static/other/tinymce/';
export const libraries = {
        includeMyLibrary: true,
        includeUserGroups: true,
        include: []
};

@MariusLuding
Copy link

@justemu changing that value did nothing for me, however, I did a search with ack and also found (first line is always the file where the code below was found):

htdocs/zotero-schema/scripts/update-etag
9:curl --silent -I --compressed https://api.zotero.org/schema | sed -n -r 's/^ETag: (".+")\s+/\1/p' > $tmp_file

Changing this at least remove the call in the browser to the api.zotero.org, but alas, still no further on loading the page.

web-library/build/static/zotero-web-library.js
84824:  apiAuthorityPart: 'api.zotero.org',

This seems to only be for testing, so not touching it for now:

web-library/test/redux/action-creators.spec.js
129:            fetchMock.mock('begin:https://api.zotero.org/', { status: 500 });
167:            fetchMock.mock('begin:https://api.zotero.org/', { status: 500 });
205:            fetchMock.mock('begin:https://api.zotero.org/', { status: 500 });


web-library/test/fixtures/state.json
5:      "apiAuthorityPart": "api.zotero.org"

Another candidate for why it might not be working:

stream-server/config/default.js
19:     apiURL: 'https://api.zotero.org/',

In this file, some static IPs are being set. I will try to edit those of the container IPs, but this seems to be related to just the client.

client/config.sh
3:sed -i 's#https://api.zotero.org/#http://192.168.1.249:8080/#g' zotero-client/resource/config.js

Same here, probably what would be needed for building the correct client:

client/zotero-client/resource/config.js
12:     API_URL: 'https://api.zotero.org/',

Wildcard-stuff from zotero. This seems fine though.

include/header.inc.php
104:    // e.g., to treat zotero.org/api/users as api.zotero.org/users

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants