diff --git a/.env.example b/.env.example index 36d579a..1b7bad1 100644 --- a/.env.example +++ b/.env.example @@ -17,4 +17,8 @@ API_BAN_LIMIT=300 DEV_MODE=0 # Maximum file storage age in minutes, set to -1 to disable -CLEANUP_MAX_AGE=43200 # Default is a month \ No newline at end of file +CLEANUP_MAX_AGE=43200 # Default is a month + +# Maximum pad file lenght, this is in characters, a character is one byte. +# Default: 524288 ( 500kb ) +MAXIMUM_PAD_SIZE=524288 \ No newline at end of file diff --git a/README.md b/README.md index 8928172..1261fec 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,66 @@ The `.env` file contains all of the available options and you should use it to c If you need any help with any setting you can always open an issue over on github and get help from me. -If you are barely getting started with hosting your own services, or even Sys admin stuff in general or writing code my suggestion is to just copy `.env` and leave it as is until you get it running with the defaults running fine, afterwards you can play with it a little and who knows, maybe even get to learn something! \ No newline at end of file +If you are barely getting started with hosting your own services, or even Sys admin stuff in general or writing code my suggestion is to just copy `.env` and leave it as is until you get it running with the defaults running fine, afterwards you can play with it a little and who knows, maybe even get to learn something! + +![Gopher](static/img/banner_how_to_run.png) + +## Docker `(Recommended)` +```bash +# Get into a directory to run this +mkdir ~/freepad && cd freepad + +# Copy the latest .env and docker-compose.example.yaml files +wget -O docker-compose.yaml https://raw.githubusercontent.com/JustKato/FreePad/master/docker-compose.example.yaml +wget -O .env https://raw.githubusercontent.com/JustKato/FreePad/master/.env.example + +# Edit your docker-compose.yaml and change the DOMAIN_BASE environment variable +vim docker-compose.yaml + +# Edit your .env file and change the variables to your liking +vim .env + +# Run the container +docker-compose up +# Run the container in the background +docker-compose up -d +``` +## Distribution +[Downloads here](https://github.com/JustKato/FreePad/releases) +```bash +# Get into a directory to run this +mkdir ~/freepad && cd freepad + +# Get the latest distribution from https://github.com/JustKato/FreePad/releases +wget -O release.zip https://github.com/JustKato/FreePad/releases/download/main/... + +# Unzip the release +unzip release.zip + +# Edit the .env file +vim ./.env + +# Run the program +./freepad +``` + +## Building +```bash +# Clone th erepo +git clone https://github.com/JustKato/FreePad.git ~/freepad + +# Get into the directory +cd ~/freepad + +# Build using the script +./build.sh + +# Copy the environment variable +cp .env dist/ + +# Go into the program's directory +cd dist + +# Run the program +./freepad +``` \ No newline at end of file diff --git a/build.sh b/build.sh index 52b2539..f00ee0b 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ echo "Building FreePad...\n"; echo "Removing old build file..."; -rm dist/freepad 2> /dev/null || true +rm dist/freepad* 2> /dev/null || true rm -r dist/static 2> /dev/null || true rm -r dist/templates 2> /dev/null || true rm dist/.env 2> /dev/null || true @@ -10,6 +10,10 @@ rm dist/.env 2> /dev/null || true # Build echo "Building executable" CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./dist/freepad . +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o ./dist/freepad-arm64 . +CGO_ENABLED=0 GOOS=windows go build -a -installsuffix cgo -o ./dist/freepad.exe . +CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -o ./dist/freepad-darwin . +CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -installsuffix cgo -o ./dist/freepad-darwin-64 . echo "Copying templates" cp -r ./templates ./dist/templates diff --git a/static/img/banner_how_to_run.png b/static/img/banner_how_to_run.png new file mode 100644 index 0000000..8d18d2e Binary files /dev/null and b/static/img/banner_how_to_run.png differ