forked from vhaudiquet/rhema-together
Accounts get a profile page with an uploaded picture, shown in the sidebar, the room bar, and every human message. Pictures live in the SQLite database and are served through an authenticated route. Hardening from the security audit: preview hosts expire after 24 hours and carry no-referrer; removing a member or archiving a room ends their event feed, presence socket, and terminal within seconds; previews and the terminal pin the SSH host key; invites are claimed atomically; missing accounts spend the same argon2 time as wrong passwords; registration is closed by default; WebSockets check the origin; and the master key is created with mode 0600. The Dockerfile builds one image with the static client and the server. The Helm chart runs a single replica with a SQLite volume, a wildcard preview ingress, and the proxy settings the event feed and uploads need. It refuses more than one replica because state is in process.
80 lines
2.3 KiB
Vue
80 lines
2.3 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { PanelRight, PanelRightClose, Settings, UserPlus } from 'lucide-vue-next'
|
|
import type { Member } from '~/types'
|
|
|
|
const props = defineProps<{
|
|
roomName: string
|
|
members: Member[]
|
|
onlineIds: string[]
|
|
isOwner: boolean
|
|
paneOpen: boolean
|
|
}>()
|
|
|
|
const emit = defineEmits<{ invite: []; togglePane: []; settings: [] }>()
|
|
|
|
const online = computed(() => new Set(props.onlineIds))
|
|
|
|
function avatarUrl(member: Member): string | null {
|
|
if (!member.avatar_updated_at) return null
|
|
return `/api/avatars/${member.account_id}?v=${member.avatar_updated_at}`
|
|
}
|
|
const visible = computed(() => props.members.slice(0, 5))
|
|
const extra = computed(() => props.members.slice(5))
|
|
const extraTitle = computed(() => extra.value.map((member) => member.display_name).join(', '))
|
|
</script>
|
|
|
|
<template>
|
|
<header class="room-topbar">
|
|
<h1 class="room-name">{{ roomName }}</h1>
|
|
|
|
<div class="room-topbar-spacer" />
|
|
|
|
<div class="presence">
|
|
<div class="presence-avatars" aria-label="Room members">
|
|
<AppAvatar
|
|
v-for="member in visible"
|
|
:key="member.id"
|
|
:name="member.display_name"
|
|
:color="member.color"
|
|
:src="avatarUrl(member)"
|
|
:offline="!online.has(member.id)"
|
|
size="sm"
|
|
/>
|
|
<span v-if="extra.length > 0" class="small muted" :title="extraTitle">+{{ extra.length }}</span>
|
|
</div>
|
|
|
|
<button
|
|
type="button"
|
|
class="icon-btn"
|
|
aria-label="Invite people"
|
|
title="Invite people"
|
|
@click="emit('invite')"
|
|
>
|
|
<UserPlus :size="16" aria-hidden="true" />
|
|
</button>
|
|
|
|
<button
|
|
type="button"
|
|
class="icon-btn"
|
|
:aria-label="paneOpen ? 'Close side pane' : 'Open side pane'"
|
|
:title="paneOpen ? 'Close side pane' : 'Open side pane'"
|
|
@click="emit('togglePane')"
|
|
>
|
|
<component :is="paneOpen ? PanelRightClose : PanelRight" :size="16" aria-hidden="true" />
|
|
</button>
|
|
|
|
<button
|
|
v-if="isOwner"
|
|
type="button"
|
|
class="icon-btn"
|
|
aria-label="Room settings"
|
|
title="Room settings"
|
|
@click="emit('settings')"
|
|
>
|
|
<Settings :size="16" aria-hidden="true" />
|
|
</button>
|
|
</div>
|
|
</header>
|
|
</template>
|