Merge pull request #1246 from tomfrenzel/kutt-improvements
Add custom hostname option to kutt
This commit is contained in:
commit
7144a47a60
@ -71,4 +71,4 @@ description
|
|||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}${CL}"
|
echo -e "${TAB}${GATEWAY}${BGN}https://${IP} or https://<your-Kutt-domain>${CL}"
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 3000,
|
"interface_port": 443,
|
||||||
"documentation": "https://github.com/thedevs-network/kutt/",
|
"documentation": "https://github.com/thedevs-network/kutt/",
|
||||||
"config_path": "/etc/kutt-data/.env",
|
"config_path": "/etc/kutt-data/.env",
|
||||||
"website": "https://kutt.it",
|
"website": "https://kutt.it",
|
||||||
@ -31,5 +31,10 @@
|
|||||||
"username": null,
|
"username": null,
|
||||||
"password": null
|
"password": null
|
||||||
},
|
},
|
||||||
"notes": []
|
"notes": [
|
||||||
|
{
|
||||||
|
"text": "Kutt needs so be served with an SSL certificate for its login to work. During install, you will be prompted to choose if you want to have Caddy installed for SSL termination or if you want to use your own reverse proxy (in that case point your reverse porxy to port 3000).",
|
||||||
|
"type": "info"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,28 +13,43 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
echo "${TAB3}How would you like to handle SSL termination?"
|
||||||
$STD apt install -y caddy
|
echo "${TAB3}[i]-Internal (self-signed SSL Certificate) [e]-External (use your own reverse proxy)"
|
||||||
msg_ok "Installed Dependencies"
|
read -rp "${TAB3}Enter your choice <i/e> (default: i): " ssl_choice
|
||||||
|
ssl_choice=${ssl_choice:-i}
|
||||||
|
case "${ssl_choice,,}" in
|
||||||
|
i)
|
||||||
|
import_local_ip
|
||||||
|
DEFAULT_HOST="$LOCAL_IP"
|
||||||
|
|
||||||
|
msg_info "Configuring Caddy"
|
||||||
|
$STD apt install -y caddy
|
||||||
|
cat <<EOF >/etc/caddy/Caddyfile
|
||||||
|
$LOCAL_IP {
|
||||||
|
reverse_proxy localhost:3000
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
systemctl restart caddy
|
||||||
|
msg_ok "Configured Caddy"
|
||||||
|
;;
|
||||||
|
e)
|
||||||
|
read -r -p "${TAB3}Enter the hostname you want to use for Kutt (eg. kutt.example.com): " custom_host
|
||||||
|
if [[ "$custom_host" ]]; then
|
||||||
|
DEFAULT_HOST="$custom_host"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
fetch_and_deploy_gh_release "kutt" "thedevs-network/kutt" "tarball"
|
fetch_and_deploy_gh_release "kutt" "thedevs-network/kutt" "tarball"
|
||||||
import_local_ip
|
|
||||||
|
|
||||||
msg_info "Configuring Kutt"
|
msg_info "Configuring Kutt"
|
||||||
cd /opt/kutt
|
cd /opt/kutt
|
||||||
cp .example.env ".env"
|
cp .example.env ".env"
|
||||||
sed -i "s|JWT_SECRET=|JWT_SECRET=$(openssl rand -base64 32)|g" ".env"
|
sed -i "s|JWT_SECRET=|JWT_SECRET=$(openssl rand -base64 32)|g" ".env"
|
||||||
sed -i "s|DEFAULT_DOMAIN=.*|DEFAULT_DOMAIN=https://$LOCAL_IP|g" ".env"
|
sed -i "s|DEFAULT_DOMAIN=.*|DEFAULT_DOMAIN=https://$DEFAULT_HOST|g" ".env"
|
||||||
$STD npm install
|
$STD npm install
|
||||||
$STD npm run migrate
|
$STD npm run migrate
|
||||||
|
|
||||||
cat <<EOF >/etc/caddy/Caddyfile
|
|
||||||
$LOCAL_IP {
|
|
||||||
reverse_proxy localhost:3000
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
systemctl restart caddy
|
|
||||||
msg_ok "Configured Kutt"
|
msg_ok "Configured Kutt"
|
||||||
|
|
||||||
msg_info "Creating Services"
|
msg_info "Creating Services"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user