All Projects → Scharkee → Netcore Postgres Oauth Boiler

Scharkee / Netcore Postgres Oauth Boiler

A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and NGINX for routing.

Projects that are alternatives of or similar to Netcore Postgres Oauth Boiler

Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+489.47%)
Mutual labels:  google, oauth2, oauth, reddit
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+105.26%)
Mutual labels:  https, letsencrypt, boilerplate, nginx
Angularmaterialfirebase
🔥 Full stack starter app with Angular 8, Material Design and Firebase (+ demo)
Stars: ✭ 229 (+301.75%)
Mutual labels:  google, oauth, boilerplate
Pow assent
Multi-provider authentication for your Pow enabled app
Stars: ✭ 236 (+314.04%)
Mutual labels:  google, oauth2, oauth
httpsbook
《深入浅出HTTPS:从原理到实战》代码示例、勘误、反馈、讨论
Stars: ✭ 77 (+35.09%)
Mutual labels:  letsencrypt, tls, https
Assent
Multi-provider framework in Elixir
Stars: ✭ 126 (+121.05%)
Mutual labels:  google, oauth2, oauth
Login With
Stateless login-with microservice for OAuth
Stars: ✭ 2,301 (+3936.84%)
Mutual labels:  google, oauth, reddit
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.
Stars: ✭ 1,026 (+1700%)
Mutual labels:  google, oauth2, oauth
Nginx Openid Connect
Reference implementation of OpenID Connect integration for NGINX Plus
Stars: ✭ 96 (+68.42%)
Mutual labels:  oauth2, oauth, nginx
letsencrypt-www
Probably the easiest way to create | renew | deploy certificate
Stars: ✭ 27 (-52.63%)
Mutual labels:  letsencrypt, tls, https
Certmagic
Automatic HTTPS for any Go program: fully-managed TLS certificate issuance and renewal
Stars: ✭ 3,864 (+6678.95%)
Mutual labels:  https, tls, letsencrypt
Ueberauth google
Google OAuth2 Strategy for Überauth.
Stars: ✭ 110 (+92.98%)
Mutual labels:  google, oauth2, oauth
External Auth Server
easy auth for reverse proxies
Stars: ✭ 189 (+231.58%)
Mutual labels:  oauth2, oauth, nginx
Greenlock
Automatic SSL renewal for NodeJS
Stars: ✭ 30 (-47.37%)
Mutual labels:  https, tls, letsencrypt
Ngx Oauth
OAuth 2.0 proxy for nginx written in Lua.
Stars: ✭ 146 (+156.14%)
Mutual labels:  oauth2, oauth, nginx
docker-ssl-reverse-proxy
Easy-to-use auto-SSL reverse proxy as a Docker container based on Caddy and Let’s Encrypt
Stars: ✭ 22 (-61.4%)
Mutual labels:  letsencrypt, tls, https
Encrypted Dns
Configuration profiles for DNS HTTPS and DNS over TLS for iOS 14 and MacOS Big Sur
Stars: ✭ 455 (+698.25%)
Mutual labels:  google, https, tls
Guacamole Install Rhel 7
Apache Guacamole installation bash script for RHEL 7 and CentOS 7 including options for Nginx, HTTPS, SSL, LDAP, Let's Encrypt certificates and more
Stars: ✭ 174 (+205.26%)
Mutual labels:  https, letsencrypt, nginx
Badssl.com
🔒 Memorable site for testing clients against bad SSL configs.
Stars: ✭ 2,234 (+3819.3%)
Mutual labels:  https, tls, nginx
IdentityServer4.PhoneNumberAuth
Sample passwordless phone number authentication using OAuth in ASP.NET Core 2.2
Stars: ✭ 83 (+45.61%)
Mutual labels:  oauth, oauth2, net-core

netcore-postgres-oauth-boiler

Status

A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and Nginx for routing.

Demo website.

Features

  • Vanilla .NET Core Server Setup:
    • Razor pages, upholstered with the Materialize css toolkit
    • Server -> client data rendering demo
    • Native Entity Framework database interface, with PostgreSQL
    • Asynchronous design
    • Auth gated route examples
  • User authentication via:
    • Regular email/password
    • Google
    • Github
    • Reddit
  • Auth method merging, linking and unlinking of social auth accounts
  • TLS/HTTPS:
    • Automatic certificate generation powered by Let's Encrypt
    • Hosting modes:
      • Self hosted mode (443/80 port access required)
      • Simple mode (just the Dockerfile, http only), for use with reverse proxy configurations
  • A lightweight PostgreSQL management tool included - Adminer

Configuration

  1. Open the docker-compose file you're going to use (depends on your platform) and set CERTBOT_EMAIL to your email for Let's Encrypt certificate generation. Moreover, set DOMAIN to your domain name. The domain should point to the IP of the machine you're running this project on.
  2. The file appsettingsExample.json needs to be renamed to appsettings.json with your own OAuth keys:
  • The process for obtaining a Google key is described here.
  • The method to create a Github app in order to get an API key is described here.
  • The process for creating a Reddit app in order to get an API key is described here.

Running the boilerplate

  • Standalone:
# clone the repo
$ git clone https://github.com/Scharkee/netcore-postgres-oauth-boiler.git
$ cd netcore-postgres-oauth-boiler
# perform configuration...

# generate TLS certificates and run on ports 80/443
# choose between docker-compose-linux.yml and docker-compose-windows.yml
$ docker-compose -f docker-compose-linux.yml up

For an explanation of the docker-compose file separation, take a look at Running on Windows.

  • Through Visual Studio:
  1. Launch Visual Studio
  2. Right-click on the docker-compose section in the Solution Explorer, and click Set as Startup Project
  3. Select either Debug or Release at the top and click the Docker Compose button to run.

Overview of services

  1. Boilerplate runs on port 3000, and is accessible through the configured domain with managed TLS
  2. PostgreSQL runs on 5432
  3. Adminer (for managing PostgreSQL) runs and can be accessed on port 8080 (localhost:8080 in a browser).
  4. Nginx runs on ports 80 and 443. Make sure no servers/web hosts/etc. are using those ports.

Running the boilerplate independently

If you're behind Nginx or a similar reverse proxy setup, you can either:

  1. Adjust the compose file so it no longer contains the Nginx container
  2. Run only the boilerplate (you will have to run PostgreSQL separately):
    • Adjust the DefaultConnection in appsettings.json in accordance with your database
    • run docker build . --tag boiler
    • run docker run boiler -p 3000:80 --name boiler

Running on Windows

Docker on Windows has an open issue with local volume mapping permissions, which results in PostgreSQL not being able to write to a (relative) local directory. Thus, when running on Windows (via run.sh), an external volume is created, which is managed by Docker.

Moreover, if you encounter a PR_END_OF_FILE_ERROR when trying to load the website, try executing:

$ docker exec nginx bash -c "mv /etc/nginx/conf.d/boiler.conf{.nokey,} ; nginx -s reload"

This seems to be a symlink issue with Windows Docker containers as well. After renaming the file once, it does not need to be touched anymore (unless you purge the nginx container).

Information & Sources

Contribution & Support

Submit bugs and requests through the project's issue tracker:

Issues

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].