Compare commits

..

No commits in common. "2d2f8ced9bcaed320c53f8f7f29c8f380f50559f" and "a55661164b84cb60e52e0125bc980affb42e662d" have entirely different histories.

17 changed files with 12446 additions and 383 deletions

View File

@ -1,42 +1,15 @@
include .env include .env
all: minikube secrets tilt
tilt:
tilt up
secrets: secrets:
kubectl delete secret link2cid --ignore-not-found kubectl delete secret link2cid --ignore-not-found
kubectl create secret generic link2cid \ kubectl create secret generic link2cid \
--from-literal=apiKey=${LINK2CID_API_KEY} --from-literal=apiKey=${LINK2CID_API_KEY}
kubectl delete secret vultr --ignore-not-found kubectl delete secret vultr
kubectl create secret generic vultr \ kubectl create secret generic vultr \
--from-literal=vultr=${VULTR_CONTAINER_REGISTRY_USERNAME} --from-literal=vultr=${VULTR_CONTAINER_REGISTRY_USERNAME}
kubectl delete secret strapi --ignore-not-found
kubectl create secret generic strapi \
--from-literal=adminJwtSecret=${STRAPI_ADMIN_JWT_SECRET} \
--from-literal=apiTokenSalt=${STRAPI_API_TOKEN_SALT} \
--from-literal=appKeys=${APP_KEYS} \
--from-literal=databaseUrl=postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME} \
--from-literal=jwtSecret=${STRAPI_JWT_SECRET} \
--from-literal=muxPlaybackRestrictionId=${MUX_PLAYBACK_RESTRICTION_ID} \
--from-literal=muxSigningKeyPrivateKey=${MUX_SIGNING_KEY_PRIVATE_KEY} \
--from-literal=s3UscBucketApplicationKey=${S3_USC_BUCKET_APPLICATION_KEY} \
--from-literal=s3UscBucketEndpoint=${S3_USC_BUCKET_ENDPOINT} \
--from-literal=s3UscBucketName=${S3_USC_BUCKET_NAME} \
--from-literal=s3UscBucketKeyId=${S3_USC_BUCKET_KEY_ID} \
--from-literal=s3UscBucketRegion=${S3_USC_BUCKET_REGION} \
--from-literal=muxSigningKeyId=${MUX_SIGNING_KEY_ID} \
--from-literal=strapiAdminEmail=${STRAPI_ADMIN_EMAIL} \
--from-literal=sendgridApiKey=${SENDGRID_API_KEY} \
--from-literal=cdnBucketUscUrl=${CDN_BUCKET_USC_URL} \
--from-literal=transferTokenSalt=${TRANSFER_TOKEN_SALT}
# --from-literal=sessionSecret=$(SESSION_SECRET) \ # --from-literal=sessionSecret=$(SESSION_SECRET) \
# --from-literal=twitchClientId=$(TWITCH_CLIENT_ID) \ # --from-literal=twitchClientId=$(TWITCH_CLIENT_ID) \

View File

@ -9,9 +9,7 @@ k8s_yaml(helm(
docker_build('fp/link2cid', './packages/link2cid') docker_build('fp/link2cid', './packages/link2cid')
docker_build( docker_build(
'fp/strapi', 'fp/strapi',
'.', './packages/strapi',
dockerfile='strapi.dockerfile',
target='dev',
live_update=[ live_update=[
sync('./packages/strapi', '/app') sync('./packages/strapi', '/app')
] ]
@ -20,20 +18,20 @@ docker_build(
## Uncomment the following for fp/next in dev mode ## Uncomment the following for fp/next in dev mode
## this is useful for changing the UI and seeing results ## this is useful for changing the UI and seeing results
docker_build( # docker_build(
'fp/next', # 'fp/next',
'.', # '.',
dockerfile='next.dockerfile', # dockerfile='next.dockerfile',
target='dev', # target='dev',
live_update=[ # live_update=[
sync('./packages/next', '/app') # sync('./packages/next', '/app')
] # ]
) # )
## Uncomment the following for fp/next in production mode ## Uncomment the following for fp/next in production mode
## this is useful to test how fp/next will behave in production environment ## this is useful to test how fp/next will behave in production environment
## note: there is no live_update here. expect slow rebuilds in response to code changes ## note: there is no live_update here. expect slow rebuilds in response to code changes
# docker_build('fp/next', '.', dockerfile='next.dockerfile') docker_build('fp/next', '.', dockerfile='next.dockerfile')
k8s_resource( k8s_resource(
@ -62,13 +60,13 @@ k8s_resource(
# port_forwards=['5050'] # port_forwards=['5050']
# ) # )
k8s_resource( # k8s_resource(
workload='strapi-pod', # workload='strapi-pod',
port_forwards=['1337'], # port_forwards=['1337'],
links=[ # links=[
link('http://localhost:1337/admin', 'Strapi Admin UI') # link('http://localhost:1337/admin', 'Strapi Admin UI')
] # ]
) # )
# v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions') # v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')

View File

@ -13,27 +13,27 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: adminJwtSecret key: ADMIN_JWT_SECRET
- name: API_TOKEN_SALT - name: API_TOKEN_SALT
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: apiTokenSalt key: API_TOKEN_SALT
- name: APP_KEYS - name: APP_KEYS
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: appKeys key: APP_KEYS
- name: DATABASE_URL - name: DATABASE_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: databaseUrl key: DATABASE_URL
- name: CDN_BUCKET_USC_URL - name: CDN_BUCKET_USC_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: cdnBucketUscUrl key: CDN_BUCKET_USC_URL
- name: DATABASE_CLIENT - name: DATABASE_CLIENT
value: postgres value: postgres
- name: DATABASE_HOST - name: DATABASE_HOST
@ -44,61 +44,61 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: jwtSecret key: JWT_SECRET
- name: MUX_PLAYBACK_RESTRICTION_ID - name: MUX_PLAYBACK_RESTRICTION_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: muxPlaybackRestrictionId key: MUX_PLAYBACK_RESTRICTION_ID
- name: MUX_SIGNING_KEY_ID - name: MUX_SIGNING_KEY_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: muxSigningKeyId key: MUX_SIGNING_KEY_ID
- name: MUX_SIGNING_KEY_PRIVATE_KEY - name: MUX_SIGNING_KEY_PRIVATE_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: muxSigningKeyPrivateKey key: MUX_SIGNING_KEY_PRIVATE_KEY
- name: NODE_ENV - name: NODE_ENV
value: production value: production
- name: S3_USC_BUCKET_APPLICATION_KEY - name: S3_USC_BUCKET_APPLICATION_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: s3UscBucketApplicationKey key: S3_USC_BUCKET_APPLICATION_KEY
- name: S3_USC_BUCKET_ENDPOINT - name: S3_USC_BUCKET_ENDPOINT
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: s3UscBucketEndpoint key: S3_USC_BUCKET_ENDPOINT
- name: S3_USC_BUCKET_KEY_ID - name: S3_USC_BUCKET_KEY_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: s3UscBucketKeyId key: S3_USC_BUCKET_KEY_ID
- name: S3_USC_BUCKET_NAME - name: S3_USC_BUCKET_NAME
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: s3UscBucketName key: S3_USC_BUCKET_NAME
- name: S3_USC_BUCKET_REGION - name: S3_USC_BUCKET_REGION
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: s3UscBucketRegion key: S3_USC_BUCKET_REGION
- name: SENDGRID_API_KEY - name: SENDGRID_API_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: sendgridApiKey key: SENDGRID_API_KEY
- name: STRAPI_URL - name: STRAPI_URL
value: {{ .Values.strapi.url }} value: {{ .Values.strapi.url }}
- name: TRANSFER_TOKEN_SALT - name: TRANSFER_TOKEN_SALT
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: strapi name: strapi
key: transferTokenSalt key: TRANSFER_TOKEN_SALT
- name: PORT - name: PORT
value: "{{ .Values.strapi.port }}" value: "{{ .Values.strapi.port }}"
resources: resources:

View File

@ -18,10 +18,10 @@ ENV NEXT_PUBLIC_SITE_URL ${NEXT_PUBLIC_SITE_URL}
ENV NEXT_PUBLIC_STRAPI_URL ${NEXT_PUBLIC_STRAPI_URL} ENV NEXT_PUBLIC_STRAPI_URL ${NEXT_PUBLIC_STRAPI_URL}
ENV NEXT_PUBLIC_UPPY_COMPANION_URL ${NEXT_PUBLIC_UPPY_COMPANION_URL} ENV NEXT_PUBLIC_UPPY_COMPANION_URL ${NEXT_PUBLIC_UPPY_COMPANION_URL}
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
COPY pnpm-lock.yaml ./ COPY pnpm-lock.yaml package.json ./
RUN pnpm fetch RUN pnpm fetch
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install --offline
COPY ./packages/next /app COPY ./packages/next /app
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install
FROM install AS dev FROM install AS dev

View File

@ -1,6 +1,6 @@
{ {
"name": "futureporn", "name": "futureporn",
"version": "1.0.3", "version": "1.0.2",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -43,25 +43,25 @@ export default async function VodPage({vod}: { vod: IVod }) {
return ( return (
<div className="container"> <div className="container">
<div className="section pt-0"> <div className="block mb-5">
<VideoInteractive vod={vod}></VideoInteractive> <VideoInteractive vod={vod}></VideoInteractive>
{(vod.attributes.thumbnail) && (<div className='mb-5'> {(vod.attributes.thumbnail) && (<div className='mb-5'>
<LinkableHeading text="Thumbnail Image" slug="thumb" icon={faImage}></LinkableHeading> <LinkableHeading text="Thumbnail Image" slug="thumb" icon={faImage}></LinkableHeading>
<Thumbnail url={vod.attributes.thumbnail.data.attributes.cdnUrl}></Thumbnail> <Thumbnail url={vod.attributes.thumbnail.data.attributes.cdnUrl}></Thumbnail>
</div>)} </div>)}
{(vod.attributes.videoSrcHash || vod.attributes.video240Hash) && ( {(vod.attributes.videoSrcHash || vod.attributes.video240Hash) && (
<> <>
<LinkableHeading text="IPFS Content IDs" slug="ipfs" icon={faGlobe}></LinkableHeading> <LinkableHeading text="IPFS Content IDs" slug="ipfs" icon={faGlobe}></LinkableHeading>
{vod.attributes.videoSrcHash && ( {vod.attributes.videoSrcHash && (
<IpfsCid label="Source" cid={vod.attributes.videoSrcHash}></IpfsCid> <IpfsCid label="Source" cid={vod.attributes.videoSrcHash}></IpfsCid>
)} )}
{vod.attributes.video240Hash && ( {vod.attributes.video240Hash && (
<IpfsCid label="240p" cid={vod.attributes.video240Hash}></IpfsCid> <IpfsCid label="240p" cid={vod.attributes.video240Hash}></IpfsCid>
)} )}
</> </>
)} )}
<nav className="level mt-5"> <nav className="level mt-5">

View File

@ -1,9 +0,0 @@
.tmp/
.cache/
.git/
.env
build/
node_modules/
# Ignoring folders that might be used in starter templates
data/
backup/

View File

@ -0,0 +1,28 @@
# Creating multi-stage build for production
FROM node:18-alpine as build
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1
ENV NODE_ENV=production
WORKDIR /opt/
COPY package.json yarn.lock ./
RUN yarn global add node-gyp
RUN yarn config set network-timeout 600000 -g && yarn install --production
ENV PATH /opt/node_modules/.bin:$PATH
WORKDIR /opt/app
COPY . .
RUN yarn build
# Creating final production image
FROM node:18-alpine
RUN apk add --no-cache vips-dev
ENV NODE_ENV=production
WORKDIR /opt/
COPY --from=build /opt/node_modules ./node_modules
WORKDIR /opt/app
COPY --from=build /opt/app ./
ENV PATH /opt/node_modules/.bin:$PATH
RUN chown -R node:node /opt/app
USER node
EXPOSE 1337
CMD ["yarn", "start"]

View File

@ -0,0 +1,26 @@
FROM node:18.16-alpine as base
RUN corepack enable
# Installing libvips-dev for sharp Compatibility
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
WORKDIR /app
FROM base AS build
COPY package.json pnpm-lock.yaml ./
# RUN yarn config set network-timeout 600000 -g && yarn install
RUN pnpm install --frozen-lockfile
COPY . .
ENV PATH=/app/node_modules/.bin:$PATH
RUN chown -R node:node /app
USER node
RUN pnpm run build
EXPOSE 1337
FROM build AS dev
CMD ["pnpm", "run", "dev"]
FROM build AS release
ENTRYPOINT ["pnpm", "run", "start"]

View File

@ -0,0 +1,31 @@
# Creating multi-stage build for production
FROM node:18-alpine as build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1
ENV NODE_ENV=production
WORKDIR /opt/
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --prod
ENV PATH /opt/node_modules/.bin:$PATH
WORKDIR /opt/app
COPY . .
RUN pnpm run build
# Creating final production image
FROM node:18-alpine
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN apk add --no-cache vips-dev
ENV NODE_ENV=production
WORKDIR /opt/
COPY --from=build /opt/node_modules ./node_modules
WORKDIR /opt/app
COPY --from=build /opt/app ./
ENV PATH /opt/node_modules/.bin:$PATH
RUN chown -R node:node /opt/app
USER node
EXPOSE 1337
CMD ["pnpm", "start"]

View File

@ -0,0 +1,19 @@
FROM node:18-alpine
# Installing libvips-dev for sharp Compatibility
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev git
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
COPY package.json yarn.lock ./
RUN yarn global add node-gyp
RUN yarn config set network-timeout 600000 -g && yarn install
ENV PATH /opt/node_modules/.bin:$PATH
WORKDIR /opt/app
COPY . .
RUN chown -R node:node /opt/app
USER node
RUN ["yarn", "build"]
EXPOSE 1337
CMD ["yarn", "dev"]

View File

@ -63,7 +63,7 @@
"react-router-dom": "5.3.4", "react-router-dom": "5.3.4",
"react-test-renderer": "^17.0.2", "react-test-renderer": "^17.0.2",
"semver": "^7.5.4", "semver": "^7.5.4",
"sharp": "0.32.6", "sharp": "^0.32.6",
"strapi-plugin-fuzzy-search": "^2.2.0", "strapi-plugin-fuzzy-search": "^2.2.0",
"styled-components": "5.3.3", "styled-components": "5.3.3",
"typescript": "^5.3.3", "typescript": "^5.3.3",
@ -81,7 +81,7 @@
"uuid": false "uuid": false
}, },
"engines": { "engines": {
"node": ">=14.19.1 <=19.x.x", "node": ">=14.19.1 <=18.x.x",
"npm": ">=6.0.0" "npm": ">=6.0.0"
}, },
"license": "MIT" "license": "MIT"

File diff suppressed because it is too large Load Diff

12037
packages/strapi/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,5 +2,5 @@ packages:
- 'packages/uppy' - 'packages/uppy'
- 'packages/bot' - 'packages/bot'
- 'packages/next' - 'packages/next'
- 'packages/strapi'
# strapi is not on here because it's not compatible with pnpm

View File

@ -1,51 +0,0 @@
# FROM node:18-alpine
# # Installing libvips-dev for sharp Compatibility
# RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev git
# ARG NODE_ENV=development
# ENV NODE_ENV=${NODE_ENV}
# WORKDIR /opt/
# COPY ./packages/strapi/package.json ./packages/strapi/yarn.lock ./
# RUN yarn global add node-gyp
# RUN yarn config set network-timeout 600000 -g && yarn install
# ENV PATH /opt/node_modules/.bin:$PATH
# WORKDIR /opt/app
# COPY ./packages/strapi .
# RUN chown -R node:node /opt/app
# USER node
# RUN ["yarn", "build"]
# EXPOSE 1337
# CMD ["yarn", "dev"]
FROM node:18.16-alpine as base
RUN corepack enable
# Installing libvips-dev for sharp Compatibility
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
WORKDIR /app
FROM base AS build
# COPY package.json pnpm-lock.yaml ./
COPY pnpm-lock.yaml ./
# RUN yarn config set network-timeout 600000 -g && yarn install
# RUN pnpm install --frozen-lockfile
RUN pnpm fetch
COPY ./packages/strapi .
RUN pnpm install --offline
# ENV PATH=/app/node_modules/.bin:$PATH
RUN chown -R node:node /app
USER node
# RUN pnpm run build
# EXPOSE 1337
FROM build AS dev
CMD ["pnpm", "run", "dev"]
FROM build AS release
CMD ["pnpm"]
ENTRYPOINT ["run", "start"]