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

Missing certain options for local testing purposes. #2596

Open
zcaliptium opened this issue Jan 14, 2024 · 2 comments
Open

Missing certain options for local testing purposes. #2596

zcaliptium opened this issue Jan 14, 2024 · 2 comments
Labels
backend Relates to Modrinth Backend or API enhancement New feature or request

Comments

@zcaliptium
Copy link

Is your suggested enhancement related to a problem? Please describe.

When I tried to run labrinth backend locally I encountered such problems. I can't just register account for testing purposes.

  1. It will throw out Captcha Error. Try resubmitting the form..

Then If I disable Cloudflare integration code...

  1. It will throw out SMTP Error: Connection error: No such host is known. (os error 11001) because SMTP server is not configured.

Describe the solution you'd like

Put options into dotenvy config:

  1. To completely disable Turnstile (Cloudflare Integration).
  2. To disable email sending and account verification.

Adding such options can make running local instance less painful.

Describe alternatives you've considered

No response

Additional context

No response

@zcaliptium zcaliptium added the enhancement New feature or request label Jan 14, 2024
@Erb3
Copy link
Contributor

Erb3 commented Aug 25, 2024

I think this is a barrier for most people who want to contribute to labrinth. It's just hard to get dummy data and accounts. There seems to be some code in the test package for generating dummy data, but there is no documentation around how to use this. Ideally I think we should allow most env variables be empty, and disable those features. For example if no SMTP is configured, instead print the email contents in the logs. In addition to disabling these features, I would suggest that we also implement and document some utility to generate dummy data.

For the turnstile specifically, there seems to be some testing tokens for development: https://developers.cloudflare.com/turnstile/troubleshooting/testing/

@Prospector Prospector transferred this issue from modrinth/labrinth Oct 19, 2024
@Prospector Prospector added the backend Relates to Modrinth Backend or API label Oct 19, 2024
@Erb3
Copy link
Contributor

Erb3 commented Nov 3, 2024

I have now gotten labrinth to work locally-ish. Steps:

  1. Update frontend .env with following settings:
BASE_URL=http://localhost:8000/v2/
BROWSER_BASE_URL=http://localhost:8000/v2/
  1. In labrinth update the following in .env:
-TURNSTILE_SECRET=none
+TURNSTILE_SECRET=1x0000000000000000000000000000000AA

-SMTP_USERNAME=none
-SMTP_PASSWORD=none
-SMTP_HOST=none
+SMTP_USERNAME=hello
+SMTP_PASSWORD=world
+SMTP_HOST=localhost
+SMTP_PORT=2525
+SMTP_TLS=false
  1. Run a program like smtp4dev to start a mock SMTP server on port 2525 with no authentication or TLS.
  2. Modify labrinth to add SMTP_PORT and SMTP_TLS settings, or install certs and use correct port. (see feat(labrinth): environment variables for more customizable SMTP #2886)
  3. Run dependencies (meilisearch, postgres, redis, etc)
  4. Run frontend & backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Relates to Modrinth Backend or API enhancement New feature or request
Development

No branches or pull requests

3 participants