Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Latest commit

 

History

History
130 lines (86 loc) · 4.27 KB

README.md

File metadata and controls

130 lines (86 loc) · 4.27 KB

#vss365 today

Get the latest #vss365 prompt.

Background

#vss365 today is a web app designed to facilitate the delivery of the Twitter-based #vss365 writing prompt. In addition to providing email-based daily notifications, the service also provides a 100% complete archive for every prompt ever used since the inception, with multiple ways to search and consume the data.

Components

#vss365 today is the combination of multiple components, each designed to falicitate development, duties, and deployment. The following is a brief listing of each component and their duty.

  • Web app: A Flask-powered web interface for viewing and downloading prompts.

  • REST API: A Flask-based REST API that handles storing, serving, and searching the prompts.

  • Finder background process: A background process that runs on a regulare schedule to find and save the prompt, as well as trigger daily email notifications.

  • MariaDB database: The primary database for storing all records and information.

  • Automatic database backups: Because data backups are important. Process is set to run at midnight UTC. Backups are located in the /backup directory (see below for details).

Development

You will need to install the following software to run the entire platform on your computer:

It is recommended to install the following software to facilitate development:

Each component may additionally have its own specific requirements. Check the specific component readme for details.

Deployment

This repo contains the required files to deploy #vss365 today on a web server.

First-time deployment

  1. You will need the following software installed on your server:

  2. Ensure you are following this structure when downloading all component setup:

    /var/www/
       vss365today/
          api/
          backup/
          db/
          finder/
          secrets/
          server/
          static/
             downloads/
             images/
                temp/
          web/
    
  3. Run mkdir -p /var/www/vss365today && cd /var/www/vss365today

  4. Run git clone https://github.com/vss365today/server.git && cd server

  5. Run chmod u+x ./init.sh && ./init.sh to set up the required files, folders, user account configurations, and latest code from git.

  6. Place all secret keys for each component in the vss365today/secrets folder. The vss365today/db folder will be used to persist all database files and data.

  7. Run chmod u+x ./build-containers.sh && ./build-containers.sh to create a fresh build of all component containers.

  8. Run chmod u+x ./update-caddy.sh && ./update-caddy.sh to place the Caddyfile file in the proper location on the server.

  9. Start the Caddy server using systemctl enable caddy.service && systemctl start caddy.service.

  10. Run docker-compose up -d to start the entire stack.

Component update deployment

  1. Download the latest source for each updated component.

  2. Run ./build-containers.sh to create a fresh build of all component containers, or manually rebuild just the containers needed.

  3. To restart the entire stack, run docker-compose down && docker-compose up -d

  4. To restart an individual component, run docker-compose down && docker-compose up -d <component_name>

  5. You will want to occasionally run docker system prune -f to remove all old container images.

Server configuration update deployment

  1. Make all required changes in the Caddyfile.

  2. Run ./update-caddy.sh to place the Caddyfile file in the proper location on the server.

  3. Run systemctl reload caddy to make the changes take effect.

Creation

2019-2022 Caleb Ely

MIT