Skip to content

Commit

Permalink
web(microbuns): add challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
kgeorgiou committed Apr 28, 2024
1 parent 46b7dc9 commit a394996
Show file tree
Hide file tree
Showing 36 changed files with 4,090 additions and 0 deletions.
28 changes: 28 additions & 0 deletions web/microbuns/challenge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Microbuns"
author: "koks"
category: web

description: |
I may be silicon but I can stil stuff my RAM with buns and appreciate poetry.
value: 500
type: dynamic_docker
extra:
initial: 500
minimum: 100
decay: 25
redirect_type: http
compose_stack: !filecontents docker-compose.yml

flags:
- CCSC{CybeR_r3alms_and_Anc1ent_v0w5}

files:
- "public/microbuns.zip"

tags:
- web
- medium

state: visible
version: "0.1"
14 changes: 14 additions & 0 deletions web/microbuns/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
backend-service:
# image: ghcr.io/cybermouflons/ccsc2024/microbuns-backend-service:latest
build: ./setup/backend-service/
ports:
- 8080:8080
users-service:
# image: ghcr.io/cybermouflons/ccsc2024/microbuns-users-service:latest
build: ./setup/users-service/
haiku-service:
# image: ghcr.io/cybermouflons/ccsc2024/microbuns-haiku-service:latest
build: ./setup/haiku-service/

Empty file added web/microbuns/public/.gitkeep
Empty file.
Binary file added web/microbuns/public/microbuns.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions web/microbuns/setup/backend-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.dockerignore
Dockerfile*
docker-compose*
app/db.sqlite
app/node_modules
app/.gitignore
25 changes: 25 additions & 0 deletions web/microbuns/setup/backend-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1.1-slim as base

# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY ./app/package.json ./app/bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

# copy production dependencies and source code into final image
FROM base AS release
COPY ./app /app
COPY --from=install /temp/prod/node_modules /app/node_modules

WORKDIR /app

# run the app
USER bun

EXPOSE 8080

ENTRYPOINT [ "bun", "run", "--watch", "index.ts" ]
175 changes: 175 additions & 0 deletions web/microbuns/setup/backend-service/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
15 changes: 15 additions & 0 deletions web/microbuns/setup/backend-service/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# backend-service

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
Binary file added web/microbuns/setup/backend-service/app/bun.lockb
Binary file not shown.
Loading

0 comments on commit a394996

Please sign in to comment.