aboutsummaryrefslogtreecommitdiff
path: root/Readme.md
blob: 06cc1e2b8b184cb2310b4ac7315c5b40f88f8fa0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# λύω-trainer

A simple app to practice the Ancient Greek verbal system.

See [luo.camilstaps.nl][live]

## Installation

```bash
git clone https://git.camilstaps.nl/clone/luo-parsetrainer.git
cd luo-parsetrainer
composer install
npm ci
npm run dev
```

## Configuration

First, create a MySQL database and a user that can connect to it. In this
example, we'll use `luo_db`, `luo_user` and `luo_pass`.

Create a `.env` file in the root directory with at least the following options:

```
APP_ENV=production
APP_DEBUG=false
APP_KEY= # a 32-char random string
APP_URL=https://example.org/luo/ # e.g., use your own URL here

APP_LOCALE=en
APP_FALLBACK_LOCALE=en

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=luo_db
DB_USERNAME=luo_user
DB_PASSWORD=luo_pass

CACHE_DRIVER=memchached
SESSION_DRIVER=memcached
QUEUE_DRIVER=database
```

Return to the root directory and run:

```bash
php artisan migrate --seed
```

### Nginx

You need to enable PHP and redirect everything to `server.php`. Configuration
on the root of a site is straightforward:

```nginx
server {
	listen [::]:80;
	server_name myhostname;
	root /.../luo;
	index index.php index.html index.htm;
	charset utf-8;

	location / {
		autoindex off;
		try_files $uri $uri/ /server.php$is_args$query_string;
	}

	location ~ \.php$ {
		# whatever you do to make PHP work
	}

	location ~ /\. {
		deny all;
	}
}
```

In a subdirectory, we need to enforce trailing slashes and do some special
things. This configures nginx to handle the trainer from `/luo/`:

```nginx
server {
	listen [::]:80;
	server_name myhostname;
	root /...;
	index index.php index.html index.htm;
	charset utf-8;

	rewrite ^([^.]*[^/])$ $1/ permanent;

	location ~ ^/luo/(.*)\.php$ {
		try_files $uri $uri/ /luo/server.php$is_args$query_string;

		# whatever you do to make PHP work
	}

	rewrite /luo/?$ /luo/public/index.php;
	location /luo {
		try_files $uri $uri/ /luo/server.php$is_args$query_string;
	}

	location / {
		autoindex off;
	}

	location ~ /\. {
		deny all;
	}
}
```

## License

Copyright 2015–present Camil Staps.
Licensed under GPL v3.0, see the LICENSE file.

This project uses the [SBL Greek][sblgrk] font which is licensed under the SBL Font User Agreement.

[live]: https://luo.camilstaps.nl/
[sblgrk]: https://www.sbl-site.org/educational/biblicalfonts.aspx