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

chore(deps): update dependency got to v11 [security] #1655

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
414d70c
chore(deps): update dependency tough-cookie to v4.1.3 [security]
renovate[bot] Sep 14, 2023
506a73c
chore(deps): update dependency semver to v7.5.2 [security]
renovate[bot] Sep 14, 2023
c3df099
chore(deps): update dependency rxjs to v7.8.1
renovate[bot] Sep 14, 2023
a24f589
chore(deps): update dependency tail to v2.2.6
renovate[bot] Sep 14, 2023
3d75165
chore(deps): update dependency systeminformation to v5.21.4
renovate[bot] Sep 14, 2023
fa004f9
chore(deps): update dependency yargs to v17.7.2
renovate[bot] Sep 14, 2023
403384c
chore(deps): update dependency systeminformation to v5.21.5
renovate[bot] Sep 15, 2023
f2e6fd4
chore(deps): update dependency semver to v7.5.4
renovate[bot] Sep 16, 2023
df2b24f
chore(deps): update dependency systeminformation to v5.21.7 [security]
renovate[bot] Sep 21, 2023
ba12650
chore(deps): update dependency systeminformation to v5.21.8
renovate[bot] Sep 22, 2023
c88a800
chore(deps): lock file maintenance
renovate[bot] Sep 23, 2023
52d230f
chore(deps): lock file maintenance
renovate[bot] Sep 25, 2023
5268592
chore(deps): update dependency systeminformation to v5.21.9
renovate[bot] Sep 26, 2023
064f6b6
✨ Added support for multiple built-in themes (#1784)
cmraible Oct 4, 2023
70e3be3
chore(update): updated step title
daniellockyer Oct 4, 2023
1922549
chore(docs): updated shipping instructions
daniellockyer Oct 4, 2023
c766560
chore(release): 1.25.1
daniellockyer Oct 4, 2023
eb3f430
fix(update): fixed permission issues when linking themes
daniellockyer Oct 5, 2023
904b0d1
chore(release): 1.25.2
daniellockyer Oct 5, 2023
09f82bb
chore(deps): update dependency systeminformation to v5.21.11
renovate[bot] Oct 5, 2023
2fcac39
chore(release): 1.25.3
daniellockyer Oct 11, 2023
f8571cb
chore(deps): update dependency @tryghost/zip to v1.1.38
renovate[bot] Oct 11, 2023
ff577b6
chore(deps): lock file maintenance
renovate[bot] Oct 16, 2023
526d080
fix: change default mysql hostname on new sites from localhost to 127…
BertanT Feb 18, 2024
b85c3cf
Update node versions in CI
vikaspotluri123 Jan 5, 2024
0b67abb
chore(deps): update actions/checkout action to v4
renovate[bot] Oct 19, 2023
5566c5b
Added support for Node 20
daniellockyer Mar 19, 2024
c43deb7
chore(release): 1.26.0
daniellockyer Mar 19, 2024
4fea26f
chore(deps): update dependency @tryghost/zip to v1.1.41
renovate[bot] Mar 19, 2024
eea658a
chore(deps): update dependency generate-password to v1.7.1
renovate[bot] Mar 19, 2024
c3216ac
chore(deps): update dependency systeminformation to v5.22.5
renovate[bot] Mar 19, 2024
c88fea0
chore(deps): update dependency systeminformation to v5.22.6
renovate[bot] Mar 20, 2024
6e55fb0
chore(deps): update dependency systeminformation to v5.22.7
renovate[bot] Apr 2, 2024
a5877ba
chore(deps): update dependency got to v11 [security]
renovate[bot] Apr 4, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
matrix:
os: [ubuntu-20.04]
password: [root]
node: [16.x]
node: [18.x]
steps:
- name: Start nginx
run: sudo service nginx start
- name: Updating hosts file
run: 'echo -e "127.0.0.1 cli-testing.ghost.org\n" | sudo tee -a /etc/hosts'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: 'cli'
- uses: actions/setup-node@v3
Expand All @@ -45,7 +45,7 @@ jobs:
--no-prompt \
--url http://cli-testing.ghost.org \
--db mysql \
--dbhost localhost \
--dbhost 127.0.0.1 \
--dbuser root \
--dbpass ${{ matrix.password }} \
--dbname ghost-mysql
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/local-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['16.x']
node: ['18.x']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: 'cli'
- uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 14.x, 16.x, 18.x ]
node: [ 18.x, 20.x ]
env:
FORCE_COLOR: 1
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="1.26.0"></a>
# [1.26.0](https://github.com/TryGhost/Ghost-CLI/compare/v1.25.3...v1.26.0) (2024-03-19)


### Bug Fixes

* change default mysql hostname on new sites from localhost to 127.0.0.1 to use ipv4 ([526d080](https://github.com/TryGhost/Ghost-CLI/commit/526d080))



<a name="1.25.3"></a>
## [1.25.3](https://github.com/TryGhost/Ghost-CLI/compare/v1.25.2...v1.25.3) (2023-10-11)



<a name="1.25.2"></a>
## [1.25.2](https://github.com/TryGhost/Ghost-CLI/compare/v1.25.1...v1.25.2) (2023-10-05)


### Bug Fixes

* **update:** fixed permission issues when linking themes ([eb3f430](https://github.com/TryGhost/Ghost-CLI/commit/eb3f430))



<a name="1.24.2"></a>
## [1.24.2](https://github.com/TryGhost/Ghost-CLI/compare/v1.24.1...v1.24.2) (2023-07-07)

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ yarn test
#### Publishing a new version

1. `yarn ship -- -r patch/minor/major`
2. `npm publish`
3. Go to https://github.com/TryGhost/Ghost-CLI/releases/new and create a new release
4. Use `Generate release notes` and publish
2. `git push`
3. `npm publish`
4. Go to https://github.com/TryGhost/Ghost-CLI/releases/new and create a new release
5. Use `Generate release notes` and publish

# Copyright & License

Expand Down
22 changes: 14 additions & 8 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class InstallCommand extends Command {
title: 'Linking latest Ghost and recording versions',
task: this.link.bind(this)
}, {
title: 'Linking latest Casper',
task: this.casper
title: 'Linking built-in themes',
task: this.defaultThemes
}], false)
}], {
argv: {...argv, version},
Expand Down Expand Up @@ -129,12 +129,18 @@ class InstallCommand extends Command {
ctx.installPath = path.join(process.cwd(), 'versions', resolvedVersion); // eslint-disable-line require-atomic-updates
}

casper() {
// Create a symlink to the theme from the current version
return symlinkSync(
path.join(process.cwd(), 'current', 'content', 'themes', 'casper'),
path.join(process.cwd(), 'content', 'themes', 'casper')
);
defaultThemes() {
const currentThemesDir = path.join(process.cwd(), 'current', 'content', 'themes');
const contentThemesDir = path.join(process.cwd(), 'content', 'themes');
const defaultThemes = fs.readdirSync(currentThemesDir);
for (const theme of defaultThemes) {
if (!fs.existsSync(path.join(contentThemesDir, theme))) {
symlinkSync(
path.join(currentThemesDir, theme),
path.join(contentThemesDir, theme)
);
}
}
}

link(ctx) {
Expand Down
45 changes: 43 additions & 2 deletions lib/commands/update.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const fs = require('fs-extra');
const path = require('path');
const symlinkSync = require('symlink-or-copy').sync;

// Utils
const {GhostError} = require('../errors');
const Command = require('../command');
const DoctorCommand = require('./doctor');
const ghostUser = require('../utils/use-ghost-user');

class UpdateCommand extends Command {
static configureOptions(commandName, yargs, extensions) {
Expand Down Expand Up @@ -42,6 +44,7 @@ class UpdateCommand extends Command {
instance,
force,
activeVersion: instance.version,
ui: this.ui,
version,
zip,
v1
Expand Down Expand Up @@ -92,6 +95,9 @@ class UpdateCommand extends Command {
}, {
title: 'Linking latest Ghost and recording versions',
task: this.link
}, {
title: 'Linking built-in themes',
task: this.linkDefaultThemes
}, {
title: 'Running database migrations',
skip: ({rollback}) => rollback,
Expand Down Expand Up @@ -218,15 +224,50 @@ class UpdateCommand extends Command {
}

link({instance, installPath, version, rollback}) {
const symlinkSync = require('symlink-or-copy').sync;

fs.removeSync(path.join(process.cwd(), 'current'));
symlinkSync(installPath, path.join(process.cwd(), 'current'));

instance.previousVersion = rollback ? null : instance.version;
instance.version = version;
instance.nodeVersion = process.versions.node;
}

async linkDefaultThemes({instance, rollback, ui}) {
const currentThemesDir = path.join(process.cwd(), 'current', 'content', 'themes');
const contentThemesDir = path.join(instance.config.get('paths.contentPath'), 'themes');
// remove any broken symlinks caused by default themes no longer existing in previous version
if (rollback) {
if (fs.existsSync(contentThemesDir)) {
const installedThemes = fs.readdirSync(contentThemesDir);
for (const theme of installedThemes) {
if (!fs.existsSync(path.join(contentThemesDir, theme))) {
if (ghostUser.shouldUseGhostUser(contentThemesDir)) {
await ui.sudo(`rm ${path.join(contentThemesDir, theme)}`, {sudoArgs: '-E -u ghost'});
} else {
fs.unlinkSync(path.join(contentThemesDir, theme));
}
}
}
}
}

// ensure all default themes (e.g. themes shipped with Ghost) are symlinked to /content/themes directory
if (fs.existsSync(currentThemesDir)) {
const defaultThemes = fs.readdirSync(currentThemesDir);
for (const theme of defaultThemes) {
if (!fs.existsSync(path.join(contentThemesDir, theme))) {
if (ghostUser.shouldUseGhostUser(contentThemesDir)) {
await ui.sudo(`ln -s ${path.join(currentThemesDir, theme)} ${path.join(contentThemesDir, theme)}`, {sudoArgs: '-E -u ghost'});
} else {
symlinkSync(
path.join(currentThemesDir, theme),
path.join(contentThemesDir, theme)
);
}
}
}
}
}
}

UpdateCommand.description = 'Update a Ghost instance';
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = async function (ui, instance) {
const zipPath = path.join(process.cwd(), `backup-${backupSuffix}.zip`);

try {
await zip.compress(path.join(instance.dir, 'content/'), zipPath, {glob: `{data/${contentExportFile},data/${membersExportFile},files/**,images/**,media/**,settings/**,themes/**}`, ignore: 'themes/casper'});
await zip.compress(path.join(instance.dir, 'content/'), zipPath, {glob: `{data/${contentExportFile},data/${membersExportFile},files/**,images/**,media/**,settings/**,themes/**}`, ignore: 'themes/casper,themes/source'});
} catch (err) {
throw new ProcessError(err);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/configure/get-prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function getPrompts(config, argv, environment) {
type: 'input',
name: 'dbhost',
message: 'Enter your MySQL hostname:',
default: config.get('database.connection.host', 'localhost')
default: config.get('database.connection.host', '127.0.0.1')
});
}

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghost-cli",
"version": "1.24.2",
"version": "1.26.0",
"description": "CLI Tool for installing & updating Ghost",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",
Expand Down Expand Up @@ -39,7 +39,7 @@
]
},
"engines": {
"node": "^12.22.1 || ^14.17.0 || ^16.13.0 || ^18.0.0"
"node": "^12.22.1 || ^14.17.0 || ^16.13.0 || ^18.0.0 || ^20.11.1"
},
"preferGlobal": true,
"dependencies": {
Expand All @@ -57,9 +57,9 @@
"fkill": "7.2.1",
"form-data": "3.0.1",
"fs-extra": "11.1.1",
"generate-password": "1.7.0",
"generate-password": "1.7.1",
"global-modules": "2.0.0",
"got": "9.6.0",
"got": "11.8.5",
"https-proxy-agent": "5.0.1",
"ini": "2.0.0",
"inquirer": "7.3.3",
Expand All @@ -78,17 +78,17 @@
"proxy-from-env": "1.1.0",
"read-last-lines": "1.8.0",
"replace-in-file": "6.3.5",
"rxjs": "7.8.0",
"semver": "7.3.8",
"rxjs": "7.8.1",
"semver": "7.5.4",
"shasum": "1.0.2",
"stat-mode": "1.0.0",
"strip-ansi": "6.0.1",
"symlink-or-copy": "1.3.1",
"systeminformation": "5.16.9",
"tail": "2.2.5",
"tough-cookie": "4.1.2",
"systeminformation": "5.22.7",
"tail": "2.2.6",
"tough-cookie": "4.1.3",
"validator": "7.2.0",
"yargs": "17.6.2",
"yargs": "17.7.2",
"yarn": "1.22.19"
},
"devDependencies": {
Expand Down
27 changes: 18 additions & 9 deletions test/unit/commands/install-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('Unit: Commands > Install', function () {
const runCommandStub = sinon.stub(testInstance, 'runCommand').resolves();
const versionStub = sinon.stub(testInstance, 'version').resolves();
const linkStub = sinon.stub(testInstance, 'link').resolves();
const casperStub = sinon.stub(testInstance, 'casper').resolves();
const defaultThemesStub = sinon.stub(testInstance, 'defaultThemes').resolves();

return testInstance.run({version: '1.0.0', setup: false, 'check-empty': true}).then(() => {
expect(dirEmptyStub.calledOnce).to.be.true;
Expand All @@ -216,7 +216,7 @@ describe('Unit: Commands > Install', function () {
expect(ensureStructureStub.calledOnce).to.be.true;
expect(versionStub.calledOnce).to.be.true;
expect(linkStub.calledOnce).to.be.true;
expect(casperStub.calledOnce).to.be.true;
expect(defaultThemesStub.calledOnce).to.be.true;
expect(runCommandStub.calledOnce).to.be.true;
});
});
Expand Down Expand Up @@ -412,20 +412,29 @@ describe('Unit: Commands > Install', function () {
});
});

describe('tasks > casper', function () {
it('links casper version correctly', function () {
describe('tasks > defaultThemes', function () {
it('creates a symlink to all themes shipped with Ghost', function () {
const symlinkSyncStub = sinon.stub();
const readdirSyncStub = sinon.stub().returns(['casper', 'source']);
const existsSyncStub = sinon.stub();
existsSyncStub.returns(false);
const InstallCommand = proxyquire(modulePath, {
'symlink-or-copy': {sync: symlinkSyncStub}
'symlink-or-copy': {sync: symlinkSyncStub},
'fs-extra': {readdirSync: readdirSyncStub, existsSync: existsSyncStub}
});

const testInstance = new InstallCommand({}, {});

testInstance.casper();
expect(symlinkSyncStub.calledOnce).to.be.true;
const context = {version: '5.67.0'};
testInstance.defaultThemes(context);
expect(symlinkSyncStub.callCount).to.equal(2);
expect(symlinkSyncStub.calledWithExactly(
path.join(process.cwd(), 'current', 'content', 'themes', 'casper'),
path.join(process.cwd(), 'content', 'themes', 'casper')
));
expect(symlinkSyncStub.calledWithExactly(
path.join(process.cwd(), 'current/content/themes/casper'),
path.join(process.cwd(), 'content/themes/casper')
path.join(process.cwd(), 'current', 'content', 'themes', 'source'),
path.join(process.cwd(), 'content', 'themes', 'source')
));
});
});
Expand Down
Loading
Loading