Closed dangayle closed 9 years ago
Hi there,
If you are using Cactus v2, this file goes at the root of your project (so, just next to pages
and others).
If you are using Cactus v3, this file goes wherever you want, just point Cactus to it with the CLI -c
flag.
Cheers,
Cactus doesn't create the file by default, so your instructions to "Modify config.json, and add the extensions you want to be fingerprinting," it makes no sense because there is no config.json file, and I don't know the data structure. Not meaning to be snarky, I really don't know what to do.
Config.json is a JSON object, and fingerprint should be a top level key.
{
"fingerprint": [extensions here]
}
Please do feel free to submit a PR if you are unhappy with the state of the docs.
Cheers,
Thanks @krallin for helping to maintain the project. I was getting into Catus v2; now excited to make Cactus v3 work for me as well.
Sorry to seem daft, but using v3, if I use the CLI try to point Cactus to the config file in the root of a newly created project:
cactus -c config.json
I get the cactus: error: invalid choice
error. All other actions are not possible until I get my config in place.
Any advice? Thanks in advance.
Hey @qaidj,
Does cactus -c config.json build
work?
I can see that addinga "config-check
command might be useful though. Is that what you're after?
Cheers,
Hmm .. no dice. Tried it and get the same error: invalid choice
Since the engine requires a config file, I have created one, but I can't get Cactus to recognize it. What would "config-check" do? Confirm format / existence?
Well, I'm not actually sure of what you're trying to achieve here: you're running Cactus without a command, so it tells you you need a command.
I'm sure you actually intend to do something else, but what is that?
(Sorry, the command above probably should have been cactus build -c config.json
— if that still doesnt work, can you paste the CLI output and run cactus --help
for me?).
Cheers,
Ah - it was indeed cactus build -c config.json
that works.
Thanks for that!
(Just for clarity, I wasn't able to run cactus serve
or cactus build
, etc. without having a config file pointed to, so I was stuck there.)
What error did you get without a config file? Was that a bug?
I'll try and check whether we can accept -c
regardless of where it is
Cheers,
I don't know enough about the way Cactus is supposed to give feedback to say it was a bug, but here are the details of what I tried:
cactus create path-name/
. This was successful.cactus serve
, I got the warning line Unable to load configuration at config.json
followed byRunning webserver at http://127.0.0.1:8000 for /Users/me/my-junk/.build
Type control-c to exit
I was able to access the project at this local URL. But was still getting the warning after save.
cactus build
I got the same warning line Unable to load configuration at config.json
{"prettify": true}
in there and tried cactus serve
again, but got the same message as before. I searched a bit and saw this thread so I tried cactus -c config.json
which yielded this response: usage: cactus [-h]
{messages:make,deploy,create,serve,domain:list,build,domain:setup}
...
cactus: error: invalid choice: 'config.json' (choose from 'messages:make', 'deploy', 'create', 'serve', 'domain:list', 'build', 'domain:setup')
cactus -c config.json build
) and got the same above error. Your subsequent reply with the cactus build -c config.json
suggestion did the trick and I was able to move on.Thanks for those details, @qaidj,
The error you were seeing was actually just a warning, but I can see how you'd think otherwise. I'll try and make this whole thing a little bit less confusing.
Cheers,
Good point - warnings, not errors.
Knowing that the full command of cactus build -c config.json
was required was the only thing I needed.
Do you have an example file for config.json? I do not know where to put my aws key
@thesues ,
You can run cactus deploy
without passing a config file and Cactus will:
Cheers,
cactus deploy
is going to work only if you have an AWS account, otherwise it will break when you just hit enter when Amazon keys are asked. The error is cactus.exceptions.InvalidCredentials
.
Back to the original question, I cannot make it work. I'm using version 3.02 installed from PyPI. Whatever I write in config.json is ignored (links are not prettified) and I keep getting the same warning:
$ cactus serve -c config.json
Unable to load configuration at config.json
Running webserver at http://127.0.0.1:8000 for /home/fede/web/cactus/sixbarsjail.it/.build
Type control-c to exit
This is my config.json, at the root of the project:
{
"site-url": "http://example.com/",
"prettify": true,
}
@fedelibre ,
config.json
is not valid JSON. There's a trailing comma. That's why it's not being loaded. IIRC we fixed that in master (the error is clearer now) but it might not be in the PyPi version yet (I have a small list of other fixes I'd like to make before pushing a new version).Cheers,
I just pip installed from master.
cactus deploy
could be used to generate a valid config.json and could ignore an empty value for AWS keys. It would be nice if it supported webfaction or, better, ssh configuration.true
.BTW, the option -c is not documented in the help.. but it's also not needed, as cactus is able to find the config.json file (at least if in the root of the project).
Hey @fedelibre
You can actually set "provider"
in your configuration to use one of the other supported deployment engines, which currently include "aws"
(S3), "rackspace"
(cloud files) and "google"
(GCS).
Adding other providers is rather simple, but so far no one has worked on Webfaction or (s)ftp.
Cheers,
@krallin Thanks for the help in this thread. Agreeing with @dangayle that the language in the help doc is confusing as it implies config.json
already exists, when it in fact needs to be created.
I am happy to update the language of the README.md
so that it's more clear that config.json
needs to be user generated.
Is there a reason that it can't be automatically created when the project is created?
@charliesneath I agree. Perhaps adding a default config.json
is the right approach. That should be reasonably straightforward.
I've included a default config.json
in the skeleton in https://github.com/koenbok/Cactus/commit/afa9bad5bbf556f6ce95c8f4d50c9e3ad1318aa9 — thanks for the suggestion!
@krallin Great, thank you!
In the docs you mention a config.json file, but when I
cactus create <foo>
, there is no config file created. Where does it go?