From 098597cc048dce4e53d0c09d17649073e9735e2f Mon Sep 17 00:00:00 2001 From: Big Jimmy Date: Mon, 26 Aug 2024 15:18:22 +0100 Subject: [PATCH] added some details to docker install instructions --- docs/install.md | 91 ++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/docs/install.md b/docs/install.md index d9bccbf8f..a394ac55a 100644 --- a/docs/install.md +++ b/docs/install.md @@ -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 @@ -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` @@ -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 @@ -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] @@ -132,10 +150,11 @@ 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 @@ -143,20 +162,22 @@ 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, @@ -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, @@ -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. -