Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ct/bookstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"

header_info "$APP"
Expand Down
8 changes: 6 additions & 2 deletions frontend/public/json/bookstack.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ram": 1024,
"hdd": 4,
"os": "debian",
"version": "12"
"version": "13"
}
}
],
Expand All @@ -33,8 +33,12 @@
},
"notes": [
{
"text": "Bookstack works only with static ip. If you Change the IP of your LXC, you Need to edit the .env File `nano /opt/bookstack/.env`",
"text": "Bookstack works only with static IP. If you change the IP of your LXC, you need to edit the .env file",
"type": "warning"
},
{
"text": "To see database credentials, type `cat ~/bookstack.creds` in LXC console",
"type": "info"
}
]
}
32 changes: 7 additions & 25 deletions install/bookstack-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,24 @@ setting_up_container
network_check
update_os

msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \
apache2 \
make
msg_info "Installing Dependencies"
$STD apt install -y make
msg_ok "Installed Dependencies"

PHP_MODULE="ldap,tidy,bz2,mysqli" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.3" setup_php

setup_composer
setup_mariadb

msg_info "Setting up Database"
DB_NAME=bookstack
DB_USER=bookstack
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{
echo "Bookstack-Credentials"
echo "Bookstack Database User: $DB_USER"
echo "Bookstack Database Password: $DB_PASS"
echo "Bookstack Database Name: $DB_NAME"
} >>~/bookstack.creds
msg_ok "Set up database"

MARIADB_DB_NAME="bookstack_db" MARIADB_DB_USER="bookstack_user" setup_mariadb_db
fetch_and_deploy_gh_release "bookstack" "BookStackApp/BookStack"
LOCAL_IP="$(hostname -I | awk '{print $1}')"
import_local_ip

msg_info "Configuring Bookstack (Patience)"
cd /opt/bookstack
cp .env.example .env
sudo sed -i "s|APP_URL=.*|APP_URL=http://$LOCAL_IP|g" /opt/bookstack/.env
sudo sed -i "s/DB_DATABASE=.*/DB_DATABASE=$DB_NAME/" /opt/bookstack/.env
sudo sed -i "s/DB_USERNAME=.*/DB_USERNAME=$DB_USER/" /opt/bookstack/.env
sudo sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$DB_PASS/" /opt/bookstack/.env
sudo sed -i "s/DB_DATABASE=.*/DB_DATABASE=$MARIADB_DB_NAME/" /opt/bookstack/.env
sudo sed -i "s/DB_USERNAME=.*/DB_USERNAME=$MARIADB_DB_USER/" /opt/bookstack/.env
sudo sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$MARIADB_DB_PASS/" /opt/bookstack/.env
$STD composer install --no-dev --no-plugins --no-interaction
$STD php artisan key:generate --no-interaction --force
$STD php artisan migrate --no-interaction --force
Expand Down