+
diff --git a/client-solid/src/Components/SinglePost.tsx b/client-solid/src/SinglePost.tsx
similarity index 84%
rename from client-solid/src/Components/SinglePost.tsx
rename to client-solid/src/SinglePost.tsx
index 285df2f..7e5eca5 100644
--- a/client-solid/src/Components/SinglePost.tsx
+++ b/client-solid/src/SinglePost.tsx
@@ -1,9 +1,9 @@
import { useParams } from "@solidjs/router";
import { JSXElement, Show, Suspense, createResource } from "solid-js";
-import { loadSpinner } from "../Util/Icons";
-import { getPost } from "../Util/api";
+import { loadSpinner } from "./Icons";
import { PostSegment } from "./Posts";
+import { getPost } from "./api";
export function SinglePost(): JSXElement {
const params = useParams();
diff --git a/client-solid/src/Util/api.ts b/client-solid/src/api.ts
similarity index 99%
rename from client-solid/src/Util/api.ts
rename to client-solid/src/api.ts
index 03c759d..34aca91 100644
--- a/client-solid/src/Util/api.ts
+++ b/client-solid/src/api.ts
@@ -72,4 +72,4 @@ export async function submitLogin(
});
if (response.ok) return await response.json();
-}
+}
\ No newline at end of file
diff --git a/client-solid/src/index.tsx b/client-solid/src/index.tsx
index 685ff03..30109db 100644
--- a/client-solid/src/index.tsx
+++ b/client-solid/src/index.tsx
@@ -1,7 +1,7 @@
import { Router } from "@solidjs/router";
import { render } from "solid-js/web";
-import Root from "./Containers/Root";
+import Root from "./Root";
import "./index.css";
const root = document.getElementById("root");
diff --git a/client-solid/tailwind.config.js b/client-solid/tailwind.config.js
index 50332cf..d6a7c8f 100644
--- a/client-solid/tailwind.config.js
+++ b/client-solid/tailwind.config.js
@@ -1,27 +1,32 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
+ content: [
+ "./index.html",
+ "./src/**/*.{js,ts,jsx,tsx}",
+ ],
daisyui: {
themes: [
{
mytheme: {
- primary: "#64279e",
- secondary: "#9454af",
- accent: "#6ff7c5",
- neutral: "#1f2329",
+ "primary": "#64279e",
+ "secondary": "#9454af",
+ "accent": "#6ff7c5",
+ "neutral": "#1f2329",
"base-100": "#2a3a47",
- info: "#8b9be5",
- success: "#79e2b4",
- warning: "#efb261",
- error: "#e1604c",
+ "info": "#8b9be5",
+ "success": "#79e2b4",
+ "warning": "#efb261",
+ "error": "#e1604c",
},
},
],
},
+
theme: {
extend: {},
},
// eslint-disable-next-line no-undef
plugins: [require("daisyui")],
-};
+}
+
diff --git a/client-solid/tsconfig.json b/client-solid/tsconfig.json
index 6a22ab0..fb72312 100644
--- a/client-solid/tsconfig.json
+++ b/client-solid/tsconfig.json
@@ -3,7 +3,11 @@
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "lib": [
+ "ES2020",
+ "DOM",
+ "DOM.Iterable"
+ ],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
@@ -19,10 +23,12 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
- "include": ["src"],
+ "include": [
+ "src"
+ ],
"references": [
{
"path": "./tsconfig.node.json"
}
]
-}
+}
\ No newline at end of file
diff --git a/client-solid/vite.config.ts b/client-solid/vite.config.ts
index 97bbb49..5594547 100644
--- a/client-solid/vite.config.ts
+++ b/client-solid/vite.config.ts
@@ -1,6 +1,6 @@
-import { defineConfig } from "vite";
-import { qrcode } from "vite-plugin-qrcode";
-import solid from "vite-plugin-solid";
+import { defineConfig } from 'vite'
+import solid from 'vite-plugin-solid'
+import { qrcode } from 'vite-plugin-qrcode'
// https://vitejs.dev/config/
export default defineConfig({
@@ -12,12 +12,12 @@ export default defineConfig({
port: 3000,
open: true,
proxy: {
- "/api": {
- target: "http://localhost:8080/api",
+ '/api': {
+ target: 'http://localhost:8080/api',
changeOrigin: true,
secure: false,
- rewrite: (path): string => path.replace(/^\/api/, ""),
- },
- },
- },
-});
+ rewrite: (path): string => path.replace(/^\/api/, '')
+ }
+ }
+ }
+})
diff --git a/justfile b/justfile
index 20a3fa9..4ac4f73 100644
--- a/justfile
+++ b/justfile
@@ -32,7 +32,8 @@ build-container-release:
podman build -t fb-server -f container/Containerfile .
# Builds a release container and runs it
-start-release: start-postgres-dev clean-podman init-sqlx build-container-release create-network
+start-release: start-postgres-dev clean-podman init-sqlx build-container-release
+ podman network create {{network}} --ignore
podman run -d --network {{network}} -e {{env_string}} -p 8080:8080 --name frostbyte fb-server
# Initializes the database, runs migrations and then prepares sqlx
@@ -44,14 +45,10 @@ init-sqlx:
# Starts a postgres container for development
[private]
-start-postgres-dev: create-network
+start-postgres-dev:
podman rm -f {{pg_container}}
podman run --network {{network}} --name {{pg_container}} -e POSTGRES_PASSWORD={{pg_pass}} -d -p {{pg_port}}:5432 docker.io/postgres:16.1-alpine
-[private]
-create-network:
- podman network create {{network}} --ignore
-
# Forcefully stops and removes the frostbyte container
[private]
clean-podman:
diff --git a/server/src/routes/users.rs b/server/src/routes/users.rs
index 60cfc4f..c5e7f02 100755
--- a/server/src/routes/users.rs
+++ b/server/src/routes/users.rs
@@ -84,14 +84,13 @@ pub struct CaptchaResponse {
}
/// Request a captcha from the captcha service
-#[allow(unreachable_code, unused_variables)]
#[post("/captcha")]
pub async fn captcha_request(cstate: Data
) -> Result {
unimplemented!("Captcha is currently disabled");
return Ok(HttpResponse::InternalServerError().json("Error"));
// This might block the thread a bit too long
- let (answer, svg) = get_captcha();
+ // let (answer, svg) = get_captcha();
// let id = rand_core::OsRng.next_u32() as i32;
diff --git a/server/src/util/util.rs b/server/src/util/util.rs
index 62754a1..b50a703 100644
--- a/server/src/util/util.rs
+++ b/server/src/util/util.rs
@@ -1,4 +1,4 @@
-use rand::Rng;
+use rand::{Rng, RngCore};
// This will do for now
pub fn hex_string(length: usize) -> String {
@@ -9,9 +9,11 @@ pub fn hex_string(length: usize) -> String {
}
mod tests {
+ use super::*;
+
#[test]
fn test_random_hex_string() {
- let s = super::hex_string(16);
+ let s = hex_string(16);
assert_eq!(s.len(), 16);
}
}