SSL in dev environment!
ci / build (push) Has been cancelled Details

This commit is contained in:
CJ_Clippy 2024-05-29 15:43:47 -08:00
parent 5b685cd7a8
commit 76e1ee60eb
29 changed files with 784 additions and 671 deletions

View File

@ -18,6 +18,8 @@ docker-compose.*
.vscode .vscode
charts/**/charts charts/**/charts
**/.env
**/node_modules
packages/strapi/.tmp/ packages/strapi/.tmp/
packages/strapi/.cache/ packages/strapi/.cache/

View File

@ -0,0 +1,15 @@
apiVersion: chisel-operator.io/v1
kind: ExitNode
metadata:
name: uwu-exit-node
namespace: futureporn
spec:
# IP address of exit node
# In this case, we will leave this as a blank string, and let the operator allocate an IP address for us
host: "155.138.254.201"
# Control plane socket port
port: 9090
# Name of the secret containing the auth key
# This is not required, but recommended
# If not set, the operator will automatically generate a secret for you
auth: uwu-auth

View File

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: futureporn
resources:
- namespace.yaml
- repository.yaml
- exit-node.yaml

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: futureporn

View File

@ -0,0 +1,15 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: chisel-operator
namespace: futureporn
spec:
interval: 1m
url: https://github.com/FyraLabs/chisel-operator
ref:
branch: main
ignore: |
# exclude all
/*
# include charts directory
!/charts/

View File

@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../base/podinfo - ../base/podinfo
- ../base/piko
- ../base/windmill - ../base/windmill
- ../base/fp - ../base/fp
patches: patches:

View File

@ -0,0 +1,48 @@
## Utility ingress (named uwu to make it non-specific) is used for several backend or development services.
## We do this to save money, as every VKE ingress cost us $10/month
## We route to different services by path
{{ if eq .Values.managedBy "Helm" }}
# ---
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: uwu-ingress
# namespace: futureporn
# annotations:
# cert-manager.io/cluster-issuer: "letsencrypt-staging"
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# # If you encounter a redirect loop or are getting a 307 response code
# # then you need to force the nginx ingress to connect to the backend using HTTPS.
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# spec:
# ingressClassName: nginx
# rules:
# - host: uwu.sbtp.xyz
# http:
# paths:
# - path: /piko
# pathType: Prefix
# backend:
# service:
# name: piko
# port:
# name: https
# - path: /windmill
# pathType: Prefix
# backend:
# service:
# name: windmmill-app
# port:
# name: https
# tls:
# - hosts:
# - uwu.sbtp.xyz
# secretName: uwu-tls
{{ end }}

View File

@ -1,15 +1,38 @@
{{ if eq .Values.managedBy "tilt" }}
---
apiVersion: chisel-operator.io/v1
kind: ExitNode
metadata:
name: next-exit-node
namespace: futureporn
spec:
host: "{{ .Values.chisel.exitNodeIp }}"
port: 9090
auth: uwu-auth
{{ end }}
---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: next name: next
namespace: futureporn namespace: futureporn
{{ if eq .Values.managedBy "tilt" }}
# create a tunnel to uwu-exit-node (chisel server)
# this allows us to have SSL in development
annotations:
chisel-operator.io/exit-node-name: "uwu-exit-node"
{{ end }}
spec: spec:
selector: selector:
app.kubernetes.io/name: next app.kubernetes.io/name: next
ports: ports:
- name: web - name: web
port: 3000 port: 3000
targetPort: 3000 targetPort: web
protocol: TCP
type: LoadBalancer
--- ---
apiVersion: v1 apiVersion: v1

View File

@ -1,37 +0,0 @@
{{ if eq .Values.managedBy "tilt" }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ngrok
namespace: futureporn
annotations:
kubernetes.io/ingress.class: ngrok
k8s.ngrok.com/namespace: futureporn
k8s.ngrok.com/service: ngrok
spec:
ingressClassName: ngrok
tls:
- secretName: ngrok-tls
hosts:
- "{{ .Values.ngrok.hostname }}"
rules:
- host: "{{ .Values.ngrok.hostname }}"
http:
paths:
- path: /next
pathType: Prefix
backend:
service:
name: next
port:
number: 3000
- path: /strapi
pathType: Prefix
backend:
service:
name: strapi
port:
number: 1337
{{ end }}

View File

@ -1,101 +0,0 @@
# In development, we need a piko agent
{{ if eq .Values.managedBy "tilt" }}
{{ end }}
# In production, we need a piko server
{{ if eq .Values.managedBy "Helm" }}
---
apiVersion: v1
kind: Service
metadata:
name: piko
namespace: futureporn
labels:
app: piko
spec:
ports:
- port: 8000
name: proxy
- port: 8001
name: upstream
- port: 8002
name: admin
- port: 8003
name: gossip
clusterIP: None
selector:
app: piko
---
apiVersion: v1
kind: ConfigMap
metadata:
name: server-config
data:
server.yaml: |
cluster:
node_id_prefix: ${POD_NAME}-
join:
- piko
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: piko
spec:
selector:
matchLabels:
app: piko
serviceName: "piko"
replicas: 3
template:
metadata:
labels:
app: piko
spec:
terminationGracePeriodSeconds: 60
containers:
- name: piko
image: my-repo/piko:latest
ports:
- containerPort: 8000
name: proxy
- containerPort: 8001
name: upstream
- containerPort: 8002
name: admin
- containerPort: 8003
name: gossip
args:
- server
- --config.path
- /config/server.yaml
- --config.expand-env
resources:
limits:
cpu: 250m
ephemeral-storage: 1Gi
memory: 1Gi
requests:
cpu: 250m
ephemeral-storage: 1Gi
memory: 1Gi
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- name: config
mountPath: "/config"
readOnly: true
volumes:
- name: config
configMap:
name: server-config
items:
- key: "server.yaml"
path: "server.yaml"
{{ end }}

View File

@ -1,8 +1,28 @@
{{ if eq .Values.managedBy "tilt" }}
---
apiVersion: chisel-operator.io/v1
kind: ExitNode
metadata:
name: strapi-exit-node
namespace: futureporn
spec:
host: "{{ .Values.chisel.exitNodeIp }}"
port: 9090
auth: uwu-auth
{{ end }}
---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: strapi name: strapi
namespace: futureporn namespace: futureporn
{{ if eq .Values.managedBy "tilt" }}
# create a tunnel to uwu-exit-node (chisel server)
# this allows us to have SSL in development
annotations:
chisel-operator.io/exit-node-name: "uwu-exit-node"
{{ end }}
spec: spec:
selector: selector:
app.kubernetes.io/name: strapi app.kubernetes.io/name: strapi
@ -11,6 +31,7 @@ spec:
port: 1339 port: 1339
targetPort: http targetPort: http
protocol: TCP protocol: TCP
type: LoadBalancer
--- ---
apiVersion: v1 apiVersion: v1
@ -178,5 +199,4 @@ spec:
name: strapi name: strapi
port: port:
number: 1339 number: 1339
{{ end }} {{ end }}

View File

@ -1,50 +0,0 @@
## Utility ingress (named uwu to make it non-specific) is used for several backend or development services.
## We do this to save money, as every VKE ingress cost us $10/month
## We route to different services by path
{{ if eq .Values.managedBy "Helm" }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: uwu-ingress
namespace: futureporn
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-staging"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# If you encounter a redirect loop or are getting a 307 response code
# then you need to force the nginx ingress to connect to the backend using HTTPS.
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
ingressClassName: nginx
rules:
- host: uwu.sbtp.xyz
http:
paths:
- path: /piko
pathType: Prefix
backend:
service:
name: piko
port:
name: https
- path: /windmill
pathType: Prefix
backend:
service:
name: windmmill-app
port:
name: https
tls:
- hosts:
- uwu.sbtp.xyz
secretName: uwu-tls
{{ end }}

View File

@ -14,15 +14,10 @@ scout:
pubsubServerUrl: https://realtime.futureporn.svc.cluster.local/faye pubsubServerUrl: https://realtime.futureporn.svc.cluster.local/faye
certIssuer: letsencrypt-staging certIssuer: letsencrypt-staging
hostname: next.futureporn.svc.cluster.local hostname: next.futureporn.svc.cluster.local
capture:
containerName: fp/capture
scout:
containerName: fp/scout
pubsubServerUrl: https://realtime.futureporn.svc.cluster.local/faye
strapi: strapi:
containerName: fp/strapi containerName: fp/strapi
port: 1339 port: 1339
url: http://localhost:1339 url: https://strapi.piko.sbtp.xyz
certIssuer: letsencrypt-staging certIssuer: letsencrypt-staging
hostname: strapi.futureporn.svc.cluster.local hostname: strapi.futureporn.svc.cluster.local
ingressClassName: ngrok ingressClassName: ngrok
@ -31,3 +26,5 @@ ngrok:
realtime: realtime:
containerName: fp/realtime containerName: fp/realtime
adminEmail: cj@futureporn.net adminEmail: cj@futureporn.net
chisel:
exitNodeIp: "155.138.254.201"

24
d.strapi.dockerfile.idk2 Normal file
View File

@ -0,0 +1,24 @@
FROM node:20-alpine as base
WORKDIR /app
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 libc6-compat git nasm bash gcompat
FROM base AS install
COPY ./packages/strapi/pnpm-lock.yaml ./packages/strapi/package.json ./
RUN pnpm install --prod --shamefully-hoist && pnpm run build
COPY ./packages/strapi .
RUN chown -R node:node /app
USER node
FROM install AS dev
ENV NODE_ENV=development
ENTRYPOINT ["pnpm"]
CMD ["run", "dev"]
FROM install AS release
ENV NODE_ENV=production
ENTRYPOINT ["pnpm"]
CMD ["run", "start"]

20
d.strapi.dockerfile.yarn Normal file
View File

@ -0,0 +1,20 @@
FROM node:18-alpine3.18
RUN echo "do a rebuild, yuou fucking shit!"
# 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 1339
CMD ["yarn", "start"]

View File

@ -1 +1,3 @@
node_modules ## This is the WRONG place to add dockerignore spec!
## We are using monorepo which menas .dockerignore must be in the root of context (../../)
## Add dockerignore specs to ../../.dockerignore instead.

View File

@ -83,7 +83,7 @@ export default function Page() {
useEffect(() => { useEffect(() => {
initAuth() initAuth()
}) }, [])

View File

@ -70,5 +70,6 @@
"eslint-config-next": "14.0.4", "eslint-config-next": "14.0.4",
"tsc": "^2.0.4", "tsc": "^2.0.4",
"typescript": "5.3.3" "typescript": "5.3.3"
} },
"packageManager": "pnpm@9.1.3"
} }

View File

@ -25,10 +25,10 @@ importers:
version: 0.2.0(@fortawesome/fontawesome-svg-core@6.5.2)(react@18.2.0) version: 0.2.0(@fortawesome/fontawesome-svg-core@6.5.2)(react@18.2.0)
'@hookform/error-message': '@hookform/error-message':
specifier: ^2.0.1 specifier: ^2.0.1
version: 2.0.1(react-dom@18.2.0)(react-hook-form@7.51.2)(react@18.2.0) version: 2.0.1(react-dom@18.2.0(react@18.2.0))(react-hook-form@7.51.2(react@18.2.0))(react@18.2.0)
'@hookform/resolvers': '@hookform/resolvers':
specifier: ^3.3.4 specifier: ^3.3.4
version: 3.3.4(react-hook-form@7.51.2) version: 3.3.4(react-hook-form@7.51.2(react@18.2.0))
'@mux/blurhash': '@mux/blurhash':
specifier: ^0.1.2 specifier: ^0.1.2
version: 0.1.2 version: 0.1.2
@ -37,19 +37,19 @@ importers:
version: 2.4.1 version: 2.4.1
'@mux/mux-player-react': '@mux/mux-player-react':
specifier: ^2.4.1 specifier: ^2.4.1
version: 2.4.1(@types/react-dom@18.2.24)(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) version: 2.4.1(@types/react-dom@18.2.24)(@types/react@18.2.75)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@paralleldrive/cuid2': '@paralleldrive/cuid2':
specifier: ^2.2.2 specifier: ^2.2.2
version: 2.2.2 version: 2.2.2
'@react-hookz/web': '@react-hookz/web':
specifier: ^24.0.4 specifier: ^24.0.4
version: 24.0.4(react-dom@18.2.0)(react@18.2.0) version: 24.0.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@tanstack/react-query': '@tanstack/react-query':
specifier: ^5.32.1 specifier: ^5.32.1
version: 5.32.1(react@18.2.0) version: 5.32.1(react@18.2.0)
'@tanstack/react-table': '@tanstack/react-table':
specifier: ^8.15.3 specifier: ^8.15.3
version: 8.15.3(react-dom@18.2.0)(react@18.2.0) version: 8.15.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@types/lodash': '@types/lodash':
specifier: ^4.17.0 specifier: ^4.17.0
version: 4.17.0 version: 4.17.0
@ -85,7 +85,7 @@ importers:
version: 3.1.1(@uppy/core@3.10.0) version: 3.1.1(@uppy/core@3.10.0)
'@uppy/react': '@uppy/react':
specifier: ^3.3.0 specifier: ^3.3.0
version: 3.3.0(@uppy/core@3.10.0)(@uppy/dashboard@3.8.0)(@uppy/drag-drop@3.1.0)(@uppy/file-input@3.1.0)(@uppy/progress-bar@3.1.1)(react@18.2.0) version: 3.3.0(@uppy/core@3.10.0)(@uppy/dashboard@3.8.0(@uppy/core@3.10.0))(@uppy/drag-drop@3.1.0(@uppy/core@3.10.0))(@uppy/file-input@3.1.0(@uppy/core@3.10.0))(@uppy/progress-bar@3.1.1(@uppy/core@3.10.0))(@uppy/status-bar@3.3.1(@uppy/core@3.10.0))(react@18.2.0)
'@uppy/remote-sources': '@uppy/remote-sources':
specifier: ^1.2.0 specifier: ^1.2.0
version: 1.2.0(@uppy/core@3.10.0) version: 1.2.0(@uppy/core@3.10.0)
@ -121,13 +121,13 @@ importers:
version: 13.1.0 version: 13.1.0
next: next:
specifier: 14.0.4 specifier: 14.0.4
version: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0) version: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1)
next-goatcounter: next-goatcounter:
specifier: ^1.0.5 specifier: ^1.0.5
version: 1.0.5(next@14.0.4)(react-dom@18.2.0)(react@18.2.0) version: 1.0.5(next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
nextjs-toploader: nextjs-toploader:
specifier: ^1.6.11 specifier: ^1.6.11
version: 1.6.11(next@14.0.4)(react-dom@18.2.0)(react@18.2.0) version: 1.6.11(next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
plyr: plyr:
specifier: ^3.7.8 specifier: ^3.7.8
version: 3.7.8 version: 3.7.8
@ -142,7 +142,7 @@ importers:
version: 18.2.0 version: 18.2.0
react-data-table-component: react-data-table-component:
specifier: ^7.5.4 specifier: ^7.5.4
version: 7.5.4(react@18.2.0)(styled-components@5.3.3) version: 7.5.4(react@18.2.0)(styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0))
react-dom: react-dom:
specifier: ^18.2.0 specifier: ^18.2.0
version: 18.2.0(react@18.2.0) version: 18.2.0(react@18.2.0)
@ -154,7 +154,7 @@ importers:
version: 3.4.0(react@18.2.0) version: 3.4.0(react@18.2.0)
react-toastify: react-toastify:
specifier: ^9.1.3 specifier: ^9.1.3
version: 9.1.3(react-dom@18.2.0)(react@18.2.0) version: 9.1.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
sharp: sharp:
specifier: ^0.33.3 specifier: ^0.33.3
version: 0.33.3 version: 0.33.3
@ -163,7 +163,7 @@ importers:
version: 1.6.6 version: 1.6.6
styled-components: styled-components:
specifier: 5.3.3 specifier: 5.3.3
version: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) version: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0)
yup: yup:
specifier: ^1.4.0 specifier: ^1.4.0
version: 1.4.0 version: 1.4.0
@ -2635,13 +2635,13 @@ snapshots:
prop-types: 15.8.1 prop-types: 15.8.1
react: 18.2.0 react: 18.2.0
'@hookform/error-message@2.0.1(react-dom@18.2.0)(react-hook-form@7.51.2)(react@18.2.0)': '@hookform/error-message@2.0.1(react-dom@18.2.0(react@18.2.0))(react-hook-form@7.51.2(react@18.2.0))(react@18.2.0)':
dependencies: dependencies:
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
react-hook-form: 7.51.2(react@18.2.0) react-hook-form: 7.51.2(react@18.2.0)
'@hookform/resolvers@3.3.4(react-hook-form@7.51.2)': '@hookform/resolvers@3.3.4(react-hook-form@7.51.2(react@18.2.0))':
dependencies: dependencies:
react-hook-form: 7.51.2(react@18.2.0) react-hook-form: 7.51.2(react@18.2.0)
@ -2754,15 +2754,16 @@ snapshots:
blurhash: 1.1.5 blurhash: 1.1.5
sharp: 0.30.7 sharp: 0.30.7
'@mux/mux-player-react@2.4.1(@types/react-dom@18.2.24)(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0)': '@mux/mux-player-react@2.4.1(@types/react-dom@18.2.24)(@types/react@18.2.75)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies: dependencies:
'@mux/mux-player': 2.4.1 '@mux/mux-player': 2.4.1
'@mux/playback-core': 0.22.4 '@mux/playback-core': 0.22.4
'@types/react': 18.2.75
'@types/react-dom': 18.2.24
prop-types: 15.8.1 prop-types: 15.8.1
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
optionalDependencies:
'@types/react': 18.2.75
'@types/react-dom': 18.2.24
'@mux/mux-player@2.4.1': '@mux/mux-player@2.4.1':
dependencies: dependencies:
@ -2835,7 +2836,7 @@ snapshots:
'@react-hookz/deep-equal@1.0.4': {} '@react-hookz/deep-equal@1.0.4': {}
'@react-hookz/web@24.0.4(react-dom@18.2.0)(react@18.2.0)': '@react-hookz/web@24.0.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies: dependencies:
'@react-hookz/deep-equal': 1.0.4 '@react-hookz/deep-equal': 1.0.4
react: 18.2.0 react: 18.2.0
@ -2854,7 +2855,7 @@ snapshots:
'@tanstack/query-core': 5.32.1 '@tanstack/query-core': 5.32.1
react: 18.2.0 react: 18.2.0
'@tanstack/react-table@8.15.3(react-dom@18.2.0)(react@18.2.0)': '@tanstack/react-table@8.15.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies: dependencies:
'@tanstack/table-core': 8.15.3 '@tanstack/table-core': 8.15.3
react: 18.2.0 react: 18.2.0
@ -2898,8 +2899,8 @@ snapshots:
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3)
'@typescript-eslint/visitor-keys': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0
debug: 4.3.4(supports-color@5.5.0) debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4(supports-color@5.5.0)
eslint: 8.57.0 eslint: 8.57.0
optionalDependencies:
typescript: 5.3.3 typescript: 5.3.3
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -2916,12 +2917,12 @@ snapshots:
'@typescript-eslint/types': 6.21.0 '@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0
debug: 4.3.4(supports-color@5.5.0) debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4(supports-color@5.5.0)
globby: 11.1.0 globby: 11.1.0
is-glob: 4.0.3 is-glob: 4.0.3
minimatch: 9.0.3 minimatch: 9.0.3
semver: 7.6.0 semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.3.3) ts-api-utils: 1.3.0(typescript@5.3.3)
optionalDependencies:
typescript: 5.3.3 typescript: 5.3.3
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -3063,16 +3064,18 @@ snapshots:
p-queue: 7.4.1 p-queue: 7.4.1
preact: 10.20.2 preact: 10.20.2
'@uppy/react@3.3.0(@uppy/core@3.10.0)(@uppy/dashboard@3.8.0)(@uppy/drag-drop@3.1.0)(@uppy/file-input@3.1.0)(@uppy/progress-bar@3.1.1)(react@18.2.0)': '@uppy/react@3.3.0(@uppy/core@3.10.0)(@uppy/dashboard@3.8.0(@uppy/core@3.10.0))(@uppy/drag-drop@3.1.0(@uppy/core@3.10.0))(@uppy/file-input@3.1.0(@uppy/core@3.10.0))(@uppy/progress-bar@3.1.1(@uppy/core@3.10.0))(@uppy/status-bar@3.3.1(@uppy/core@3.10.0))(react@18.2.0)':
dependencies: dependencies:
'@uppy/core': 3.10.0 '@uppy/core': 3.10.0
'@uppy/utils': 5.7.5
prop-types: 15.8.1
react: 18.2.0
optionalDependencies:
'@uppy/dashboard': 3.8.0(@uppy/core@3.10.0) '@uppy/dashboard': 3.8.0(@uppy/core@3.10.0)
'@uppy/drag-drop': 3.1.0(@uppy/core@3.10.0) '@uppy/drag-drop': 3.1.0(@uppy/core@3.10.0)
'@uppy/file-input': 3.1.0(@uppy/core@3.10.0) '@uppy/file-input': 3.1.0(@uppy/core@3.10.0)
'@uppy/progress-bar': 3.1.1(@uppy/core@3.10.0) '@uppy/progress-bar': 3.1.1(@uppy/core@3.10.0)
'@uppy/utils': 5.7.5 '@uppy/status-bar': 3.3.1(@uppy/core@3.10.0)
prop-types: 15.8.1
react: 18.2.0
'@uppy/remote-sources@1.2.0(@uppy/core@3.10.0)': '@uppy/remote-sources@1.2.0(@uppy/core@3.10.0)':
dependencies: dependencies:
@ -3264,14 +3267,14 @@ snapshots:
dependencies: dependencies:
dequal: 2.0.3 dequal: 2.0.3
babel-plugin-styled-components@2.1.4(@babel/core@7.24.5)(styled-components@5.3.3): babel-plugin-styled-components@2.1.4(@babel/core@7.24.5)(styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0)):
dependencies: dependencies:
'@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5
'@babel/helper-module-imports': 7.24.3 '@babel/helper-module-imports': 7.24.3
'@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.5) '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.5)
lodash: 4.17.21 lodash: 4.17.21
picomatch: 2.3.1 picomatch: 2.3.1
styled-components: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) styled-components: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0)
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
@ -3458,7 +3461,7 @@ snapshots:
debug@4.3.4(supports-color@5.5.0): debug@4.3.4(supports-color@5.5.0):
dependencies: dependencies:
ms: 2.1.2 ms: 2.1.2
supports-color: 5.5.0 optionalDependencies:
supports-color: 5.5.0 supports-color: 5.5.0
decompress-response@6.0.0: decompress-response@6.0.0:
@ -3617,11 +3620,12 @@ snapshots:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3) '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
eslint: 8.57.0 eslint: 8.57.0
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0)
eslint-plugin-react: 7.34.1(eslint@8.57.0) eslint-plugin-react: 7.34.1(eslint@8.57.0)
eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0)
optionalDependencies:
typescript: 5.3.3 typescript: 5.3.3
transitivePeerDependencies: transitivePeerDependencies:
- eslint-import-resolver-webpack - eslint-import-resolver-webpack
@ -3635,14 +3639,13 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0): eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0):
dependencies: dependencies:
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4(supports-color@5.5.0) debug: 4.3.4(supports-color@5.5.0)
enhanced-resolve: 5.16.0 enhanced-resolve: 5.16.0
eslint: 8.57.0 eslint: 8.57.0
eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
fast-glob: 3.3.2 fast-glob: 3.3.2
get-tsconfig: 4.7.3 get-tsconfig: 4.7.3
is-core-module: 2.13.1 is-core-module: 2.13.1
@ -3653,19 +3656,19 @@ snapshots:
- eslint-import-resolver-webpack - eslint-import-resolver-webpack
- supports-color - supports-color
eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0):
dependencies: dependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
debug: 3.2.7 debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
eslint: 8.57.0 eslint: 8.57.0
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0):
dependencies: dependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
array-includes: 3.1.8 array-includes: 3.1.8
array.prototype.findlastindex: 1.2.5 array.prototype.findlastindex: 1.2.5
array.prototype.flat: 1.3.2 array.prototype.flat: 1.3.2
@ -3674,7 +3677,7 @@ snapshots:
doctrine: 2.1.0 doctrine: 2.1.0
eslint: 8.57.0 eslint: 8.57.0
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
hasown: 2.0.2 hasown: 2.0.2
is-core-module: 2.13.1 is-core-module: 2.13.1
is-glob: 4.0.3 is-glob: 4.0.3
@ -3684,6 +3687,8 @@ snapshots:
object.values: 1.2.0 object.values: 1.2.0
semver: 6.3.1 semver: 6.3.1
tsconfig-paths: 3.15.0 tsconfig-paths: 3.15.0
optionalDependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
transitivePeerDependencies: transitivePeerDependencies:
- eslint-import-resolver-typescript - eslint-import-resolver-typescript
- eslint-import-resolver-webpack - eslint-import-resolver-webpack
@ -3756,7 +3761,6 @@ snapshots:
chalk: 4.1.2 chalk: 4.1.2
cross-spawn: 7.0.3 cross-spawn: 7.0.3
debug: 4.3.4(supports-color@5.5.0) debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4(supports-color@5.5.0)
doctrine: 3.0.0 doctrine: 3.0.0
escape-string-regexp: 4.0.0 escape-string-regexp: 4.0.0
eslint-scope: 7.2.2 eslint-scope: 7.2.2
@ -4261,14 +4265,13 @@ snapshots:
natural-compare@1.4.0: {} natural-compare@1.4.0: {}
next-goatcounter@1.0.5(next@14.0.4)(react-dom@18.2.0)(react@18.2.0): next-goatcounter@1.0.5(next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1))(react-dom@18.2.0(react@18.2.0))(react@18.2.0):
dependencies: dependencies:
next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0) next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1)
next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0): next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1):
dependencies: dependencies:
'@next/env': 14.0.4 '@next/env': 14.0.4
'@swc/helpers': 0.5.2 '@swc/helpers': 0.5.2
@ -4279,7 +4282,6 @@ snapshots:
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
styled-jsx: 5.1.1(@babel/core@7.24.5)(react@18.2.0) styled-jsx: 5.1.1(@babel/core@7.24.5)(react@18.2.0)
styled-jsx: 5.1.1(@babel/core@7.24.5)(react@18.2.0)
watchpack: 2.4.0 watchpack: 2.4.0
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.0.4 '@next/swc-darwin-arm64': 14.0.4
@ -4291,15 +4293,15 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.0.4 '@next/swc-win32-arm64-msvc': 14.0.4
'@next/swc-win32-ia32-msvc': 14.0.4 '@next/swc-win32-ia32-msvc': 14.0.4
'@next/swc-win32-x64-msvc': 14.0.4 '@next/swc-win32-x64-msvc': 14.0.4
sass: 1.74.1
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros
nextjs-toploader@1.6.11(next@14.0.4)(react-dom@18.2.0)(react@18.2.0): nextjs-toploader@1.6.11(next@14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1))(react-dom@18.2.0(react@18.2.0))(react@18.2.0):
dependencies: dependencies:
'@types/nprogress': 0.2.3 '@types/nprogress': 0.2.3
next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0) next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.74.1)
next: 14.0.4(@babel/core@7.24.5)(react-dom@18.2.0)(react@18.2.0)
nprogress: 0.2.0 nprogress: 0.2.0
prop-types: 15.8.1 prop-types: 15.8.1
react: 18.2.0 react: 18.2.0
@ -4486,11 +4488,11 @@ snapshots:
minimist: 1.2.8 minimist: 1.2.8
strip-json-comments: 2.0.1 strip-json-comments: 2.0.1
react-data-table-component@7.5.4(react@18.2.0)(styled-components@5.3.3): react-data-table-component@7.5.4(react@18.2.0)(styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0)):
dependencies: dependencies:
deepmerge: 4.3.1 deepmerge: 4.3.1
react: 18.2.0 react: 18.2.0
styled-components: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) styled-components: 5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0)
react-dom@18.2.0(react@18.2.0): react-dom@18.2.0(react@18.2.0):
dependencies: dependencies:
@ -4508,7 +4510,7 @@ snapshots:
dependencies: dependencies:
react: 18.2.0 react: 18.2.0
react-toastify@9.1.3(react-dom@18.2.0)(react@18.2.0): react-toastify@9.1.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0):
dependencies: dependencies:
clsx: 1.2.1 clsx: 1.2.1
react: 18.2.0 react: 18.2.0
@ -4753,14 +4755,14 @@ snapshots:
strip-json-comments@3.1.1: {} strip-json-comments@3.1.1: {}
styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0): styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0):
dependencies: dependencies:
'@babel/helper-module-imports': 7.24.3 '@babel/helper-module-imports': 7.24.3
'@babel/traverse': 7.24.5(supports-color@5.5.0) '@babel/traverse': 7.24.5(supports-color@5.5.0)
'@emotion/is-prop-valid': 0.8.8 '@emotion/is-prop-valid': 0.8.8
'@emotion/stylis': 0.8.5 '@emotion/stylis': 0.8.5
'@emotion/unitless': 0.7.5 '@emotion/unitless': 0.7.5
babel-plugin-styled-components: 2.1.4(@babel/core@7.24.5)(styled-components@5.3.3) babel-plugin-styled-components: 2.1.4(@babel/core@7.24.5)(styled-components@5.3.3(@babel/core@7.24.5)(react-dom@18.2.0(react@18.2.0))(react-is@16.13.1)(react@18.2.0))
css-to-react-native: 3.2.0 css-to-react-native: 3.2.0
hoist-non-react-statics: 3.3.2 hoist-non-react-statics: 3.3.2
react: 18.2.0 react: 18.2.0
@ -4773,9 +4775,10 @@ snapshots:
styled-jsx@5.1.1(@babel/core@7.24.5)(react@18.2.0): styled-jsx@5.1.1(@babel/core@7.24.5)(react@18.2.0):
dependencies: dependencies:
'@babel/core': 7.24.5
client-only: 0.0.1 client-only: 0.0.1
react: 18.2.0 react: 18.2.0
optionalDependencies:
'@babel/core': 7.24.5
supports-color@5.5.0: supports-color@5.5.0:
dependencies: dependencies:

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
# STOP! This .gitignore is probably not the .gitignore you are looking for. # STOP! This .dockerignore is probably not the .dockerignore you are looking for.
# The gitignore in the ROOT of the Docker context is the .gitignore that docker uses. # The dockerignore in the ROOT of the Docker context is the .dockerignore that docker uses.
# thus, see ../../.gitignore # We are using a monorepo and the docker build context is the root of this git repo.
# thus, see ../../.dockerignore

View File

@ -1,5 +0,0 @@
#!/bin/bash
. .env
chisel client --auth="${CHISEL_AUTH}" "${CHISEL_SERVER}" R:8900:localhost:1337

3
scripts/k8s-chisel-operator.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
kubectl apply -k https://github.com/FyraLabs/chisel-operator

View File

@ -2,10 +2,11 @@
source .env source .env
kubectl --namespace futureporn delete secret uwu-auth --ignore-not-found
kubectl --namespace futureporn create secret generic uwu-auth \
--from-literal=auth=${CHISEL_AUTH}
kubectl --namespace futureporn delete secret windmill-postgresql --ignore-not-found kubectl --namespace futureporn delete secret windmill-postgresql --ignore-not-found
# kubectl --namespace futureporn create secret generic windmill-postgresql \
# --from-literal=postgres-password=${WINDMILL_POSTGRES_PASSWORD}
## we do this so helm can adopt our pre-made secret @see https://github.com/helm/helm/pull/7649 ## we do this so helm can adopt our pre-made secret @see https://github.com/helm/helm/pull/7649
cat <<EOF | kubectl --namespace futureporn create -f- cat <<EOF | kubectl --namespace futureporn create -f-
--- ---

0
scripts/kind-with-local-registry.sh Normal file → Executable file
View File

View File

@ -0,0 +1,23 @@
#!/bin/bash
## restore
# kubectl -n futureporn exec postgres -- psql -U postgres -d futureporn_db -f - < "/home/cj/Documents/futureporn-meta/backups/2024-05-21_21-44-35-futureporn-db.psql"
# kubectl -n futureporn exec -it postgres -- bash -c "psql -U postgres futureporn_db -f /home/cj/Documents/futureporn-meta/backups/2024-05-21_21-44-35-futureporn-db.psql"
# kubectl -n futureporn exec -i postgres -- pg_restore -U postgres -d futureporn_db < /home/cj/Documents/futureporn-meta/backups/2024-05-21_21-44-35-futureporn-db.psql
# kubectl exec -i POD_NAME -- pg_restore -U USERNAME -C -d DATABASE < dump.sql
# kubectl -n futureporn cp /home/cj/Documents/futureporn-meta/backups/2024-05-29-futureporn_db-dev.psql postgres:/tmp/db.psql
# kubectl -n futureporn exec -i postgres -- pg_restore -U postgres -d futureporn_db /tmp/db.psql
# kubectl -n futureporn exec -ti db-postgresql-0 -- rm /tmp/db.psql
datestamp=$(date -u "+%Y%m%dT%H%M%SZ")
outputfilename="${datestamp}_development.psql"
outputfullpath="/tmp/${outputfilename}"
kubectl -n futureporn exec -i postgres -- pg_dump --file "${outputfullpath}" --port "5432" --username "postgres" --no-password --format=c --large-objects --verbose "futureporn_db"
echo "outputfilename=${outputfilename}, outputfullpath=${outputfullpath}"
kubectl -n futureporn cp "postgres:${outputfullpath}" "/home/cj/Documents/futureporn-meta/backups/${outputfilename}"

View File

@ -1,3 +1,5 @@
#!/bin/bash
## drop futureporn_db ## drop futureporn_db
kubectl -n futureporn exec postgres -- psql -U postgres --command "DROP DATABASE futureporn_db;" kubectl -n futureporn exec postgres -- psql -U postgres --command "DROP DATABASE futureporn_db;"
@ -24,6 +26,6 @@ kubectl -n futureporn exec postgres -- psql -U postgres --command "\
# kubectl exec -i POD_NAME -- pg_restore -U USERNAME -C -d DATABASE < dump.sql # kubectl exec -i POD_NAME -- pg_restore -U USERNAME -C -d DATABASE < dump.sql
kubectl -n futureporn cp /home/cj/Documents/futureporn-meta/backups/2024-05-21_21-44-35-futureporn-db.psql postgres:/tmp/db.psql kubectl -n futureporn cp /home/cj/Documents/futureporn-meta/backups/20240529T224110Z_development.psql postgres:/tmp/db.psql
kubectl -n futureporn exec -i postgres -- pg_restore -U postgres -d futureporn_db /tmp/db.psql kubectl -n futureporn exec -i postgres -- pg_restore -U postgres -d futureporn_db /tmp/db.psql
# kubectl -n futureporn exec -ti db-postgresql-0 -- rm /tmp/db.psql # kubectl -n futureporn exec -ti db-postgresql-0 -- rm /tmp/db.psql

View File

@ -9,8 +9,8 @@ dotenv(fn='.env')
# kubefwd all namespaces Tilt deploys to. # kubefwd all namespaces Tilt deploys to.
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')
v1alpha1.extension(name='kubefwd:config', repo_name='default', repo_path='kubefwd') # v1alpha1.extension(name='kubefwd:config', repo_name='default', repo_path='kubefwd')
# v1alpha1.extension_repo( # v1alpha1.extension_repo(
# name='default', # name='default',
@ -44,6 +44,7 @@ v1alpha1.extension(name='kubefwd:config', repo_name='default', repo_path='kubefw
# ] # ]
# ) # )
k8s_yaml(helm( k8s_yaml(helm(
'./charts/fp', './charts/fp',
values=['./charts/fp/values-dev.yaml'], values=['./charts/fp/values-dev.yaml'],
@ -77,29 +78,16 @@ docker_build(
# ) # )
load('ext://uibutton', 'cmd_button') load('ext://uibutton', 'cmd_button')
# @todo in the future we can add a button for seeding the db from scratch. # cmd_button('postgres:seed',
# this would be good for onboarding devs # argv=['sh', './scripts/postgres-seed.sh'],
# step 1 would be creating the db # resource='postgres',
# # icon_name='dataset',
# text='seed db with schema',
# step 2 is ??? # )
#
# set -eu
# # get k8s pod name from tilt resource name
# POD_NAME="$(tilt get kubernetesdiscovery "$resource" -ojsonpath='{.status.pods[0].name}')"
# kubectl exec "$POD_NAME" -- $command
cmd_button('postgres:seed',
argv=['sh', './scripts/postgres-seed.sh'],
resource='postgres',
icon_name='dataset',
text='seed db with schema',
)
cmd_button('postgres:restore', cmd_button('postgres:restore',
argv=['sh', './scripts/postgres-restore.sh'], argv=['sh', './scripts/postgres-restore.sh'],
resource='postgres', resource='postgres',
icon_name='cloud', icon_name='cloud_download',
text='restore db from backup', text='restore db from backup',
) )
cmd_button('postgres:drop', cmd_button('postgres:drop',
@ -108,7 +96,12 @@ cmd_button('postgres:drop',
icon_name='delete', icon_name='delete',
text='delete the database' text='delete the database'
) )
cmd_button('postgres:backup',
argv=['sh', './scripts/postgres-backup.sh'],
resource='postgres',
icon_name='download',
text='backup the database'
)
## Uncomment the following for fp/next in dev mode ## Uncomment the following for fp/next in dev mode
@ -120,7 +113,7 @@ docker_build(
dockerfile='d.next.dockerfile', dockerfile='d.next.dockerfile',
target='dev', target='dev',
build_args={ build_args={
'NEXT_PUBLIC_STRAPI_URL': 'http://strapi.futureporn.svc.cluster.local:1339' 'NEXT_PUBLIC_STRAPI_URL': 'https://strapi.piko.sbtp.xyz'
}, },
live_update=[ live_update=[
sync('./packages/next', '/app') sync('./packages/next', '/app')
@ -173,7 +166,6 @@ k8s_resource(
workload='next', workload='next',
port_forwards=['3000'], port_forwards=['3000'],
links=[ links=[
link('http://next.futureporn.svc.cluster.local:3000'),
link('https://next.piko.sbtp.xyz'), link('https://next.piko.sbtp.xyz'),
] ]
) )
@ -182,7 +174,6 @@ k8s_resource(
port_forwards=['1339'], port_forwards=['1339'],
links=[ links=[
link('http://localhost:1339/admin'), link('http://localhost:1339/admin'),
link('http://strapi.futureporn.svc.cluster.local:1339'),
link('https://strapi.piko.sbtp.xyz'), link('https://strapi.piko.sbtp.xyz'),
] ]
) )
@ -206,3 +197,4 @@ k8s_resource(
workload='pgadmin', workload='pgadmin',
port_forwards=['5050'] port_forwards=['5050']
) )