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

Content folder configuration #307

Closed
sebgie opened this issue Jul 7, 2017 · 3 comments · Fixed by #329
Closed

Content folder configuration #307

sebgie opened this issue Jul 7, 2017 · 3 comments · Fixed by #329
Assignees
Milestone

Comments

@sebgie
Copy link
Contributor

sebgie commented Jul 7, 2017

I spent way too much time yesterday to find out where usage of the special content folder is configured. It appears that the content path is configured using an environment variable (

process.env.paths__contentPath = path.join(process.cwd(), 'content');
).

Would it be sensible to put the content path in the configuration file so it is a) obvious and b) harder to get accidentially overwritten?

@acburdine
Copy link
Member

I'm pretty sure I tried it and didn't get it to work right, but I can try it again and see if I was doing it wrong.

@ErisDS
Copy link
Member

ErisDS commented Jul 10, 2017

On reflection, I think this issue needs to be dealt with asap.

If we don't have the path set in the config file, then we will have to handle adding it to all existing config files if we change this later.

I'm not sure if anyone else is aware, but the appveyor test of ghost install local is currently failing, here's a link: https://ci.appveyor.com/project/acburdine/ghost-cli/build/76

Relevant lines:

[02:29:30] Setting up instance [completed]
[02:29:30] Running database migrations [started]
[02:29:30] Running database migrations [failed]
[02:29:30] → The server has encountered an error.
�[?25hAn error occurred.
Message: 'The server has encountered an error.'
Debug Information:
    Node Version: v4.8.3
    Ghost-CLI Version: 1.0.0-beta.6
    Environment: development
    Command: 'ghost install local'
Additional log info available in: C:\Users\appveyor\.ghost\logs\ghost-cli-debug-2017-07-10T02_29_30_353Z.log

Log file contents:

Message: 'The server has encountered an error.'

Stack: InternalServerError: The server has encountered an error.
    at new KnexMigrateError (C:\projects\ghost-cli\node_modules\knex-migrator\lib\errors.js:7:26)
    at new KnexMigrator (C:\projects\ghost-cli\node_modules\knex-migrator\lib\index.js:26:15)
    at Task.runMigrations [as task] (C:\projects\ghost-cli\lib\tasks\migrate.js:15:24)
    at C:\projects\ghost-cli\node_modules\listr\lib\task.js:169:30
    at process._tickCallback (node.js:438:9)

Error: Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.
    at doesContentPathExist (C:\clitest\versions\1.0.0-beta.2\core\server\config\utils.js:78:15)
    at Object.loadNconf (C:\clitest\versions\1.0.0-beta.2\core\server\config\index.js:61:11)
    at Object.<anonymous> (C:\clitest\versions\1.0.0-beta.2\core\server\config\index.js:78:27)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\clitest\versions\1.0.0-beta.2\MigratorConfig.js:1:76)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

Seems to be related to the contentPath as well?

@acburdine
Copy link
Member

It's not the same error. The reason Appveyor is failing is because of incorrect path handling in Ghost itself (it didn't handle windows absolute paths correctly).

acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- set content path manually in config during run
- add handling to linux extension that ensures the user is correct
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- set content path manually in config during run
- add handling to linux extension that ensures the user is correct
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- set content path manually in config during run
- add handling to linux extension that ensures the user is correct
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- set content path manually in config during run
- add handling to linux extension that ensures the user is correct
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- instead of mutating process.env, set the contentPath in config if it does not exist
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- instead of mutating process.env, set the contentPath in config if it does not exist
@kirrg001 kirrg001 added this to the 1.0.0-rc.1 milestone Jul 10, 2017
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Jul 10, 2017
closes TryGhost#307
- instead of mutating process.env, set the contentPath in config if it does not exist
acburdine added a commit that referenced this issue Jul 10, 2017
closes #307
- instead of mutating process.env, set the contentPath in config if it does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants