+2
-1
.env.example
+2
-1
.env.example
···
+5
-15
.github/workflows/docker-image.yml
+5
-15
.github/workflows/docker-image.yml
······
-80
.github/workflows/main.yml
-80
.github/workflows/main.yml
···
+67
-230
Cargo.lock
+67
-230
Cargo.lock
·················································································
+4
-3
Cargo.toml
+4
-3
Cargo.toml
···-sqlx = { version = "0.8", features = ["runtime-tokio-native-tls", "postgres", "uuid", "chrono"] }···
+2
-2
Dockerfile
+2
-2
Dockerfile
······
+52
-12
README.md
+52
-12
README.md
···-A very performant and light (6mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres.+A very performant and light (2MB in memory) link shortener and tracker. Written in Rust and React and uses Postgres or SQLite.+- `SIMPLELINK_USER`: Optional. If set along with SIMPLELINK_PASS, creates an admin user on first run+- `INITIAL_LINKS`: Optional. Semicolon-separated list of initial links in format "url,code;url2,code2"+If `SIMPLELINK_USER` and `SIMPLELINK_PASS` are not passed, an admin-setup-token is pasted to the console and as a text file in the project root.-#set api-domain to where you will be deploying the link shortener, eg: link.example.com, default is localhost:8080-On an empty database, an admin-setup-token.txt is created as well as pasted into the terminal output. This is needed to make the admin account.
+7
-7
build.sh
+7
-7
build.sh
············
+1
-5
docker-compose.yml
+1
-5
docker-compose.yml
+14
-11
frontend/index.html
+14
-11
frontend/index.html
···
+40
-4
frontend/src/api/client.ts
+40
-4
frontend/src/api/client.ts
······
+82
-62
frontend/src/components/AuthForms.tsx
+82
-62
frontend/src/components/AuthForms.tsx
···············-<Tabs value={activeTab} onValueChange={(value: string) => setActiveTab(value as 'login' | 'register')}>
+139
frontend/src/components/EditModal.tsx
+139
frontend/src/components/EditModal.tsx
···+'Custom code must be 1-32 characters and contain only letters, numbers, underscores, and hyphens',
+45
-14
frontend/src/components/LinkList.tsx
+45
-14
frontend/src/components/LinkList.tsx
···import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"······························
+160
-98
frontend/src/components/StatisticsModal.tsx
+160
-98
frontend/src/components/StatisticsModal.tsx
···
+10
frontend/src/context/AuthContext.tsx
+10
frontend/src/context/AuthContext.tsx
···
+1
frontend/src/types/api.ts
+1
frontend/src/types/api.ts
+28
-15
frontend/vite.config.ts
+28
-15
frontend/vite.config.ts
···
+3
migrations/20250219000000_extend_short_code.sql
+3
migrations/20250219000000_extend_short_code.sql
+42
migrations/sqlite/20250125000000_init.sql
+42
migrations/sqlite/20250125000000_init.sql
···
+8
-7
src/auth.rs
+8
-7
src/auth.rs
·········
+583
-155
src/handlers.rs
+583
-155
src/handlers.rs
·······································+pub async fn check_first_user(state: web::Data<AppState>) -> Result<impl Responder, AppError> {
+94
-10
src/lib.rs
+94
-10
src/lib.rs
······-pub async fn check_and_generate_admin_token(pool: &sqlx::PgPool) -> anyhow::Result<Option<String>> {+pub async fn check_and_generate_admin_token(db: &DatabasePool) -> anyhow::Result<Option<String>> {···
+165
-12
src/main.rs
+165
-12
src/main.rs
············
+77
-5
src/models.rs
+77
-5
src/models.rs
·········