Skip to content

Commit

Permalink
Squashed history
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-signal committed Jan 5, 2024
0 parents commit 7f9392a
Show file tree
Hide file tree
Showing 19 changed files with 5,883 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./workers
steps:
- uses: actions/checkout@v3
- name: Use Node.js version
uses: actions/setup-node@v3
with:
node-version: 20.10.0
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run build
- run: npm test
619 changes: 619 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# storage-manager-private

This repository provides services that are used by [Signal-Server](https://github.com/signalapp/Signal-Server) to manage the contents of object stores that back Signal's CDN system. These functions allow the server to delete objects, move objects between different buckets, and list objects.


# License

Copyright 2024 Signal Messenger, LLC

Licensed under the [AGPLv3](LICENSE)
13 changes: 13 additions & 0 deletions workers/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
34 changes: 34 additions & 0 deletions workers/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"semi": [2, "always"],
"quotes": ["error", "single"],
"no-unused-vars": "off",
"prefer-const": ["error", {"destructuring": "all"}],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
176 changes: 176 additions & 0 deletions workers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Logs

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

# 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/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# 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
.cache

# 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.\*

# wrangler project

.dev.vars
.wrangler/

# webstorm

.idea
1 change: 1 addition & 0 deletions workers/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.10.0
6 changes: 6 additions & 0 deletions workers/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 140,
"singleQuote": true,
"semi": true,
"useTabs": true
}
37 changes: 37 additions & 0 deletions workers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Overview

This directory provides a storage-manager built on [Cloudflare workers](https://developers.cloudflare.com/workers/) that manages objects stored on [Cloudflare R2](https://developers.cloudflare.com/r2/)

# Building
You'll need [Node.js](https://nodejs.org/). If you use [nvm](https://github.com/creationix/nvm) run
```
nvm use
```

To install dependencies,
```
npm install
```

In order to deploy to Cloudflare or use non-local development mode, use the [`wrangler`](https://developers.cloudflare.com/workers/wrangler/install-and-update/) utility. Follow those instructions to authenticate with your Cloudflare account.

# Testing

To run a development server you can interact with over `localhost`:
```
npx wrangler dev
```

To run unit tests,
```
npm test
```

# Deploying

## One time setup
Create R2 buckets and update the bindings in `wrangler.toml`, then:

```
wrangler deploy -e <staging|production>
```
Loading

0 comments on commit 7f9392a

Please sign in to comment.