Run OpenTech.News locally
Overview
OpenTech.news has several components: - Fetch news feeds from RSS & save to database - Create a newsfeed as a markdown file - Build an HTML site and upload it to AWS S3 to be served on the site
Get the source code
git clone https://codeberg.org/jro/OpenTechNews.git
Setup Python
Get Python virtual environment setup:
# On MacOS
python3 -m venv venv-mac
source venv-mac/bin/activate
# On Linux
python -m venv venv-linux
source venv-linux/bin/activate
pip install -r requirements.txt
# Upgrade Pip
pip install --upgrade pip
(?) Why separate virtual environments for Mac/Linux? We often share the files using SyncThing, in order to seamlessly develop with a Mac, and then work on Linux - the separate virtual environments make this easy to share the folder, and use the right one for the operating system.
Setup Credentials
Note: You will need to create these ENV files, as they are note in the source code for security reasons.
Setup AWS credentials:
Optional: Run aws configure
:
source _SECRETS/set_aws.env
Setup Supabase credentials:
source _SECRETS/set_supabase.env
How to run locally
Load newsfeeds into database:
python app/load-newsfeed-stories-to-database.py
Build feed as markdown:
python app/build_homepage-feed-page_markdown.py
Build HTML site and sync to AWS S3 bucket
source app/crons/build-update-site.sh