Merge branch 'develop' into stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
FloatingGhost 2022-09-10 15:40:44 +01:00
commit e094e12c3e
11 changed files with 2763 additions and 2303 deletions

View file

@ -412,6 +412,7 @@ export default {
submit: 'Submit',
settings: 'Settings',
instance: 'Instance',
search: 'Search',
upload: 'Upload',
mailer: 'Mailer',
linkFormatter: 'Link Formatter',
@ -425,7 +426,6 @@ export default {
mrf: 'MRF',
mediaProxy: 'Media Proxy',
metadata: 'Metadata',
gopher: 'Gopher',
jobQueue: 'Job queue',
webPush: 'Web push encryption',
rateLimiters: 'Rate limiters',

View file

@ -107,7 +107,7 @@ export const parseTuples = (tuples, key) => {
}, [])
} else if (item.tuple[0] === ':prune') {
accum[item.tuple[0]] = item.tuple[1] === ':disabled' ? [item.tuple[1]] : item.tuple[1].tuple
} else if (item.tuple[0] === ':proxy_url' || item.tuple[0] === ':sender') {
} else if (item.tuple[0] === ':sender') {
accum[item.tuple[0]] = parseStringOrTupleValue(item.tuple[0], item.tuple[1])
} else if (item.tuple[0] === ':args') {
accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1])

View file

@ -4,7 +4,6 @@ export const tabs = [
{ label: 'Captcha', path: 'captcha', tab: ':captcha' },
{ label: 'Emoji', path: 'emoji', tab: ':emoji' },
{ label: 'Frontend', path: 'frontend', tab: ':frontend' },
{ label: 'Gopher', path: 'gopher', tab: ':gopher' },
{ label: 'HTTP', path: 'http', tab: ':http' },
{ label: 'Instance', path: 'instance', tab: ':instance' },
{ label: 'Job queue', path: 'job-queue', tab: ':job_queue' },
@ -17,5 +16,6 @@ export const tabs = [
{ label: 'Rate limiters', path: 'rate-limiters', tab: ':rate_limiters' },
{ label: 'Web push encryption', path: 'web-push', tab: ':web_push' },
{ label: 'Upload', path: 'upload', tab: ':upload' },
{ label: 'Search', path: 'search', tab: ':search' },
{ label: 'Other', path: 'other', tab: ':other' }
]

View file

@ -115,7 +115,6 @@
<icons-input v-if="setting.key === ':icons'" :data="iconsData" :setting-group="settingGroup" :setting="setting"/>
<boolean-combined-input v-if="booleanCombinedInput" :data="data" :setting-group="settingGroup" :setting="setting"/>
<mascots-input v-if="setting.key === ':mascots'" :data="keywordData" :setting-group="settingGroup" :setting="setting"/>
<proxy-url-input v-if="setting.key === ':proxy_url'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting" :parents="settingParent"/>
<prune-input v-if="setting.key === ':prune'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting"/>
<rate-limit-input v-if="settingGroup.key === ':rate_limit'" :data="data" :setting-group="settingGroup" :setting="setting"/>
<reg-invites-input v-if="[':registrations_open', ':invites_enabled'].includes(setting.key)" :data="data" :setting-group="settingGroup" :setting="setting"/>

View file

@ -44,6 +44,17 @@
<el-form :model="streamerData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="streamer" :data="streamerData"/>
</el-form>
<el-divider v-if="translator" class="divider thick-line"/>
<el-form :model="translatorData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="translator" :data="translatorData"/>
</el-form>
<el-form v-if="usesDeepL" :model="deeplData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="deepl" :data="deeplData"/>
</el-form>
<el-form v-if="usesLibreTranslate" :model="libretranslateData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="libre_translate" :data="libretranslateData"/>
</el-form>
<div class="submit-button-container">
<el-button class="submit-button" type="primary" @click="onSubmit">{{ $t('settings.submit') }}</el-button>
</div>
@ -172,6 +183,30 @@ export default {
},
welcomeData() {
return _.get(this.settings.settings, [':pleroma', ':welcome']) || {}
},
translator() {
return this.$store.state.settings.description.find(setting => setting.key === ':translator')
},
translatorData() {
return _.get(this.settings.settings, [':pleroma', ':translator']) || {}
},
usesDeepL() {
return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('deepl')
},
usesLibreTranslate() {
return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('libretranslate')
},
deepl() {
return this.$store.state.settings.description.find(setting => setting.key === ':deepl')
},
deeplData() {
return _.get(this.settings.settings, [':pleroma', ':deepl']) || {}
},
libre_translate() {
return this.$store.state.settings.description.find(setting => setting.key === ':libre_translate')
},
libretranslateData() {
return _.get(this.settings.settings, [':pleroma', ':libre_translate']) || {}
}
},
async mounted() {

View file

@ -1,7 +1,13 @@
<template>
<div v-if="!loading" :class="isSidebarOpen" class="form-container">
<el-form v-if="!loading" :model="gopherData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="gopher" :data="gopherData"/>
<el-form :model="searchData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="search" :data="searchData"/>
</el-form>
<el-form v-if="isMeilisearch" :model="meilisearchData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="meilisearch" :data="meilisearchData"/>
</el-form>
<el-form v-if="isElasticsearch" :model="elasticsearchData" :label-position="labelPosition" :label-width="labelWidth">
<setting :setting-group="elasticsearch" :data="elasticsearchData"/>
</el-form>
<div class="submit-button-container">
<el-button class="submit-button" type="primary" @click="onSubmit">{{ $t('settings.submit') }}</el-button>
@ -16,17 +22,35 @@ import Setting from './Setting'
import _ from 'lodash'
export default {
name: 'Gopher',
name: 'Search',
components: { Setting },
computed: {
...mapGetters([
'settings'
]),
gopher() {
return this.settings.description.find(setting => setting.key === ':gopher')
search() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Search')
},
gopherData() {
return _.get(this.settings.settings, [':pleroma', ':gopher']) || {}
searchData() {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search']) || {}
},
meilisearch() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Search.Meilisearch')
},
isMeilisearch() {
return (_.get(this.settings.settings, [':pleroma', 'Pleroma.Search', ':module']) || '').toLowerCase().endsWith('meilisearch')
},
meilisearchData() {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search.Meilisearch']) || {}
},
elasticsearch() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Search.Elasticsearch.Cluster')
},
isElasticsearch() {
return (_.get(this.settings.settings, [':pleroma', 'Pleroma.Search', ':module']) || '').toLowerCase().endsWith('elasticsearch')
},
elasticsearchData() {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search.Elasticsearch.Cluster']) || {}
},
isMobile() {
return this.$store.state.app.device === 'mobile'

View file

@ -4,7 +4,6 @@ export { default as Captcha } from './Captcha'
export { default as Emoji } from './Emoji'
export { default as Esshd } from './Esshd'
export { default as Frontend } from './Frontend'
export { default as Gopher } from './Gopher'
export { default as Http } from './Http'
export { default as Instance } from './Instance'
export { default as JobQueue } from './JobQueue'
@ -18,3 +17,4 @@ export { default as Other } from './Other'
export { default as RateLimiters } from './RateLimiters'
export { default as Upload } from './Upload'
export { default as WebPush } from './WebPush'
export { default as Search } from './Search'

View file

@ -26,7 +26,7 @@ export const tabs = description => {
},
'instance': {
label: 'settings.instance',
settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated']
settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated', ':translator', ':deepl', ':libre_translate']
},
'job-queue': {
label: 'settings.jobQueue',
@ -68,6 +68,10 @@ export const tabs = description => {
label: 'settings.upload',
settings: ['Pleroma.Upload.Filter.AnonymizeFilename', 'Pleroma.Upload.Filter.Mogrify', 'Pleroma.Uploaders.S3', 'Pleroma.Uploaders.Local', 'Pleroma.Upload', ':s3']
},
'search': {
label: 'settings.search',
settings: ['Pleroma.Search', 'Pleroma.Search.Meilisearch', 'Pleroma.Search.Elasticsearch.Cluster']
},
'other': {
label: 'settings.other',
settings: [':mime', 'Pleroma.User.Backup', 'Pleroma.Web.Plugs.RemoteIp', 'Pleroma.Web.Endpoint.MetricsExporter', ':modules', 'Pleroma.Web.ApiSpec.CastAndValidate', ':terms_of_services']

View file

@ -9,7 +9,7 @@
<div class="docs-search-container">
<el-link
:underline="false"
href="https://docs-develop.pleroma.social/backend/administration/CLI_tasks/config/"
href="https://docs.akkoma.dev/stable/administration/CLI_tasks/config/"
target="_blank">
<el-button class="settings-docs-button">
<span>
@ -71,7 +71,6 @@ import {
Emoji,
Esshd,
Frontend,
Gopher,
Http,
Instance,
JobQueue,
@ -84,6 +83,7 @@ import {
Other,
RateLimiters,
Upload,
Search,
WebPush
} from './components'
import RebootButton from '@/components/RebootButton'
@ -96,7 +96,6 @@ export default {
Emoji,
Esshd,
Frontend,
Gopher,
Http,
Instance,
JobQueue,
@ -110,6 +109,7 @@ export default {
RateLimiters,
RebootButton,
Upload,
Search,
WebPush
},
data() {

View file

@ -274,20 +274,6 @@ describe('Parse tuples', () => {
expect(_.isEqual(expectedSenderString, parseTuples(senderString, ':welcome'))).toBeTruthy()
})
it('parses proxy_url', () => {
const proxyUrlNull = [{ tuple: [':proxy_url', null] }]
const proxyUrlTuple = [{ tuple: [':proxy_url', { tuple: [':socks5', ':localhost', 3090] }]}]
const proxyUrlString = [{ tuple: [':proxy_url', 'localhost:9020'] }]
const expectedProxyUrlNull = { ':proxy_url': { socks5: false, host: null, port: null }}
const expectedProxyUrlTuple = { ':proxy_url': { socks5: true, host: ':localhost', port: 3090 }}
const expectedProxyUrlString = { ':proxy_url': { socks5: false, host: 'localhost', port: '9020' }}
expect(_.isEqual(expectedProxyUrlNull, parseTuples(proxyUrlNull, ':http'))).toBeTruthy()
expect(_.isEqual(expectedProxyUrlTuple, parseTuples(proxyUrlTuple, ':http'))).toBeTruthy()
expect(_.isEqual(expectedProxyUrlString, parseTuples(proxyUrlString, ':http'))).toBeTruthy()
})
it('parses args setting in Pleroma.Upload.Filter.Mogrify', () => {
const tuples = [{ tuple: [':args', ['strip', '{ "implode", "1" }']]}]
const expectedResult = { ':args': ['strip', '{ "implode", "1" }'] }

4958
yarn.lock

File diff suppressed because it is too large Load diff