move storage data directory to root

This commit is contained in:
Philipinho 2024-06-27 15:07:48 +01:00
parent aea37eecda
commit e73293856b
7 changed files with 20 additions and 7 deletions

View File

@ -2,3 +2,4 @@ node_modules
.git
.gitignore
dist
data

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.env
data
# compiled output
/dist
/node_modules

View File

@ -22,7 +22,7 @@ COPY --from=builder /app/apps/server/package.json /app/apps/server/package.json
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/packages/ /app/packages/
COPY --from=builder /app/pnpm*.yaml /app/
# should optimize packages
RUN npm install -g pnpm
RUN chown -R node:node /app
@ -31,9 +31,9 @@ USER node
RUN pnpm install --frozen-lockfile --prod
RUN mkdir -p /app/apps/server/data/storage
RUN mkdir -p /app/data/storage
VOLUME ["/app/apps/server/data/storage"]
VOLUME ["/app/data/storage"]
EXPOSE 3000

View File

@ -5,7 +5,7 @@ import { getFileUrl } from "@/lib/config.ts";
export default function ImageView(props: NodeViewProps) {
const { node, selected } = props;
const { src, width, align } = node.attrs;
const { src, width, align, title } = node.attrs;
const flexJustifyContent = useMemo(() => {
if (align === "center") return "center";
@ -26,6 +26,7 @@ export default function ImageView(props: NodeViewProps) {
fit="contain"
w={width}
src={getFileUrl(src)}
alt={title}
className={selected ? "ProseMirror-selectednode" : ""}
/>
</NodeViewWrapper>

View File

@ -11,7 +11,7 @@ import { notifications } from "@mantine/notifications";
import useUserRole from "@/hooks/use-user-role.tsx";
const formSchema = z.object({
name: z.string().nonempty("Workspace name cannot be blank"),
name: z.string().min(4).nonempty("Workspace name cannot be blank"),
});
type FormValues = z.infer<typeof formSchema>;

View File

@ -1,2 +1,11 @@
import * as path from 'path';
export const APP_DATA_PATH = 'data';
export const LOCAL_STORAGE_PATH = `${APP_DATA_PATH}/storage`;
const LOCAL_STORAGE_DIR = `${APP_DATA_PATH}/storage`;
export const LOCAL_STORAGE_PATH = path.resolve(
process.cwd(),
'..',
'..',
LOCAL_STORAGE_DIR,
);

View File

@ -13,6 +13,7 @@ import {
import { LocalDriver, S3Driver } from '../drivers';
import * as process from 'node:process';
import { LOCAL_STORAGE_PATH } from '../../../common/helpers';
import path from 'path';
function createStorageDriver(disk: StorageConfig): StorageDriver {
switch (disk.driver) {
@ -35,7 +36,7 @@ export const storageDriverConfigProvider = {
return {
driver,
config: {
storagePath: process.cwd() + '/' + LOCAL_STORAGE_PATH,
storagePath: LOCAL_STORAGE_PATH,
},
};