feat: add account avatars and a deployable image
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.
This commit is contained in:
1 parent
7e7a1d2bb6
commit
3b82719d56
38 files changed
+1307
-106
No files matched your search
@@ -4,7 +4,7 @@ import type { Message } from '~/types'
|
||||
import { fullTime, relativeTime } from '~/utils/format'
|
||||
import { memberColorVar } from '~/utils/member'
|
||||
|
||||
const props = defineProps<{ message: Message; color?: string | null }>()
|
||||
const props = defineProps<{ message: Message; color?: string | null; avatar?: string | null }>()
|
||||
|
||||
const segments = computed(() => {
|
||||
const parts = props.message.text.split(/(@rhema\b)/gi)
|
||||
@@ -34,16 +34,19 @@ const style = computed(() => ({ '--member': memberColorVar(props.color) }))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="msg">
|
||||
<div class="msg-head">
|
||||
<span class="msg-author member-name" :style="style">{{ message.author_name }}</span>
|
||||
<span class="msg-time" :title="fullTime(message.created_at)">{{ relativeTime(message.created_at) }}</span>
|
||||
</div>
|
||||
<div class="msg-text">
|
||||
<template v-for="(segment, index) in segments" :key="index">
|
||||
<span v-if="segment.mention" class="mention">{{ segment.text }}</span>
|
||||
<template v-else>{{ segment.text }}</template>
|
||||
</template>
|
||||
<div v-else class="msg msg-human">
|
||||
<AppAvatar :name="message.author_name" :color="color" :src="avatar" size="sm" />
|
||||
<div class="msg-body">
|
||||
<div class="msg-head">
|
||||
<span class="msg-author member-name" :style="style">{{ message.author_name }}</span>
|
||||
<span class="msg-time" :title="fullTime(message.created_at)">{{ relativeTime(message.created_at) }}</span>
|
||||
</div>
|
||||
<div class="msg-text">
|
||||
<template v-for="(segment, index) in segments" :key="index">
|
||||
<span v-if="segment.mention" class="mention">{{ segment.text }}</span>
|
||||
<template v-else>{{ segment.text }}</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user