Hi,
I've successfully boot-strapped my node with posty-chef cookbook.
However when I started using posty-client to add my first domain, I got the same error:
root@ip-172-31-19-216:/srv/posty_api# posty-client domain add example.org
PostyClient::Resources::Domain :: load failed with (401) '{"error":"Unauthorized. Invalid or expired token."}'
create PostyClient::Resources::Domain : example.org
"Unauthorized. Invalid or expired token."
This config is created upon bootstrapping as you can see below:
* template[/root/.posty_client.yml] action create
- create new file /root/.posty_client.yml
- update content in file /root/.posty_client.yml from none to 7aa7da
--- /root/.posty_client.yml 2016-03-11 06:19:31.498050999 +0000
+++ /root/.chef-.posty_client.yml20160311-1430-1pxbvx8 2016-03-11 06:19:31.498050999 +0000
@@ -1 +1,5 @@
+development:
+ api_url: https://ip-172-31-19-216.ap-southeast-1.compute.internal/posty_api/api/v1
+ api_version: v1
+ access_token: 5d470051c51180bc1eca07511be64487
- change mode from '' to '0644'
- change owner from '' to 'root'
- change group from '' to 'root'
I have no idea why this token is invalid...
I'd like to have some additional questions:
Are those tokens generated randomly so they're different on each deployment?
What does 'development' in above template really mean? Is it related to default "rack_env" value in attribute file? I tried to change this attribute to 'production' but seems the posty-client config is still the same.
Please try
rake api_key:generate
and write the new generated api_key to your config file.
it should generate a api_key only once
posty_client can be used with multiple environments e.g. mailserver1, mailserver2 the development namespace is the default one
If you want to use the namespace mailserver1 then you must set
ENV['POSTY_ENV']
to mailserver1
Hi, I've successfully boot-strapped my node with posty-chef cookbook. However when I started using posty-client to add my first domain, I got the same error:
My client config is below:
This config is created upon bootstrapping as you can see below:
I have no idea why this token is invalid... I'd like to have some additional questions:
Thank you for your great cookbook!