Skip to content

Commit

Permalink
Merge branch 'main' into issue/492-empty-tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dmols committed Jun 29, 2023
2 parents d0a7eff + 6169231 commit 8891ead
Show file tree
Hide file tree
Showing 14 changed files with 314 additions and 280 deletions.
8 changes: 4 additions & 4 deletions .env → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ APP_SECRET=eb2f09f8a21b0b7c57b9fc36eee250eb
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:[email protected]:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#DATABASE_URL=mysql://root:root@127.0.0.1:3306/udoit3
DATABASE_URL=mysql://root:root@db:3306/udoit3
###< doctrine/doctrine-bundle ###
### PRIVATE KEY PASSWORD: UDOIT3.0 ###

Expand All @@ -40,7 +40,7 @@ APP_LTI_REDIRECT_PATH="/lti/authorize/check"
APP_LTI_NAME="UDOIT 3"
ADMIN_LTI_NAME="UDOIT 3 Admin"
USE_DEVELOPMENT_AUTH="no"
VERSION_NUMBER="3.3.0"
VERSION_NUMBER="3.3.1"


###> symfony/messenger ###
Expand Down Expand Up @@ -153,9 +153,9 @@ DATE_FORMAT="Y-m-d"

###> base url ###
# Base URL for client callbacks
BASE_URL=""
BASE_URL="http://127.0.0.1:8000/udoit3"
# Webpack public path
WEBPACK_PUBLIC_PATH="/build"
WEBPACK_PUBLIC_PATH="/udoit3/build"
###> base url ###

###> user name storage ###
Expand Down
14 changes: 0 additions & 14 deletions .env.local.example

This file was deleted.

13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- 'dev/*'
- 'stable/*'

env:
REGISTRY: ghcr.io
Expand All @@ -16,7 +16,6 @@ jobs:
steps:
- uses: actions/checkout@v2


- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
Expand Down Expand Up @@ -46,13 +45,11 @@ jobs:

- name: Build Image
run: |
cp .env.local.example .env.local
docker-compose -f docker-compose.nginx.yml build
docker-compose -f docker-compose.nginx.yml run composer composer install --no-dev --no-interaction --no-progress --optimize-autoloader
docker-compose -f docker-compose.nginx.yml run yarn bash -c 'cd /app && yarn install && yarn build'
cp .env.example .env
docker compose -f docker-compose.nginx.yml build
docker compose -f docker-compose.nginx.yml run composer composer install --no-dev --no-interaction --no-progress --optimize-autoloader
docker compose -f docker-compose.nginx.yml run yarn bash -c 'cd /app && yarn install && yarn build'
docker build . -t udoit:latest -f build/nginx/Dockerfile.build
docker tag udoit:latest ${{ env.REGISTRY }}/${{ steps.case.outputs.lowercase }}:${{ steps.slash.outputs.value }}
docker push ${{ env.REGISTRY }}/${{ steps.case.outputs.lowercase }}:${{ steps.slash.outputs.value }}
9 changes: 9 additions & 0 deletions .github/workflows/udoit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ jobs:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1']
node-version: [16.19.0]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Check PHP syntax errors
uses: overtrue/[email protected]

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
Expand All @@ -35,6 +41,9 @@ jobs:
key: php-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php-versions }}-composer-

- name: Create .env file
run: cp .env.example .env

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ yarn-error.log
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

.env
58 changes: 35 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,24 @@ If you are contributing code to UDOIT, please follow the guidelines below.

### Forking

If you are an outside contributor, you will need to fork the UDOIT project in order to work on it. If you are familiar with Git, but are unsure of the forking process, read the [Forking Projects](https://guides.github.com/activities/forking/) guide. After you are finished fixing a bug or implementing a feature on your fork, submit a pull request using the appropriate [Dev branch](#dev-branches) as the `base`.
If you are an outside contributor, you will need to fork the UDOIT project in order to work on it. If you are familiar with Git, but are unsure of the forking process, read the [Forking Projects](https://guides.github.com/activities/forking/) guide. Make your changes in an appropriately-named [issue branch](#issue-branches) in your fork. After you are finished fixing a bug or implementing a feature on your fork, submit a pull request back to this repository.

The overall workflow is:

1. Choose an issue to work on, or submit a new one.
2. [Fork this project](https://guides.github.com/activities/forking/)
3. Make the changes necessary to resolve the issue.
4. Test the code in your own environment.
5. Create a pull request
1. Use the appropriate [Dev branch](#dev-branches) as the `base`
2. Write a description of what you did in the `description` field.
3. [Link the pull request to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
6. Pay attention to the pull request and respond to any questions others have about it. It may take a few back-and-forth communications and changes for your pull request to be approved and merged.
3. Create an [issue branch](#issue-branches).
4. Make the changes necessary to resolve the issue.
5. Test the code in your own environment.
6. Commit and push the code to your fork.
7. Create a pull request back to the ucfopen/UDOIT repository.
1. Write a description of what you did in the `description` field.
2. [Link the pull request to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
8. Pay attention to the pull request and respond to any questions others have about it. It may take a few back-and-forth communications and changes for your pull request to be approved and merged.

## Branching
### Branching

If you are a member of the UDOIT team, you can either fork the project (using the instructions above) or branch. Refer to the [Issue Branches](#issue-branches) section for the proper naming convention and pull request process.
If you are a member of the UDOIT team, you can either fork the project (using the instructions above) or create a new branch within this repository. Refer to the [Issue Branches](#issue-branches) section for the proper naming convention and pull request process.

## Explanation of Branches and Merging

Expand All @@ -64,28 +65,39 @@ UDOIT has a structured flow for how issues, branches, and releases are handled.
### Main Branch

* This is the default branch.
* It always points at the latest release, and thus always production ready.
* Issue branches merge into this branch.
* It represents the latest version of UDOIT, but it is not intended for production use.

### Dev Branches
### Stable Branches

* Naming Convention: `dev/v1-2-10` - a new one for every upcoming release version - following [SEMVER](http://semver.org/). (Note: Hyphens are used instead of periods to preserve compatibility with the Heroku button.)
* Issue branches merge into this branch (never main)
* When this dev branch is ready for release, it is merged into main and deleted
* Naming convention: `stable/major.minor.x`, following [Semantic Versioning](https://semver.org/)
* They represent the latest stable version of each minor release, including all bugfixes and patches up to that point.
* They are intended for production use.
* The current release and previous minor release will receive security vulnerability fixes.
* Only the current release will receive non-security bugfixes.

### Issue Branches

* Naming Convention: `issue/3432-add-package-json-dependency`
* The number is an issue number, and the text is a very short description of the issue.
* Naming Convention: `issue/####-short-description-of-issue`, where `####` is the issue number.
* All issue branches must be tied to an issue, even in your forked version of UDOIT.
* Make sure you update your forked version first, then create your issue branch from the current dev branch.
* After work is completed, create a pull request into the target dev branch (never main).
* After work is completed, create a pull request into `main`.
* After the pull request is merged, the issue branch should be deleted.

### Releases
### Hotfix Branches

* Naimg convention: `hotfix/short-description`
* They represent security vulnerability fixes for the current or previous release.
* After work is completed, create a pull request into the target `stable` branch.
* Also merge these changes into `main` and any other `stable` branch where the vulnerability exists.

## Releases

The steps in this section are performed by the project maintainers.

* After the dev branch for a release is merged into main, a [Release](https://github.com/ucfopen/UDOIT/releases) is created for it. [Article about managing releases](https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository)
* Releases are named in the format `v1.2.10` (the same as the dev branch, but with periods instead of dashes).
* Each release gets a tag with the same name as the release after it's merged into main.
* It is suggested that you sign release tags for extra trust ([git tag](https://git-scm.com/book/tr/v2/Git-Tools-Signing-Your-Work)).
1. When `main` is ready for a new minor release, a new [stable branch](#stable-branches) is created.
* Patch releases for the current minor release are merged into the existing stable branch.
* Patch releases for previous minor releases are merged directly into the existing stable branch, not into `main`. The remaining steps below are still followed.
2. A new [Release](https://github.com/ucfopen/UDOIT/releases) is created for it, named in the format `major.minor.patch` [Article about managing releases](https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository)
3. Each release gets a tag with the same name as the release. This tag points at the appropriate commit hash.
4. It is suggested that you sign release tags for extra trust ([git tag](https://git-scm.com/book/tr/v2/Git-Tools-Signing-Your-Work)).
2 changes: 2 additions & 0 deletions HEROKU.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Click the Heroku button and follow the instructions below:
6. Fill out the `JWK_BASE_URL` field with the URL to your LMS. The default value works for instructure hosted instances of Canvas, but will need to be modified if your JWK configuration is hosted at a different domain than `iss`.
7. Click the Deploy button and wait for the process to complete.

The above deploy uses the Heroku Postgres Mini plan by default. Please check `https://elements.heroku.com/addons/heroku-postgresql` for Heroku Postgresql plan details. You can upgrade Postgresql plan inside Heroku UI later.

### Step 2: Database Migration and Setup
Next we need to set up the database and insert our institution in to the appropriate table.
1. Click "Manage App" or go to `https://dashboard.heroku.com/apps/yourapp`. (Replace 'yourapp' with the name you gave in Step 1.2.)
Expand Down
18 changes: 9 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ We strongly recommend managing the source code through Git. The benefit of this
If you prefer not to use Git, you can download a zip file of the latest release from the [Releases Page](https://github.com/ucfopen/UDOIT/releases). Unzip it in the directory on your server where UDOIT will live.

## .ENV Setup
UDOIT uses a `.env.local` file for storing configuration variables. To create it:
UDOIT uses a `.env` file for storing configuration variables. To create it:

1. Copy the file `.env.local.example` to `.env.local` by running
1. Copy the file `.env.example` to `.env` by running
```
cp .env.local.example .env.local
cp .env.example .env
```
2. Leave `APP_ENV` set to `prod`
> If you are setting up a development environment, set this to `dev` and follow the steps in [Installing Composer Dependencies](#installing-composer-dependencies) without the `--no-dev` flag to obtain all of the development packages.
3. Add your database information to thie `DATABASE_URL` variable. (The default value of `mysql://root:root@db:3306/udoit3` is suitable for running it on your local computer using Docker.)
3. Add your database information to the `DATABASE_URL` variable. (The default value of `mysql://root:root@db:3306/udoit3` is suitable for running it on your local computer using Docker.)
4. Modify the `BASE_URL` to match the URL of your instance of UDOIT. (The default value of `http://127.0.0.1:8000/udoit3` is suitable for running it on your local computer using Docker.)
5. Modify the `WEBPACK_PUBLIC_PATH` to match the `BASE_URL` you set. (The default value of `/udoit3/build` is suitable for running it on your local computer usind Docker. Example: If your `BASE_URL` is set to `http://127.0.0.1:8000`, your `WEBPACK_PUBLIC_PATH` should be `/build`.)
6. Set `APP_LMS` to the name of your LMS.
* `canvas` if you are using the Canvas LMS.
* `d2l` if you are using the D2l Brightspace LMS.
7. (Optional) You can change the default language for your entire UDOIT instance by adding the `DEFAULT_LANG` variable. Currently supported languages are English (`en`) and Spanish (`es`).
8. (Optional) If you are using UDOIT with a self-hosted instance of Canvas, you can add the `JWK_BASE_URL` variable and set it to the URL of your instance of Canvas. (Example: `JWK_BASE_URL="https://canvas.dev.myschool.edu"`)
7. If you are using UDOIT with a self-hosted instance of Canvas, you can add the `JWK_BASE_URL` variable and set it to the URL of your instance of Canvas. (Example: `JWK_BASE_URL="https://canvas.dev.myschool.edu"`)
8. (Optional) You can change the default language for your entire UDOIT instance by adding the `DEFAULT_LANG` variable. Currently supported languages are English (`en`) and Spanish (`es`).

## Docker
We provide a fast and simple way of setting up a local UDOIT instance through the use of Docker containers.
Expand All @@ -54,15 +54,15 @@ To set up the docker containers, you must first install [Docker](https://docs.do
### 2. Build the Containers
If you prefer to build the containers yourself, or you are actively developing UDOIT and need to rebuild the containers to test your cahnges, run the following command from within the UDOIT directory:

docker-compose -f docker-compose.nginx.yml up
docker compose -f docker-compose.nginx.yml up

### 3. Wait
Wait for all of the containers to finish initializing. This can take over 15 minutes. You will know you are ready to proceed with the next step when you haven't seen any output in your terminal for a few minutes.

### 4. Set up the Database
The first time you start the containers, you will need to set up the database to handle all the information UDOIT generates as it runs. Run the following command:

docker-compose -f docker-compose.nginx.yml run php php bin/console doctrine:migrations:migrate
docker compose -f docker-compose.nginx.yml run php php bin/console doctrine:migrations:migrate

> You will also need to run that command whenever you update to a new version of UDOIT.
Expand All @@ -72,7 +72,7 @@ Skip to [Testing your Setup](#testing-your-setup) to continue.
### 6. Stopping the Containers
If you ever want to stop the containers, you can do so with the following command:

docker-compose -f docker-compose.nginx.yml down
docker compose -f docker-compose.nginx.yml down



Expand Down
6 changes: 3 additions & 3 deletions INSTALL_CANVAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ lms_api_domain=$Canvas.api.domain
* Click `ON` to enable the newly created key

---
## Docker-Compose Base URL
If you are setting up UDOIT for local development through docker-compose, <YOUR_UDOIT_BASE_URL> in both the API developer key and the LTI developer key above should be set to `http://127.0.0.1:8000/udoit3`.
## Docker Compose Base URL
If you are setting up UDOIT for local development through `docker compose`, <YOUR_UDOIT_BASE_URL> in both the API developer key and the LTI developer key above should be set to `http://127.0.0.1:8000/udoit3`.

---
## Update the Institutions Table
Expand Down Expand Up @@ -187,4 +187,4 @@ UDOIT now needs to be added to an account in Canvas. Follow these steps to add t
8. Paste the `Client ID` from the developer LTI Key you created earlier.
9. Click Submit.

You're done! "UDOIT" should now appear in the navigation menu of the course (or every course in the account) in which you installed it. If you installed it to an account, "UDOIT Admin" will also appear in the account navigation menu.
You're done! "UDOIT" should now appear in the navigation menu of the course (or every course in the account) in which you installed it. If you installed it to an account, "UDOIT Admin" will also appear in the account navigation menu.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
},
"addons": [
"heroku-postgresql:hobby-basic"
"heroku-postgresql:mini"
],
"buildpacks": [
{
Expand Down
1 change: 1 addition & 0 deletions build/nginx/php-custom.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
max_execution_time = 180
memory_limit = 500M
Loading

0 comments on commit 8891ead

Please sign in to comment.