Giter Club home page Giter Club logo

yew-actix-template's Introduction

Docker + Actix + Yew Full Stack Template

IMAGE ALT TEXT

๐Ÿ‘จโ€๐Ÿ’ป YouTube videos

  1. Full Stack Rust App Template using Yew + Actix! https://youtu.be/oCiGjrpGk4A
  2. Add Docker to your full stack Rust app Actix + Yew App https://youtu.be/YzjFk694bFM
  3. SERVER SIDE OAUTH with Actix Web, Yew and Rust (analyzing GRAMMARLY) https://youtu.be/Wl8oj3KYqxM
  4. I added a Database To Our YEW ACTIX Template To Store Users And OAuth Tokens. https://youtu.be/ENgMHIQk7T8

๐Ÿ‘‰ Join our Discord Community

You can join our Discord Community, here is the invite link.

๐Ÿ‘จโ€๐Ÿ’ป Project Structure

Contains 3 sub-projects

  1. actix-api: actix web server
  2. yew-ui: Yew frontend
  3. types: json serializable structures used to communicate the frontend and backend.

Dockerized workflow

  1. Install docker
  2. Run one of the supported make commands
make test
make up
make down
make build

OAuth2

This template supports OAuth2 via yew-auth, to configure client_id and other secrets, read the docker-compose => https://github.com/security-union/yew-actix-template/blob/main/docker/docker-compose.yaml

Copy docker/.env-sample to docker/.env and fill in the variables. Assuming that you want to use Google as your OAuth provider, you will need to generate OAuth 2.0 credentials using a Google Cloud developer account.

Once you have a Google Cloud developer account, you can generate the values for the OAUTH_CLIENT_ID and OAUTH_SECRET variables using the following steps: Setting up OAuth 2.0. As part of registering your web app with Google Cloud to associate with the OAuth credentials, you will need to configure your app to request the following scopes: email, profile, and openid.

yew-actix-template's People

Contributors

darioalessandro avatar griffobeid avatar resnickmicah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yew-actix-template's Issues

RUSTSEC-2023-0018: Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU)

Race Condition Enabling Link Following and Time-of-check Time-of-use (TOCTOU)

Details
Package remove_dir_all
Version 0.5.3
URL XAMPPRocky/remove_dir_all@7247a8b
Date 2023-02-24
Patched versions >=0.8.0

The remove_dir_all crate is a Rust library that offers additional features over the Rust
standard library fs::remove_dir_all function.

It was possible to trick a privileged process doing a recursive delete in an
attacker controlled directory into deleting privileged files, on all operating systems.

For instance, consider deleting a tree called 'etc' in a parent directory
called 'p'. Between calling remove_dir_all("a") and remove_dir_all("a")
actually starting its work, the attacker can move 'p' to 'p-prime', and
replace 'p' with a symlink to '/'. Then the privileged process deletes 'p/etc'
which is actually /etc, and now your system is broken. There are some
mitigations for this exact scenario, such as CWD relative file lookup, but
they are not guaranteed - any code using absolute paths will not have that
protection in place.

The same attack could be performed at any point in the directory tree being
deleted: if 'a' contains a child directory called 'etc', attacking the
deletion by replacing 'a' with a link is possible.

The new code in this release mitigates the attack within the directory tree
being deleted by using file-handle relative operations: to open 'a/etc', the
path 'etc' relative to 'a' is opened, where 'a' is represented by a file
descriptor (Unix) or handle (Windows). With the exception of the entry points
into the directory deletion logic, this is robust against manipulation of the
directory hierarchy, and remove_dir_all will only delete files and directories
contained in the tree it is deleting.

The entry path however is a challenge - as described above, there are some
potential mitigations, but since using them must be done by the calling code,
it is hard to be confident about the security properties of the path based
interface.

The new extension trait RemoveDir provides an interface where it is much
harder to get it wrong.

somedir.remove_dir_contents("name-of-child").

Callers can then make their own security evaluation about how to securely get
a directory handle. That is still not particularly obvious, and we're going to
follow up with a helper of some sort (probably in the fs_at crate). Once
that is available, the path based entry points will get deprecated.

In the interim, processes that might run with elevated privileges should
figure out how to securely identify the directory they are going to delete, to
avoid the initial race. Pragmatically, other processes should be fine with the
path based entry points : this is the same interface std::fs::remove_dir_all
offers, and an unprivileged process running in an attacker controlled
directory can't do anything that the attacker can't already do.

See advisory page for additional details.

RUSTSEC-2023-0001: reject_remote_clients Configuration corruption

reject_remote_clients Configuration corruption

Details
Package tokio
Version 1.19.2
URL GHSA-7rrj-xr53-82p7
Date 2023-01-04
Patched versions >=1.18.4, <1.19.0,>=1.20.3, <1.21.0,>=1.23.1
Unaffected versions <1.7.0

On Windows, configuring a named pipe server with pipe_mode will force ServerOptions::reject_remote_clients as false.

This drops any intended explicit configuration for the reject_remote_clients that may have been set as true previously.

The default setting of reject_remote_clients is normally true meaning the default is also overriden as false.

Workarounds

Ensure that pipe_mode is set first after initializing a ServerOptions. For example:

let mut opts = ServerOptions::new();
opts.pipe_mode(PipeMode::Message);
opts.reject_remote_clients(true);

See advisory page for additional details.

RUSTSEC-2023-0034: Resource exhaustion vulnerability in h2 may lead to Denial of Service (DoS)

Resource exhaustion vulnerability in h2 may lead to Denial of Service (DoS)

Details
Package h2
Version 0.3.15
URL hyperium/hyper#2877
Date 2023-04-14
Patched versions >=0.3.17

If an attacker is able to flood the network with pairs of HEADERS/RST_STREAM frames, such that the h2 application is not able to accept them faster than the bytes are received, the pending accept queue can grow in memory usage. Being able to do this consistently can result in excessive memory use, and eventually trigger Out Of Memory.

This flaw is corrected in hyperium/h2#668, which restricts remote reset stream count by default.

See advisory page for additional details.

RUSTSEC-2023-0023: `openssl` `SubjectAlternativeName` and `ExtendedKeyUsage::other` allow arbitrary file read

openssl SubjectAlternativeName and ExtendedKeyUsage::other allow arbitrary file read

Details
Package openssl
Version 0.10.45
URL sfackler/rust-openssl#1854
Date 2023-03-24
Patched versions >=0.10.48

SubjectAlternativeName and ExtendedKeyUsage arguments were parsed using the OpenSSL
function X509V3_EXT_nconf. This function parses all input using an OpenSSL mini-language
which can perform arbitrary file reads.

Thanks to David Benjamin (Google) for reporting this issue.

See advisory page for additional details.

RUSTSEC-2023-0022: `openssl` `X509NameBuilder::build` returned object is not thread safe

openssl X509NameBuilder::build returned object is not thread safe

Details
Package openssl
Version 0.10.45
URL sfackler/rust-openssl#1854
Date 2023-03-24
Patched versions >=0.10.48

OpenSSL has a modified bit that it can set on on X509_NAME objects. If this
bit is set then the object is not thread-safe even when it appears the code is
not modifying the value.

Thanks to David Benjamin (Google) for reporting this issue.

See advisory page for additional details.

No git tags

Hi, and great content btw.

I've noticed that you don't use tags at all that allow people to see just the content that has changed for specific videos. For example, after watching the first video, I would like to see the code that you used and showed in that video. Unfortunately, after going to the github link here, I can only see the whole codebase created from ALL the videos. This makes it difficult to understand what is related to just starting up actix and yew (as seen in video 1) and what is for all the other content in later videos.

Using git tags would allow me to grab a specific version matching the video I am watching. It would also allow me to diff between versions to see what changed too.

Would it be possible to add tags that synchronise with the released videos on youtube? Thanks.

unknown shorthand flag: 'f' in -f

I get the error in the title when running make up. Ubuntu 22.04 LTS.

sudo apt install docker
...
~/repos/yew-actix-template$ make up
docker compose -f docker/docker-compose.yaml up
unknown shorthand flag: 'f' in -f
See 'docker --help'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.