Coder Social home page Coder Social logo

nnr's Introduction

No Nonsense Recipes

Just recipes, no nonsense

Built with Cookiecutter Django

Black code style

:License: MIT

https:/nononsense.recipes is an ad-free, subscription recipe website.

Deploying

Setting up a fresh Ubuntu server. This uses scripts found in homebin

Install prerequisites

Add the postgresql repositories and use a newer version than whatever apt has. See here

Create a superuser in postgres for the main server user (probably 'ubuntu')

sudo su postgres
psql postgres
CREATE USER ubuntu WITH SUPERUSER;
\q
exit

Make sure TCP/IP connections with username/password are enabled for postgres. For standard install edit files in /etc/postgresql/15/main (replace 15 with postgresql version used) Edit postgres.conf to enable TCP/IP and pg_hba.conf to set allowed for nnr user.

Add the nginx, redis, supervisor and utility scripts

sudo apt install redis, supervisor, nginx
git clone [email protected]:ggetzie/homebin.git

Create ssh key and link to github

See here

Install Python 3.11+

See here

Clone the repository, copy over .env file

# on server
cd /usr/local/src/
git clone --recurse-submodules [email protected]:ggetzie/nnr.git

# on local
scp -i "nnr_server_key.pem" nnr_prod_keys ubuntu@nnr-server:/usr/local/src/nnr/.env

Create a user

setup_user nnr_user

Export environment variables from .env file

source export_dotenv nnr

Setup Database

setup_db $DB_USER $DB_NAME $nnr_DB_PW
psql nnr_db < nnr_db_prod.pgsql

Link supervisor and nginx configurations

link_srv nnr production

Enable ssl with certbot

See instructions Note AWS Lightsail does not enable port 443 by default. Go to the networking tab in the Lightsail dashboard to open it.

Install go and build recipe of the day

update_go 1.19.3
cd /usr/local/src/nnr/awslambda/rotd
mkdir build
go build -o build/rotd rotd.go

configure cron job

Note server time is UTC. Run rotd once per day at 7am EST (UTC-5)

m h  dom  mon  dow  command
0 12 *    *    *    /usr/local/src/nnr/recipes/management/rotd.sh

nnr's People

Contributors

dependabot[bot] avatar ggetzie avatar

Watchers

 avatar

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.