summaryrefslogtreecommitdiff
path: root/internal/api/model/instancev1.go
AgeCommit message (Collapse)AuthorFiles
2023-10-24[bugfix] serialize instance terms via API (#2293)Libravatar tobi1
2023-08-19[feature] Instance rules (#2125)Libravatar f0x521
* init instance rules database model, admin api * expose instance rules in public instance api * public /api/v1/instance/rules route * GET ruleById * createRule route * createRule auth check * updateRule * deleteRule * list rules on about page * ruleGet auth * add about page ids for anchors * process and store adding violated rules to reports * admin api models for instance rules * instance rule edit frontend * change rule inputs to textareas * database fixes after rebase (#2124) * remove unused imports * fix db migration column name * fix tests * fix more tests * fix postgres error with wrongly used Ident * add some tests, fiddle with rule model a bit, fix postgres migration * swagger docs --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-05-06[bugfix] Return languages in api/v1/instance (#1741)Libravatar Daenney1
It turns out that in Masto v2.3.0 the languages key was added to the V1 Instance and that it's effectively mandatory. Though in GtS we don't really have this concept yet, some apps will explode if the languages key is missing altogether. So at least return the empty array on V1 too in the hopes that it makes things work well enough. For history's sake, you can see the attributes that will get serialised in https://github.com/mastodon/mastodon/blob/f877aa9d70d0d600961989b8e97c0e0ce3ac1db6/app/serializers/rest/v1/instance_serializer.rb#L6-L9. Because the attribute does not have a conditional defined for it, there isn't a filter that optionally omits it, or a def languages to modify the behaviour the attribute is effectively always included and serialised. Fixes: #1662
2023-03-12[chore] Improve copyright header handling (#1608)Libravatar Daenney1
* [chore] Remove years from all license headers Years or year ranges aren't required in license headers. Many projects have removed them in recent years and it avoids a bit of yearly toil. In many cases our copyright claim was also a bit dodgy since we added the 2021-2023 header to files created after 2021 but you can't claim copyright into the past that way. * [chore] Add license header check This ensures a license header is always added to any new file. This avoids maintainers/reviewers needing to remember to check for and ask for it in case a contribution doesn't include it. * [chore] Add missing license headers * [chore] Further updates to license header * Use the more common // indentend comment format * Remove the hack we had for the linter now that we use the // format * Add SPDX license identifier
2023-02-02[feature] Implement `/api/v2/instance` endpoint (#1409)Libravatar tobi1
* interim: start adding /api/v2/instance * finish up