You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-91Lines changed: 46 additions & 91 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,18 @@ These are using Laravel Socialite, so any provider supported by Socialite can be
20
20
21
21
These are custom integrations but more can be added and used if people develop them. The Internal provider allows you to manually issue tickets to users.
22
22
23
-
## Setup
23
+
24
+
## Technology
25
+
26
+
This project is written in PHP 8.4 using the Laravel 12 framework. It was migrated from Laravel 10 and 11 so has some
27
+
legacy project structure - but this is the intended upgrade path.
28
+
29
+
Horizon and Telescope are installed and enabled, with access limited to the admin role. The application itself is
30
+
served using Laravel Octane and FrankenPHP.
31
+
32
+
Websocket communications are handled using Laravel Reverb.
33
+
34
+
## Development Setup
24
35
25
36
You will need to create a Discord application and have the Client ID and Client Secret available.
26
37
@@ -43,108 +54,52 @@ You should now be able to login. The first user will be given the admin role.
43
54
44
55
## Production Deployment
45
56
46
-
I use the following docker-compose for running this in production:
47
-
48
-
```yaml
49
-
version: '3'
50
-
services:
51
-
nginx:
52
-
image: ghcr.io/mintopia/control-nginx:develop
53
-
env_file: .env.nginx
54
-
restart: unless-stopped
55
-
depends_on:
56
-
- php-fpm
57
-
networks:
58
-
- frontend
59
-
- default
60
-
volumes:
61
-
- ./public:/var/www/storage/public
62
-
63
-
php-fpm:
64
-
image: ghcr.io/mintopia/control-php-fpm:develop
65
-
env_file: .env
66
-
restart: unless-stopped
67
-
depends_on:
68
-
- redis
69
-
- database
70
-
volumes:
71
-
- ./logs:/var/www/storage/logs
72
-
- ./public:/var/www/storage/public
73
-
74
-
redis:
75
-
image: redis:6.2.6
76
-
restart: unless-stopped
77
-
78
-
database:
79
-
image: mariadb:10.5-focal
80
-
env_file: .env.mariadb
81
-
restart: unless-stopped
82
-
volumes:
83
-
- ./database:/var/lib/mysql
84
-
85
-
worker:
86
-
image: ghcr.io/mintopia/control-php-fpm:develop
87
-
restart: unless-stopped
88
-
deploy:
89
-
replicas: 2
90
-
env_file: .env
91
-
depends_on:
92
-
- database
93
-
- redis
94
-
volumes:
95
-
- ./logs:/var/www/storage/logs
96
-
- ./public:/var/www/storage/public
97
-
entrypoint: ['php']
98
-
command: 'artisan queue:work'
99
-
100
-
101
-
scheduler:
102
-
image: ghcr.io/mintopia/control-php-fpm:develop
103
-
restart: unless-stopped
104
-
env_file: .env
105
-
depends_on:
106
-
- database
107
-
- redis
108
-
volumes:
109
-
- ./logs:/var/www/storage/logs
110
-
- ./public:/var/www/storage/public
111
-
entrypoint: ['php']
112
-
command: 'artisan schedule:work'
113
-
114
-
artisan:
115
-
image: ghcr.io/mintopia/control-php-fpm:develop
116
-
profiles:
117
-
- artisan
118
-
env_file: .env
119
-
depends_on:
120
-
- database
121
-
- redis
122
-
volumes:
123
-
- ./logs:/var/www/storage/logs
124
-
- ./public:/var/www/storage/public
125
-
entrypoint: ['php', 'artisan']
126
-
127
-
networks:
128
-
frontend:
129
-
external: true
130
-
```
57
+
In the `example` directory there is a docker compose file and some .env example files. These are for the setup I use.
58
+
Just rename the .env files and edit them accordingly. You can get a [random Laravel application key here](https://generate-random.org/laravel-key-generator).
59
+
60
+
You need to expose the `control` container to the public. This is configured to listen on port 80
61
+
in the docker compose, so you probably want something like Traefik or Caddy in-front as a reverse proxy.
62
+
63
+
I'm running this with an external docker network called `frontend` with Caddy running as HTTP/HTTPS ingress. You will
64
+
need to add a network section for the `control` service to add it to the `frontend` network if you
65
+
want to do this.
131
66
132
-
I'm running with an external docker network called `frontend` with Caddy running as HTTP/HTTPS ingress. To bring up the site, run the following:
67
+
You will need to make a logs directory and chmod it 777 as I still need to sort permissions out.
133
68
69
+
To bring up the site, run the following:
134
70
135
71
```bash
136
-
# Create your docker compose file
137
-
# Create your .env file from the project's .env.example and edit as required.
138
72
docker compose up -d redis database
139
-
docker compose run --rm artisan key:generate
140
73
docker compose run --rm artisan migrate
141
74
docker compose run --rm artisan db:seed
142
-
docker compose run --rm artisan control:setup-discord
75
+
docker compose run --rm artisan setup:discord
143
76
docker compose up -d
144
77
```
145
78
146
79
You should now be able to visit the site and login. From here you can use the admin menu to configure the site.
147
80
81
+
## Observability
82
+
83
+
Control supports basic observability functionality in using an OpenTelemetry collector. It can support traces, logs
84
+
and metrics. If enabled, it will create traces for all HTTP requests. To enable it, add the following to your `.env`:
85
+
86
+
```dotenv
87
+
OPENTELEMETRY_ENABLED=true
88
+
```
89
+
90
+
For logging output, a logger is defined and can be used. I suggest you use this with your usual logger, eg. `daily`.
91
+
You can specify this logging with the following environment variables:
92
+
93
+
```dotenv
94
+
LOG_CHANNEL=stack
95
+
LOG_STACK=opentelemetry,daily
96
+
```
97
+
98
+
By default it is configured to send to an OpenTelemetry container running with the name `collector`. An example config
99
+
is supplied with placeholders for sending data to [Honeycomb](https://www.honeycomb.io/).
100
+
101
+
The plan will be to add further spans within individual requests and have spans for the jobs and queued actions.
102
+
148
103
## Contributing
149
104
150
105
It's an open source project and I'm happy to accept pull requests. I am terrible at UI and UX, which is why this is entirely using server-side rendering. If someone wants to use Vue/Laravel Livewire - please go ahead!
0 commit comments