Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New script : Ghost #1361

Merged
merged 40 commits into from
Jan 10, 2025
Merged

New script : Ghost #1361

merged 40 commits into from
Jan 10, 2025

Conversation

fabrice1236
Copy link
Contributor

@fabrice1236 fabrice1236 commented Jan 9, 2025

✍️ Description

This pull request adds support for Ghost, an open-source CMS (https://ghost.org/).


  • Related Discussion:167

🛠️ Type of Change

Please check the relevant options:

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that resolves an issue)
  • Breaking change (fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts)

✅ Prerequisites

The following steps must be completed for the pull request to be considered:

  • Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • Testing performed (I have thoroughly tested my changes and verified expected functionality.)
  • Documentation updated (I have updated any relevant documentation)

📋 Additional Information (optional)

To make the setup easy, the script sets up Ghost using localhost as a domain (ghost doesn't support IPs) and listens on 0.0.0.0 to still receive requests from the outside. It's normally designed to run with a domain in production, or on your local machine for testing (not on another in your network), but for a plug-and-play solution, this works well.
You are also required to run ghost commands as a non-root user, so the script also creates the "ghost-user" for that. I mention this in the json file, in case the user needs access to them (starting and stopping can still be done by root as it's a service).

…and consolidate Node.js and npm installation steps
@fabrice1236 fabrice1236 requested a review from a team as a code owner January 9, 2025 18:22
@github-actions github-actions bot added new script A change that adds a new script website A change to the website labels Jan 9, 2025
Copy link
Member

@michelroegl-brunner michelroegl-brunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all Comments and unneseccary comments.

ct/ghost.sh Outdated Show resolved Hide resolved
ct/ghost.sh Outdated Show resolved Hide resolved
ct/ghost.sh Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
json/ghost.json Outdated Show resolved Hide resolved
install/ghost-install.sh Outdated Show resolved Hide resolved
@MickLesk MickLesk merged commit f275cdd into community-scripts:main Jan 10, 2025
5 checks passed
@logicxonline
Copy link

⚙️ Using Default Settings on node pve
🖥️ Operating System: debian
🌟 Version: 12
📦 Container Type: Unprivileged
💾 Disk Size: 5GB
🧠 CPU Cores: 2
🛠️ RAM Size: 1024MiB
🆔 Container ID: 121
🚀 Creating a Ghost LXC using the above default settings

✔️ Using local for Template Storage.
✔️ Using local-zfs for Container Storage.
✔️ Updated LXC Template List
✔️ LXC Container 121 was successfully created.
✔️ Started LXC Container
✔️ Set up Container OS
✔️ Network Connected: 172.16.1.58
✔️ IPv4 Internet Connected
✖️ IPv6 Internet Not Connected
✔️ DNS Resolved github.com to 140.82.121.4
✔️ Updated Container OS
⠹ Installing Dependencies
[ERROR] in line 44: exit code 0: while executing command "$@" > /dev/null 2>&1
root@pve:~#

@dsibilly
Copy link

I am also getting an error after the OS updates are completed. Running in verbose mode provides the following:

✔️  Updated Container OS
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'mysql-server' has no installation candidate

[ERROR] in line 19: exit code 0: while executing command $STD apt-get install -y curl sudo mc nginx mysql-server ca-certificates gnupg

Either the mysql-server dependency should likely be changed to mariadb-server, or the script should add the official MySQL repository to apt so it can be installed from the official releases. I don't think Debian keeps MySQL in their repos anymore.

@MickLesk
Copy link
Member

test again please

@dsibilly
Copy link

@MickLesk Improvement! I see the script installing MariaDB now instead of MySQL, and it gets much further in the process. However, it runs into this:

✔ Setting up Systemd
+ sudo systemctl is-active ghost_localhost
+ sudo systemctl start ghost_localhost
+ sudo systemctl stop ghost_localhost
✖ Starting Ghost
One or more errors occurred.

1) GhostError

Message: Ghost was able to start, but errored during boot with: Access denied for user 'root'@'localhost'
Help: Unknown database error
Suggestion: journalctl -u ghost_localhost -n 50

Debug Information:
    OS: Debian GNU/Linux, v12
    Node Version: v20.18.1
    Ghost Version: 5.105.0
    Ghost-CLI Version: 1.26.1
    Environment: production
    Command: 'ghost install --db=mysql --dbhost=localhost --dbuser=root --dbpass=LpJ7qf2Jpmn6V --dbname=ghost --url=http://localhost:2368 --no-prompt --no-setup-nginx --no-setup-ssl --no-setup-mysql --enable --start --ip 0.0.0.0'

Additional log info available in: /home/ghost-user/.ghost/logs/ghost-cli-debug-2025-01-10T16_56_11_973Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

[ERROR] in line 68: exit code 0: while executing command sudo -u ghost-user -H sh -c "cd /var/www/ghost && ghost install --db=mysql --dbhost=localhost --dbuser=root --dbpass=$DB_PASS --dbname=ghost --url=http://localhost:2368 --no-prompt --no-setup-nginx --no-setup-ssl --no-setup-mysql --enable --start --ip 0.0.0.0"

Looks like the script can't use the root account on MariaDB?

@fabrice1236
Copy link
Contributor Author

I implemented a fix in #1408

@neilcrew
Copy link

I note that the script installs with MariaDB but Ghost recommends using My SQL. Any reason for this and any prospect for moving to MySQL?

@MickLesk
Copy link
Member

Logic is the Same? MariaDB use MySQL ?

@neilcrew
Copy link

Maybe so, but it does display a warning.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new script A change that adds a new script website A change to the website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants