Update documentation

This commit is contained in:
rubenwardy 2021-02-05 15:29:44 +00:00
parent 0918b8b676
commit 3ce653ba74
6 changed files with 95 additions and 23 deletions

@ -280,6 +280,9 @@ def update_config(package):
form.trigger.data = PackageUpdateTrigger.COMMIT form.trigger.data = PackageUpdateTrigger.COMMIT
form.action.data = "notification" form.action.data = "notification"
if "trigger" in request.args:
form.trigger.data = PackageUpdateTrigger.get(request.args["trigger"])
if form.validate_on_submit(): if form.validate_on_submit():
if form.disable.data: if form.disable.data:
flash("Deleted update configuration", "success") flash("Deleted update configuration", "success")

@ -46,10 +46,10 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
* `title`: Human-readable title. * `title`: Human-readable title.
* `name`: Technical name (needs permission if already approved). * `name`: Technical name (needs permission if already approved).
* `short_description` * `short_description`
* `tags`: List of tag names, see [misc](#misc). * `tags`: List of [tag](#tags) names.
* `content_warnings`: List of content warning names, see [misc](#misc). * `content_warnings`: List of [content warning](#content-warnings) names.
* `license`: A license name. * `license`: A [license](#licenses) name.
* `media_license`: A license name. * `media_license`: A [license](#licenses) name.
* `long_description`: Long markdown description. * `long_description`: Long markdown description.
* `repo`: Git repo URL. * `repo`: Git repo URL.
* `website`: Website URL. * `website`: Website URL.
@ -187,7 +187,7 @@ curl -X POST https://content.minetest.net/api/packages/username/name/screenshots
## Topics ## Topics
* GET `/api/topics/`: Supports [Package Queries](#package-queries), and the following two options: * GET `/api/topics/` ([View](/api/topics/)): Supports [Package Queries](#package-queries), and the following two options:
* `show_added`: Show topics which exist as packages, default true. * `show_added`: Show topics which exist as packages, default true.
* `show_discarded`: Show topics which have been marked as outdated, default false. * `show_discarded`: Show topics which have been marked as outdated, default false.
@ -206,19 +206,49 @@ Supported query parameters:
* `show_discarded`: Show topics marked as discarded. * `show_discarded`: Show topics marked as discarded.
* `limit`: Return at most `limit` topics. * `limit`: Return at most `limit` topics.
## Types
## Misc ### Tags
* GET `/api/scores/` * GET `/api/tags/` ([View](/api/tags/)): List of:
* See [Package Queries](#package-queries)
* GET `/api/tags/`: List of:
* `name`: technical name * `name`: technical name
* `title`: human-readable title * `title`: human-readable title
* `description`: tag description or null * `description`: tag description or null
* GET `/api/licenses/`: List of:
### Content Warnings
* GET `/api/content_warnings/` ([View](/api/content_warnings/)): List of:
* `name`: technical name
* `title`: human-readable title
* `description`: tag description or null
### Licenses
* GET `/api/licenses/` ([View](/api/licenses/)): List of:
* `name` * `name`
* `is_foss`: whether the license is foss * `is_foss`: whether the license is foss
* GET `/api/homepage/`
### Minetest Versions
* GET `/api/minetest_versions/` ([View](/api/minetest_versions/))
* `name`: Version name.
* `is_dev`: boolean, is dev version.
* `protocol_version`: protocol version umber.
## Misc
* GET `/api/scores/` ([View](/api/scores/))
* See [Top Packages Algorithm](/help/top_packages/).
* Supports [Package Queries](#package-queries).
* Returns list of:
* `author`: package author name.
* `name`: package technical name.
* `downloads`: number of downloads.
* `score`: total package score.
* `score_reviews`: score from reviews.
* `score_downloads`: score from downloads.
* GET `/api/homepage/` ([View](/api/homepage/)) - get contents of homepage.
* `count`: number of packages * `count`: number of packages
* `downloads`: get number of downloads * `downloads`: get number of downloads
* `new`: new packages * `new`: new packages
@ -227,4 +257,3 @@ Supported query parameters:
* `pop_txp`: popular textures * `pop_txp`: popular textures
* `pop_game`: popular games * `pop_game`: popular games
* `high_reviewed`: highest reviewed * `high_reviewed`: highest reviewed
* GET `/api/minetest_versions/`

@ -20,6 +20,11 @@ The process is as follows:
3. The git host posts a webhook notification to ContentDB, using the API token assigned to it. 3. The git host posts a webhook notification to ContentDB, using the API token assigned to it.
4. ContentDB checks the API token and issues a new release. 4. ContentDB checks the API token and issues a new release.
<p class="alert alert-warning">
"New commit" or "push" based webhooks are currently broken as they don't check the branch name.
This means that releases will be created for pushes to non-default branches.
</p>
## Setting up ## Setting up
### GitHub ### GitHub
@ -49,9 +54,10 @@ The process is as follows:
choose "Tag push events". choose "Tag push events".
8. Add webhook. 8. Add webhook.
## Configuring ## Configuring Release Creation
See the [Package Configuration and Releases Guide](/help/package_config/) for See the [Package Configuration and Releases Guide](/help/package_config/) for
documentation on configuring the release creation. documentation on configuring the release creation.
You can set the min/max Minetest version from the Git repository, and also
configure what files are included. From the Git repository, you can set the min/max Minetest versions, which files are included,
and update the package meta.

@ -502,9 +502,9 @@ class Package(db.Model):
return url_for("packages.bulk_change_release", return url_for("packages.bulk_change_release",
author=self.author.username, name=self.name) author=self.author.username, name=self.name)
def getUpdateConfigURL(self, action=None): def getUpdateConfigURL(self, trigger=None, action=None):
return url_for("packages.update_config", return url_for("packages.update_config",
author=self.author.username, name=self.name, action=action) author=self.author.username, name=self.name, trigger=trigger, action=action)
def getSetupReleasesURL(self): def getSetupReleasesURL(self):
return url_for("packages.setup_releases", return url_for("packages.setup_releases",

@ -29,6 +29,14 @@
{{ _("Have you read the Package Inclusion Policy and Guidance yet?") }} {{ _("Have you read the Package Inclusion Policy and Guidance yet?") }}
</div> </div>
{% if package %}
<div class="alert alert-secondary">
<a class="float-right btn btn-sm btn-default" href="/help/package_config/#cdbjson">{{ _("Read more") }}</a>
{{ _("You can include a .cdb.json file in your %(type)s to update these details automatically.", type=package.type.value.lower()) }}
</div>
{% endif %}
{% if package and package.checkPerm(current_user, "REIMPORT_META") and package.releases.first() %} {% if package and package.checkPerm(current_user, "REIMPORT_META") and package.releases.first() %}
<form class="alert alert-secondary mb-5" method="post" action="{{ package.getUpdateFromReleaseURL() }}"> <form class="alert alert-secondary mb-5" method="post" action="{{ package.getUpdateFromReleaseURL() }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

@ -5,6 +5,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<a class="btn btn-secondary float-right" href="{{ package.getDetailsURL() }}">
{{ _("Later") }}
</a>
<h1>{{ self.title() }}</h1> <h1>{{ self.title() }}</h1>
<p> <p>
@ -22,12 +25,35 @@
{{ _("This can be changed later.") }} {{ _("This can be changed later.") }}
</p> </p>
<p class="mt-5">
<a class="btn btn-primary" href="{{ package.getUpdateConfigURL() }}">Automatically</a> <div class="row">
<a class="btn btn-secondary ml-2" href="{{ package.getUpdateConfigURL(action="notification") }}">Manually, enable reminders</a> <div class="col-md-6 mt-5">
<a class="btn btn-secondary ml-2" href="{{ package.getCreateReleaseURL() }}">Manually, no reminders</a> <h3 class="mt-0">{{ _("Automatically (Recommended)") }}</h3>
<a class="btn btn-secondary ml-2" href="{{ package.getDetailsURL() }}">Later</a> <p>
<a class="btn btn-primary" href="{{ package.getUpdateConfigURL(trigger="commit") }}">
{{ _("Rolling Release") }}
</a>
<a class="btn btn-primary ml-2" href="{{ package.getUpdateConfigURL(trigger="tag") }}">
{{ _("On Git Tag") }}
</a>
{# <a class="btn btn-secondary ml-2" href="{{ package.getUpdateConfigURL() }}">#}
{# {{ _("Advanced") }}#}
{# </a>#}
</p> </p>
</div>
<div class="col-md-6 mt-5">
<h3 class="mt-0">{{ _("Manually") }}</h3>
<p>
<a class="btn btn-secondary" href="{{ package.getUpdateConfigURL(action="notification") }}">
{{ _("With reminders") }}
</a>
<a class="btn btn-secondary ml-2" href="{{ package.getCreateReleaseURL() }}">
{{ _("No reminders") }}
</a>
</p>
</div>
</div>
{% else %} {% else %}
<p> <p>
{{ _("Using Git would allow you to create releases automatically when you push code or tags.") }} {{ _("Using Git would allow you to create releases automatically when you push code or tags.") }}