Compare commits
No commits in common. "e48f74b970b046d62dc5efa6b84d8cf6571693c7" and "c6e3fa3eee04daef94bcbdc04ace6e354c29ec0c" have entirely different histories.
e48f74b970
...
c6e3fa3eee
8 changed files with 2 additions and 115 deletions
|
@ -1,19 +1,3 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::time::SystemTime;
|
||||
|
||||
use crate::env;
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use diesel::{SqliteConnection, r2d2::{ConnectionManager, PooledConnection}, RunQueryDsl, QueryDsl, SelectableHelper, ExpressionMethods, OptionalExtension};
|
||||
use crate::database::models::User;
|
||||
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use axum::{async_trait, extract::FromRequestParts, http::{header::AUTHORIZATION, request::Parts, StatusCode}};
|
||||
use tracing::{warn, error};
|
||||
use crate::database::{actions, models::User};
|
||||
|
|
|
@ -1,17 +1 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
pub mod auth;
|
|
@ -1,18 +1,2 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
pub mod extractors;
|
||||
pub mod routes;
|
|
@ -1,19 +1,3 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use argon2::{password_hash::{rand_core::OsRng, SaltString}, Argon2, PasswordHash, PasswordHasher, PasswordVerifier};
|
||||
use axum::{extract::State, http::StatusCode, routing::{get, post, put, delete}, Json, Router};
|
||||
use chrono::{Utc, NaiveDateTime};
|
||||
|
|
|
@ -1,17 +1 @@
|
|||
// Identity. Store your memories and mental belongings
|
||||
// Copyright (C) 2024 Sofía Aritz
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
pub mod auth;
|
|
@ -17,7 +17,7 @@
|
|||
use axum::{extract::{MatchedPath, Request}, response::Response, routing::get, Router};
|
||||
use database::create_connection_pool;
|
||||
use diesel::{r2d2::ConnectionManager, SqliteConnection};
|
||||
use env::{listen_port, LoadEnvError};
|
||||
use env::LoadEnvError;
|
||||
use http::routes::auth::auth_router;
|
||||
use r2d2::Pool;
|
||||
use tower_http::{classify::ServerErrorsFailureClass, trace::TraceLayer};
|
||||
|
@ -101,8 +101,7 @@ async fn main() {
|
|||
),
|
||||
);
|
||||
|
||||
// FIXME(sofia): Add an env var to change the bind addr
|
||||
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", listen_port()))
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
|
||||
.await
|
||||
.expect("failed to bind");
|
||||
|
||||
|
|
Loading…
Reference in a new issue