+8
-2
README.md
+8
-2
README.md
···
1
1
# SimpleLink
2
+
2
3
A very performant and light (6mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres.
3
4
4
5

···
8
9
## Build
9
10
10
11
### From Source
12
+
11
13
First configure .env.example and save it to .env
12
14
13
15
If DATABASE_URL is set, it will connect to a Postgres DB. If blank, it will use an sqlite db in /data
···
15
17
```bash
16
18
#set api-domain to where you will be deploying the link shortener, eg: link.example.com, default is localhost:8080
17
19
git clone https://github.com/waveringana/simplelink && cd simplelink
18
-
./build.sh api-domain=localhost:8080
20
+
./build.sh
19
21
cargo run
20
22
```
21
23
22
24
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.
23
25
24
26
Alternatively if you want a binary form
27
+
25
28
```bash
26
29
./build.sh --binary
27
30
```
31
+
28
32
then check /target/release for the binary named `SimpleGit`
29
33
30
34
### From Docker
35
+
31
36
```bash
32
-
docker build --build-arg API_URL=http://localhost:8080 -t simplelink .
37
+
docker build --build-arg -t simplelink .
33
38
docker run -p 8080:8080 \
34
39
-e JWT_SECRET=change-me-in-production \
35
40
-v simplelink_data:/data \
···
37
42
```
38
43
39
44
### From Docker Compose
45
+
40
46
Adjust the included docker-compose.yml to your liking; it includes a postgres config as well.
+7
-7
build.sh
+7
-7
build.sh
···
1
1
#!/bin/bash
2
2
3
3
# Default values
4
-
API_URL="http://localhost:8080"
4
+
#API_URL="http://localhost:8080"
5
5
RELEASE_MODE=false
6
6
BINARY_MODE=false
7
7
···
9
9
for arg in "$@"
10
10
do
11
11
case $arg in
12
-
api-domain=*)
13
-
API_URL="${arg#*=}"
14
-
shift
15
-
;;
12
+
#api-domain=*)
13
+
#API_URL="${arg#*=}"
14
+
#shift
15
+
#;;
16
16
--release)
17
17
RELEASE_MODE=true
18
18
shift
···
24
24
esac
25
25
done
26
26
27
-
echo "Building project with API_URL: $API_URL"
27
+
#echo "Building project with API_URL: $API_URL"
28
28
echo "Release mode: $RELEASE_MODE"
29
29
30
30
# Check if cargo is installed
···
42
42
# Build frontend
43
43
echo "Building frontend..."
44
44
# Create .env file for Vite
45
-
echo "VITE_API_URL=$API_URL" > frontend/.env
45
+
#echo "VITE_API_URL=$API_URL" > frontend/.env
46
46
47
47
# Install frontend dependencies and build
48
48
cd frontend