1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00

Updated README

This commit is contained in:
Sayantan Santra 2023-04-08 15:56:42 -05:00
parent 0ddd75502d
commit 4edf7349b0

View file

@ -62,19 +62,10 @@ Clone this repository
``` ```
git clone https://gitlab.com/SinTan1729/simply-shorten git clone https://gitlab.com/SinTan1729/simply-shorten
``` ```
Note that Gradle 6.x.x and JDK 11 are required. Other versions are not tested
### 1. Build the `.jar` file
```
gradle build --no-daemon
```
The `--no-daemon` option means that gradle should exit as soon as the build is
finished. Without it, gradle would still be running in the background
in order to speed up future builds.
### 2. Set environment variables ### 2. Set environment variables
```bash ```bash
# Required for authentication # Required for authentication
export username=<api username>
export password=<api password> export password=<api password>
# Sets where the database exists. Can be local or remote (optional) # Sets where the database exists. Can be local or remote (optional)
export db_url=<url> # Default: './urls.sqlite' export db_url=<url> # Default: './urls.sqlite'
@ -83,9 +74,10 @@ export db_url=<url> # Default: './urls.sqlite'
export site_url=<url> export site_url=<url>
``` ```
### 3. Run it ### 3. Build and run it
``` ```
java -jar build/libs/url.jar cd actix
cargo run
``` ```
You can optionally set the port the server listens on by appending `--port=[port]` You can optionally set the port the server listens on by appending `--port=[port]`
### 4. Navigate to `http://localhost:4567` in your browser, add links as you wish. ### 4. Navigate to `http://localhost:4567` in your browser, add links as you wish.
@ -99,7 +91,6 @@ docker build . -t simply-shorten:latest
1. Run the image 1. Run the image
``` ```
docker run -p 4567:4567 docker run -p 4567:4567
-d url:latest
-e username="username" -e username="username"
-e password="password" -e password="password"
-d simply-shorten:latest -d simply-shorten:latest
@ -127,19 +118,15 @@ docker run -p 4567:4567 \
``` ```
## Disable authentication ## Disable authentication
As requested in #5, it is possible to completely disable the authentication. It's not possible to completely disable authentication. It's rather easy to implement
This if not recommended, as it will allow anyone to create new links and delete but there's literally no point. Rather, for testing purposes, you can omit the password
environment variable, and any provided password should work.
This if not recommended in actual use however, as it will allow anyone to create new links and delete
old ones. This might not seem like a bad idea, until you have hundreds of links old ones. This might not seem like a bad idea, until you have hundreds of links
pointing to illegal content. Since there are no logs, it's impossible to prove pointing to illegal content. Since there are no logs, it's impossible to prove
that those links aren't created by you. that those links aren't created by you.
If you still want to do it, then you need to set an environment variable to
an exact value:
```
INSECURE_DISABLE_PASSWORD=I_KNOW_ITS_BAD
```
Any other value will not work.
## Notes ## Notes
- It started as a fork of [this project](https://gitlab.com/draganczukp/simply-shorten). - It started as a fork of [this project](https://gitlab.com/draganczukp/simply-shorten).
- The list of adjectives and names used for random short url generation is a modified - The list of adjectives and names used for random short url generation is a modified