Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account frontend #12

Draft
wants to merge 29 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
83715ae
Merge pull request #2 from PresidentialParadise/feat/db_conn
Druue Oct 23, 2021
55cd93a
Added CI
Druue Oct 23, 2021
671a849
Fixed linting
Druue Oct 23, 2021
ee8e121
Merge pull request #4 from PresidentialParadise/feat/ci
Druue Oct 23, 2021
1e72e8d
Added endpoints for recipe retrieval / manipulation:
Druue Oct 24, 2021
e415b16
Added user endpoints
Druue Oct 24, 2021
cbb8cf3
Merge pull request #5 from PresidentialParadise/feat/endpoints
Druue Oct 24, 2021
30665f4
cleanup
Druue Oct 25, 2021
8ca8a6c
add docs
jdonszelmann Nov 1, 2021
44bebc8
add logging and remove requirement for .env
jdonszelmann Nov 1, 2021
16aa507
switch to tracing
jdonszelmann Nov 1, 2021
7ec12ab
format and newlines at eof
jdonszelmann Nov 1, 2021
c402536
Merge pull request #7 from jonay2000/remove-dotenv-requirement
Nov 1, 2021
f795c84
initial auh
jdonszelmann Nov 1, 2021
dcaec11
add authentication routes
jdonszelmann Nov 1, 2021
7abb7b7
revoke expired tokens
jdonszelmann Nov 1, 2021
9a5df4d
remove yarn.lock
jdonszelmann Nov 1, 2021
1626373
Merge branch 'auth' of github.com:PresidentialParadise/The-Big-Cheese…
jdonszelmann Nov 1, 2021
59abc28
document envvars
jdonszelmann Nov 1, 2021
eb2dc2f
initial doctests
jdonszelmann Nov 1, 2021
7cfaff5
auth tests
jdonszelmann Nov 1, 2021
96e7d97
add tests to ci
jdonszelmann Nov 1, 2021
0ab0333
fix fmt and clippy
jdonszelmann Nov 1, 2021
83cd5d3
fix clippy
jdonszelmann Nov 1, 2021
6742563
sanitize user output, and disallow non admin users to set others to a…
jdonszelmann Nov 2, 2021
f1b9936
initial frontend
jdonszelmann Nov 3, 2021
87879ac
fix pr issues
jdonszelmann Nov 3, 2021
34efb11
Merge branch 'sanitize-routes' of github.com:PresidentialParadise/The…
jdonszelmann Nov 3, 2021
9aa84db
initial frontend
jdonszelmann Nov 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Docker

# GHA Workflow for building and publishing the docker container with layer caching
# It is based on this helpful article: https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching

on:
push:
tags: ["*"]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: registry.xirion.net

jobs:
publish_server:
runs-on: ubuntu-latest
env:
working-directory: ./server
IMAGE_NAME: library/the-big-cheese
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

# This is the a separate action that sets up buildx runner
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# Use GHA caching
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
# Key is named differently to avoid collision
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx

# Login in to the registry
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: penultimo
password: ${{ secrets.XIRION_REGISTRY_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
# Note the mode=max here
# More: https://github.com/moby/buildkit#--export-cache-options
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
83 changes: 83 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
on: [push, pull_request]

name: Rust

defaults:
run:
working-directory: server

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
TEST_DB_URI: "mongodb://localhost:27017"
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.4

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path server/Cargo.toml

check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path server/Cargo.toml

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path server/Cargo.toml --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path server/Cargo.toml -- -W clippy::pedantic -D warnings
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
.idea
20 changes: 0 additions & 20 deletions client/.eslintrc.cjs

This file was deleted.

8 changes: 4 additions & 4 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/node_modules/
/public/build/

.DS_Store
node_modules
/build
/.svelte-kit
/package
yarn.lock
9 changes: 0 additions & 9 deletions client/.prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions client/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["svelte.svelte-vscode"]
}
38 changes: 0 additions & 38 deletions client/README.md

This file was deleted.

Loading