-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yaml
More file actions
326 lines (322 loc) · 12.4 KB
/
Copy pathconfig.yaml
File metadata and controls
326 lines (322 loc) · 12.4 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# BASIC CONFIGURATION, DO NOT ALTER
# Put your configuration in `config.local.yaml`
# ########################################
# METADATA
# ########################################
# short name of the event, also used in output paths
event_short_name: ""
# full name of the event, used in content
event_full_name: ""
# Public conference website URL, shown in the email footer (${event_website}).
event_website: ""
# Public HTTPS prefix for cert downloads, used in delivery emails.
# Pattern: {certificates_url}{uuid}/{uuid}.pdf
# e.g. https://s3.eu-central-1.amazonaws.com/certs.example.com/your-conference/
certificates_url: ""
# Optional S3 write URI (`s3://bucket/prefix`) — printed by `reissue.py` as the
# `aws s3 cp` target for a re-cut PDF. If empty, the runbook line says "push to
# the configured S3 location" generically. Should mirror certificates_url's
# bucket+prefix without the public-HTTPS wrapper:
# e.g. s3://certs.example.com/your-conference
certificates_s3_uri: ""
# Optional fallback base for the validation link when `validation_url` is unset.
# (Attendee validation pages are generated locally under
# `_certificates/<event>/attendees/website-validate/<uuid>/contents.lr`;
# publishing them to a website checkout is a manual step.)
static_pages_website: ""
# Public URL prefix for the validation link printed on the PDF.
# Pattern: {validation_url}{uuid}/
# e.g. https://your-conference.example.com/attendee-certificate/<uuid>/
validation_url: ""
# Attendee data file, relative to dirs.data_dir. CSV (.csv) or Excel (.xlsx).
attendees_table: ""
# Source for generating `attendees_table` from a Pretix check-in list export.
# `preprocess_checkin.py` reads `checkin_table` (the exported xlsx, under
# dirs.data_dir) and writes the canonical `attendees_table` CSV. Leave
# `checkin_table` empty if you maintain `attendees_table` by hand.
attendee_checkin:
checkin_table: ""
sheet: "Check-in list"
# Process only the first N attendees (useful for testing). 0 = process all.
batch_size: 0
# Display text for the cert's "No." line, keyed by Attendee.attended_how value.
# Empty when a value is missing from the map.
attendance_display:
"on site": " · onsite"
"remotely": " · online"
# Title used on the Lektor validation page (contents.lr).
validation_page_title: "Certificate of Attendance Validation Service"
# ########################################
# OPTIONAL CERTIFICATE TYPES
# ########################################
# Masterclass + Speaker (+ Volunteers, …) certificates reuse the same pipeline
# but with their own data source, background, layout and Lektor destinations. Set
# `enabled: true` and populate the per-type block in the per-project config to
# generate them via `python run.py --type <name>`.
#
# `--type` choices are derived from config (see run.build_dispatch): `attendee`
# is always available; `speaker` appears when enabled; and ANY block here that
# sets `enabled: true` AND `load_columns` (masterclass, volunteer, or a new
# table-based type you add) is offered automatically — no code change needed.
masterclass:
enabled: false
# Excel under dirs.data_dir.
attendees_table: ""
# Source-column -> Attendee-field mapping passed to ProcessAttendees.
load_columns: {}
pdf_background:
file: "" # under dirs.graphics
text_items: []
speaker:
enabled: false
# JSON under dirs.data_dir — confirmed sessions only (the source of truth
# for which speaker certs to emit). Schema per item:
# {ID, "Proposal title", "Session type": {en}, "Speaker IDs", "Speaker names"}
sessions_json: ""
# JSON under dirs.data_dir — speaker directory used to resolve each Speaker ID
# to an email. Schema per item: {ID, Name, Email, ...}
speakers_json: ""
pdf_background:
file: ""
text_items: []
# URL templates resolved with {attendee.speaker_id} / {attendee.proposal_id}.
speaker_url_template: ""
talk_url_template: ""
# Volunteer/Organizer — a table-based type (mechanically like masterclass). The
# token is singular (`--type volunteer`); the output dir pluralises to
# `volunteers/`. `attendees_table` is a CSV/XLSX with Pretix columns mapped by
# `load_columns`. Optionally `source_products` lets preprocess_checkin.py
# generate that file by filtering the check-in list to rows whose Product
# contains any listed substring (case-insensitive); omit it to maintain
# `attendees_table` by hand.
volunteer:
enabled: false
attendees_table: ""
load_columns: {}
source_products: [] # e.g. ["organizer", "volunteer"]
pdf_background:
file: ""
text_items: []
# ########################################
# DIRECTORIES
# ########################################
# Directories. Resolved by participation_certificate/__init__.py:
# - `fonts_dir` is REPO-WIDE — resolved against the repo root (shared across
# every project).
# - All other keys are PROJECT-RELATIVE — resolved against
# `projects/${CERTIFICATE_PROJECT_SLUG}/`. Rename the value here (or in the
# per-project config.yaml) to relocate; downstream code only ever sees the
# resolved absolute path.
dirs:
# Output PDFs + records + email previews + validation pages (project-relative).
path_to_certificates: "./_certificates"
# PKCS#12 keystore + password file live here (project-relative).
path_to_signatures: "./_signatures"
# Shared TTF fonts — REPO-WIDE; do not duplicate per project.
fonts_dir: "./fonts"
# Per-event source data (CSV / XLSX / JSON) (project-relative).
data_dir: "./_data"
# Per-event cert-background PDFs + sponsor logos (project-relative).
graphics: "./graphics"
# ########################################
# FONTS
# ########################################
# Font configuration for PDF generation
fonts:
# Automatically load all TTF fonts from fonts directory
auto_load_ttf: true
# Default font to use if not specified
default_font: "helvetica"
default_size: 12
# Specific font definitions (optional)
# Format: font_name: {file: "path/to/font.ttf", styles: {bold: "path/to/font-bold.ttf", italic: "path/to/font-italic.ttf"}}
custom_fonts:
# Example:
# poppins:
# regular: "Poppins/Poppins-Regular.ttf"
# bold: "Poppins/Poppins-Bold.ttf"
# italic: "Poppins/Poppins-Italic.ttf"
# Initial font setting when creating PDFs
initial_font:
name: "helvetica"
size: 12
style: "" # "", "B", "I", or "BI"
# ########################################
# LAYOUT
# ########################################
# It's important to know the dimensions of your page to place items correctly.
# DIN A4 pages in landscape orientation have
# a width of 297mm and a height of 210mm = 841.89 x 595.28 points.
layout:
default:
background:
color:
- 0
- 0
- 0 # black
font:
size: 12
name: "helvetica"
style: ""
color:
- 0
- 0
- 0 # black
width: 200
# PDF Background Configuration (optional)
# Use a prepared PDF as background template instead of colored rectangles
# When enabled, the background rectangles below will be ignored
pdf_background:
enabled: false # Set to true to use a PDF as background
file: "" # Filename relative to graphics directory (e.g., "certificate_template.pdf")
page: 1 # Which page number to use from multipage PDFs (1-based index)
background:
# Items are place on top of each other.
# Add a sequence of items to be placed on the canvas.
# Currently only rectangles are supported.
# Rectangle as the background, will look like a frame.
- color:
- 61
- 164
- 51 # some green
width: 0 # full width
height: 0 # full height
position:
- 0
- 0
text_items:
# text: "str"
# position: tuple(x, y) # x from left, y from top; y is the text BASELINE.
# font:
# name: "str valid font name (optional, fallbacks to default)"
# size: number (optional, fallbacks to default)
# style: B, I, BI (optional, fallbacks to "")
# width + height (both set) -> "wrap-box": text wraps to `width` and may span
# several lines. position[1] is still the FIRST line's baseline (same
# convention as a plain item), and `height` only bounds the wrap — it does
# NOT vertically centre. So a single-line wrap-box at [x, y] lands on the
# exact same baseline as a simple text item at [x, y].
- text: "This is a Title"
position:
- 45
- 98
font:
name: "helvetica"
size: 48
style: ""
- text: "Format text: {attendee.full_name}"
position:
- 50
- 180
font:
name: "helvetica"
size: 24
- text: "No. {attendee.hash}"
position:
- 532
- 128
font:
name: "helvetica"
size: 24
- text:
- multi-lime bold **{event_full_name}**
- text with format.
position:
- 45
- 200
width: 600
font:
size: 16
graphics:
- name: "24-snake.svg"
position:
- 400
- 160
width: 440
- name: "PyConDE.svg"
position:
- 125
- 500
width: 40
link: https://pycon.de
metadata:
description: "Add text here."
title: "Title"
author: "Author"
keywords: "A, B, C"
# ########################################
# EMAIL DELIVERY (Mailgun)
# ########################################
# All editable email copy lives under `email:` here (or, populated per event,
# in config_local.yaml). The renderer drops these fields into a shared layout
# at `participation_certificate/email_templates/layout.{html,txt}`.
#
# Body fields accept lightweight markdown:
# **bold**, *italic*, [link text](url)
# converted to HTML for the HTML email and stripped to readable prose for text.
#
# `string.Template` substitution; supported runtime variables:
# ${first_name}, ${full_name}, ${event_full_name}, ${event_short_name},
# ${certificates_url}, ${download_url}, ${uuid}, ${validation_url},
# ${talk_title}, ${talk_url}, ${speaker_url}, ${masterclass}
email:
# One-liner subject per cert type.
subjects:
attendee: ""
masterclass: ""
speaker: ""
# Body content is layered: `default` is the fallback for any field a cert
# type doesn't override. Effective body for a cert type = `{...default, ...<type>}`.
# Every field in `_REQUIRED_FIELDS` (see email_renderer.py) must be present
# after the merge — set to `""` in `default` if you want a field to render
# empty for types that don't override it.
body:
default:
greeting: "" # e.g. "Dear ${first_name},"
intro: "" # main cert-introduction paragraph
download_intro: "" # one-liner above the CTA button
cta_label: "" # button text (no markdown)
post_cta: "" # paragraph(s) after the CTA — validation link etc.
closing: "" # gratitude paragraph
signature: "" # "All the best,"
sign_off: "" # "The ${event_full_name} team"
attendee: {} # override only what differs from default
masterclass: {}
speaker: {}
# Legal footer — shared by all cert types. Markdown allowed.
footer: ""
# Optional BCC for every delivered email (audit copy). Empty disables.
bcc: ""
mailgun:
# Sending domain configured in Mailgun (e.g. "mg.pycon.de").
domain: ""
# "eu" → api.eu.mailgun.net, "us" → api.mailgun.net.
region: "eu"
# `${from_name} <${from_email}>` is the `From:` header.
from_name: ""
from_email: ""
# API key file path, relative to project root. One-line plaintext.
api_key_path: "_secret/mailgun_key"
# Max messages per second sent to Mailgun's REST API.
rate_limit_per_sec: 5
# ########################################
# BRANDING (HTML email)
# ########################################
branding:
# Path to the logo image, relative to project root. Sent as an inline (CID)
# attachment; HTML templates reference `<img src="cid:<filename>">`.
logo_path: "assets/email/pyconde-pydata-2026-logo.png"
# ########################################
# DIGITAL SIGNATURE
# ########################################
signing:
# PKCS#12 keystore filename, relative to dirs.path_to_signatures.
# Leave empty to skip signing (PDFs will be encrypted-only).
sign_key: ""
# Path to a file containing the keystore password, relative to project root.
sign_password_path: "_signatures/keystore_password"
# Embedded in the PDF signature metadata, visible to anyone verifying the cert.
contact: ""
location: ""
reason: ""
# ########################################