Magnus Hagander [Thu, 20 Feb 2025 18:27:10 +0000 (19:27 +0100)]
Return response instead of exception on invalid name formats
Magnus Hagander [Thu, 20 Feb 2025 18:21:27 +0000 (19:21 +0100)]
Add CSRF token to add repo form
Magnus Hagander [Fri, 12 Apr 2024 14:01:30 +0000 (16:01 +0200)]
Add csrf middleware
We should really have this everywhere..
Magnus Hagander [Wed, 10 Apr 2024 08:52:00 +0000 (10:52 +0200)]
Update for django 4.2
Magnus Hagander [Wed, 7 Jun 2023 20:12:45 +0000 (22:12 +0200)]
Import upstream auth plugin again
Magnus Hagander [Wed, 7 Jun 2023 20:09:01 +0000 (22:09 +0200)]
Fix signal receiving function signature
Magnus Hagander [Wed, 7 Jun 2023 20:07:19 +0000 (22:07 +0200)]
Import latest upstream auth plugin (again)
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.
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.
Magnus Hagander [Sun, 7 Nov 2021 13:21:11 +0000 (14:21 +0100)]
Add DEFAULT_AUTO_FIELD for Django 3.2
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.
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
Magnus Hagander [Sat, 28 Aug 2021 14:49:34 +0000 (16:49 +0200)]
Also mention gitlab as an option, not just github
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.
Magnus Hagander [Sat, 28 Aug 2021 14:47:05 +0000 (16:47 +0200)]
Fix typo
Spotted by Kyotaro Horiguchi
Magnus Hagander [Sun, 17 Jan 2021 14:21:29 +0000 (15:21 +0100)]
Include .git at the end of cgit urls being purged
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)
Magnus Hagander [Mon, 4 Jan 2021 12:57:40 +0000 (13:57 +0100)]
Also purge cgit urls, in addition to existing gitweb ones
Magnus Hagander [Mon, 4 Jan 2021 12:57:19 +0000 (13:57 +0100)]
Fix indentation and regexp escaping
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...
Magnus Hagander [Sun, 27 Dec 2020 17:01:31 +0000 (18:01 +0100)]
Remove unused import
Magnus Hagander [Sun, 27 Dec 2020 16:56:08 +0000 (17:56 +0100)]
Remove description file for non-exported repositories
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.
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.
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.
Magnus Hagander [Tue, 11 Aug 2020 15:24:44 +0000 (17:24 +0200)]
Import latest version of community authentication plugin
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.
Magnus Hagander [Sun, 9 Aug 2020 14:36:17 +0000 (16:36 +0200)]
Remove unused import
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.
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
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.
Magnus Hagander [Tue, 31 Mar 2020 18:08:41 +0000 (20:08 +0200)]
Specify on_delete=models.CASCADE on all ForeignKey fields
Magnus Hagander [Wed, 26 Feb 2020 17:24:28 +0000 (18:24 +0100)]
Sync up community auth plugin to latest-and-greatest
Magnus Hagander [Sun, 23 Feb 2020 21:18:50 +0000 (22:18 +0100)]
Another unicode fix for writing repo configs
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.
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
Magnus Hagander [Tue, 22 Oct 2019 12:35:07 +0000 (14:35 +0200)]
Update migrations for py3 migration
Magnus Hagander [Wed, 18 Sep 2019 08:48:49 +0000 (10:48 +0200)]
Don't dump keys if they consist only of whitespace
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
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.
Magnus Hagander [Thu, 7 Feb 2019 21:56:31 +0000 (22:56 +0100)]
Update reposync for py3
Magnus Hagander [Thu, 7 Feb 2019 21:40:18 +0000 (22:40 +0100)]
It seems tabremover is not needed in python3
Magnus Hagander [Thu, 7 Feb 2019 21:29:37 +0000 (22:29 +0100)]
Fix git key sync
Magnus Hagander [Thu, 7 Feb 2019 21:20:02 +0000 (22:20 +0100)]
Update varnishpurge trigger to use requests and be py3
Magnus Hagander [Thu, 7 Feb 2019 21:18:04 +0000 (22:18 +0100)]
Import latest version of py3 compatible auth.py
Magnus Hagander [Thu, 7 Feb 2019 21:17:12 +0000 (22:17 +0100)]
Basic python3 updates
Magnus Hagander [Thu, 7 Feb 2019 10:23:55 +0000 (11:23 +0100)]
pep8 fixes
Magnus Hagander [Thu, 7 Feb 2019 10:08:48 +0000 (11:08 +0100)]
tabs -> spaces for pep8
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).
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.
Magnus Hagander [Sun, 25 Feb 2018 13:16:22 +0000 (14:16 +0100)]
Remove staticfiles and sites apps, not used
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
Magnus Hagander [Mon, 30 May 2016 14:02:13 +0000 (16:02 +0200)]
Remove references to pgfoundry
Magnus Hagander [Mon, 30 May 2016 14:02:06 +0000 (16:02 +0200)]
Update URL references to https
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
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.
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.
Magnus Hagander [Tue, 22 Dec 2015 10:05:06 +0000 (11:05 +0100)]
Minor code updatse to support django 1.8
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
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
Magnus Hagander [Sat, 25 May 2013 21:26:22 +0000 (17:26 -0400)]
Update for django 1.4
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.
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.
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.
Magnus Hagander [Thu, 21 Feb 2013 16:23:56 +0000 (17:23 +0100)]
Fix regexp escaping
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.
Magnus Hagander [Thu, 21 Feb 2013 15:57:29 +0000 (16:57 +0100)]
Add varnish purger trigger
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
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.
Magnus Hagander [Wed, 20 Feb 2013 16:37:21 +0000 (17:37 +0100)]
Actually put timestamps in the logfile
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
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
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.
Magnus Hagander [Wed, 28 Dec 2011 14:05:41 +0000 (15:05 +0100)]
Update urls (already done in production, forgot to commit..)
Magnus Hagander [Wed, 28 Dec 2011 14:02:06 +0000 (15:02 +0100)]
Support newer versions of django
Magnus Hagander [Wed, 28 Dec 2011 14:01:55 +0000 (15:01 +0100)]
Implement postgresql.org community authentication version 2
Magnus Hagander [Wed, 6 Jul 2011 11:00:12 +0000 (13:00 +0200)]
Add csrf token, required by modern django
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 ;)
Magnus Hagander [Thu, 30 Dec 2010 13:11:40 +0000 (14:11 +0100)]
Add note about what the description field is for
Magnus Hagander [Wed, 22 Dec 2010 14:00:14 +0000 (15:00 +0100)]
Avoid using Python 2.6 syntax
Magnus Hagander [Wed, 22 Dec 2010 13:57:27 +0000 (14:57 +0100)]
Add support for custom gitweb tabwidth
Magnus Hagander [Sat, 17 Oct 2009 18:34:40 +0000 (20:34 +0200)]
Properly dump multiple ssh keys to the authorized_keys file.
Magnus Hagander [Tue, 11 Aug 2009 12:29:46 +0000 (14:29 +0200)]
Add instructions about users/ namespace.
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.
Magnus Hagander [Wed, 22 Jul 2009 09:40:28 +0000 (11:40 +0200)]
Add ssh url information
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...
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.
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.
Magnus Hagander [Thu, 26 Mar 2009 15:16:11 +0000 (16:16 +0100)]
Include .git suffix in gitweb list as well
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.
Magnus Hagander [Sun, 8 Mar 2009 19:09:45 +0000 (20:09 +0100)]
Clearify a few things, per David Fetter
Magnus Hagander [Thu, 5 Mar 2009 19:17:08 +0000 (20:17 +0100)]
Add initial help page.
Magnus Hagander [Wed, 4 Mar 2009 16:33:53 +0000 (17:33 +0100)]
Better __str__ for permissions - mainly shown when deleting an object.
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...
Magnus Hagander [Wed, 4 Mar 2009 15:08:06 +0000 (16:08 +0100)]
Dept of really stupid. COALESCE works the other way..
Magnus Hagander [Wed, 4 Mar 2009 15:06:40 +0000 (16:06 +0100)]
Deal with repositories without owner (such as remote ones)
Magnus Hagander [Wed, 4 Mar 2009 15:05:14 +0000 (16:05 +0100)]
Fix another bunch of typos. Maybe I should test things?
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
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.
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