posty / posty_api

Utility to administrate mailserver based on postfix and dovecot
www.posty-soft.org
Other
85 stars 19 forks source link

Regexp validation of domain names #11

Closed leonkyneur closed 9 years ago

leonkyneur commented 9 years ago

I'm finding the regexp used for validating domain names too strict when using a sub-domain or even some country TLDs.

Examples that fail: mysub.mydomain.com mydomain.com.au mydomain.co.nz etc...

Happy to submit a pull request if required.

lweis commented 9 years ago

Many thanks, we will adjust it in the next few days!

leonkyneur commented 9 years ago

:+1: thanks

avinashtanniru commented 9 years ago

Please give me reply for this error. how to assess remotely and add API keys to the user.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.254.10/posty_api/api/v1/domains. This can be fixed by moving the resource to the same domain or enabling CORS.

chicobico commented 9 years ago

@avinash- does is error occures when you use the webui or directly

avinashtanniru commented 9 years ago

no @chicobico when i inspect element in with firebug.

avinashtanniru commented 9 years ago

I hosted in digital ocean server i'm unable to add domain as well as users through it. how to add domains when i hosted in live VPS server. ?
@chicobico Please help me out ?

chicobico commented 9 years ago

have you already created a initial api_key with rake api_key:generate

chicobico commented 9 years ago

@leonkyneur The Regex now also works with subdomains and domains like example.co.uk. If you still have problems please let us know

avinashtanniru commented 9 years ago

when i install in a vps there is a key pre generated. from my system i need access which is deployed in cloud VPS.

@chicobico. where should i generate key in cloud or in my local system ?

chicobico commented 9 years ago

To generate a initial key go to the project root on the cloud server (e.g. /home/posty/posty_api) and run rake api_key:generate

chicobico commented 9 years ago

rake api_key:generate RACK_ENV=production

avinashtanniru commented 9 years ago

how can i connect to posty from the cloud server ? @chicobico in google-chrome and add domains in it.

chicobico commented 9 years ago

have you created the api_key? If you are not sure check your database. The table api_keys should now contain 1 row with a access_token.

avinashtanniru commented 9 years ago

S created automatically @chicobico next step ?

avinashtanniru commented 9 years ago

Key "afb2e480cbba1a3d92b8ff971b6561cb" found @chicobico

avinashtanniru commented 9 years ago

production: api_url: http://192.168.254.10/posty_api/app/api/v1 api_version: v1 access_token: afb2e480cbba1a3d92b8ff971b6561cb

I have seen this.

chicobico commented 9 years ago

Browse with Google Chrome to: http://192.168.254.10:9292/api/v1/api_keys?auth_token=afb2e480cbba1a3d92b8ff971b6561cb If you started the API with rackup the port is 9292 If you not startet the API yet start it with rackup This should output a list with all api_keys The IP-Address 192.168.254.10 looks like it´s your local ipaddress you must use the ipaddress of the server on which the api runs.

avinashtanniru commented 9 years ago

1Q) How many tokens can i generated ? if need to send to the another user to add domains and user shall i should send him whole url ?

@chicobico

chicobico commented 9 years ago

You can create as much as you want. You can host the webui on a central place. Or the user uses the webui on workstation then he needs the following: "servers": [ { "caption": "posty server 1", "url": "http://192.168.254.10:9292/api/v1", "key": "123456" } Another option is to use the posty_client on the terminal then he needs the following: production: api_url: http://192.168.254.10:9292/api/ api_version: v1 access_token: ask your admin

@avinash- can you access the posty_api now?

leonkyneur commented 9 years ago

@avinash- thanks working as expected