diff --git a/INSTALL.md b/INSTALL.md index c90889a9..7543924d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,109 +1,90 @@ -Mac OS ---- -Install Python Version Manager (pyenv) -see this site: https://opensource.com/article/19/5/python-3-default-mac - - brew install pyenv +# Contents -Install Python3 version and set as default (with pyenv) +* [Setup Database](#setup-database) +* [Install Python Libraries](#install-python-libraries) +* [Install redis-server and git](#install-redis-server-and-git) +* [Setup pyfedi](#setup-pyfedi) +* [Setup .env file](#setup-env-file) +* [Initialise Database and Setup Admin account](#initialise-database-and-setup-admin-account) +* [Run the app](#run-the-app) +* [Database Management](#database-management) +* [Keeping your local instance up to date](#keeping-your-local-instance-up-to=date) +* [Running PieFed in production](#running-piefed-in-production) +* [Pre-requisites for Mac OS](#pre-requisites-for-mac-os) +* [Notes for Windows (WSL2)](#notes-for-windows-wsl2) +* [Notes for Pip Package Management](#notes-for-pip-package-management) - pyenv install 3.8.6 - pyenv global 3.7.3 +
-Note.. -You may see this error when running `pip install -r requirements.txt` in regards to psycopg2: - - ld: library not found for -lssl - clang: error: linker command failed with exit code 1 (use -v to see invocation) - error: command 'clang' failed with exit status 1 +## Setup Database -If this happens try installing openssl... -Install openssl with brew install openssl if you don't have it already. - - brew install openssl - -Add openssl path to LIBRARY_PATH : - - export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ +#### Install postgresql 16 -Linux ---- -install these additional packages +For installation environments that use 'apt' as a package manager: -```sudo apt install python3-psycopg2 libpq-dev python3-dev redis-server``` +`sudo apt install ca-certificates pkg-config` +`wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -` +`sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'` +`sudo apt update` +`sudo apt install libpq-dev postgresql` + +#### Create new DB user + +Choose a username and password. To use 'pyfedi' for both: +`sudo -iu postgres psql -c "CREATE USER pyfedi WITH PASSWORD 'pyfedi';"` + +#### Create new database + +Choose a database name, owned by your new user. For a database called and owned by 'pyfedi': +`sudo -iu postgres psql -c "CREATE DATABASE pyfedi WITH OWNER pyfedi;"` + + + +## Install Python Libraries + +[Pre-requisites for Mac OS](#pre-requisites-for-mac-os) +[Notes for Windows (WSL2)](#notes-for-windows-wsl2) + +For installation environments that use 'apt' as a package manager: +`sudo apt install python3-pip python3-venv python3-dev python3-psycopg2` -Pip Package Management: ---- + -make sure you have 'wheel' installed: - ```pip install wheel``` +## Install redis-server and git -dump currently installed packages to file: - ```pip freeze > requirements.txt``` +For installation environments that use 'apt' as a package manager: +`sudo apt install redis-server` +`sudo apt install git` -install packages from a file: - ```pip install -r requirements.txt``` + -upgrade a package: - ```pip install --upgrade