-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_config.sh
executable file
·52 lines (38 loc) · 1.86 KB
/
generate_config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
echo "Press enter to use the default value '[value]' or use a custom value"
read -p "Server domain name - this is the end url of where abyss will be hosted []: " -e ABYSS_URL
read -p "Upload key - this is the key you will need to have to be able to make uploads to the server []: " -e UPLOAD_KEY
read -p "Files Directory - this is the dir location for storing the files [./files]: " -e ABYSS_FILEDIR
if [ -z $ABYSS_FILEDIR ]; then
ABYSS_FILEDIR="./files"
fi
read -p "Server port - this is the port the server will run on; type just the port number. []: " -e ABYSS_PORT
read -p "Auth username - this is the username to access /tree (show all uploaded files) [admin]: " -e AUTH_USERNAME
if [ -z $AUTH_USERNAME ]; then
AUTH_USERNAME="admin"
fi
read -p "Auth password - this is the password to access /tree (show all uploaded files) [admin]: " -e AUTH_PASSWORD
if [ -z $AUTH_PASSWORD ]; then
AUTH_PASSWORD="admin"
fi
read -p "Auth for upload form - should password be needed to upload text through the browser? [yes]: " -e SHOULD_AUTH
if [ -z $SHOULD_AUTH ]; then
SHOULD_AUTH="yes"
fi
cat << EOF > .env
# This is the full name of the final domain for the server. Example: paste.abyss.dev
ABYSS_URL=$ABYSS_URL
# Where abyss will store files. It's fine to leave it empty. Defaults to "./files"
ABYSS_FILEDIR=$ABYSS_FILEDIR
# The port the server will run on, it's fine to leave it empty. Defaults to :3235
ABYSS_PORT=$ABYSS_PORT
# This is the username of the user for accessing /tree
AUTH_USERNAME=$AUTH_USERNAME
# This is the password of the user for accessing /tree
AUTH_PASSWORD=$AUTH_PASSWORD
# This is whether you need a password to upload text (through browser or curl)
SHOULD_AUTH=$SHOULD_AUTH
# This is the key needed to make uploads. Include it as X-Auth in curl.
# Tip: Save it somewhere and use it in curl with \$(cat /path/to/key)
UPLOAD_KEY=$UPLOAD_KEY
EOF