mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-10 19:05:09 +00:00
Add NOPASSWD for ghost-user during install and enable Ghost on all interfaces
This commit is contained in:
parent
3cbc4768cd
commit
5ba3173869
@ -11,7 +11,7 @@ APP="Ghost"
|
|||||||
var_tags="cms;blog"
|
var_tags="cms;blog"
|
||||||
var_cpu="2"
|
var_cpu="2"
|
||||||
var_ram="1024"
|
var_ram="1024"
|
||||||
var_disk="4"
|
var_disk="5"
|
||||||
var_os="ubuntu"
|
var_os="ubuntu"
|
||||||
var_version="22.04"
|
var_version="22.04"
|
||||||
var_unprivileged="1"
|
var_unprivileged="1"
|
||||||
@ -30,7 +30,6 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
# CHECK FOR NPM HERE !
|
|
||||||
|
|
||||||
if command -v ghost &> /dev/null; then
|
if command -v ghost &> /dev/null; then
|
||||||
current_version=$(ghost --version | awk '{print $2}') #TO REVIEW
|
current_version=$(ghost --version | awk '{print $2}') #TO REVIEW
|
||||||
@ -54,4 +53,6 @@ build_container
|
|||||||
description
|
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 "${TAB}${GATEWAY}${BGN}http://${IP}:2368${CL}"
|
@ -60,6 +60,7 @@ msg_ok "Installed Ghost CLI"
|
|||||||
msg_info "Creating ghost-user"
|
msg_info "Creating ghost-user"
|
||||||
$STD adduser --disabled-password --gecos "Ghost user" ghost-user
|
$STD adduser --disabled-password --gecos "Ghost user" ghost-user
|
||||||
$STD usermod -aG sudo ghost-user
|
$STD usermod -aG sudo ghost-user
|
||||||
|
echo "ghost-user ALL=(ALL) NOPASSWD: /usr/bin/ghost" | tee /etc/sudoers.d/ghost-user
|
||||||
msg_ok "Created ghost-user"
|
msg_ok "Created ghost-user"
|
||||||
|
|
||||||
# Set up Ghost
|
# Set up Ghost
|
||||||
@ -67,30 +68,10 @@ msg_info "Setting up Ghost"
|
|||||||
mkdir -p /var/www/ghost
|
mkdir -p /var/www/ghost
|
||||||
chown -R ghost-user:ghost-user /var/www/ghost
|
chown -R ghost-user:ghost-user /var/www/ghost
|
||||||
chmod 775 /var/www/ghost
|
chmod 775 /var/www/ghost
|
||||||
sudo -u ghost-user -H sh -c "cd /var/www/ghost && ghost install --db=mysql --dbhost=localhost --dbuser=root --dbpass=ghost --dbname=ghost --url=http://localhost:2368 --no-prompt --no-setup-nginx --no-setup-ssl --no-setup-mysql --no-start"
|
sudo -u ghost-user -H sh -c "cd /var/www/ghost && ghost install --db=mysql --dbhost=localhost --dbuser=root --dbpass=ghost --dbname=ghost --url=http://localhost:2368 --no-prompt --no-setup-nginx --no-setup-ssl --no-setup-mysql --enable --start --ip 0.0.0.0"
|
||||||
|
rm /etc/sudoers.d/ghost-user #Remove ghost-user for sudoers after setup (not required anymore)
|
||||||
msg_ok "Ghost setup completed"
|
msg_ok "Ghost setup completed"
|
||||||
|
|
||||||
# Creating Service (if needed)
|
|
||||||
# msg_info "Creating Service"
|
|
||||||
# cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
|
||||||
# [Unit]
|
|
||||||
# Description=${APPLICATION} Service
|
|
||||||
# After=network.target
|
|
||||||
|
|
||||||
# [Service]
|
|
||||||
# Type=simple
|
|
||||||
# Environment="NODE_ENV=production"
|
|
||||||
# ExecStart=/usr/bin/node /usr/bin/ghost run
|
|
||||||
# WorkingDirectory=/var/www/ghost
|
|
||||||
# User=ghost-user
|
|
||||||
# Group=ghost-user
|
|
||||||
# Restart=always
|
|
||||||
|
|
||||||
# [Install]
|
|
||||||
# WantedBy=multi-user.target
|
|
||||||
# EOF
|
|
||||||
# systemctl enable -q --now ${APPLICATION}.service
|
|
||||||
# msg_ok "Created Service"
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"cpu": 2,
|
"cpu": 2,
|
||||||
"ram": 1024,
|
"ram": 1024,
|
||||||
"hdd": 4,
|
"hdd": 5,
|
||||||
"os": "Ubuntu",
|
"os": "Ubuntu",
|
||||||
"version": "24.04"
|
"version": "24.04"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user