ukchukx / rust_auth_service

A simple Rust authentication service
https://bowlsofsalt.com/web-and-api-authentication-service-in-rust/
15 stars 2 forks source link

.env config #1

Open Bounderx opened 4 years ago

Bounderx commented 4 years ago

maybe you have an .env config for me, mine doesn't work.

DATABASE_URL=postgres://localhost/ubuntu

BIND_ADDRESS=127.0.0.1:8088

DOMAIN=192.168.178.45 PORT=3000 HOST=http://localhost:3000 DOMAIN_URL=http://localhost:3000 SECRET_KEY=0123

enable/disable logging

RUST_LOG=

mail

SMTP_SENDER_NAME=test SMTP_USERNAME=myuser SMTP_PASSWORD=mypass SMTP_HOST=smtp.1und1.de SMTP_PORT=587 SMTP_SECURITY=tls

ukchukx commented 4 years ago

@Bounderx Your database url is not well-formed. It's supposed to look like: DATABASE_URL=postgres://<postgres_username>:<postgres_password>@localhost/<database>

Bounderx commented 4 years ago

@ukchukx I just obscured the database, it works. it is probably a problem with 'lettre' ?

ubuntu@ubuntu:~/rust/projectx$ cargo build Compiling auth_service v0.1.0 (/home/ubuntu/rust/projectx) error[E0433]: failed to resolve: could not findsmtpinlettre --> src/email_service.rs:7:3 | 7 | smtp::{ | ^^^^ could not findsmtpinlettre`

error[E0432]: unresolved imports lettre::Email, lettre::SmtpClient, lettre::ClientSecurity, lettre::ClientTlsParameters, lettre::smtp --> src/email_service.rs:2:3 2 Email, ^^^^^ no Email in the root 3 SmtpClient, ^^^^^^^^^^ no SmtpClient in the root 4 ClientSecurity, ^^^^^^^^^^^^^^ no ClientSecurity in the root 5 ClientTlsParameters, ^^^^^^^^^^^^^^^^^^^
no ClientTlsParameters in the root
help: a similar name exists in the module: TlsParameters
6 Transport,
7 smtp::{
^^^^ could not find smtp in lettre

error[E0433]: failed to resolve: use of undeclared type or module Mechanism --> src/email_service.rs:53:57 | 53 | ... .authentication_mechanism(Mechanism::Login) | ^^^^^^^^^ use of undeclared type or module Mechanism

error[E0433]: failed to resolve: use of undeclared type or module Credentials --> src/email_service.rs:54:44 | 54 | ... .credentials(Credentials::new(vars::smtp_username(), vars::smtp_password())) | ^^^^^^^^^^^ use of undeclared type or module Credentials

warning: unused import: Transport --> src/email_service.rs:6:3 6 Transport, ^^^^^^^^^

= note: #[warn(unused_imports)] on by default

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0432, E0433. For more information about an error, try rustc --explain E0432. error: could not compile auth_service. `

ukchukx commented 4 years ago

@Bounderx It appears you need to download the lettre dependency. If the repo link does not work for you, you can switch to any appropriate Cargo version.