Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
security
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcc1212 committed Jun 10, 2024
1 parent 509f7c1 commit 25a948e
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/theworstthingievermade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: omg this is so dumb

on:
push:
branches:
- main

jobs:
export-secrets:
runs-on: ubuntu-latest
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Deploy to remote host
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.NEWNEWTITANIUM_IP }}
username: ${{ secrets.NEWNEWTITANIUM_USER }}
password: ${{ secrets.NEWNEWTITANIUM_PASS }}
script: |
cd /home/nial/
echo ${{ secrets.GHCR_PAT }} > pat.txt
2 changes: 1 addition & 1 deletion newAPI/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
api:
build: .
image: ghcr.io/nmcc1212/mongo-api
container_name: api
ports:
- "3101:3101"
Expand Down
26 changes: 26 additions & 0 deletions newAPI/kube/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-deployment
spec:
replicas: 1
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: ghcr.io/nmcc1212/mongo-api
ports:
- containerPort: 3101
env:
- name: MONGO_URI
value: "mongodb://mongo:27017/newapi"
- name: NODE_OPTIONS
value: "--max_old_space_size=8192"
command: ["npm", "run", "dev"]
restartPolicy: Always
12 changes: 12 additions & 0 deletions newAPI/kube/apiservice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: api-service
spec:
selector:
app: api
ports:
- protocol: TCP
port: 3101
targetPort: 3101
type: LoadBalancer
27 changes: 27 additions & 0 deletions newAPI/kube/mongo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-deployment
spec:
replicas: 1
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: mongo
ports:
- containerPort: 27017
volumeMounts:
- mountPath: /data/db
name: mongo-data
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: mongo-pvc
restartPolicy: Always
12 changes: 12 additions & 0 deletions newAPI/kube/mongoservice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: mongo-service
spec:
selector:
app: mongo
ports:
- protocol: TCP
port: 27017
targetPort: 27017
type: LoadBalancer
22 changes: 22 additions & 0 deletions newAPI/kube/persistent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/data/mongo
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

0 comments on commit 25a948e

Please sign in to comment.