Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update changes from elk #7

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
689bbcd
docs: use GitHub markdown formatting for note in Readme (#2536)
Roshanjossey Jan 1, 2024
6532de4
feat: add a new link icon (#2534)
shuuji3 Jan 1, 2024
835dd7d
fix: spoiler button style in notifications (#2537)
BeiyanYunyi Jan 1, 2024
0413430
fix: trigger code block highlighting when the highlighter is ready (…
ocavue Jan 1, 2024
2155b0c
feat: add Vercel KV (#2533)
prplecake Jan 2, 2024
ab83baf
feat: add LTR/RTL in hashtags and mentions support (#2541)
userquin Jan 4, 2024
8f7429c
feat(i18n): update vi-VN.json (#2506)
mastoduy Jan 8, 2024
01fac8b
fix: meta og:url should use the origin of the request instead of elk.…
Joshix-1 Jan 9, 2024
cd667d0
feat: upgrade to masto.js v6 (#2530)
patak-dev Jan 9, 2024
8adb935
feat(i18n): missing and rewording `es` and `es-419` keys (#2511)
mrcego Jan 9, 2024
7ada031
feat(i18n): complete the translation of `copy_account_name` (#2487)
yrming Jan 9, 2024
b756056
feat(i18n): updated gl-ES translation (#2522)
xmgz Jan 9, 2024
10cb351
feat: improve title and layout of the confirm dialog (#2307)
shuuji3 Jan 9, 2024
0e0399b
chore(deps): update docker/setup-buildx-action action to v3 (#2528)
renovate[bot] Jan 10, 2024
bc555c7
chore(deps): update docker/login-action action to v3 (#2515)
renovate[bot] Jan 10, 2024
e4202fd
chore(deps): update docker/metadata-action action to v5 (#2527)
renovate[bot] Jan 10, 2024
f771347
feat(i18n): Update portuguese from Portugal translation (#2555)
emanuelpina Jan 10, 2024
4d23d0f
chore(deps): update docker/setup-qemu-action action to v3 (#2558)
renovate[bot] Jan 15, 2024
f55886c
feat: add new setting to disable blur for low-performance device (#2561)
shuuji3 Jan 18, 2024
ea2ca77
feat: add Bluesky and Friendica icons (#2563)
shuuji3 Jan 18, 2024
66ad22d
refactor: fix lint warnings (#2564)
shuuji3 Jan 21, 2024
6d468a7
feat(i18n): Update vi-VN.json (#2560)
mastoduy Jan 21, 2024
fe67666
fix: subscribe to proper user.notification stream (#2566)
patak-dev Jan 21, 2024
1512027
feat(i18n): Update it-IT locale (#2567)
katullo11 Jan 23, 2024
832f5cf
feat(i18n): Update it-IT locale (#2569)
katullo11 Jan 24, 2024
809071f
fix: rename tab label from "Mention" to "Mentions" (#2570)
shuuji3 Jan 24, 2024
e8fc0ee
fix: allow to translate "Lock" string on profile (#2571)
shuuji3 Jan 24, 2024
a4670e1
feat(i18n): Update it-IT locale (#2572)
katullo11 Jan 26, 2024
87f1902
feat(i18n): Update vi-VN.json (#2574)
mastoduy Jan 26, 2024
d383d6e
feat: Add option to preserve whitespace in parseOptions (#2448)
zcf0508 Jan 26, 2024
eeadaac
feat(i18n): Update es.json (#2576)
userquin Jan 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NUXT_CLOUDFLARE_ACCOUNT_ID=
NUXT_CLOUDFLARE_NAMESPACE_ID=
NUXT_CLOUDFLARE_API_TOKEN=

# 'cloudflare' | 'fs'
# 'cloudflare' | 'vercel' | 'fs'
NUXT_STORAGE_DRIVER=
NUXT_STORAGE_FS_BASE=

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
uses: actions/checkout@v4
- name: Docker meta
id: metal
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,41 @@ If you want to contribute to the parent project, check out [its repo](https://gi

The crab team maintains a deployment at:

- 🦀 Production: [elk.bumscode.com](https://elk.bumscode.com)
- 🦀 Production: [crab.bumscode.com](https://crab.bumscode.com)

### Self-Host Docker Deployment

In order to host Elk yourself you can use the provided Dockerfile to build a container with elk. Be aware, that Elk only loads properly if the connection is done via SSL/TLS. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself.
One could put Elk behind popular reverse proxies with SSL Handling like Traefik, NGINX etc.

1. checkout source ```git clone https://github.com/elk-zone/elk.git```
1. got into new source dir: ```cd elk```
1. build Docker image: ```docker build .```
1. create local storage directory for settings: ```mkdir elk-storage```
1. adjust permissions of storage dir: ```sudo chown 911:911 ./elk-storage```
1. start container: ```docker-compose up -d```

> [!NOTE]
> The provided Dockerfile creates a container which will eventually run Elk as non-root user and create a persistent named Docker volume upon first start (if that volume does not yet exist). This volume is always created with root permission. Failing to change the permissions of ```/elk/data``` inside this volume to UID:GID 911 (as specified for Elk in the Dockerfile) will prevent Elk from storing it's config for user accounts. You either have to fix the permission in the created named volume, or mount a directory with the correct permission to ```/elk/data``` into the container.


### Ecosystem

These are known deployments using Elk as an alternative Web client for Mastodon servers or as a base for other projects in the fediverse:

- [elk.fedified.com](https://elk.fedified.com) - Use Elk to log into any compatible instance
- [elk.me.uk](https://elk.me.uk) - Use Elk to log into any compatible instance, hosted on Google Cloud Run with no Cloudflare proxy
- [elk.h4.io](https://elk.h4.io) - Use Elk for the `h4.io` Server
- [elk.universeodon.com](https://elk.universeodon.com) - Use Elk for the Universeodon Server
- [elk.vmst.io](https://elk.vmst.io) - Use Elk for the `vmst.io` Server
- [elk.hostux.social](https://elk.hostux.social) - Use Elk for the `hostux.social` Server
- [elk.cupoftea.social](https://elk.cupoftea.social) - Use Elk for the `cupoftea.social` Server
- [elk.aus.social](https://elk.aus.social) - Use Elk for the `aus.social` Server
- [elk.mstdn.ca](https://elk.mstdn.ca) - Use Elk for the `mstdn.ca` Server
- [elk.mastodonapp.uk](https://elk.mastodonapp.uk) - Use Elk for the `mastodonapp.uk` Server
- [elk.bolha.us](https://elk.bolha.us) - Use Elk for the `bolha.us` Server

> **Note**: Community deployments are **NOT** maintained by the Elk team. It may not be synced with Elk's source code. Please do your own research about the host servers before using them.

## 💖 Sponsors

Expand Down
4 changes: 3 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ provideGlobalCommands()
const route = useRoute()

if (process.server && !route.path.startsWith('/settings')) {
const url = useRequestURL()

useHead({
meta: [
{ property: 'og:url', content: `https://elk.zone${route.path}` },
{ property: 'og:url', content: `${url.origin}${route.path}` },
],
})
}
Expand Down
4 changes: 2 additions & 2 deletions components/account/AccountFollowButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const { client } = $(useMasto())
async function unblock() {
relationship!.blocking = false
try {
const newRel = await client.v1.accounts.unblock(account.id)
const newRel = await client.v1.accounts.$select(account.id).unblock()
Object.assign(relationship!, newRel)
}
catch (err) {
Expand All @@ -32,7 +32,7 @@ async function unblock() {
async function unmute() {
relationship!.muting = false
try {
const newRel = await client.v1.accounts.unmute(account.id)
const newRel = await client.v1.accounts.$select(account.id).unmute()
Object.assign(relationship!, newRel)
}
catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions components/account/AccountFollowRequestButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function authorizeFollowRequest() {
relationship!.requestedBy = false
relationship!.followedBy = true
try {
const newRel = await client.v1.followRequests.authorize(account.id)
const newRel = await client.v1.followRequests.$select(account.id).authorize()
Object.assign(relationship!, newRel)
}
catch (err) {
Expand All @@ -25,7 +25,7 @@ async function authorizeFollowRequest() {
async function rejectFollowRequest() {
relationship!.requestedBy = false
try {
const newRel = await client.v1.followRequests.reject(account.id)
const newRel = await client.v1.followRequests.$select(account.id).reject()
Object.assign(relationship!, newRel)
}
catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions components/account/AccountHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function previewAvatar() {
async function toggleNotifications() {
relationship!.notifying = !relationship?.notifying
try {
const newRel = await client.v1.accounts.follow(account.id, { notify: relationship?.notifying })
const newRel = await client.v1.accounts.$select(account.id).follow({ notify: relationship?.notifying })
Object.assign(relationship!, newRel)
}
catch {
Expand Down Expand Up @@ -97,7 +97,7 @@ async function editNote(event: Event) {
if (relationship.note?.trim() === newNote.trim())
return

const newNoteApiResult = await client.v1.accounts.createNote(account.id, { comment: newNote })
const newNoteApiResult = await client.v1.accounts.$select(account.id).note.create({ comment: newNote })
relationship.note = newNoteApiResult.note
personalNoteDraft.value = relationship.note ?? ''
}
Expand Down
4 changes: 3 additions & 1 deletion components/account/AccountLockIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
defineProps<{
showLabel?: boolean
}>()

const { t } = useI18n()
</script>

<template>
Expand All @@ -15,7 +17,7 @@ defineProps<{
<div i-ri:lock-line />
</CommonTooltip>
<div v-if="showLabel">
Lock
{{ t('account.lock') }}
</div>
</div>
</template>
7 changes: 4 additions & 3 deletions components/account/AccountMoreButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ function shareAccount() {

async function toggleReblogs() {
if (!relationship!.showingReblogs && await openConfirmDialog({
title: t('confirm.show_reblogs.title', [account.acct]),
title: t('confirm.show_reblogs.title'),
description: t('confirm.show_reblogs.description', [account.acct]),
confirm: t('confirm.show_reblogs.confirm'),
cancel: t('confirm.show_reblogs.cancel'),
}) !== 'confirm')
return

const showingReblogs = !relationship?.showingReblogs
relationship = await client.v1.accounts.follow(account.id, { reblogs: showingReblogs })
relationship = await client.v1.accounts.$select(account.id).follow({ reblogs: showingReblogs })
}

async function addUserNote() {
Expand All @@ -44,7 +45,7 @@ async function removeUserNote() {
if (!relationship!.note || relationship!.note.length === 0)
return

const newNote = await client.v1.accounts.createNote(account.id, { comment: '' })
const newNote = await client.v1.accounts.$select(account.id).note.create({ comment: '' })
relationship!.note = newNote.note
emit('removeNote')
}
Expand Down
4 changes: 2 additions & 2 deletions components/account/AccountPaginator.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Paginator, mastodon } from 'masto'
import type { mastodon } from 'masto'

const { paginator, account, context } = defineProps<{
paginator: Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams>
paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined>
context?: 'following' | 'followers'
account?: mastodon.v1.Account
relationshipContext?: 'followedBy' | 'following'
Expand Down
10 changes: 4 additions & 6 deletions components/common/CommonPaginator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
// @ts-expect-error missing types
import { DynamicScroller } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
import type { Paginator, WsEvents } from 'masto'
import type { mastodon } from 'masto'
import type { UnwrapRef } from 'vue'

const {
paginator,
stream,
keyProp = 'id',
virtualScroller = false,
eventType = 'update',
preprocess,
endMessage = true,
} = defineProps<{
paginator: Paginator<T[], O>
paginator: mastodon.Paginator<T[], O>
keyProp?: keyof T
virtualScroller?: boolean
stream?: Promise<WsEvents>
eventType?: 'notification' | 'update'
stream?: mastodon.streaming.Subscription
preprocess?: (items: (U | T)[]) => U[]
endMessage?: boolean | string
}>()
Expand Down Expand Up @@ -46,7 +44,7 @@ defineSlots<{
const { t } = useI18n()
const nuxtApp = useNuxtApp()

const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess)
const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), preprocess)

nuxtApp.hook('elk-logo:click', () => {
update()
Expand Down
4 changes: 2 additions & 2 deletions components/conversation/ConversationPaginator.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Paginator, mastodon } from 'masto'
import type { mastodon } from 'masto'

const { paginator } = defineProps<{
paginator: Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
}>()

function preprocess(items: mastodon.v1.Conversation[]): mastodon.v1.Conversation[] {
Expand Down
4 changes: 2 additions & 2 deletions components/list/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const isRemoved = ref(false)
async function edit() {
try {
isRemoved.value
? await client.v1.lists.addAccount(list, { accountIds: [account.id] })
: await client.v1.lists.removeAccount(list, { accountIds: [account.id] })
? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
: await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
isRemoved.value = !isRemoved.value
}
catch (err) {
Expand Down
7 changes: 4 additions & 3 deletions components/list/ListEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function cancelEdit() {

const { submit, submitting } = submitter(async () => {
try {
list.value = await client.v1.lists.update(form.id, {
list.value = await client.v1.lists.$select(form.id).update({
title: form.title,
})
cancelEdit()
Expand All @@ -58,7 +58,8 @@ async function removeList() {
return

const confirmDelete = await openConfirmDialog({
title: t('confirm.delete_list.title', [list.value.title]),
title: t('confirm.delete_list.title'),
description: t('confirm.delete_list.description', [list.value.title]),
confirm: t('confirm.delete_list.confirm'),
cancel: t('confirm.delete_list.cancel'),
})
Expand All @@ -70,7 +71,7 @@ async function removeList() {
if (confirmDelete === 'confirm') {
await nextTick()
try {
await client.v1.lists.remove(list.value.id)
await client.v1.lists.$select(list.value.id).remove()
emit('listRemoved', list.value.id)
}
catch (err) {
Expand Down
6 changes: 3 additions & 3 deletions components/list/Lists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { userId } = defineProps<{

const { client } = $(useMasto())
const paginator = client.v1.lists.list()
const listsWithUser = ref((await client.v1.accounts.listLists(userId)).map(list => list.id))
const listsWithUser = ref((await client.v1.accounts.$select(userId).lists.list()).map(list => list.id))

function indexOfUserInList(listId: string) {
return listsWithUser.value.indexOf(listId)
Expand All @@ -15,11 +15,11 @@ async function edit(listId: string) {
try {
const index = indexOfUserInList(listId)
if (index === -1) {
await client.v1.lists.addAccount(listId, { accountIds: [userId] })
await client.v1.lists.$select(listId).accounts.create({ accountIds: [userId] })
listsWithUser.value.push(listId)
}
else {
await client.v1.lists.removeAccount(listId, { accountIds: [userId] })
await client.v1.lists.$select(listId).accounts.remove({ accountIds: [userId] })
listsWithUser.value = listsWithUser.value.filter(id => id !== listId)
}
}
Expand Down
6 changes: 5 additions & 1 deletion components/main/MainContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ defineProps<{

const container = ref()
const route = useRoute()
const userSettings = useUserSettings()
const { height: windowHeight } = useWindowSize()
const { height: containerHeight } = useElementBounding(container)
const wideLayout = computed(() => route.meta.wideLayout ?? false)
Expand All @@ -26,10 +27,13 @@ const containerClass = computed(() => {
<template>
<div ref="container" :class="containerClass">
<div
sticky top-0 z10 backdrop-blur
sticky top-0 z10
pt="[env(safe-area-inset-top,0)]"
bg="[rgba(var(--rgb-bg-base),0.7)]"
class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]"
:class="{
'backdrop-blur': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
>
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex" border="b base">
<div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
Expand Down
2 changes: 1 addition & 1 deletion components/modal/ModalConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const emit = defineEmits<{

<template>
<div flex="~ col" gap-6>
<div font-bold text-lg text-center>
<div font-bold text-lg>
{{ title }}
</div>
<div v-if="description">
Expand Down
9 changes: 8 additions & 1 deletion components/modal/ModalDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const visible = defineModel<boolean>({ required: true })

const deactivated = useDeactivated()
const route = useRoute()
const userSettings = useUserSettings()

/** scrollable HTML element */
const elDialogMain = ref<HTMLDivElement>()
Expand Down Expand Up @@ -156,7 +157,13 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<!-- corresponding to issue: #106, so please don't remove it. -->

<!-- Mask layer: blur -->
<div class="dialog-mask" absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter backdrop-blur-sm touch-none />
<div
class="dialog-mask"
:class="{
'backdrop-blur-sm': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter touch-none
/>
<!-- Mask layer: dimming -->
<div class="dialog-mask" absolute inset-0 z-0 bg-black opacity-48 touch-none h="[calc(100%+0.5px)]" @click="clickMask" />
<!-- Dialog container -->
Expand Down
8 changes: 6 additions & 2 deletions components/nav/NavBottomMoreMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function toggleVisible() {
}

const buttonEl = ref<HTMLDivElement>()
/** Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened */
/**
* Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened
* @param mouse
*/
function clickEvent(mouse: MouseEvent) {
if (mouse.target && !buttonEl.value?.children[0].contains(mouse.target as any)) {
if (modelValue.value) {
Expand Down Expand Up @@ -141,11 +144,12 @@ const { dragging, dragDistance } = invoke(() => {
:class="{
'duration-0': dragging,
'duration-250': !dragging,
'backdrop-blur-md': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
transition="transform ease-in"
flex-1 min-w-48 py-6 mb="-1px"
of-y-auto scrollbar-hide overscroll-none max-h="[calc(100vh-200px)]"
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter backdrop-blur-md
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter
border-t-1 border-base
>
<!-- Nav -->
Expand Down
Loading
Loading