Closed chadwhitacre closed 8 years ago
Seems like you're off and running, @kzisme. Welcome aboard! :-)
Reopening to help @kzisme get a PR under his belt.
Waddya say, @kzisme? Can you remind me: do you have Gratipay.com installed locally? That's the first step ...
@whit537 So any tasks you would like me to look at?
I'm on winter break now as well, so I can put some more time towards this (depends on work schedule)
I do not currently on my Mac - I'll try to do that now.
@whit537 Currently cloning the repo - and installed progresql with brew
I'm on winter break now as well, so I can put some more time towards this (depends on work schedule)
Awesome!
I do not currently on my Mac - I'll try to do that now.
Cool. Ping here if you get stuck.
So any tasks you would like me to look at?
There are a few tickets about inefficiencies in the admin experience on the site ... low priority overall but fairly straightforward, and maybe a low-pressure place to start. Wanna pick one of these?
https://github.com/gratipay/gratipay.com/issues/3879 https://github.com/gratipay/gratipay.com/issues/3845 https://github.com/gratipay/gratipay.com/issues/3548 https://github.com/gratipay/gratipay.com/issues/3121
Currently cloning the repo - and installed progresql with brew
Cool. If you find any snags with brew-installed postgres let's make sure we note them in the README if needed, m'kay?
Signing off for tonight ...
!m @kzisme :dancer:
Currently - I cloned the repo, created a virtualenv, and installed postgres without a hitch.
Although I'm currently getting this error when following the local quick start.
[kevinzita@Godric~/projects/gratipay.com$] sudo -u postgres createuser --superuser $USER
sudo: unknown user: postgres
[kevinzita@Godric~/projects/gratipay.com$] sudo postgres createuser --superuser $USER
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.
[kevinzita@Godric~/projects/gratipay.com$]
So I suppose after this step I have to run createdb gratipay
and then fill the db with fake data based on the schema.
First time messing with postgresql
As for the issues - I'll take a look and probably look more after I get my local Gratipay up and running
Okay ... you need to figure out how brew
-installed Postgres sets up permissions and user accounts, and then either adapt the README instructions to whatever your Postgres is already configured for, or modify your Postgres permissions to conform to what the README expects. Does that give you enough to go on?
Hopefully I'll take a look when I get off work this evening. I was just following the quick start guide last night
@whit537 brew installed 9.4.5 postgres. Which instructions are you referring to? I'm looking at the "Local Database Setup" area in README.
So, currently I'm confused and stuck since I'm not sure which permissions are expected.
@kzisme - What happens when you run just postgres createuser --superuser $USER
without sudo
?
Hop on IRC if you're free and we'll try to get this sorted out together :)
From http://exponential.io/blog/2015/02/21/install-postgresql-on-mac-os-x-via-brew/, it looks like brew creates a user by default using the logged in user's name (kevinzita, in your case), so you might be able to skip the createuser
step..
I'll check tomorrow! I work until 3pm then I'll try again. What channels do you frequent?
I appreciate the help! On Dec 20, 2015 1:20 AM, "Paul Kuruvilla" notifications@github.com wrote:
@kzisme https://github.com/kzisme - What happens when you run just postgres createuser --superuser $USER without sudo?
Hop on IRC if you're free and we'll try to get this sorted out together :)
— Reply to this email directly or view it on GitHub https://github.com/gratipay/inside.gratipay.com/issues/253#issuecomment-166069921 .
What channels do you frequent?
Just #gratipay :)
Alright! I'll be in there tomorrow afternoon. On Dec 20, 2015 1:26 AM, "Kevin Zita" bleedgreenandgold@gmail.com wrote:
I'll check tomorrow! I work until 3pm then I'll try again. What channels do you frequent?
I appreciate the help! On Dec 20, 2015 1:20 AM, "Paul Kuruvilla" notifications@github.com wrote:
@kzisme https://github.com/kzisme - What happens when you run just postgres createuser --superuser $USER without sudo?
Hop on IRC if you're free and we'll try to get this sorted out together :)
— Reply to this email directly or view it on GitHub https://github.com/gratipay/inside.gratipay.com/issues/253#issuecomment-166069921 .
@rohitpaulk I'm online now!
Also running postgres createuser --superuser $USER
returns
postgres: invalid argument: "createuser"
@kzisme - Try just createuser --superuser $USER
(without the postgres
)?
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The files belonging to this database system will be owned by user "kevinzita".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres".
Success! !m @rohitpaulk and @whit537 for hanging in there through my questions!
Aha, we're close
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Perfect :)
After running the provided commands - make test and make run worked.
Any other tips about stopping the service or general things I might run into @rohitpaulk?
I gotta run some errands ,but I'll look at it soon.
Nice! :dancer:
!m @kzisme @rohitpaulk
@whit537 Should I have (or do I have to) request access to fresh desk?
Also does #3548 and #3879 relate to each other? (Does one fix work for both possibly?) Just trying to find a starting point
and some more initial questions!
How do I go about viewing the described actions in each issue (for instance - how do I access the admin panel within my local Gratipay account).
...(may think of more while I'm poking around)
how do I access the admin panel within my local Gratipay account
Set is_admin
on your local user to true
. You can do this by running a SQL query via the postgres console ($ psql -d gratipay
). Does that help?
Alright just going to update with some progress - Postgres seems super cool BUT it's the first cli db system I've used (My db design course used MSSQL)
[kevinzita@Godric~/projects/gratipay.com$] psql -d gratipay
psql (9.4.5)
Type "help" for help.
gratipay=# SELECT table_name
gratipay-# FROM information_schema.tables
gratipay-# WHERE table_schema='public'
gratipay-# AND table_type='BASE TABLE';
table_name
----------------------
elsewhere
tips
exchange_routes
transfers
exchanges
absorptions
paydays
communities
community_members
statements
takes
events
emails
email_queue
balances_at
participants
payroll
payments
payment_instructions
teams
(20 rows)
Alright - so it appears I have to add my local user after querying the participants
table.
Currently looking for a way to get Postgres to properly align everything after I submit a query...
Using \x auto
formats wrapped lines nicely if it doesn't do it automatically.
Also worth noting that...
\list or \l: list all databases
\dt: list all tables in the current database
So I am currently signed in via Github (locally), but I am not listed as a participant - must I add myself via Postgres Query - or since I signed in will (or should I have been added)
If you signed in with Github, you should be in the participants table. Wish I could help with Postgres, but I downloaded a GUI (Mac) to help visualize the database.
@mattbk Which GUI Client did you (or do you) use?
@kzisme - I've used http://www.sequelpro.com/ on the Mac
I use https://eggerapps.at/postico/ for the little that I do in the db.
@rohitpaulk Are you able to hop on IRC for a bit?
Update:
So - I tried Sequelpro - looked into it further and it seems that it's only meant for MySQL.
Took another crack at the cli console and found my username by doing the following:
gratipay=# SELECT * FROM participants WHERE username = kzisme;
ERROR: column "kzisme" does not exist
LINE 1: SELECT * FROM participants WHERE username = kzisme;
^
gratipay=# SELECT * FROM participants WHERE id = 101;
-[ RECORD 1 ]----------+------------------------------------------------------
username | kzisme
session_token | 6ccbc715f24440c0aa63206f04990419
session_expires | 2015-12-22 10:54:42.374986+00
ctime | 2015-12-21 02:47:55.266991+00
claimed_time | 2015-12-21 02:47:55.276749+00
is_admin | f
balance | 0.00
anonymous_giving | f
balanced_customer_href |
is_suspicious |
id | 101
username_lower | kzisme
api_key |
avatar_url | https://avatars.githubusercontent.com/u/3493562?s=160
is_closed | f
giving | 0.00
taking | 0.00
is_free_rider |
email_address |
email_lang |
is_searchable | t
old_auth_usage |
notifications | {}
notify_charge | 3
braintree_customer_id |
ngiving_to | 0
ntaking_from | 0
status_of_1_0_payout | completed
Then...
gratipay=# UPDATE participants SET is_admin = true WHERE id = 101;
UPDATE 1
Successfully updated my account with admin privileges.
I've been looking around and I haven't found it documented anywhere, but in test environments we have to use accepted test CC numbers found here
looked into it further and it seems that it's only meant for MySQL
Whoopsy, sorry about that :) We use MySQL at work, hence the confusion
SELECT * FROM participants WHERE username = kzisme;
You'll need single quotes around kzisme
Ah, is that why it was searching for columns instead of rows? I figured it was something small like that :)
I used to use double quotes instead of single quotes and get the same error... Turns out that a single quote is used for a string constant, but double quotes are used for identifiers.
From http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html:
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes ('), for example 'This is a string'. To include a single-quote character within a string constant, write two adjacent single quotes, e.g., 'Dianne''s horse'. Note that this is not the same as a double-quote character (").
There is a second kind of identifier: the delimited identifier or quoted identifier. It is formed by enclosing an arbitrary sequence of characters in double-quotes ("). A delimited identifier is always an identifier, never a key word. So "select" could be used to refer to a column or table named "select", whereas an unquoted select would be taken as a key word and would therefore provoke a parse error when used where a table or column name is expected. The example can be written with quoted identifiers like this:
Awesome! I've began looking at https://github.com/gratipay/gratipay.com/issues/3845 and have pinged you there :dancer:
!m @kzisme
@kzisme Seems like you're as onboarded as you're gonna be for now, eh? :-)
@whit537 I would have to agree :)
Got a first PR from @kzisme at https://github.com/gratipay/gratipay.com/pull/3559.
@kzisme Here's a ticket to help you get onboarded. Any random questions you have about contributing to Gratipay, feel free to ask them here. How can we help you contribute more?