[chore] update dependencies, bump to Go 1.19.1 (#826)

* update dependencies, bump Go version to 1.19

* bump test image Go version

* update golangci-lint

* update gotosocial-drone-build

* sign

* linting, go fmt

* update swagger docs

* update swagger docs

* whitespace

* update contributing.md

* fuckin whoopsie doopsie

* linterino, linteroni

* fix followrequest test not starting processor

* fix other api/client tests not starting processor

* fix remaining tests where processor not started

* bump go-runners version

* don't check last-webfingered-at, processor may have updated this

* update swagger command

* update bun to latest version

* fix embed to work the same as before with new bun

Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
This commit is contained in:
kim 2022-09-28 18:30:40 +01:00 committed by GitHub
commit a156188b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1135 changed files with 258905 additions and 137146 deletions

View file

@ -74,6 +74,8 @@ func (suite *AccountStandardTestSuite) SetupTest() {
suite.accountModule = account.New(suite.processor).(*account.Module)
testrig.StandardDBSetup(suite.db, nil)
testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media")
suite.NoError(suite.processor.Start())
}
func (suite *AccountStandardTestSuite) TearDownTest() {

View file

@ -39,37 +39,37 @@ import (
// The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'.
// The parameters can also be given in the body of the request, as XML, if the content-type is set to 'application/xml'.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// consumes:
// - application/json
// - application/xml
// - application/x-www-form-urlencoded
// consumes:
// - application/json
// - application/xml
// - application/x-www-form-urlencoded
//
// produces:
// - application/json
// produces:
// - application/json
//
// security:
// - OAuth2 Application:
// - write:accounts
// security:
// - OAuth2 Application:
// - write:accounts
//
// responses:
// '200':
// description: "An OAuth2 access token for the newly-created account."
// schema:
// "$ref": "#/definitions/oauthToken"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// description: "An OAuth2 access token for the newly-created account."
// schema:
// "$ref": "#/definitions/oauthToken"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountCreatePOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, false, false)
if err != nil {

View file

@ -33,37 +33,38 @@ import (
//
// Delete your account.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// consumes:
// - multipart/form-data
// consumes:
// - multipart/form-data
//
// parameters:
// - name: password
// in: formData
// description: Password of the account user, for confirmation.
// type: string
// required: true
// parameters:
// -
// name: password
// in: formData
// description: Password of the account user, for confirmation.
// type: string
// required: true
//
// security:
// - OAuth2 Bearer:
// - write:accounts
// security:
// - OAuth2 Bearer:
// - write:accounts
//
// responses:
// '202':
// description: "The account deletion has been accepted and the account will be deleted."
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '202':
// description: "The account deletion has been accepted and the account will be deleted."
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountDeletePOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -32,38 +32,40 @@ import (
//
// Get information about an account with the given ID.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: The id of the requested account.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: The id of the requested account.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// description: The requested account.
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -35,89 +35,101 @@ import (
//
// Update your account.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// consumes:
// - multipart/form-data
// consumes:
// - multipart/form-data
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: discoverable
// in: formData
// description: Account should be made discoverable and shown in the profile directory (if enabled).
// type: boolean
// - name: bot
// in: formData
// description: Account is flagged as a bot.
// type: boolean
// - name: display_name
// in: formData
// description: The display name to use for the account.
// type: string
// allowEmptyValue: true
// - name: note
// in: formData
// description: Bio/description of this account.
// type: string
// allowEmptyValue: true
// - name: avatar
// in: formData
// description: Avatar of the user.
// type: file
// - name: header
// in: formData
// description: Header of the user.
// type: file
// - name: locked
// in: formData
// description: Require manual approval of follow requests.
// type: boolean
// - name: source[privacy]
// in: formData
// description: Default post privacy for authored statuses.
// type: string
// - name: source[sensitive]
// in: formData
// description: Mark authored statuses as sensitive by default.
// type: boolean
// - name: source[language]
// in: formData
// description: Default language to use for authored statuses (ISO 6391).
// type: string
// - name: source[status_format]
// in: formData
// description: Default format to use for authored statuses (plain or markdown).
// type: string
// - name: custom_css
// in: formData
// description: |-
// Custom CSS to use when rendering this account's profile or statuses.
// String must be no more than 5,000 characters (~5kb).
// type: string
// parameters:
// -
// name: discoverable
// in: formData
// description: Account should be made discoverable and shown in the profile directory (if enabled).
// type: boolean
// -
// name: bot
// in: formData
// description: Account is flagged as a bot.
// type: boolean
// -
// name: display_name
// in: formData
// description: The display name to use for the account.
// type: string
// allowEmptyValue: true
// -
// name: note
// in: formData
// description: Bio/description of this account.
// type: string
// allowEmptyValue: true
// -
// name: avatar
// in: formData
// description: Avatar of the user.
// type: file
// -
// name: header
// in: formData
// description: Header of the user.
// type: file
// -
// name: locked
// in: formData
// description: Require manual approval of follow requests.
// type: boolean
// -
// name: source[privacy]
// in: formData
// description: Default post privacy for authored statuses.
// type: string
// -
// name: source[sensitive]
// in: formData
// description: Mark authored statuses as sensitive by default.
// type: boolean
// -
// name: source[language]
// in: formData
// description: Default language to use for authored statuses (ISO 6391).
// type: string
// -
// name: source[status_format]
// in: formData
// description: Default format to use for authored statuses (plain or markdown).
// type: string
// -
// name: custom_css
// in: formData
// description: >-
// Custom CSS to use when rendering this account's profile or statuses.
// String must be no more than 5,000 characters (~5kb).
// type: string
//
// security:
// - OAuth2 Bearer:
// - write:accounts
// security:
// - OAuth2 Bearer:
// - write:accounts
//
// responses:
// '200':
// description: "The newly updated account."
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// description: "The newly updated account."
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -31,31 +31,31 @@ import (
//
// Verify a token by returning account details pertaining to it.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// schema:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountVerifyGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -32,40 +32,40 @@ import (
//
// Block account with id.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: The id of the account to block.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: The id of the account to block.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - write:blocks
// security:
// - OAuth2 Bearer:
// - write:blocks
//
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// description: Your relationship to the account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountBlockPOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -36,57 +36,58 @@ import (
// The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'.
// The parameters can also be given in the body of the request, as XML, if the content-type is set to 'application/xml'.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// consumes:
// - application/json
// - application/xml
// - application/x-www-form-urlencoded
// consumes:
// - application/json
// - application/xml
// - application/x-www-form-urlencoded
//
// parameters:
// - name: id
// required: true
// in: path
// description: ID of the account to follow.
// type: string
// - default: true
// description: Show reblogs from this account.
// in: formData
// name: reblogs
// type: boolean
// x-go-name: Reblogs
// - default: false
// description: Notify when this account posts.
// in: formData
// name: notify
// type: boolean
// x-go-name: Notify
// parameters:
// -
// name: id
// required: true
// in: path
// description: ID of the account to follow.
// type: string
// -
// name: reblogs
// type: boolean
// default: true
// description: Show reblogs from this account.
// in: formData
// -
// default: false
// description: Notify when this account posts.
// in: formData
// name: notify
// type: boolean
//
// produces:
// - application/json
// produces:
// - application/json
//
// security:
// - OAuth2 Bearer:
// - write:follows
// security:
// - OAuth2 Bearer:
// - write:follows
//
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountFollowPOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -32,42 +32,43 @@ import (
//
// See followers of account with given id.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: Account ID.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: Account ID.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// name: accounts
// description: Array of accounts that follow this account.
// schema:
// type: array
// items:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: accounts
// description: Array of accounts that follow this account.
// schema:
// type: array
// items:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountFollowersGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -32,42 +32,43 @@ import (
//
// See accounts followed by given account id.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: Account ID.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: Account ID.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// name: accounts
// description: Array of accounts that are followed by this account.
// schema:
// type: array
// items:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: accounts
// description: Array of accounts that are followed by this account.
// schema:
// type: array
// items:
// "$ref": "#/definitions/account"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountFollowingGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -15,44 +15,45 @@ import (
//
// See your account's relationships with the given account IDs.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: array
// items:
// type: string
// description: Account IDs.
// in: query
// required: true
// parameters:
// -
// name: id
// type: array
// items:
// type: string
// description: Account IDs.
// in: query
// required: true
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// name: account relationships
// description: Array of account relationships.
// schema:
// type: array
// items:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: account relationships
// description: Array of account relationships.
// schema:
// type: array
// items:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountRelationshipsGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -36,91 +36,100 @@ import (
//
// The statuses will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: Account ID.
// in: path
// required: true
// - name: limit
// type: integer
// description: Number of statuses to return.
// default: 30
// in: query
// required: false
// - name: exclude_replies
// type: boolean
// description: Exclude statuses that are a reply to another status.
// default: false
// in: query
// required: false
// - name: exclude_reblogs
// type: boolean
// description: Exclude statuses that are a reblog/boost of another status.
// default: false
// in: query
// required: false
// - name: max_id
// type: string
// description: |-
// Return only statuses *OLDER* than the given max status ID.
// The status with the specified ID will not be included in the response.
// in: query
// - name: min_id
// type: string
// description: |-
// Return only statuses *NEWER* than the given min status ID.
// The status with the specified ID will not be included in the response.
// in: query
// required: false
// - name: pinned_only
// type: boolean
// description: Show only pinned statuses. In other words, exclude statuses that are not pinned to the given account ID.
// default: false
// in: query
// required: false
// - name: only_media
// type: boolean
// description: Show only statuses with media attachments.
// default: false
// in: query
// required: false
// - name: only_public
// type: boolean
// description: Show only statuses with a privacy setting of 'public'.
// default: false
// in: query
// required: false
// parameters:
// -
// name: id
// type: string
// description: Account ID.
// in: path
// required: true
// -
// name: limit
// type: integer
// description: Number of statuses to return.
// default: 30
// in: query
// required: false
// -
// name: exclude_replies
// type: boolean
// description: Exclude statuses that are a reply to another status.
// default: false
// in: query
// required: false
// -
// name: exclude_reblogs
// type: boolean
// description: Exclude statuses that are a reblog/boost of another status.
// default: false
// in: query
// required: false
// -
// name: max_id
// type: string
// description: >-
// Return only statuses *OLDER* than the given max status ID.
// The status with the specified ID will not be included in the response.
// in: query
// -
// name: min_id
// type: string
// description: >-
// Return only statuses *NEWER* than the given min status ID.
// The status with the specified ID will not be included in the response.
// in: query
// required: false
// -
// name: pinned_only
// type: boolean
// description: Show only pinned statuses. In other words, exclude statuses that are not pinned to the given account ID.
// default: false
// in: query
// required: false
// -
// name: only_media
// type: boolean
// description: Show only statuses with media attachments.
// default: false
// in: query
// required: false
// -
// name: only_public
// type: boolean
// description: Show only statuses with a privacy setting of 'public'.
// default: false
// in: query
// required: false
//
// security:
// - OAuth2 Bearer:
// - read:accounts
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// name: statuses
// description: Array of statuses.
// schema:
// type: array
// items:
// "$ref": "#/definitions/status"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: statuses
// description: Array of statuses.
// schema:
// type: array
// items:
// "$ref": "#/definitions/status"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountStatusesGETHandler(c *gin.Context) {
authed, err := oauth.Authed(c, false, false, false, false)
if err != nil {

View file

@ -32,40 +32,41 @@ import (
//
// Unblock account with ID.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: The id of the account to unblock.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: The id of the account to unblock.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - write:blocks
// security:
// - OAuth2 Bearer:
// - write:blocks
//
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountUnblockPOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {

View file

@ -32,40 +32,41 @@ import (
//
// Unfollow account with id.
//
// ---
// tags:
// - accounts
// ---
// tags:
// - accounts
//
// produces:
// - application/json
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: The id of the account to unfollow.
// in: path
// required: true
// parameters:
// -
// name: id
// type: string
// description: The id of the account to unfollow.
// in: path
// required: true
//
// security:
// - OAuth2 Bearer:
// - write:follows
// security:
// - OAuth2 Bearer:
// - write:follows
//
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
// responses:
// '200':
// name: account relationship
// description: Your relationship to this account.
// schema:
// "$ref": "#/definitions/accountRelationship"
// '400':
// description: bad request
// '401':
// description: unauthorized
// '404':
// description: not found
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) AccountUnfollowPOSTHandler(c *gin.Context) {
authed, err := oauth.Authed(c, true, true, true, true)
if err != nil {