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

Verified mods tor #1284

Merged
merged 5 commits into from
Apr 2, 2018
Merged

Verified mods tor #1284

merged 5 commits into from
Apr 2, 2018

Conversation

jjeffryes
Copy link
Contributor

@jjeffryes jjeffryes commented Mar 22, 2018

If the app is in Tor mode, use the new Tor endpoint for the verified moderators.

Closes #1275

@jjeffryes jjeffryes requested a review from rmisio March 22, 2018 16:54
@@ -51,6 +51,7 @@ export default class extends Model {
listingsGridViewType: 'grid',
bitcoinUnit: 'BTC',
verifiedModsProvider: 'https://search.ob1.io/verified_moderators',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea that if the provider doesn't provide a seperate tor url, the standard url will be filled in for both urls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe? When we add the ability to put in a custom endpoint, we'd have to handle that situation.

If a user just put in a clearnet endpoint, we could either:
a. set the Tor endpoint to that url
b. fall back to the clear endpoint in the verifiedMods collection if the Tor endpoint is missing
c. not load verified mods at all if the user in is Tor mode and doesn't have a Tor endpoint

I think that's something we'll have to figure out when planning the feature to edit your endpoints.

@@ -18,7 +19,8 @@ export default class extends Collection {
}

url() {
return app.localSettings.get('verifiedModsProvider');
const usingTor = app.serverConfig.tor && getCurrentConnection().server.get('useTor');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could eliminate the app.serverConfig.tor part there since it doesn't really matter if the server is using tor or not because this call wouldn't go through the server. getCurrentConnection().server.get('useTor') indicates that the user chose to use tor in their server config and that IMHO should be enough for us to route the verified mods call through a tor endpoint.

@@ -18,7 +19,7 @@ export default class extends Collection {
}

url() {
return app.localSettings.get('verifiedModsProvider');
return app.localSettings.get(`verifiedModsProvider${getCurrentConnection().server.get('useTor') ? 'Tor' : ''}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this line too long?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is. I switched editors and didn't notice it had linting turned off and a different line length.

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

Successfully merging this pull request may close these issues.

2 participants