gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

instance.go (5895B)


      1 // GoToSocial
      2 // Copyright (C) GoToSocial Authors admin@gotosocial.org
      3 // SPDX-License-Identifier: AGPL-3.0-or-later
      4 //
      5 // This program is free software: you can redistribute it and/or modify
      6 // it under the terms of the GNU Affero General Public License as published by
      7 // the Free Software Foundation, either version 3 of the License, or
      8 // (at your option) any later version.
      9 //
     10 // This program is distributed in the hope that it will be useful,
     11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 // GNU Affero General Public License for more details.
     14 //
     15 // You should have received a copy of the GNU Affero General Public License
     16 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18 package model
     19 
     20 import "mime/multipart"
     21 
     22 // InstanceSettingsUpdateRequest models an instance update request.
     23 //
     24 // swagger:ignore
     25 type InstanceSettingsUpdateRequest struct {
     26 	// Title to use for the instance. Max 40 characters.
     27 	Title *string `form:"title" json:"title" xml:"title"`
     28 	// Username for the instance contact account. Must be the username of an existing admin.
     29 	ContactUsername *string `form:"contact_username" json:"contact_username" xml:"contact_username"`
     30 	// Email for reaching the instance administrator(s).
     31 	ContactEmail *string `form:"contact_email" json:"contact_email" xml:"contact_email"`
     32 	// Short description of the instance, max 500 chars. HTML formatting accepted.
     33 	ShortDescription *string `form:"short_description" json:"short_description" xml:"short_description"`
     34 	// Longer description of the instance, max 5,000 chars. HTML formatting accepted.
     35 	Description *string `form:"description" json:"description" xml:"description"`
     36 	// Terms and conditions of the instance, max 5,000 chars. HTML formatting accepted.
     37 	Terms *string `form:"terms" json:"terms" xml:"terms"`
     38 	// Image to use as the instance thumbnail.
     39 	Avatar *multipart.FileHeader `form:"thumbnail" json:"thumbnail" xml:"thumbnail"`
     40 	// Image description for the instance avatar.
     41 	AvatarDescription *string `form:"thumbnail_description" json:"thumbnail_description" xml:"thumbnail_description"`
     42 	// Image to use as the instance header.
     43 	Header *multipart.FileHeader `form:"header" json:"header" xml:"header"`
     44 }
     45 
     46 // InstanceConfigurationAccounts models instance account config parameters.
     47 //
     48 // swagger:model instanceConfigurationAccounts
     49 type InstanceConfigurationAccounts struct {
     50 	// Whether or not accounts on this instance are allowed to upload custom CSS for profiles and statuses.
     51 	//
     52 	// example: false
     53 	AllowCustomCSS bool `json:"allow_custom_css"`
     54 	// The maximum number of featured tags allowed for each account.
     55 	// Currently not implemented, so this is hardcoded to 10.
     56 	MaxFeaturedTags int `json:"max_featured_tags"`
     57 	// The maximum number of profile fields allowed for each account.
     58 	// Currently not configurable, so this is hardcoded to 6. (https://github.com/superseriousbusiness/gotosocial/issues/1876)
     59 	MaxProfileFields int `json:"max_profile_fields"`
     60 }
     61 
     62 // InstanceConfigurationStatuses models instance status config parameters.
     63 //
     64 // swagger:model instanceConfigurationStatuses
     65 type InstanceConfigurationStatuses struct {
     66 	// Maximum allowed length of a post on this instance, in characters.
     67 	//
     68 	// example: 5000
     69 	MaxCharacters int `json:"max_characters"`
     70 	// Max number of attachments allowed on a status.
     71 	//
     72 	// example: 4
     73 	MaxMediaAttachments int `json:"max_media_attachments"`
     74 	// Amount of characters clients should assume a url takes up.
     75 	//
     76 	// example: 25
     77 	CharactersReservedPerURL int `json:"characters_reserved_per_url"`
     78 	// List of mime types that it's possible to use for statuses on this instance.
     79 	//
     80 	// example: ["text/plain","text/markdown"]
     81 	SupportedMimeTypes []string `json:"supported_mime_types,omitempty"`
     82 }
     83 
     84 // InstanceConfigurationMediaAttachments models instance media attachment config parameters.
     85 //
     86 // swagger:model instanceConfigurationMediaAttachments
     87 type InstanceConfigurationMediaAttachments struct {
     88 	// List of mime types that it's possible to upload to this instance.
     89 	//
     90 	// example: ["image/jpeg","image/gif"]
     91 	SupportedMimeTypes []string `json:"supported_mime_types"`
     92 	// Max allowed image size in bytes
     93 	//
     94 	// example: 2097152
     95 	ImageSizeLimit int `json:"image_size_limit"`
     96 	// Max allowed image size in pixels as height*width.
     97 	//
     98 	// GtS doesn't set a limit on this, but for compatibility
     99 	// we give Mastodon's 4096x4096px value here.
    100 	//
    101 	// example: 16777216
    102 	ImageMatrixLimit int `json:"image_matrix_limit"`
    103 	// Max allowed video size in bytes
    104 	//
    105 	// example: 10485760
    106 	VideoSizeLimit int `json:"video_size_limit"`
    107 	// Max allowed video frame rate.
    108 	//
    109 	// example: 60
    110 	VideoFrameRateLimit int `json:"video_frame_rate_limit"`
    111 	// Max allowed video size in pixels as height*width.
    112 	//
    113 	// GtS doesn't set a limit on this, but for compatibility
    114 	// we give Mastodon's 4096x4096px value here.
    115 	//
    116 	// example: 16777216
    117 	VideoMatrixLimit int `json:"video_matrix_limit"`
    118 }
    119 
    120 // InstanceConfigurationPolls models instance poll config parameters.
    121 //
    122 // swagger:model instanceConfigurationPolls
    123 type InstanceConfigurationPolls struct {
    124 	// Number of options permitted in a poll on this instance.
    125 	//
    126 	// example: 4
    127 	MaxOptions int `json:"max_options"`
    128 	// Number of characters allowed per option in the poll.
    129 	//
    130 	// example: 50
    131 	MaxCharactersPerOption int `json:"max_characters_per_option"`
    132 	// Minimum expiration time of the poll in seconds.
    133 	//
    134 	// example: 300
    135 	MinExpiration int `json:"min_expiration"`
    136 	// Maximum expiration time of the poll in seconds.
    137 	//
    138 	// example: 2629746
    139 	MaxExpiration int `json:"max_expiration"`
    140 }
    141 
    142 // InstanceConfigurationEmojis models instance emoji config parameters.
    143 type InstanceConfigurationEmojis struct {
    144 	// Max allowed emoji image size in bytes.
    145 	//
    146 	// example: 51200
    147 	EmojiSizeLimit int `json:"emoji_size_limit"`
    148 }