2023-10-14 09:27:32 +00:00
|
|
|
|
import { webpackBundler } from "@payloadcms/bundler-webpack";
|
|
|
|
|
import { mongooseAdapter } from "@payloadcms/db-mongodb";
|
2024-04-04 19:42:48 +00:00
|
|
|
|
import { cloudStorage } from "@payloadcms/plugin-cloud-storage";
|
2023-07-14 11:03:01 +00:00
|
|
|
|
import path from "path";
|
2023-08-11 21:11:10 +00:00
|
|
|
|
import { buildConfig } from "payload/config";
|
2024-04-06 08:36:11 +00:00
|
|
|
|
import { sftpAdapter } from "payloadcms-sftp-storage";
|
2024-05-15 11:44:50 +00:00
|
|
|
|
import { Attributes } from "./collections/Attributes/Attributes";
|
2024-04-05 13:41:58 +00:00
|
|
|
|
import { Audios } from "./collections/Audios/Audios";
|
2024-03-20 12:31:24 +00:00
|
|
|
|
import { ChronologyEvents } from "./collections/ChronologyEvents/ChronologyEvents";
|
2024-03-03 17:18:42 +00:00
|
|
|
|
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
2024-04-08 21:12:19 +00:00
|
|
|
|
import { CreditsRoles } from "./collections/CreditsRoles/CreditsRoles";
|
2023-08-11 21:11:10 +00:00
|
|
|
|
import { Currencies } from "./collections/Currencies/Currencies";
|
2024-01-20 02:25:52 +00:00
|
|
|
|
import { Folders } from "./collections/Folders/Folders";
|
2024-03-03 17:18:42 +00:00
|
|
|
|
import { GenericContents } from "./collections/GenericContents/GenericContents";
|
2024-02-29 23:26:06 +00:00
|
|
|
|
import { Images } from "./collections/Images/Images";
|
2023-08-11 21:11:10 +00:00
|
|
|
|
import { Languages } from "./collections/Languages/Languages";
|
2024-05-15 11:44:50 +00:00
|
|
|
|
import { MediaThumbnails } from "./collections/MediaThumbnails/MediaThumbnails";
|
2024-02-29 23:26:06 +00:00
|
|
|
|
import { Pages } from "./collections/Pages/Pages";
|
2023-08-11 21:11:10 +00:00
|
|
|
|
import { Recorders } from "./collections/Recorders/Recorders";
|
2024-04-05 10:53:59 +00:00
|
|
|
|
import { Scans } from "./collections/Scans/Scans";
|
2024-02-29 23:26:06 +00:00
|
|
|
|
import { Tags } from "./collections/Tags/Tags";
|
2024-04-04 19:42:48 +00:00
|
|
|
|
import { Videos } from "./collections/Videos/Videos";
|
2024-04-05 05:41:42 +00:00
|
|
|
|
import { VideosChannels } from "./collections/VideosChannels/VideosChannels";
|
|
|
|
|
import { VideosSubtitles } from "./collections/VideosSubtitles/VideosSubtitles";
|
2024-04-05 15:02:06 +00:00
|
|
|
|
import { WebsiteConfig } from "./collections/WebsiteConfig/WebsiteConfig";
|
2024-03-02 19:38:38 +00:00
|
|
|
|
import { Wordings } from "./collections/Wordings/Wordings";
|
2023-07-22 18:32:18 +00:00
|
|
|
|
import { Icon } from "./components/Icon";
|
2023-08-11 21:11:10 +00:00
|
|
|
|
import { Logo } from "./components/Logo";
|
|
|
|
|
import { Collections } from "./constants";
|
2023-10-23 20:39:17 +00:00
|
|
|
|
import { createEditor } from "./utils/editor";
|
2023-07-14 11:03:01 +00:00
|
|
|
|
|
2024-04-06 08:36:11 +00:00
|
|
|
|
const configuredFtpAdapter = sftpAdapter({
|
|
|
|
|
connectOptions: {
|
|
|
|
|
host: process.env.SFTP_HOST,
|
|
|
|
|
username: process.env.SFTP_USERNAME,
|
|
|
|
|
privateKey: process.env.SFTP_PRIVATE_KEY,
|
|
|
|
|
},
|
|
|
|
|
destinationPathRoot: process.env.SFTP_DESTINATION_PATH_ROOT ?? "",
|
2024-04-07 00:23:07 +00:00
|
|
|
|
publicEndpoint: process.env.SFTP_BASE_URL ?? "",
|
2024-04-05 13:41:58 +00:00
|
|
|
|
});
|
|
|
|
|
|
2023-07-14 11:03:01 +00:00
|
|
|
|
export default buildConfig({
|
2023-08-11 21:11:10 +00:00
|
|
|
|
serverURL: process.env.PAYLOAD_URI,
|
2023-07-14 11:03:01 +00:00
|
|
|
|
admin: {
|
2023-08-11 21:11:10 +00:00
|
|
|
|
user: Collections.Recorders,
|
2023-07-22 18:32:18 +00:00
|
|
|
|
components: { graphics: { Logo, Icon } },
|
|
|
|
|
meta: {
|
|
|
|
|
favicon: "/public/favicon.ico",
|
|
|
|
|
ogImage: "og.jpg",
|
|
|
|
|
titleSuffix: "- Accord’s Library",
|
2023-07-22 18:32:48 +00:00
|
|
|
|
},
|
2023-07-22 18:32:18 +00:00
|
|
|
|
css: path.resolve(__dirname, "styles.scss"),
|
2023-10-14 09:27:32 +00:00
|
|
|
|
bundler: webpackBundler(),
|
2023-07-14 11:03:01 +00:00
|
|
|
|
},
|
2023-10-23 20:39:17 +00:00
|
|
|
|
editor: createEditor({}),
|
2023-07-22 18:32:48 +00:00
|
|
|
|
collections: [
|
2024-02-29 23:26:06 +00:00
|
|
|
|
Pages,
|
2024-03-13 04:32:02 +00:00
|
|
|
|
Collectibles,
|
|
|
|
|
Folders,
|
2024-03-20 12:31:24 +00:00
|
|
|
|
ChronologyEvents,
|
|
|
|
|
|
2024-03-13 04:32:02 +00:00
|
|
|
|
Images,
|
2024-04-05 13:41:58 +00:00
|
|
|
|
Audios,
|
|
|
|
|
MediaThumbnails,
|
2024-04-04 19:42:48 +00:00
|
|
|
|
Videos,
|
2024-04-05 05:41:42 +00:00
|
|
|
|
VideosSubtitles,
|
|
|
|
|
VideosChannels,
|
2024-04-05 10:53:59 +00:00
|
|
|
|
Scans,
|
2024-03-20 12:31:24 +00:00
|
|
|
|
|
2024-02-29 23:26:06 +00:00
|
|
|
|
Tags,
|
2024-05-15 11:44:50 +00:00
|
|
|
|
Attributes,
|
2024-04-08 21:12:19 +00:00
|
|
|
|
CreditsRoles,
|
2024-03-13 04:32:02 +00:00
|
|
|
|
Recorders,
|
|
|
|
|
Languages,
|
|
|
|
|
Currencies,
|
2024-03-03 17:18:42 +00:00
|
|
|
|
Wordings,
|
|
|
|
|
GenericContents,
|
2023-07-22 18:32:48 +00:00
|
|
|
|
],
|
2023-10-14 09:27:32 +00:00
|
|
|
|
db: mongooseAdapter({
|
2024-04-05 05:41:42 +00:00
|
|
|
|
url: process.env.MONGODB_URI ?? "",
|
2023-10-14 09:27:32 +00:00
|
|
|
|
}),
|
2024-04-05 15:02:06 +00:00
|
|
|
|
globals: [WebsiteConfig],
|
2023-07-14 11:03:01 +00:00
|
|
|
|
telemetry: false,
|
|
|
|
|
typescript: {
|
|
|
|
|
outputFile: path.resolve(__dirname, "types/collections.ts"),
|
|
|
|
|
},
|
|
|
|
|
graphQL: {
|
2023-07-22 18:32:48 +00:00
|
|
|
|
disable: true,
|
2023-07-14 11:03:01 +00:00
|
|
|
|
},
|
2024-05-12 10:44:41 +00:00
|
|
|
|
rateLimit: {
|
2024-05-12 15:14:24 +00:00
|
|
|
|
skip: () => true,
|
2024-05-12 10:44:41 +00:00
|
|
|
|
},
|
2024-04-04 19:42:48 +00:00
|
|
|
|
plugins: [
|
|
|
|
|
cloudStorage({
|
|
|
|
|
collections: {
|
|
|
|
|
[Collections.Videos]: {
|
2024-04-05 13:41:58 +00:00
|
|
|
|
adapter: configuredFtpAdapter,
|
|
|
|
|
disableLocalStorage: true,
|
|
|
|
|
disablePayloadAccessControl: true,
|
|
|
|
|
},
|
2024-04-11 05:37:07 +00:00
|
|
|
|
[Collections.VideosSubtitles]: {
|
|
|
|
|
adapter: configuredFtpAdapter,
|
|
|
|
|
disableLocalStorage: true,
|
|
|
|
|
disablePayloadAccessControl: true,
|
|
|
|
|
},
|
2024-04-05 13:41:58 +00:00
|
|
|
|
[Collections.Audios]: {
|
|
|
|
|
adapter: configuredFtpAdapter,
|
2024-04-04 19:42:48 +00:00
|
|
|
|
disableLocalStorage: true,
|
|
|
|
|
disablePayloadAccessControl: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
2023-07-14 11:03:01 +00:00
|
|
|
|
});
|