pearcy
pearcy
Explore posts from servers
RRailway
Created by pearcy on 9/18/2024 in #✋|help
Email Configuration Fails with "550 5.7.1 Relaying Denied"
I'm encountering an issue with sending emails from Ghost CMS hosted on Railway. Despite having correct SMTP settings with Mailgun, I consistently receive the following error in the logs: 550 5.7.1 Relaying denied Background: I've verified my SMTP settings with Mailgun by testing them directly using curl for both ports 587 (TLS) and 465 (SSL), and both tests were successful. Here are the environment variables I have set in Railway for Ghost CMS:
mail__auth__user="[email protected]"
mail__from="[email protected]"
mail__options__host="smtp.mailgun.org"
mail__options__port="587"
mail__options__secure="false"
mail__options__service="Mailgun"
mail__transport="SMTP"
mail__auth__pass="API_KEY_PLACEHOLDER"
mail__auth__user="[email protected]"
mail__from="[email protected]"
mail__options__host="smtp.mailgun.org"
mail__options__port="587"
mail__options__secure="false"
mail__options__service="Mailgun"
mail__transport="SMTP"
mail__auth__pass="API_KEY_PLACEHOLDER"
curl Test Script: I used the following curl test script to confirm that Mailgun is processing emails correctly:
#!/bin/bash

# Create a temporary file to hold the email content
EMAIL_CONTENT=$(mktemp)

# Write the email content to the temporary file
echo -e "Subject: Test Mail\n\nThis is a test email using the 587 port." > "$EMAIL_CONTENT"

# Use curl to send the email using port 587 (TLS)
curl -v --url 'smtp://smtp.mailgun.org:587' \
--user '[email protected]:API_KEY_PLACEHOLDER' \
--mail-from '[email protected]' \
--mail-rcpt '[email protected]' \
--upload-file "$EMAIL_CONTENT"

# Clean up the temporary file
rm -f "$EMAIL_CONTENT"
#!/bin/bash

# Create a temporary file to hold the email content
EMAIL_CONTENT=$(mktemp)

# Write the email content to the temporary file
echo -e "Subject: Test Mail\n\nThis is a test email using the 587 port." > "$EMAIL_CONTENT"

# Use curl to send the email using port 587 (TLS)
curl -v --url 'smtp://smtp.mailgun.org:587' \
--user '[email protected]:API_KEY_PLACEHOLDER' \
--mail-from '[email protected]' \
--mail-rcpt '[email protected]' \
--upload-file "$EMAIL_CONTENT"

# Clean up the temporary file
rm -f "$EMAIL_CONTENT"
Can you help determine why Ghost CMS, with the same SMTP settings, fails with the relaying denied error while the curl test works fine? Is there any specific configuration or network restriction on Railway that might be causing this issue?
11 replies
RRailway
Created by pearcy on 9/16/2024 in #✋|help
MySQL Deployment Fails
I'm encountering issues with a MySQL instance running on Railway, which seems to be affecting my deployment. I tried another instance and getting the same error. Using the built-in deploy path - Create / Database / Add MySQL
You reached the start of the range → Sep 16, 2024 5:33 PM

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/9fee6adc-f4ac-4cf3-9c39-5f7eb6a624ea/vol_35glb32mgghcrjum

2024-09-16 21:33:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.

2024-09-16 21:33:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-09-16 21:33:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.

'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-09-16T21:33:10.434366Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-09-16T21:33:10.550541Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 1

2024-09-16T21:33:10.555372Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2024-09-16T21:33:10.865883Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2024-09-16T21:33:11.058069Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2024-09-16T21:33:11.058105Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-09-16T21:33:11.070049Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.

2024-09-16T21:33:11.096322Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock

2024-09-16T21:33:11.096408Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '9.0.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
You reached the start of the range → Sep 16, 2024 5:33 PM

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/9fee6adc-f4ac-4cf3-9c39-5f7eb6a624ea/vol_35glb32mgghcrjum

2024-09-16 21:33:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.

2024-09-16 21:33:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-09-16 21:33:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.

'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-09-16T21:33:10.434366Z 0 [System] [MY-015015] [Server] MySQL Server - start.

2024-09-16T21:33:10.550541Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 1

2024-09-16T21:33:10.555372Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2024-09-16T21:33:10.865883Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2024-09-16T21:33:11.058069Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

2024-09-16T21:33:11.058105Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

2024-09-16T21:33:11.070049Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.

2024-09-16T21:33:11.096322Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock

2024-09-16T21:33:11.096408Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '9.0.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
17 replies
RRailway
Created by pearcy on 8/27/2024 in #✋|help
Ghost CMS email config
I’m running into an issue with Ghost CMS where users are unable to sign up for my newsletter due to an email configuration problem. Here’s the setup and what I’ve tried so far: #### Steps Taken: 1. Created Subdomain in Mailgun: - Subdomain: mg.domain.com 2. DNS Configuration: - Added MX, TXT, and CNAME records to my Namecheap registrar. 3. DNS Check & Verification: - All records passed DNS checks and are verified in Mailgun. 4. Email Configuration in Railway: - I added the email settings as Railway environment variables instead of using config.production.json (I don’t believe I have access to the config file due to deployment via a Railway Docker image). Environment Variables:
mail__transport="SMTP"
mail__options__service="Mailgun"
mail__options__host="smtp.mailgun.org"
mail__options__port="587" # also tried "465" for SSL/TLS
mail__options__secure="false" # "true" if using port 465
mail__auth__user="[email protected]"
mail__auth__pass="hidden"
mail__from="[email protected]"

mail__transport="SMTP"
mail__options__service="Mailgun"
mail__options__host="smtp.mailgun.org"
mail__options__port="587" # also tried "465" for SSL/TLS
mail__options__secure="false" # "true" if using port 465
mail__auth__user="[email protected]"
mail__auth__pass="hidden"
mail__from="[email protected]"

Reference: https://ghost.org/docs/config/ 5. Mailgun Configuration Verification: - I used swaks to confirm that my Mailgun SMTP settings are correct. - A test email was successfully sent and received via my terminal.
Mailgun Logs:
08/27/24, 1:01:59 PM Delivered
OK
08/27/24, 1:01:55 PM Accepted

08/27/24, 1:01:59 PM Delivered
OK
08/27/24, 1:01:55 PM Accepted

#### Question: - Is using environment variables in Railway instead of config.production.json a workable approach for Ghost CMS email configuration? Any insights or suggestions would be greatly appreciated.
6 replies
RRailway
Created by pearcy on 8/18/2024 in #✋|help
Deploying Ghost on Railway from GitHub Repo
Hey everyone, I’m working on self-hosting a Ghost CMS using the Ghost Starter repo from my GitHub: https://github.com/TryGhost/Starter. Setup: 1. Project: Ghost CMS, based on the Starter theme, hosted on Railway. 2. Deployment method: Self-hosting on Railway, pulling the source code directly from my GitHub repo. Issue: I’m facing a deployment issue during the yarn install --frozen-lockfile step. Here’s what the logs show:
#11 2.148 error Your lockfile needs to be updated, but yarn was run with --frozen-lockfile.
#11 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1
#11 2.148 error Your lockfile needs to be updated, but yarn was run with --frozen-lockfile.
#11 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1
It seems the lockfile needs to be updated, but the install process is forced to use a frozen lockfile, causing the build to fail. package.json snippet
{
"name": "ghost-starter-theme",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ghost run",
"build": "rollup -c --environment BUILD:production",
"dev": "rollup -c --environment BUILD:development -w"
},
"dependencies": {
"ghost": "^5.x",
"mysql2": "^2.3.3"
},
"devDependencies": {
"ghost-cli": "^1.21.0",
"rollup": "^3.18.0"
}
}
{
"name": "ghost-starter-theme",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "ghost run",
"build": "rollup -c --environment BUILD:production",
"dev": "rollup -c --environment BUILD:development -w"
},
"dependencies": {
"ghost": "^5.x",
"mysql2": "^2.3.3"
},
"devDependencies": {
"ghost-cli": "^1.21.0",
"rollup": "^3.18.0"
}
}
What I Need Help With: - Given that I’m using the starter Ghost CMS repo, do I need to update the lockfile, or is there a better approach to avoid this error? - Am I missing anything in my setup for deploying on Railway when self-hosting without Docker?
- I was able to deploy using Railway’s templates but need to deploy from my GitHub repo to allow for editing and updates. Any advice or insights would be appreciated! Thanks in advance!
6 replies
WWasp-lang
Created by pearcy on 1/11/2024 in #🙋questions
Unable to access the Dashboard as an admin user
When I spin up a open-saas repo (https://github.com/wasp-lang/open-saas.git) everything works swimmingly except I am unable to access to the Dashboard as an admin user. -- running locally, Docker Postgres, dev env changes: // app/.env.server [email protected] // app/main.wasp isAdmin Boolean @default(true) Expected behavior: After these env changes, I signup and should have access to the Dashboard. -- there is nothing in my account in nav so enter /admin directly in the URL. If I change all the values to "false", I can get access to the Dashboard but when I go back to account or demo-app it routes me to the login screen. // app/main.wasp ``` route AdminRoute { path: "/admin", to: DashboardPage } page DashboardPage { authRequired: false, component: import Dashboard from "@client/admin/pages/DashboardPage" }
11 replies