pggit.git
2 months agoReturn response instead of exception on invalid name formats master
Magnus Hagander [Thu, 20 Feb 2025 18:27:10 +0000 (19:27 +0100)]
Return response instead of exception on invalid name formats

2 months agoAdd CSRF token to add repo form
Magnus Hagander [Thu, 20 Feb 2025 18:21:27 +0000 (19:21 +0100)]
Add CSRF token to add repo form

13 months agoAdd csrf middleware
Magnus Hagander [Fri, 12 Apr 2024 14:01:30 +0000 (16:01 +0200)]
Add csrf middleware

We should really have this everywhere..

13 months agoUpdate for django 4.2
Magnus Hagander [Wed, 10 Apr 2024 08:52:00 +0000 (10:52 +0200)]
Update for django 4.2

23 months agoImport upstream auth plugin again
Magnus Hagander [Wed, 7 Jun 2023 20:12:45 +0000 (22:12 +0200)]
Import upstream auth plugin again

23 months agoFix signal receiving function signature
Magnus Hagander [Wed, 7 Jun 2023 20:09:01 +0000 (22:09 +0200)]
Fix signal receiving function signature

23 months agoImport latest upstream auth plugin (again)
Magnus Hagander [Wed, 7 Jun 2023 20:07:19 +0000 (22:07 +0200)]
Import latest upstream auth plugin (again)

23 months agoSync up to latest version of community auth plugin
Magnus Hagander [Wed, 7 Jun 2023 20:00:23 +0000 (22:00 +0200)]
Sync up to latest version of community auth plugin

This moves the subscription to user changes over to a signal, to make it
cleaner and keeping us from having to carry a diff against the standard
auth plugin.

3 years agoSubscribe to updates for newly created users
Magnus Hagander [Mon, 7 Mar 2022 20:40:32 +0000 (21:40 +0100)]
Subscribe to updates for newly created users

When a user was created by import, such as when a permission was granted
before their first login, the main community auth system would not know
about this registration, and because of that it would not send any
updates about the user such as secondary email addresses or ssh keys.
This would result in the user ssh key not being present and the user
unable to work with the repositories until they first logged in and ten
removed and re-added their key. Not very friendly, so use the newly
created endpoint on pgweb to subscribe to the notifications as soon as
the user has been created.

Also call this endpoint after the user has manually logged in the very
first time (meaning the user entry is created), to trigger an immediate
replication of any *existing* ssh key on the pgweb system. This is
required since the ssh key is not part of the "login package" due to
being potentially too long to fit on an URL.

3 years agoAdd DEFAULT_AUTO_FIELD for Django 3.2
Magnus Hagander [Sun, 7 Nov 2021 13:21:11 +0000 (14:21 +0100)]
Add DEFAULT_AUTO_FIELD for Django 3.2

3 years agoSwitch to using Cryptodome for encryption
Magnus Hagander [Wed, 13 Oct 2021 19:16:29 +0000 (21:16 +0200)]
Switch to using Cryptodome for encryption

Crypto is unmaintaned and will soon be gone from our distros. keysync
isn't actually used at this time, but we should make sure the scripts
are updated if we want to go back in the future.

3 years agoReplace mentions of pgfoundry with a more generic wording
Magnus Hagander [Mon, 30 Aug 2021 08:39:26 +0000 (10:39 +0200)]
Replace mentions of pgfoundry with a more generic wording

pgfoundry is far enough in the past that many people don't know what it
was :) So be more clear about what we mean.

Suggested by Daniel Gustafsson

3 years agoAlso mention gitlab as an option, not just github
Magnus Hagander [Sat, 28 Aug 2021 14:49:34 +0000 (16:49 +0200)]
Also mention gitlab as an option, not just github

3 years agoExplicitly mention that ssh is only for authenticated access
Magnus Hagander [Sat, 28 Aug 2021 14:48:39 +0000 (16:48 +0200)]
Explicitly mention that ssh is only for authenticated access

Anonymous access should always use http or git.

3 years agoFix typo
Magnus Hagander [Sat, 28 Aug 2021 14:47:05 +0000 (16:47 +0200)]
Fix typo

Spotted by Kyotaro Horiguchi

4 years agoInclude .git at the end of cgit urls being purged
Magnus Hagander [Sun, 17 Jan 2021 14:21:29 +0000 (15:21 +0100)]
Include .git at the end of cgit urls being purged

4 years agoWrite a per-repository cgitrc file if required
Magnus Hagander [Mon, 4 Jan 2021 14:25:32 +0000 (15:25 +0100)]
Write a per-repository cgitrc file if required

Initially, load a special stylesheet if a tab width of 4 is chosen (like
the main pg repo)

4 years agoAlso purge cgit urls, in addition to existing gitweb ones
Magnus Hagander [Mon, 4 Jan 2021 12:57:40 +0000 (13:57 +0100)]
Also purge cgit urls, in addition to existing gitweb ones

4 years agoFix indentation and regexp escaping
Magnus Hagander [Mon, 4 Jan 2021 12:57:19 +0000 (13:57 +0100)]
Fix indentation and regexp escaping

4 years agoUpdate descriptions and list only if changed
Magnus Hagander [Sun, 27 Dec 2020 17:06:43 +0000 (18:06 +0100)]
Update descriptions and list only if changed

Use the new replace_file_from_string() function to replace these files
conditionally. Even if they're small...

4 years agoRemove unused import
Magnus Hagander [Sun, 27 Dec 2020 17:01:31 +0000 (18:01 +0100)]
Remove unused import

4 years agoRemove description file for non-exported repositories
Magnus Hagander [Sun, 27 Dec 2020 16:56:08 +0000 (17:56 +0100)]
Remove description file for non-exported repositories

4 years agoSupport creation of both lighttpd and nginx configuration files
Magnus Hagander [Sun, 27 Dec 2020 13:22:44 +0000 (14:22 +0100)]
Support creation of both lighttpd and nginx configuration files

We only support reloading one webserver, as it's not really expected to
run more than one, but concurrently supporting generating both file
formats will make migration a lot easier.

4 years agoDon't accidentally delete ssh keys on login
Magnus Hagander [Tue, 11 Aug 2020 15:39:32 +0000 (17:39 +0200)]
Don't accidentally delete ssh keys on login

ssh key information is not included when a direct login is done (to not
overflow the URL length limit), so don't delete the user ssh key in this
case.

4 years agoSupport receiving and updating ssh keys from upstream live
Magnus Hagander [Tue, 11 Aug 2020 15:24:27 +0000 (17:24 +0200)]
Support receiving and updating ssh keys from upstream live

This includes adding an API endpoint for push changes from the new
community authentication API.

4 years agoImport latest version of community authentication plugin
Magnus Hagander [Tue, 11 Aug 2020 15:24:44 +0000 (17:24 +0200)]
Import latest version of community authentication plugin

4 years agoMake references to users be foreign key instead of string matches
Magnus Hagander [Tue, 11 Aug 2020 14:32:57 +0000 (16:32 +0200)]
Make references to users be foreign key instead of string matches

We've previously done string matching on usernames which comes with all
sorts of problems :/

Instead, do a proper foreign key to the users model. Our authentication
system already (and for a long time) supports importing a user by email
address from upstream if the user doesn't exist, so instead update the
integration to do that when adding new users with permissions.

NOTE! Prior to deploying this migration all users referenced in the
permissions and ssh tables *must* exist in auth_users, otherwise the
migration will fail.

4 years agoRemove unused import
Magnus Hagander [Sun, 9 Aug 2020 14:36:17 +0000 (16:36 +0200)]
Remove unused import

4 years agoRemove schema.sql
Magnus Hagander [Sun, 9 Aug 2020 14:33:02 +0000 (16:33 +0200)]
Remove schema.sql

Since years back we have been using django migrations, so keeping this
one around just causes confusion.

5 years agoUser.is_authenticated is no longer a callable in Django 2.2
Magnus Hagander [Wed, 1 Apr 2020 13:56:42 +0000 (15:56 +0200)]
User.is_authenticated is no longer a callable in Django 2.2

5 years agoUpdate config for modern django versions
Magnus Hagander [Tue, 31 Mar 2020 18:09:38 +0000 (20:09 +0200)]
Update config for modern django versions

MIDDLEWARE_CLASSES should now be named MIDDLEWARE, the messages app is
now required by admin (was before as well but not enforced) and the
include syntax for the admin site has changed.

5 years agoSpecify on_delete=models.CASCADE on all ForeignKey fields
Magnus Hagander [Tue, 31 Mar 2020 18:08:41 +0000 (20:08 +0200)]
Specify on_delete=models.CASCADE on all ForeignKey fields

5 years agoSync up community auth plugin to latest-and-greatest
Magnus Hagander [Wed, 26 Feb 2020 17:24:28 +0000 (18:24 +0100)]
Sync up community auth plugin to latest-and-greatest

5 years agoAnother unicode fix for writing repo configs
Magnus Hagander [Sun, 23 Feb 2020 21:18:50 +0000 (22:18 +0100)]
Another unicode fix for writing repo configs

5 years agoFix code for changing tab width
Magnus Hagander [Sun, 23 Feb 2020 21:15:14 +0000 (22:15 +0100)]
Fix code for changing tab width

This has been broken for some time since py3 requires the options to be
in string format, it's just a very infrequent codepath.

5 years agoSwitch backend interface to boostrap
Magnus Hagander [Tue, 22 Oct 2019 12:34:40 +0000 (14:34 +0200)]
Switch backend interface to boostrap

Make it look less bad and opens up for some further improvements

5 years agoUpdate migrations for py3 migration
Magnus Hagander [Tue, 22 Oct 2019 12:35:07 +0000 (14:35 +0200)]
Update migrations for py3 migration

5 years agoDon't dump keys if they consist only of whitespace
Magnus Hagander [Wed, 18 Sep 2019 08:48:49 +0000 (10:48 +0200)]
Don't dump keys if they consist only of whitespace

5 years agoRevert "Delete users/ssh keys when removed upstream"
Magnus Hagander [Wed, 18 Sep 2019 08:43:05 +0000 (10:43 +0200)]
Revert "Delete users/ssh keys when removed upstream"

Yeah, we can't delete those because we're loading incrementally. A
proper fix will include more changes upstream

5 years agoDelete users/ssh keys when removed upstream
Magnus Hagander [Wed, 18 Sep 2019 08:36:13 +0000 (10:36 +0200)]
Delete users/ssh keys when removed upstream

Existing code would only update changed users, but if the ssh key was
actually removed upstream the old one would be kept around.

6 years agoUpdate reposync for py3
Magnus Hagander [Thu, 7 Feb 2019 21:56:31 +0000 (22:56 +0100)]
Update reposync for py3

6 years agoIt seems tabremover is not needed in python3
Magnus Hagander [Thu, 7 Feb 2019 21:40:18 +0000 (22:40 +0100)]
It seems tabremover is not needed in python3

6 years agoFix git key sync
Magnus Hagander [Thu, 7 Feb 2019 21:29:37 +0000 (22:29 +0100)]
Fix git key sync

6 years agoUpdate varnishpurge trigger to use requests and be py3
Magnus Hagander [Thu, 7 Feb 2019 21:20:02 +0000 (22:20 +0100)]
Update varnishpurge trigger to use requests and be py3

6 years agoImport latest version of py3 compatible auth.py
Magnus Hagander [Thu, 7 Feb 2019 21:18:04 +0000 (22:18 +0100)]
Import latest version of py3 compatible auth.py

6 years agoBasic python3 updates
Magnus Hagander [Thu, 7 Feb 2019 21:17:12 +0000 (22:17 +0100)]
Basic python3 updates

6 years agopep8 fixes
Magnus Hagander [Thu, 7 Feb 2019 10:23:55 +0000 (11:23 +0100)]
pep8 fixes

6 years agotabs -> spaces for pep8
Magnus Hagander [Thu, 7 Feb 2019 10:08:48 +0000 (11:08 +0100)]
tabs -> spaces for pep8

7 years agoFix template loaders for django 1.11
Magnus Hagander [Sun, 25 Mar 2018 14:54:59 +0000 (16:54 +0200)]
Fix template loaders for django 1.11

Seems django 1.11 automatically enables caching template loader, which
of course breaks the ability to make any changes to the pages of a
website without restarting it. And there is no way to turn it off other
than to explicitly configure individual loders (the logic to turn it on
in non-debug configurations is hardcoded and cannot be changed).

7 years agoUpdates to make Django 1.11 compatible
Magnus Hagander [Sun, 25 Feb 2018 13:17:16 +0000 (14:17 +0100)]
Updates to make Django 1.11 compatible

All changes are backwards compatible, so can be deployed on both
existing 1.8 and upcoming 1.11 infrastructure.

7 years agoRemove staticfiles and sites apps, not used
Magnus Hagander [Sun, 25 Feb 2018 13:16:22 +0000 (14:16 +0100)]
Remove staticfiles and sites apps, not used

7 years agoSynchronize ssh keys using http API instead of postgresql call
Magnus Hagander [Sun, 10 Dec 2017 16:22:09 +0000 (17:22 +0100)]
Synchronize ssh keys using http API instead of postgresql call

Finally break the ties with community auth 1.0

8 years agoRemove references to pgfoundry
Magnus Hagander [Mon, 30 May 2016 14:02:13 +0000 (16:02 +0200)]
Remove references to pgfoundry

8 years agoUpdate URL references to https
Magnus Hagander [Mon, 30 May 2016 14:02:06 +0000 (16:02 +0200)]
Update URL references to https

8 years agoChange URL for static resources
Magnus Hagander [Mon, 30 May 2016 13:47:08 +0000 (15:47 +0200)]
Change URL for static resources

Can't use the same as gitweb when both run on https

8 years agoSet default values so it's actually possible to request new repositories
Magnus Hagander [Mon, 30 May 2016 11:46:58 +0000 (13:46 +0200)]
Set default values so it's actually possible to request new repositories

The handling must've changed when we upgraded to django 1.8, and somehow
we managed to miss that in testing.

Noted by Devrim Gunduz.

9 years agoAdd initial migration with everything
Magnus Hagander [Tue, 22 Dec 2015 13:56:11 +0000 (14:56 +0100)]
Add initial migration with everything

To make it possible to use django migrations in the future.

9 years agoMinor code updatse to support django 1.8
Magnus Hagander [Tue, 22 Dec 2015 10:05:06 +0000 (11:05 +0100)]
Minor code updatse to support django 1.8

9 years agoPut a 1.8 manage.py and wsgi.py in place in the correct locations
Magnus Hagander [Tue, 22 Dec 2015 10:04:49 +0000 (11:04 +0100)]
Put a 1.8 manage.py and wsgi.py in place in the correct locations

9 years agoMove the admin project into a subdirectory
Magnus Hagander [Tue, 22 Dec 2015 09:16:26 +0000 (10:16 +0100)]
Move the admin project into a subdirectory

Preparing for a django 1.8 migration

11 years agoUpdate for django 1.4
Magnus Hagander [Sat, 25 May 2013 21:26:22 +0000 (17:26 -0400)]
Update for django 1.4

12 years agoDEBUG should be disabled by default
Magnus Hagander [Thu, 18 Apr 2013 18:30:59 +0000 (20:30 +0200)]
DEBUG should be disabled by default

Can be turned on in the local settings if necessary.

Reported by Heikki.

12 years agoGenerate lighttpd config output instead of .htaccess files
Magnus Hagander [Sat, 13 Apr 2013 14:44:22 +0000 (16:44 +0200)]
Generate lighttpd config output instead of .htaccess files

This is what we use to publish and hide repositories for access over http
(actualy git over http, not gitweb). And since we switched to lighttpd,
we no longer use .htaccess.

12 years agoPurge git serving URLs as well, not just the gitweb view
Magnus Hagander [Sat, 13 Apr 2013 13:56:16 +0000 (15:56 +0200)]
Purge git serving URLs as well, not just the gitweb view

Without this, a "git fetch" could become very delayed when accessing
the repositories, since the contents might be cached.

12 years agoFix regexp escaping
Magnus Hagander [Thu, 21 Feb 2013 16:23:56 +0000 (17:23 +0100)]
Fix regexp escaping

12 years agoUse subprocess.call instead of execvp to call the git command
Magnus Hagander [Thu, 21 Feb 2013 16:15:13 +0000 (17:15 +0100)]
Use subprocess.call instead of execvp to call the git command

Without doing this, we never return, and thus never fire the triggers.

12 years agoAdd varnish purger trigger
Magnus Hagander [Thu, 21 Feb 2013 15:57:29 +0000 (16:57 +0100)]
Add varnish purger trigger

12 years agoGive pushtrigger the configuration object
Magnus Hagander [Thu, 21 Feb 2013 15:55:38 +0000 (16:55 +0100)]
Give pushtrigger the configuration object

So that they can read some configuration variables

12 years agoAdd basic support for push triggers
Magnus Hagander [Wed, 20 Feb 2013 17:14:04 +0000 (18:14 +0100)]
Add basic support for push triggers

These are python classes that fire a method when somebody pushes to the
server. This is sort of a "global hook", that only gets information about
the repository itself - instead of having to create manual hooks on each
and every repository.

The hook fires after the command completes, unless it fails.

12 years agoActually put timestamps in the logfile
Magnus Hagander [Wed, 20 Feb 2013 16:37:21 +0000 (17:37 +0100)]
Actually put timestamps in the logfile

13 years agoFix incorrect links to the community auth system
Magnus Hagander [Fri, 27 Jan 2012 09:54:06 +0000 (10:54 +0100)]
Fix incorrect links to the community auth system

Reported by Tatsuo Ishii

13 years agoInclude full name, now that we have it from the new auth system...
Magnus Hagander [Sun, 22 Jan 2012 21:43:26 +0000 (22:43 +0100)]
Include full name, now that we have it from the new auth system...

Noted by Stefan Kaltenbrunner

13 years agoSet upstream when syncing remote git repositories
Magnus Hagander [Wed, 28 Dec 2011 14:10:08 +0000 (15:10 +0100)]
Set upstream when syncing remote git repositories

This was already changed in production, forgot to commit.

13 years agoUpdate urls (already done in production, forgot to commit..)
Magnus Hagander [Wed, 28 Dec 2011 14:05:41 +0000 (15:05 +0100)]
Update urls (already done in production, forgot to commit..)

13 years agoSupport newer versions of django
Magnus Hagander [Wed, 28 Dec 2011 14:02:06 +0000 (15:02 +0100)]
Support newer versions of django

13 years agoImplement postgresql.org community authentication version 2
Magnus Hagander [Wed, 28 Dec 2011 14:01:55 +0000 (15:01 +0100)]
Implement postgresql.org community authentication version 2

13 years agoAdd csrf token, required by modern django
Magnus Hagander [Wed, 6 Jul 2011 11:00:12 +0000 (13:00 +0200)]
Add csrf token, required by modern django

14 years agoMore prominently talk about alternative hosting
Magnus Hagander [Thu, 30 Dec 2010 13:19:29 +0000 (14:19 +0100)]
More prominently talk about alternative hosting

In particular, plug github quite a bit more, because it's usually
a much better offering than git.postgresql.org. For one thing, they
have people actually responding quickly to requests ;)

14 years agoAdd note about what the description field is for
Magnus Hagander [Thu, 30 Dec 2010 13:11:40 +0000 (14:11 +0100)]
Add note about what the description field is for

14 years agoAvoid using Python 2.6 syntax
Magnus Hagander [Wed, 22 Dec 2010 14:00:14 +0000 (15:00 +0100)]
Avoid using Python 2.6 syntax

14 years agoAdd support for custom gitweb tabwidth
Magnus Hagander [Wed, 22 Dec 2010 13:57:27 +0000 (14:57 +0100)]
Add support for custom gitweb tabwidth

15 years agoProperly dump multiple ssh keys to the authorized_keys file.
Magnus Hagander [Sat, 17 Oct 2009 18:34:40 +0000 (20:34 +0200)]
Properly dump multiple ssh keys to the authorized_keys file.

15 years agoAdd instructions about users/ namespace.
Magnus Hagander [Tue, 11 Aug 2009 12:29:46 +0000 (14:29 +0200)]
Add instructions about users/ namespace.

15 years agoAdd support for subdirectories in repository paths, per request
Magnus Hagander [Sat, 1 Aug 2009 15:07:17 +0000 (17:07 +0200)]
Add support for subdirectories in repository paths, per request
from Peter E.

15 years agoAdd ssh url information
Magnus Hagander [Wed, 22 Jul 2009 09:40:28 +0000 (11:40 +0200)]
Add ssh url information

15 years agoAdd .git suffix to gitweb links, another oops due to the namespace
Magnus Hagander [Mon, 15 Jun 2009 12:25:32 +0000 (14:25 +0200)]
Add .git suffix to gitweb links, another oops due to the namespace
changes...

15 years agoProperly include /git/ in generated URL in the admin interface, per
Magnus Hagander [Mon, 15 Jun 2009 12:23:44 +0000 (14:23 +0200)]
Properly include /git/ in generated URL in the admin interface, per
complaint from Dave Page.

16 years agoAdd an RSS feed of all repositories, including those not approved yet.
Magnus Hagander [Mon, 4 May 2009 18:44:34 +0000 (20:44 +0200)]
Add an RSS feed of all repositories, including those not approved yet.

One good way to figure out if we've forgtten to approve something.

16 years agoInclude .git suffix in gitweb list as well
Magnus Hagander [Thu, 26 Mar 2009 15:16:11 +0000 (16:16 +0100)]
Include .git suffix in gitweb list as well

16 years agoRe-instate the ".git" suffix on all repositories, since Peter had a lot
Magnus Hagander [Thu, 26 Mar 2009 15:09:58 +0000 (16:09 +0100)]
Re-instate the ".git" suffix on all repositories, since Peter had a lot
of thought behind it being there.

16 years agoClearify a few things, per David Fetter
Magnus Hagander [Sun, 8 Mar 2009 19:09:45 +0000 (20:09 +0100)]
Clearify a few things, per David Fetter

16 years agoAdd initial help page.
Magnus Hagander [Thu, 5 Mar 2009 19:17:08 +0000 (20:17 +0100)]
Add initial help page.

16 years agoBetter __str__ for permissions - mainly shown when deleting an object.
Magnus Hagander [Wed, 4 Mar 2009 16:33:53 +0000 (17:33 +0100)]
Better __str__ for permissions - mainly shown when deleting an object.

16 years agoDon't remove files/dirs starting with a period - because
Magnus Hagander [Wed, 4 Mar 2009 16:01:07 +0000 (17:01 +0100)]
Don't remove files/dirs starting with a period - because
those are lockfiles...

16 years agoDept of really stupid. COALESCE works the other way..
Magnus Hagander [Wed, 4 Mar 2009 15:08:06 +0000 (16:08 +0100)]
Dept of really stupid. COALESCE works the other way..

16 years agoDeal with repositories without owner (such as remote ones)
Magnus Hagander [Wed, 4 Mar 2009 15:06:40 +0000 (16:06 +0100)]
Deal with repositories without owner (such as remote ones)

16 years agoFix another bunch of typos. Maybe I should test things?
Magnus Hagander [Wed, 4 Mar 2009 15:05:14 +0000 (16:05 +0100)]
Fix another bunch of typos. Maybe I should test things?

16 years agoDon't ever allow any direct access to a remote-synced repository
Magnus Hagander [Wed, 4 Mar 2009 14:49:11 +0000 (15:49 +0100)]
Don't ever allow any direct access to a remote-synced repository

16 years agoMove interlocking tool to it's own file, and use it from gitdump
Magnus Hagander [Wed, 4 Mar 2009 14:47:11 +0000 (15:47 +0100)]
Move interlocking tool to it's own file, and use it from gitdump
as well to prevent concurrent access.

16 years agoAdd interlocking so we don't run the script more than once
Magnus Hagander [Wed, 4 Mar 2009 14:25:15 +0000 (15:25 +0100)]
Add interlocking so we don't run the script more than once