Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Marcus Andersson
aurweb
Commits
c3c110c0
Commit
c3c110c0
authored
Dec 26, 2014
by
Lukas Fleischer
Browse files
Honor the database socket setting in Git scripts
Signed-off-by:
Lukas Fleischer
<
archlinux@cryptocrack.de
>
parent
e1aac98b
Changes
3
Hide whitespace changes
Inline
Side-by-side
scripts/git-integration/git-auth.py
View file @
c3c110c0
...
...
@@ -12,6 +12,7 @@ aur_db_host = config.get('database', 'host')
aur_db_name
=
config
.
get
(
'database'
,
'name'
)
aur_db_user
=
config
.
get
(
'database'
,
'user'
)
aur_db_pass
=
config
.
get
(
'database'
,
'password'
)
aur_db_socket
=
config
.
get
(
'database'
,
'socket'
)
key_prefixes
=
config
.
get
(
'auth'
,
'key-prefixes'
).
split
()
username_regex
=
config
.
get
(
'auth'
,
'username-regex'
)
...
...
@@ -25,7 +26,7 @@ if pubkey is None or not pubkey.startswith(valid_prefixes):
db
=
mysql
.
connector
.
connect
(
host
=
aur_db_host
,
user
=
aur_db_user
,
passwd
=
aur_db_pass
,
db
=
aur_db_name
,
buffered
=
True
)
unix_socket
=
aur_db_socket
,
buffered
=
True
)
cur
=
db
.
cursor
()
cur
.
execute
(
"SELECT Username FROM Users WHERE SSHPubKey = %s "
+
...
...
scripts/git-integration/git-serve.py
View file @
c3c110c0
...
...
@@ -15,6 +15,7 @@ aur_db_host = config.get('database', 'host')
aur_db_name
=
config
.
get
(
'database'
,
'name'
)
aur_db_user
=
config
.
get
(
'database'
,
'user'
)
aur_db_pass
=
config
.
get
(
'database'
,
'password'
)
aur_db_socket
=
config
.
get
(
'database'
,
'socket'
)
repo_base_path
=
config
.
get
(
'serve'
,
'repo-base'
)
repo_regex
=
config
.
get
(
'serve'
,
'repo-regex'
)
...
...
@@ -40,7 +41,8 @@ def setup_repo(repo, user):
die
(
'invalid repository name: %s'
%
(
repo
))
db
=
mysql
.
connector
.
connect
(
host
=
aur_db_host
,
user
=
aur_db_user
,
passwd
=
aur_db_pass
,
db
=
aur_db_name
)
passwd
=
aur_db_pass
,
db
=
aur_db_name
,
unix_socket
=
aur_db_socket
)
cur
=
db
.
cursor
()
cur
.
execute
(
"SELECT COUNT(*) FROM PackageBases WHERE Name = %s "
,
[
repo
])
...
...
@@ -66,7 +68,7 @@ def setup_repo(repo, user):
def
check_permissions
(
pkgbase
,
user
):
db
=
mysql
.
connector
.
connect
(
host
=
aur_db_host
,
user
=
aur_db_user
,
passwd
=
aur_db_pass
,
db
=
aur_db_name
,
buffered
=
True
)
unix_socket
=
aur_db_socket
,
buffered
=
True
)
cur
=
db
.
cursor
()
cur
.
execute
(
"SELECT COUNT(*) FROM PackageBases INNER JOIN Users "
+
...
...
scripts/git-integration/git-update.py
View file @
c3c110c0
...
...
@@ -17,6 +17,7 @@ aur_db_host = config.get('database', 'host')
aur_db_name
=
config
.
get
(
'database'
,
'name'
)
aur_db_user
=
config
.
get
(
'database'
,
'user'
)
aur_db_pass
=
config
.
get
(
'database'
,
'password'
)
aur_db_socket
=
config
.
get
(
'database'
,
'socket'
)
def
save_srcinfo
(
srcinfo
,
db
,
cur
,
user
):
# Obtain package base ID and previous maintainer.
...
...
@@ -206,7 +207,7 @@ srcinfo = aurinfo.ParseAurinfoFromIterable(srcinfo_raw)
db
=
mysql
.
connector
.
connect
(
host
=
aur_db_host
,
user
=
aur_db_user
,
passwd
=
aur_db_pass
,
db
=
aur_db_name
,
buffered
=
True
)
unix_socket
=
aur_db_socket
,
buffered
=
True
)
cur
=
db
.
cursor
()
save_srcinfo
(
srcinfo
,
db
,
cur
,
user
)
db
.
close
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment