Skip to content

Commit

Permalink
added some details to docker install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Big Jimmy authored and Big Jimmy committed Aug 26, 2024
1 parent 91d2cd7 commit 098597c
Showing 1 changed file with 56 additions and 35 deletions.
91 changes: 56 additions & 35 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ The codespace includes Mailhog, which will trap any emails sent by MyRadio. To s
click the Local Address next to port 8025 in the Ports panel.

## Docker Install

If you have Docker on your system, use Docker Compose to set up an environment.
Simply run `docker compose up -d`, and visit "https://localhost:4443/myradio/".
Simply run `docker compose up -d` and visit "https://localhost:4443/myradio/".

If you encounter an error with autoload.php:
find the id of your myradio container using `docker dontainer ls`
enter a bash session with `docker exec -it [myradioid] bash`
then in this session run `composer install`
finally exit the session by running `exit`

## Vagrant Install

MyRadio comes with a Vagrantfile based on Ubuntu 19.10.
If you have [Vagrant](https://www.vagrantup.com) installed and want to get
developing or playing right away, just run `vagrant up` and a few minutes
Expand All @@ -43,8 +51,9 @@ so be sure to never run this in a production environment, or remove the
permission before doing so.

## Uncontained Install

Install Apache2, PHP, Composer and PostgreSQL on your prefered Unix-based distro.
Or Windows, if you're into that.
Or Windows, if you're into that.
MyRadio has been tested with Ubuntu and FreeBSD.

cd to your MyRadio installation and run `composer install`
Expand Down Expand Up @@ -74,6 +83,7 @@ Alias /api /usr/local/www/MyRadio/src/PublicAPI
Restart Apache2, go to http://hostname/myradio

To make a new postgresql server, run the following after:

```
pg_createcluster [YOUR_POSTGRES_VERSION] myradio
su postgres
Expand All @@ -85,36 +95,44 @@ CREATE DATABASE myradio WITH OWNER=myradio;
# Post-Installation

## Myradio Setup

CONNECT:
- Open up "https://localhost:4443/myradio/" in a browser
- [Use Chrome as this often fails to run on Firefox]
- It will say "connection not private" so press "advanced" and then "proceed"

- Open up "https://localhost:4443/myradio/" in a browser
- [Use Chrome as this often fails to run on Firefox]
- It will say "connection not private" so press "advanced" and then "proceed"

DATABASE:
- On the intro screen press "Click here to continue"
- Enter the database details (see Default Credentials) and press Next
- Press "run task", wait a few seconds and then press "run task" again.
- [This method is a workaround for a slight bug in how we build the database]


- On the intro screen press "Click here to continue"
- Enter the database details (see Default Credentials) and press Next
- Press "run task", wait a few seconds and then press "run task" again.
- [This method is a workaround for a slight bug in how we build the database]

USER:
- [Here you can make config changes but the defaults are autofilled]
- Press "complete starting set", scroll and press "save and continue"
- Input any first and last name, an email (NOT an @york.ac.uk email) and a password
- [If you enter an @york.ac.uk email you will not be able to login at all]
- Login using the email and password you just enterted

- [Here you can make config changes but the defaults are autofilled]
- Press "complete starting set", scroll and press "save and continue"
- Input any first and last name, an email (NOT an @york.ac.uk email) and a password
- [If you enter an @york.ac.uk email you will not be able to login at all]
- Login using the email and password you just enterted

## Default Credentials

Database: (when building the database, these credentials are needed)
- Hostname: `postgres` if running in Docker, `localhost` otherwise
- Database: myradio
- Username: myradio
- Password: myradio

- Hostname: `postgres` if running in Docker, `localhost` otherwise
- Database: myradio
- Username: myradio
- Password: myradio

Vagrant VM: (if you need to ssh into the virtual machine)
- Username: vagrant
- Password: vagrant

- Username: vagrant
- Password: vagrant

## Tests

MyRadio uses [Codeception](http://codeception.com/quickstart) for its test suite.

[This was written with a Vagrant install in mind - has not been tested on Docker]
Expand All @@ -132,31 +150,34 @@ blanks the `myradio_test` database each time it is ran, so it can be used to
reset the database and config file, should this prove necessary.

Summary:
* `composer install`
* `vagrant up`
* `vagrant ssh -- /vagrant/scripts/reset-db.sh`
* `src/vendor/bin/codecept run`

- `composer install`
- `vagrant up`
- `vagrant ssh -- /vagrant/scripts/reset-db.sh`
- `src/vendor/bin/codecept run`

The vagrant initialisation script also runs `composer install`, but that is run
on the virtual machine which also installs the PHP extensions required for
Codeception. These extensions may be missing locally, so running composer will
confirm that they are present.

## Next Steps

Once you've got through the setup wizard, the next thing that's most useful to
you is most likely creating a show.

To do this, you first need to:
- Create a Term (Show Scheduler -> Manage Terms)
- Create a Show (List My Shows -> Create a Show)
- Apply for a Season of your new Show (List My Shows -> New Season)
- Schedule the Season (Shows Scheduler)

- Create a Term (Show Scheduler -> Manage Terms)
- Create a Show (List My Shows -> Create a Show)
- Apply for a Season of your new Show (List My Shows -> New Season)
- Schedule the Season (Shows Scheduler)

### Setting up your own 2016-site

First pull [2016-site](https://github.com/UniversityRadioYork/2016-site)

#### database
#### database

Next you need a api_key to allow the website to access myradio's show information,

Expand All @@ -168,11 +189,12 @@ login into database with details used during setup of myradio

[please choose a better key than 'ARANDOMSTRINGOFCHARACTERS']

You might need add some other database columns to create shows
You might need add some other database columns to create shows

for example:
- explict podcasts (to create shows)
- selector (expected by 2016-site/can remove this from models/index.go 2016-site)

- explict podcasts (to create shows)
- selector (expected by 2016-site/can remove this from models/index.go 2016-site)

2016-site uses parts of database that aren't made on myradio creation,

Expand All @@ -186,8 +208,7 @@ you can use setup guide in [2016-site](https://github.com/UniversityRadioYork/20
And setup a reverse proxy to "https://localhost:4443/api/v2" or configure ssl for https connections
To complete the setup.


### A note on Seasons and Terms

MyRadio splits Shows into "Seasons". Any Season is applied to in relation to a
"Term", which is a user defined space of time (normally 11-15 weeks). This is because The University of York has 12 week semesters, if you didn't know.

0 comments on commit 098597c

Please sign in to comment.