Commit Graph

48 Commits

Author SHA1 Message Date
Drew DeVault ba1e43917b Fix conn.execute with new SQLAlchemy version 2023-10-31 08:55:03 +01:00
Vlad-Stefan Harbuz fb56d7ba60 add project RSS feed
Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
2023-02-22 09:18:52 +01:00
Adnan Maolood 16dea8ac4d hubsrht: Match projects case-sensitively 2022-07-06 10:29:31 +02:00
Conrad Hoffmann d637723564 Uppercase the Visibility enum keys
There is currently a mismatch, causing for example project creation via
the web interface to fail, because the validation code is using the enum
keys, which are lowercase, but everything else uses uppercase.

Simply use uppercase everywhere, like already the case in other
services.
2022-07-01 09:18:57 +02:00
Drew DeVault b2e5433d30 projects.py: print readme exceptions 2022-02-14 17:53:23 +01:00
Adnan Maolood a77998c012 hubsrht: Remove usage of repository(id) GraphQL query
The repository(id) query will be removed from git.sr.ht, so use the
User.repository(name) query instead.
2022-02-14 15:42:51 +01:00
Sebastian LaVine 809792c0d0 Remove misplaced word 2021-09-21 09:20:43 +02:00
Sol Fisher Romanoff 1426569187 Make project names match [A-Za-z0-9._-]+
Project names in URLs are now case-insensitive --
This might break existing projects.

Also prohibits use of '.git' and '.hg' as project names.
2021-08-11 09:41:50 +02:00
Drew DeVault 7c9bff2e86 Prohibit projects named . or .. 2021-06-12 11:54:06 -04:00
Alexey Yerin c86e3280d7 Show last five repos when trying to clone project
Repositories are sorted by latest update time, like on "sources" tab.

Ticket: https://todo.sr.ht/~sircmpwn/hub.sr.ht/61
2021-01-29 10:35:00 -05:00
Drew DeVault b75ac04029 Tolerate # symbol in tag entry 2021-01-18 15:29:02 -05:00
Drew DeVault bd37e09523 Use GraphQL to fetch readmes from git.sr.ht 2020-12-03 08:33:47 -05:00
Drew DeVault 8737b4881d Make project tags optional
Didn't notice this in the original patchset
2020-09-12 09:57:41 -04:00
наб dc078f279f Add project tags
Ref: ~sircmpwn/hub.sr.ht#19
2020-09-12 09:10:26 -04:00
Gregory Anders 10453628e7 Fix typo in error message 2020-08-20 12:37:36 -04:00
наб 39eafa9bbf Show helpful error on Mercurial clones as well
Unfortunately "hg clone" seems to have issues with the redirect to the
version with the trailing slash, but it's better than the raw HTML dump
from before

-- >8 --
nabijaczleweli@tarta:~/uwu$ hg clone http://127.0.0.1:5014/~nabijaczleweli/projeq wellb
abort: HTTP Error 308: PERMANENT REDIRECT
nabijaczleweli@tarta:~/uwu$ hg clone http://127.0.0.1:5014/~nabijaczleweli/projeq/ wellb
abort: 'http://127.0.0.1:5014/~nabijaczleweli/projeq/' does not appear to be an hg repository:
---%<--- (text/plain; charset=utf-8)

You have tried to clone a project from sourcehat, but you probably meant to
clone a specific hg repository for this project instead. A single project on
sourcehat often has more than one hg repository.

You can visit the following URL:

  http://127.0.0.1:5014/~nabijaczleweli/projeq/sources

To the browse source repositories for this project.

---%<---
!
nabijaczleweli@tarta:~/uwu$
-- >8 --
2020-08-20 12:37:35 -04:00
наб b2f59c803b Return an error when trying to clone a project
-- >8 --
nabijaczleweli@tarta:~/uwu/git$ strace -f -o ss git clone http://127.0.0.1:5014/~nabijaczleweli/projeq
Cloning into 'projeq'...
fatal: remote error:

This is a sourcehat project, which amalgamates multiple source repositories,
issue trackers, and mailing lists.

You can visit
  http://127.0.0.1:5014/~nabijaczleweli/projeq/sources
to pick a specific source.

nabijaczleweli@tarta:~/uwu/git$
-- >8 --

Returning a non-ERR here and going down to a pack is possible
(confer https://twitter.com/nabijaczleweli/status/1296062752516079617)
but errors later down the line are either more verbose and hint at
implementation errors, or leave repositories in a sticky state.

Ref: ~sircmpwn/hub.sr.ht#49
2020-08-20 10:21:26 -04:00
Drew DeVault 7b76b9d5eb Add confirmation page for project deletion 2020-07-20 10:04:29 -04:00
Drew DeVault 1e3e641abc projects.py: import session from flask 2020-07-09 12:29:16 -04:00
Drew DeVault 3c6f828df2 Fix project deletion
SQLAlchemy's internal cascade handling is the most miserable, broken
piece of shit I have ever had the displeasure of using. So we circumvent
it entirely and let the SQL server do the right thing.

A word of advice: don't use SQLAlchemy for new projects.
2020-07-09 09:56:20 -04:00
Michał Sidor (Michcioperz) d24e508cd4 Add support for different named READMEs 2020-05-25 10:10:57 -04:00
Drew DeVault 9765707eb7 Fix visibility updates in project settings 2020-04-30 14:02:08 -04:00
Drew DeVault b90812f934 Fix URLs for embedded images in project summaries 2020-04-30 08:46:07 -04:00
Drew DeVault 7d1cb671f3 Better handling of private or unlisted resources 2020-04-29 13:25:49 -04:00
Drew DeVault 216ca85b16 Allow trailing slashes on some routes 2020-04-29 10:46:05 -04:00
Drew DeVault f29b90b8fa projects.create_POST: validate name matches regex 2020-04-29 08:41:17 -04:00
Drew DeVault 102fca490c Implement featured projects 2020-04-28 14:08:56 -04:00
Drew DeVault a3fd75170b Add logged-in user dashboard page 2020-04-27 11:57:50 -04:00
Drew DeVault 89a2e3ac9f Rig up Mercurial support 2020-04-06 13:21:13 -04:00
Drew DeVault af43379a80 Implement project deletion
And fix all of the cascades on the database relationships

Fuck SQLAlchemy
L
2020-04-02 13:14:35 -04:00
Drew DeVault 2ec9808304 Add project config page 2020-04-02 12:55:05 -04:00
Drew DeVault cbc4326657 Implement dismissal of new project checklist 2020-04-02 11:48:41 -04:00
Drew DeVault adaabb8031 Show friendlier error on failure to fetch README.md 2020-04-01 18:26:52 -04:00
Drew DeVault 03f858a9bf Implement project event feed 2020-04-01 15:16:20 -04:00
Drew DeVault 665d0ca21f Implement genuine event list on summary page 2020-04-01 15:03:52 -04:00
Drew DeVault 09e18897b6 Move mailing list routes to separate blueprint 2020-04-01 13:35:25 -04:00
Drew DeVault 3b7b28a5cf Move sources routes to separate blueprint 2020-04-01 13:30:57 -04:00
Drew DeVault b6b673e4d7 Add search & manage page for mailing lists 2020-04-01 09:05:17 -04:00
Drew DeVault 1ba020a264 Add "manage sources" page 2020-04-01 08:58:48 -04:00
Drew DeVault 57719e8391 add list: correct typo in search field name 2020-03-31 16:09:47 -04:00
Drew DeVault a005c28fdf Flesh out webhooks a bit more 2020-03-31 16:09:33 -04:00
Drew DeVault 88af4176a7 Implement creating new mailing lists 2020-03-31 15:08:00 -04:00
Drew DeVault c47f6ff49a Rig up git repo creation, webhooks 2020-03-31 11:40:55 -04:00
Drew DeVault 74d8068b44 Add event tracking 2020-03-25 19:17:53 -04:00
Drew DeVault f0f753bfd3 Add basic mailing lists support 2020-03-25 11:18:18 -04:00
Drew DeVault 2aedc53e7f Add page listing source repos for project 2020-03-24 12:14:02 -04:00
Drew DeVault f8a9b84bc5 Implement fetching readme from git repos 2020-03-24 11:22:55 -04:00
Drew DeVault a50a47f7e6 Initial commit 2020-03-24 10:26:15 -04:00