Skip to content

Commit 52cf3ee

Browse files
Sheikah45Brutus5000
authored andcommitted
Add terms of service and fix some local profile run config
1 parent 36b41b9 commit 52cf3ee

7 files changed

Lines changed: 967 additions & 14 deletions

File tree

src/main/java/com/faforever/api/config/swagger/SwaggerConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public OpenAPI fafOpenAPI() {
2424
.info(new Info().title("Forged Alliance Forever API")
2525
.description("The official API for Forged Alliance Forever")
2626
.version(fafApiProperties.getVersion())
27+
.termsOfService("https://content.faforever.com/tos/api-tos.html")
2728
.license(new License()
2829
.name("MIT")
2930
.url("https://github.com/FAForever/faf-java-api/blob/develop/LICENSE")

src/main/java/com/faforever/api/deployment/ExeUploaderService.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,11 @@ private void checkAllowedBranchName(String modName) throws ApiException {
8383
}
8484

8585
private Path getCopyToPath(String modName, String fileName) {
86-
String copyTo = null;
87-
switch (modName) {
88-
case "fafbeta":
89-
copyTo = apiProperties.getDeployment().getForgedAllianceBetaExePath();
90-
break;
91-
case "fafdevelop":
92-
copyTo = apiProperties.getDeployment().getForgedAllianceDevelopExePath();
93-
break;
94-
default:
95-
throw new ApiException(new Error(ErrorCode.INVALID_FEATURED_MOD, modName));
96-
}
86+
String copyTo = switch (modName) {
87+
case "fafbeta" -> apiProperties.getDeployment().getForgedAllianceBetaExePath();
88+
case "fafdevelop" -> apiProperties.getDeployment().getForgedAllianceDevelopExePath();
89+
default -> throw new ApiException(new Error(ErrorCode.INVALID_FEATURED_MOD, modName));
90+
};
9791

9892
return Paths.get(copyTo, fileName);
9993
}

src/main/resources/config/application-local.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ faf-api:
3939
registration:
4040
activation-url-format: ${ACTIVATION_URL_FORMAT:http://localhost:8020/account/activate?username=%s&token=%s}
4141
subject: ${REGISTRATION_EMAIL_SUBJECT:FAF user registration}
42-
html-format: ${REGISTRATION_EMAIL_BODY:"Registration email body for user {0} with activation link {1}"}
42+
activation-mail-template-path: ${ACCOUNT_ACTIVATION_MAIL_TEMPLATE_PATH:test-account-activation.html}
43+
welcome-subject: ${WELCOME_MAIL_SUBJECT:Welcome to FAF}
44+
welcome-mail-template-path: ${WELCOME_MAIL_TEMPLATE_PATH:test-welcome-to-faf.html}
4345
password-reset:
4446
password-reset-url-format: ${PASSWORD_RESET_URL_FORMAT:http://localhost:8020/account/password/confirmReset?username=%s&token=%s}
4547
subject: ${PASSWORD_RESET_EMAIL_SUBJECT:FAF password reset}
46-
html-format: ${PASSWORD_RESET_EMAIL_BODY:Reset email body for user {0} with reset link {1}}
48+
mail-template-path: ${PASSWORD_RESET_MAIL_TEMPLATE_PATH:test-password-reset.html}
4749
steam:
4850
realm: ${STEAM_REALM:http://localhost}
4951
api-key: ${STEAM_API_KEY:banana}

src/main/resources/config/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ spring:
8585
application:
8686
name: FAF Java API
8787
datasource:
88-
url: jdbc:mariadb://${DATABASE_ADDRESS}/${DATABASE_NAME:faf}?useSSL=false
88+
url: jdbc:mariadb://${DATABASE_ADDRESS:127.0.0.1}/${DATABASE_NAME:faf}?useSSL=false
8989
name: faf
9090
username: ${DATABASE_USERNAME}
9191
password: ${DATABASE_PASSWORD}

test-account-activation.html

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
<!doctype html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
3+
<head>
4+
<title>
5+
6+
</title>
7+
<!--[if !mso]><!-->
8+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
9+
<!--<![endif]-->
10+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
11+
<meta name="viewport" content="width=device-width, initial-scale=1">
12+
<style type="text/css">
13+
#outlook a { padding:0; }
14+
body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }
15+
table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }
16+
img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }
17+
p { display:block;margin:13px 0; }
18+
</style>
19+
<!--[if mso]>
20+
<noscript>
21+
<xml>
22+
<o:OfficeDocumentSettings>
23+
<o:AllowPNG/>
24+
<o:PixelsPerInch>96</o:PixelsPerInch>
25+
</o:OfficeDocumentSettings>
26+
</xml>
27+
</noscript>
28+
<![endif]-->
29+
<!--[if lte mso 11]>
30+
<style type="text/css">
31+
.mj-outlook-group-fix { width:100% !important; }
32+
</style>
33+
<![endif]-->
34+
<!--[if !mso]><!-->
35+
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700" rel="stylesheet" type="text/css">
36+
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
37+
<link href="https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css">
38+
<style type="text/css">
39+
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700);
40+
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
41+
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
42+
</style>
43+
<!--<![endif]-->
44+
<style type="text/css">
45+
@media only screen and (min-width:480px) {
46+
.mj-column-per-100 { width:100% !important; max-width: 100%; }
47+
}
48+
</style>
49+
<style media="screen and (min-width:480px)">
50+
.moz-text-html .mj-column-per-100 { width:100% !important; max-width: 100%; }
51+
</style>
52+
<style type="text/css">
53+
54+
55+
56+
@media only screen and (max-width:480px) {
57+
table.mj-full-width-mobile { width: 100% !important; }
58+
td.mj-full-width-mobile { width: auto !important; }
59+
}
60+
61+
</style>
62+
<style type="text/css">.footer li {
63+
display: inline-block;
64+
padding: 0 1px;
65+
}
66+
67+
.footer ul {
68+
padding: 0;
69+
list-style-type: none;
70+
}
71+
72+
.footer a {
73+
text-decoration: none;
74+
}
75+
76+
a, a:visited {
77+
color: white;
78+
}
79+
80+
.footer a:hover {
81+
color: #d32a0e;
82+
}</style>
83+
</head>
84+
<body style="word-spacing:normal;background-color:#fafafa;">
85+
<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">
86+
FAForever account activation
87+
</div>
88+
<div style="background-color:#fafafa;">
89+
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><v:rect style="width:600px;" xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"><v:fill origin="0.5, 0" position="0.5, 0" src="https://content.faforever.com/images/background/email-header.jpg" type="tile" size="1,1" aspect="atleast" /><v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0"><![endif]-->
90+
<div style="background:url('https://content.faforever.com/images/background/email-header.jpg') center top / cover repeat;background-position:center top;background-repeat:repeat;background-size:cover;margin:0px auto;max-width:600px;">
91+
<div style="line-height:0;font-size:0;">
92+
<table align="center" background="https://content.faforever.com/images/background/email-header.jpg" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:url('https://content.faforever.com/images/background/email-header.jpg') center top / cover repeat;background-position:center top;background-repeat:repeat;background-size:cover;width:100%;">
93+
<tbody>
94+
<tr>
95+
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
96+
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
97+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
98+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
99+
<tbody>
100+
<tr>
101+
<td style="font-size:0px;word-break:break-word;">
102+
<div style="height:50px;line-height:50px;">
103+
&#x200a;
104+
</div> </td>
105+
</tr>
106+
<tr>
107+
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
108+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
109+
<tbody>
110+
<tr>
111+
<td style="width:100px;"> <img alt="FAF Logo" height="100" src="https://faforever.com/images/vector_faf_logo.png" style="border:0;display:block;outline:none;text-decoration:none;height:100px;width:100%;font-size:13px;" width="100"> </td>
112+
</tr>
113+
</tbody>
114+
</table> </td>
115+
</tr>
116+
<tr>
117+
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
118+
<div style="font-family:Yanone Kaffeesatz, Open Sans, Helvetica, Arial, sans-serif;font-size:40px;line-height:1;text-align:center;color:white;">
119+
Forged Alliance Forever
120+
</div> </td>
121+
</tr>
122+
<tr>
123+
<td style="font-size:0px;word-break:break-word;">
124+
<div style="height:50px;line-height:50px;">
125+
&#x200a;
126+
</div> </td>
127+
</tr>
128+
</tbody>
129+
</table>
130+
</div>
131+
<!--[if mso | IE]></td></tr></table><![endif]--> </td>
132+
</tr>
133+
</tbody>
134+
</table>
135+
</div>
136+
</div>
137+
<!--[if mso | IE]></v:textbox></v:rect></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
138+
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;">
139+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
140+
<tbody>
141+
<tr>
142+
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
143+
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
144+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
145+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
146+
<tbody>
147+
<tr>
148+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
149+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;">
150+
<h1>Activate your account</h1>
151+
<p>Dear {{username}},</p>
152+
<p>welcome to the FAForever community. To finish your registration please activate your account and select a password. </p>
153+
</div> </td>
154+
</tr>
155+
<tr>
156+
<td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
157+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;">
158+
<tbody>
159+
<tr>
160+
<td align="center" bgcolor="#414141" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#414141;" valign="middle"> <a href="{{activationUrl}}" style="display:inline-block;background:#414141;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> Activate account </a> </td>
161+
</tr>
162+
</tbody>
163+
</table> </td>
164+
</tr>
165+
<tr>
166+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
167+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;">
168+
<p>Further information will be provided to you after activation.</p>
169+
</div> </td>
170+
</tr>
171+
<tr>
172+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
173+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;">
174+
<p>Thanks,</p>
175+
<p>-- The FAForever team</p>
176+
</div> </td>
177+
</tr>
178+
</tbody>
179+
</table>
180+
</div>
181+
<!--[if mso | IE]></td></tr></table><![endif]--> </td>
182+
</tr>
183+
</tbody>
184+
</table>
185+
</div>
186+
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" bgcolor="gray" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
187+
<div style="background:gray;background-color:gray;margin:0px auto;max-width:600px;">
188+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:gray;background-color:gray;width:100%;">
189+
<tbody>
190+
<tr>
191+
<td style="direction:ltr;font-size:0px;padding:0;text-align:center;">
192+
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
193+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
194+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
195+
<tbody>
196+
<tr>
197+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
198+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#d3d3d3;">
199+
<p>You don't know where this email is coming from?</p>
200+
<p>Someone used your email address in the registration form on faforever.com. If you do not wish to be part of our community, just ignore or delete this email. No account was created yet. </p>
201+
</div> </td>
202+
</tr>
203+
</tbody>
204+
</table>
205+
</div>
206+
<!--[if mso | IE]></td></tr></table><![endif]--> </td>
207+
</tr>
208+
</tbody>
209+
</table>
210+
</div>
211+
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="footer-outlook" style="width:600px;" width="600" bgcolor="#000000" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
212+
<div class="footer" style="background:#000000;background-color:#000000;margin:0px auto;max-width:600px;">
213+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#000000;background-color:#000000;width:100%;">
214+
<tbody>
215+
<tr>
216+
<td style="direction:ltr;font-size:0px;padding:2px;text-align:center;">
217+
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:596px;" ><![endif]-->
218+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
219+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
220+
<tbody>
221+
<tr>
222+
<td align="center" style="font-size:0px;padding:2px;word-break:break-word;">
223+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:center;color:white;">
224+
<ul>
225+
<li> <a target="_blank" href="https://discord.com/invite/hgvj6Af"> <img src="https://content.faforever.com/images/icons/discord-white-20px.png" alt="Discord"> </a> </li>
226+
<li> <a target="_blank" href="https://www.youtube.com/c/ForgedAllianceForever"> <img src="https://content.faforever.com/images/icons/youtube-white-20px.png" alt="Youtube"> </a> </li>
227+
<li> <a target="_blank" href="https://www.facebook.com/ForgedAllianceForever"> <img src="https://content.faforever.com/images/icons/facebook-white-20px.png" alt="Facebook"> </a> </li>
228+
<li> <a target="_blank" href="https://github.com/FAForever/"> <img src="https://content.faforever.com/images/icons/github-white-20px.png" alt="Github"> </a> </li>
229+
<li> <a target="_blank" href="https://www.patreon.com/faf"> <img src="https://content.faforever.com/images/icons/patreon-white-20px.png" alt="Patreon"> </a> </li>
230+
</ul>
231+
<p> <a href="https://wwww.faforever.com">www.faforever.com</a> </p>
232+
</div> </td>
233+
</tr>
234+
</tbody>
235+
</table>
236+
</div>
237+
<!--[if mso | IE]></td></tr></table><![endif]--> </td>
238+
</tr>
239+
</tbody>
240+
</table>
241+
</div>
242+
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
243+
<div style="margin:0px auto;max-width:600px;">
244+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
245+
<tbody>
246+
<tr>
247+
<td style="direction:ltr;font-size:0px;padding:0;text-align:center;">
248+
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
249+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
250+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
251+
<tbody>
252+
<tr>
253+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
254+
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:gray;">
255+
<p>If the button above does not work, you need to open this url manually in your browser: {{activationUrl}}</p>
256+
</div> </td>
257+
</tr>
258+
</tbody>
259+
</table>
260+
</div>
261+
<!--[if mso | IE]></td></tr></table><![endif]--> </td>
262+
</tr>
263+
</tbody>
264+
</table>
265+
</div>
266+
<!--[if mso | IE]></td></tr></table><![endif]-->
267+
</div>
268+
</body>
269+
</html>

0 commit comments

Comments
 (0)