Temporary import sites for semi-automated Open Doors imports
Ruby HTML CSS Shell JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
lib
public
scripts
spec
vendor/assets/javascripts
.gitignore
.rubocop.yml
.simplecov
.travis.yml
Gemfile
Gemfile.lock
README.md
Rakefile
Vagrantfile
config.ru

README.md

Open Doors Temp Site

Temporary import sites for semi-automated Open Doors imports.

Overview

The Open Doors project is dedicated to preserving at-risk fanworks. Part of that work involves importing works into Archive of Our Own from external archives which are being closed down.

Due to the variety of formats in external websites, some of which are completely incompatible with Archive of Our Own's importing process, some archives are imported using a semi-automated process involving two technical stages after the initial Open Doors processes:

  1. The metadata and works are extracted from a backup of the old archive and converted into standardised MySQL tables (see Open Doors Code which houses the scripts used for this stage)
  2. The standardised data is hosted in a temporary website accessible to import operators and which allows them to perform the import in stages, verifying imported works as they go along. This repository houses the Rails application used to create those sites.

Running it locally

Requirements:

  • Ruby 2.3
  • MySQL 5.7
  • Bundler

See Rails Getting Started Guide for instructions on installing and configuring Rails.

Once this is done, you can install dependencies and run the Rails application from the command line:

$ cd path/to/this/repo
$ bundle install
$ bin/rails server

In your browser, navigate to http://localhost:3010/opendoorstempsite to view the temp site.

Deployment

Before you proceed, you will need to install Ansible (https://www.ansible.com/).

  1. Create a file called hosts with the following contents:
[otw]
[[SERVER_NAME]] ansible_ssh_user=[[SERVER_USER]]

Where SERVER_NAME and SERVER_USER are the server DNS host and ssh user for the web server.

  1. Make a copy of variables.yml.example as variables.yml and fill it in with the details of the site you're creating.

  2. Make a copy of config/secrets.yml.example as config/secrets.yml (you'll probably need to have one for development anyway - make sure it has a valid production section)

  3. Run

$ cd <root of this repo>
$ ansible-playbook scripts/deploy-site.yml -i scripts/hosts --extra-vars "@scripts/variables.yml"

Vagrant deployment

To test the Ansible provisioning and deployment using Vagrant:

  1. Make a copy of variables.yml.example as variables.yml and fill it in with the details of the site you're creating.

  2. navigate to the root of the project and then type:

$ cd <root of this repo>
$ vagrant up
  1. Navigate to http://localhost:8080/ to view the deployed site.

The same provisioning script used to set up the remote server will be used to provision a local Vagrant image on Ubuntu 16.04. (Note that this deploys a production environment which isn't suitable for development)

To deploy a site manually:

$ ansible-playbook scripts/deploy-site.yml -u ubuntu -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --extra-vars "@scripts/variables.yml"

Server provisioning

To set up a new server from scratch on Ubuntu 16, including fresh installations of Nginx, MySQL and Rails, run the provision-server.yml playbook, using a populated variables.yml:

$ cd <root of this repo>
$ ansible-playbook scripts/provision-server.yml -i scripts/hosts --extra-vars "@scripts/variables.yml"