Commit graph

189 commits

Author SHA1 Message Date
Drew DeVault
c65d3bedea Upgrade to Alpine 3.20 2024-08-05 15:19:28 +02:00
Drew DeVault
58e1a53279 content.html: fix unclosed <a> tag in nav 2024-07-24 14:21:05 +02:00
Conrad Hoffmann
5f00bb1a28 Add .git_archival and .gitattributes
These files should have been added in 7f8cabe8 but were forgotten.
2024-07-16 22:40:20 +02:00
Conrad Hoffmann
7f8cabe8a8 Preparations for PEP440 support
Currrently, builds for patches are broken because the version numbers
generated for them are not valid according to PEP 440 [1].

This has to be solved in several steps, in coordination with the
packaging code. Procedure will be the same as for core.sr.ht:

https://git.sr.ht/~sircmpwn/core.sr.ht/commit/57ee3427

The only difference is that the extra build step (running `make`) will
remain in `setup.py` (as there is no generic mechanism for this in
`pyproject.toml`). This just means the build process will still always
have to be performed with setuptools as backend.

[1] https://peps.python.org/pep-0440
2024-07-16 18:30:30 +02:00
Conrad Hoffmann
30066c04b2 api: update generated file after last dep upgrade 2024-05-24 11:44:39 +02:00
Drew DeVault
e0febde0e3 Upgrade to Alpine 3.19 2024-03-20 14:32:22 +01:00
Drew DeVault
8540644f27 .builds: drop arch, debian 2024-02-09 10:20:46 +01:00
Simon Ser
00129294e6 Upgrade dependencies 2024-01-31 09:13:02 +01:00
Simon Ser
07aed9ec2f Upgrade core-go 2024-01-31 09:11:59 +01:00
наб
59384ec3e7 Make "source" link go to source instead of another render in the backing repo 2024-01-21 20:35:59 +01:00
наб
79d062cbda Make "history" link go to the actual ref serving the wiki instead of the default branch 2024-01-21 20:25:20 +01:00
Conrad Hoffmann
e8fb1d43cf Adapt to changes in core.sr.ht 2024-01-09 12:26:52 +01:00
Conrad Hoffmann
0f68e8bc93 Don't sanitize root wiki's HTML
The sanitizer has become pretty strict, but the root wiki's content is
not user-supplied, so there is no harm in making an exception for it.
2024-01-09 11:57:44 +01:00
Conrad Hoffmann
5eb03fd359 Update to latest version of core-go 2024-01-09 11:34:22 +01:00
Adnan Maolood
5f673ef71a Move go.mod to root 2023-06-01 12:27:48 +02:00
Drew DeVault
49dd76c705 Upgrade to Alpine 3.17 2023-03-22 11:58:39 +01:00
Conrad Hoffmann
62e8f477ac Do not disclose existence of private resources
When a user attempts to view a wiki that they do not have access to, the
error code should not disclose that this resource does in fact exist.
2022-11-10 11:40:32 +01:00
Conrad Hoffmann
8de82b919c Derive access to private wikis from backing repo
Currently, no one except the owner can access private wikis. This commit
provides access to private wikis to non-owners based on their access to
the backing git repository.

This allows collaborating with other people on private wikis.
2022-11-10 11:40:32 +01:00
Drew DeVault
6c762404e9 .builds/alpine.yml: add API restart step 2022-11-02 10:34:19 +01:00
Drew DeVault
1c7789adc5 Set minimum Go version to 1.17 2022-11-02 10:17:53 +01:00
Adnan Maolood
30178b1808 API: implement user account deletion 2022-11-02 10:09:32 +01:00
Adnan Maolood
fcf4b4f083 schema.sql: Add missing cascades
These cascades were added in the ID unification migration.
2022-11-02 10:03:22 +01:00
Adnan Maolood
b77b7ba419 mansrht: Use canonical user IDs
Update user IDs across man.sr.ht to match those of meta.sr.ht.
2022-10-26 10:50:13 +02:00
Adnan Maolood
08438203d1 Add schema.sql 2022-08-17 10:05:34 +02:00
Thorben Günther
d79cdb1490 Import Markup from markupsafe
Using jinja2 here is deprecated.
2022-05-30 13:45:31 +02:00
Conrad Hoffmann
d2ab9ce8c0 Fix repo creation during "new wiki" workflow
Currently, creating new repos when setting up a new wiki fails because
man.sr.ht does not specify the visibility of the repo to be created.
This commit fixes this by allowing the user to choose the visibility
in the "Create a new repo" form and passing the selected value to the
API call for repo creation.

Fixes: https://todo.sr.ht/~sircmpwn/man.sr.ht/58
2022-03-14 12:22:00 +01:00
Drew DeVault
e3bd7b93de .builds/alpine.yml: upgrade to 3.15 2022-02-21 18:18:11 +01:00
Ignas Kiela
861451162c Instrument caches 2022-01-20 10:01:00 +01:00
Peter Sanchez
c685181d1b Updating config example for new mail options 2021-12-01 09:36:35 +01:00
Drew DeVault
8db6e0b822 new-wiki.html: fix suggested git commands
See #55
2021-10-18 10:44:18 +02:00
Drew DeVault
4545705f9a Fix issues with "first paragraph" rehoming
This code is designed to put the first paragraph ahead of the table of
contents, but it could cause issues if the first HTML element was not a
paragraph tag, or if the page had the ToC disabled or had no headings.
2021-09-23 13:13:06 +02:00
Sol Fisher Romanoff
2ad9c145ce Make wiki names match [A-Za-z0-9._-]+
Also prohibits use of '.git' and '.hg' as wiki names.
2021-08-11 09:44:11 +02:00
Drew DeVault
d842538a2f create: fix logic error with existing refs
The "existing" branch in the template is used on the repo select screen
to filter out repositories which already have a wiki created for them.
This change adds a short-circuit which avoids the check in other
situations.

While I'm here I also tweaked the appearance of this page a bit.
2021-08-06 10:02:07 +02:00
Drew DeVault
cb0e0d1446 .builds/alpine.yml: upgrade to 3.14 2021-08-03 12:31:35 +02:00
Nguyễn Gia Phong
4f9faf3d43 Remove whitespace before wiki name 2021-07-06 14:50:40 -04:00
nytpu
e03d3d6437 Add links back to wiki root on wiki pages
This adds links back to the wiki root index in two places: on the
pseudo-breadcrumbs with the username and wiki name, and on the "article"
tab.  This makes it possible to navigate back to the wiki index from any
wiki page, whereas before it was impossible.  The new links also fixes
the most counterintuitive link on the page, as the "article" tab linking
back to the site root (/) is very strange and unexpected.
2021-07-06 10:05:07 -04:00
nytpu
0caaf0b96f Fix double-tilde bug in the delete wiki page
The routes for `user_content` in mansrht/blueprints/html.py include a
tilde ('~') in them, which is required for the route to function
properly.  However, .canonical_name already includes a tilde[a].  This
causes in a bug where any usage of user_content with the
owner.canonical_name field will result in a generated url where the
username is prefixed with two tildes ("~~nytpu") rather than one.

This replaces the usages of owner.canonical_name with owner.username
which is identical to .canonical_name (see link [a]) except that it does
not have a leading tilde.

[a]: 99a8168de4/item/srht/oauth/user.py (L37)
2021-07-06 10:05:07 -04:00
Drew DeVault
c1333ba01f Prohibit . and .. in wiki names 2021-06-12 11:57:35 -04:00
Thorben Günther
08c70ab276 Fix Flask 2.0.x incompatible blueprint names 2021-05-26 20:12:18 -04:00
Drew DeVault
64483f3dee Revert "Link back to wiki index"
This reverts commit 0c6887ca55.
2021-05-17 09:38:09 -04:00
Nguyễn Gia Phong
0c6887ca55 Link back to wiki index 2021-05-17 09:31:54 -04:00
Armin Weigl
02bf4622f3 Validate existence of branch 2021-03-17 11:07:18 -04:00
Armin Weigl
6884b882a6 Fix 500 when creating a wiki from branch containing invalid utf-8 2021-03-17 11:07:17 -04:00
Eyal Sawady
2d16df0ce6 Replace man.sr.ht with {{domain}} in titles 2021-02-15 08:26:13 -05:00
Nolan Prescott
0662e81605 Move username out of wiki title
piggyback the header-extension style used in git.sr.ht for repository
descriptions in order to move wiki owner out of the wiki title while
keeping it visually adjacent. Link username to wiki profile page.

Intended to address sr.ht-discuss: Wiki "Public" page
<C96YNX5WZPFC.1CU197QUTFYCI@taiga>
2021-02-12 11:07:47 -05:00
Drew DeVault
94577633e6 .builds/alpine: upgrade to 3.13 2021-02-08 10:13:52 -05:00
Alexey Yerin
c2b60d8041 Make code.gray respect dark theme
When creating a new wiki, clone URL background is white. This commit
fixes it.
2021-02-02 10:14:56 -05:00
Drew DeVault
d2f2a02f33 Fix deletion of repos which don't exist 2021-01-28 12:44:17 -05:00
Drew DeVault
d165c26f3a Fix wiki deletion when repo is missing 2021-01-28 12:39:24 -05:00
Nolan Prescott
8275ea5452 Fall back to empty string without first paragraph
This patch provides a default value so that a None is not inserted
into the HTML view

Issue reported to the mailing list:

> If a wiki page is e.g.
>
>     # Foo
>     ## Bar
>
> then it renders like
>
>     None
>     {{table of contents}}
>     # Foo
>     ## Bar
2020-11-08 09:42:31 -05:00