Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
horvbalint committed Jan 31, 2024
1 parent 1607afc commit 90c167a
Show file tree
Hide file tree
Showing 7 changed files with 1,155 additions and 1,164 deletions.
2 changes: 1 addition & 1 deletion backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- redis
environment:
SPEER_SERVER_ADDRESS: 0.0.0.0:9001
SPEER_REDIS_ADDRESS: redis:6379
SPEER_REDIS_URL: redis:6379
SPEER_MONGO_URL: mongodb://mongo:27017

mongo:
Expand Down
1 change: 1 addition & 0 deletions backend/dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN rm ./target/release/deps/speer*
COPY . .
RUN cargo build --release


FROM debian:bookworm-slim
WORKDIR /speer

Expand Down
10 changes: 5 additions & 5 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pub struct EnvVars {
noreply_email: String,
#[serde(default = "default_server_address")]
server_address: String,
#[serde(default = "default_redis_address")]
redis_address: String,
#[serde(default = "default_redis_url")]
redis_url: String,
#[serde(default = "default_mongo_url")]
mongo_url: String,
#[serde(default = "default_frontend_url")]
Expand Down Expand Up @@ -70,7 +70,7 @@ async fn main() -> std::io::Result<()> {
let changelog = serde_json::from_str::<Map<String, Value>>(&json_string).unwrap();

let session_middleware = SessionMiddleware::builder(
RedisActorSessionStore::new(&env_vars.redis_address),
RedisActorSessionStore::new(&env_vars.redis_url),
Key::from(env_vars.cookie_secret.as_ref())
)
.cookie_same_site(SameSite::Strict)
Expand Down Expand Up @@ -131,8 +131,8 @@ fn default_server_address() -> String {
"localhost:9001".to_string()
}

fn default_redis_address() -> String {
"localhost:6379".to_string()
fn default_redis_url() -> String {
"redis://localhost:6379".to_string()
}

fn default_mongo_url() -> String {
Expand Down
8 changes: 5 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/pwa": "^3.3.5",
"nuxt": "^2.17.3",
"simple-peer": "^9.11.1",
"streamsaver": "^2.0.6",
"web-streams-polyfill": "^3.2.1"
},
"devDependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/pwa": "^3.3.5",
"nuxt": "^2.17.3"
}
}
3 changes: 1 addition & 2 deletions frontend/plugins/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export default ({ $axios, redirect, store, ...ctx }) => {
})
$axios.onError( error => {
if (error.response && error.response.status == 401) {
store.dispatch('logout')
redirect('/login')
}
})
}
}
Loading

0 comments on commit 90c167a

Please sign in to comment.