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

refinerycms switches: not forcing -p (empty password). #506

Closed
ghost opened this issue Mar 5, 2011 · 8 comments
Closed

refinerycms switches: not forcing -p (empty password). #506

ghost opened this issue Mar 5, 2011 · 8 comments
Milestone

Comments

@ghost
Copy link

ghost commented Mar 5, 2011

Hi,

first of all : thanks for RefineryCMS, it is the perfect match for my Debian PostgreSQL Nginx Passenger 3 RoR 3 stack.

I would like to ask for the following improvements regarding PostgreSQL at refinerycms command runtime:

1 - refinerycms wants to use a password (default ' '). But PostgreSQL can connect with "ident" (beside many other methods) too. "ident" means not needing a password at all when connecting. (The scope of "ident" is out of this issue, I ensure you that using it is not a security risk if properly done locally). So first improvement would be to NOT use a default empty password but let the user use the switch -p ' ' if needed. This would make it possible for users to use -d postgresql -u foo and connect with foo to db with ident and no password.

2 - also refinerycms wants to use "encoding: unicode" in database.yml , but many still use "latin1" for whatever reasons (me included). The second improvement would be to add and encoding switch to refinerycms command. ie: -e 'latin1' . This should affect config/database.yml encoding: lines. Otherwise I have to try it once, then change enconding in database.yml and try again with --update. Not to mention that --update fails because baz_* databases don't exist yet

These are two issues that stop me to correctly go ahead and use refinerycms right now.

@parndt
Copy link
Member

parndt commented Mar 5, 2011

If you don't use Unicode does this affect utf-8 support?
Btw it's Rails that creates your database.yml for you. We aren't doing anything special here.
Could you fork the project and submit a pull request (ensure that it doesn't affect other db)?
Thanks

@ghost
Copy link
Author

ghost commented Mar 5, 2011

example:

i run:
refinerycms /var/nginx/cgacx -d postgresql -u postgres

i get:
Creating a new database..
NOTE: if your database username is not 'postgres' or your password is not '' then the installer will stop working here.

Running: cd "/var/nginx/cgacx" && /usr/local/bin/ruby -S rake -f "/var/nginx/cgacx/Rakefile" db:create
FATAL: Ident authentication failed for user "postgres"

@ghost
Copy link
Author

ghost commented Mar 5, 2011

hi prandt,

unfortunately I cannot code Ruby or RoR, therefore a fork cannot be useful.

I honestly don't know if not using unicode affects utf-8. I'll search and try to answer this.

@ghost
Copy link
Author

ghost commented Mar 5, 2011

hi prandt:

it seems it does affect it:

[12:22] hi all, if my database is encded latin1 , can i still use utf-8 in my cms ?

[12:22] related to this: https://github.com/resolve/refinerycms/issues/#issue/506

[12:23] please thanks

[12:24] if the client program (the cms in this case) is storing utf8 and expecting utf8 back, then you should at least set the client_encoding to that

[12:24] i see

[12:24] thanks RhodiumToad

[12:24] if you have utf8 as the client_encoding but latin1 as the database encoding, it'll all work unless you try and store any unicode characters that don't exist in latin1 - these will provoke an error

[12:25] having utf8 as the database encoding too is preferable

I'm changing my dbs to unicode

@parndt
Copy link
Member

parndt commented Mar 6, 2011

So the simplest solution is not to specify -p '' when there is no password on postgresql? Is that correct?

@ghost
Copy link
Author

ghost commented Mar 6, 2011

Exactly , make the -p switch optional and don't use an empty passwd for it by default.

ps: I've converted postgresql to unicode, created a dedicated refinery db role and installed just fine. but yet -p should be improved as discussed.

@parndt
Copy link
Member

parndt commented Mar 6, 2011

I've created a default rails app using postgresql and the config/database.yml file that is created by rails is identical to the one we're using (we don't modify it).

So, Rails is putting in a password field by default, not us. So we're never using -p, Rails is using its postgresql adaptor for every step.

The only thing we could do is completely remove these fields from config/database.yml if you specified blanks for these fields.

@parndt
Copy link
Member

parndt commented Mar 7, 2011

Added support for --ident in the installation task which uses ident authentication at the database level by commenting out the username and password credentials. Closed by d21bb7a (ht: radar)

hvirring pushed a commit to hvirring/refinerycms that referenced this issue May 11, 2011
…uthentication at the database level by commenting out the username and password credentials. Closes refineryGH-506 (ht: radar)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant