View Javadoc
1   /*
2    * Copyright 2012-2025 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.app.web.admin.general;
17  
18  import org.lastaflute.web.validation.Required;
19  import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
20  
21  import jakarta.validation.constraints.Max;
22  import jakarta.validation.constraints.Min;
23  import jakarta.validation.constraints.Size;
24  
25  /**
26   * Form class for editing general system settings in the admin interface.
27   * This form handles global configuration settings that affect the entire Fess system,
28   * including crawling behavior, authentication, logging, and various system parameters.
29   *
30   */
31  public class EditForm {
32  
33      /**
34       * Creates a new EditForm instance.
35       */
36      public EditForm() {
37          // Default constructor
38      }
39  
40      /**
41       * Enable or disable incremental crawling.
42       * When enabled, only new or modified documents are crawled.
43       */
44      @Size(max = 10)
45      public String incrementalCrawling;
46  
47      /**
48       * Number of days to keep crawled documents before cleanup.
49       * Set to -1 to disable automatic cleanup.
50       */
51      @Required
52      @Min(-1)
53      @Max(1000)
54      @ValidateTypeFailure
55      public Integer dayForCleanup;
56  
57      /**
58       * Number of threads to use for crawling operations.
59       * Higher values increase crawling speed but consume more resources.
60       */
61      @Required
62      @Min(0)
63      @Max(100)
64      @ValidateTypeFailure
65      public Integer crawlingThreadCount;
66  
67      /**
68       * Enable or disable search query logging.
69       * When enabled, user search queries are logged for analysis.
70       */
71      @Size(max = 10)
72      public String searchLog;
73  
74      /**
75       * Enable or disable user information tracking.
76       * When enabled, user information is stored and tracked.
77       */
78      @Size(max = 10)
79      public String userInfo;
80  
81      /**
82       * Enable or disable user favorite functionality.
83       * When enabled, users can save favorite search results.
84       */
85      @Size(max = 10)
86      public String userFavorite;
87  
88      /**
89       * Enable or disable JSON Web API.
90       * When enabled, search results can be retrieved via JSON API.
91       */
92      @Size(max = 10)
93      public String webApiJson;
94  
95      /**
96       * Application-specific value for custom configurations.
97       * This field can be used to store custom application settings.
98       */
99      @Size(max = 10000)
100     public String appValue;
101 
102     /**
103      * Default label value to use when no specific label is selected.
104      * This affects which documents are included in search results by default.
105      */
106     @Size(max = 1000)
107     public String defaultLabelValue;
108 
109     /**
110      * Default sort order for search results.
111      * Defines how search results are ordered when no specific sort is requested.
112      */
113     @Size(max = 1000)
114     public String defaultSortValue;
115 
116     /**
117      * Virtual host configuration for multi-tenant setups.
118      * Allows different search configurations based on the request host.
119      */
120     @Size(max = 10000)
121     public String virtualHostValue;
122 
123     /**
124      * Enable or disable appending query parameters to search URLs.
125      * When enabled, additional parameters are added to search result URLs.
126      */
127     @Size(max = 10)
128     public String appendQueryParameter;
129 
130     /**
131      * Enable or disable login requirement for search access.
132      * When enabled, users must authenticate before performing searches.
133      */
134     @Size(max = 10)
135     public String loginRequired;
136 
137     /**
138      * Enable or disable result collapsing for similar documents.
139      * When enabled, similar search results are grouped together.
140      */
141     @Size(max = 10)
142     public String resultCollapsed;
143 
144     /**
145      * Enable or disable display of login link in the search interface.
146      * When enabled, a login link is shown to unauthenticated users.
147      */
148     @Size(max = 10)
149     public String loginLink;
150 
151     /**
152      * Enable or disable thumbnail generation for documents.
153      * When enabled, thumbnails are generated for supported file types.
154      */
155     @Size(max = 10)
156     public String thumbnail;
157 
158     /**
159      * Types of crawling failures to ignore during crawling operations.
160      * Specified failure types will not be logged or counted as errors.
161      */
162     @Size(max = 1000)
163     public String ignoreFailureType;
164 
165     /**
166      * Threshold for failure count before stopping crawling of a URL.
167      * Set to -1 to disable the threshold check.
168      */
169     @Required
170     @Min(-1)
171     @Max(10000)
172     @ValidateTypeFailure
173     public Integer failureCountThreshold;
174 
175     /**
176      * Enable or disable popular word tracking and display.
177      * When enabled, frequently searched terms are tracked and displayed.
178      */
179     @Size(max = 10)
180     public String popularWord;
181 
182     /**
183      * Character encoding to use for CSV file exports.
184      * This setting affects the encoding of downloaded CSV files.
185      */
186     @Required
187     @Size(max = 20)
188     public String csvFileEncoding;
189 
190     /**
191      * Number of days to keep search logs before purging.
192      * Set to -1 to disable automatic purging of search logs.
193      */
194     @Min(-1)
195     @Max(100000)
196     @ValidateTypeFailure
197     public Integer purgeSearchLogDay;
198 
199     /**
200      * Number of days to keep job logs before purging.
201      * Set to -1 to disable automatic purging of job logs.
202      */
203     @Min(-1)
204     @Max(100000)
205     @ValidateTypeFailure
206     public Integer purgeJobLogDay;
207 
208     /**
209      * Number of days to keep user information before purging.
210      * Set to -1 to disable automatic purging of user information.
211      */
212     @Min(-1)
213     @Max(100000)
214     @ValidateTypeFailure
215     public Integer purgeUserInfoDay;
216 
217     /**
218      * Bot user agents whose search logs should be purged.
219      * Search logs from these bots will be automatically removed.
220      */
221     @Size(max = 10000)
222     public String purgeByBots;
223 
224     /**
225      * Email addresses to receive system notifications.
226      * Multiple addresses can be specified, separated by commas.
227      */
228     @Size(max = 1000)
229     public String notificationTo;
230 
231     /**
232      * Enable or disable search suggestions based on search logs.
233      * When enabled, suggestions are generated from previous searches.
234      */
235     @Size(max = 10)
236     public String suggestSearchLog;
237 
238     /**
239      * Enable or disable search suggestions based on document content.
240      * When enabled, suggestions are generated from indexed documents.
241      */
242     @Size(max = 10)
243     public String suggestDocuments;
244 
245     /**
246      * Number of days to keep suggestion search logs before purging.
247      * Set to 0 to disable purging of suggestion search logs.
248      */
249     @Min(0)
250     @Max(100000)
251     @ValidateTypeFailure
252     public Integer purgeSuggestSearchLogDay;
253 
254     /**
255      * LDAP server URL for authentication.
256      * Used when LDAP authentication is enabled.
257      */
258     @Size(max = 1000)
259     public String ldapProviderUrl;
260 
261     /**
262      * LDAP security principal for binding to the LDAP server.
263      * Used for authenticating with the LDAP server.
264      */
265     @Size(max = 1000)
266     public String ldapSecurityPrincipal;
267 
268     /**
269      * LDAP admin security principal for administrative operations.
270      * Used for admin-level operations on the LDAP server.
271      */
272     @Size(max = 1000)
273     public String ldapAdminSecurityPrincipal;
274 
275     /**
276      * LDAP admin security credentials (password) for administrative operations.
277      * Used in conjunction with the admin security principal.
278      */
279     @Size(max = 1000)
280     public String ldapAdminSecurityCredentials;
281 
282     /**
283      * LDAP base DN (Distinguished Name) for user searches.
284      * Defines the root of the LDAP directory tree for user lookups.
285      */
286     @Size(max = 1000)
287     public String ldapBaseDn;
288 
289     /**
290      * LDAP filter for finding user accounts.
291      * Defines the search filter used to locate user accounts in LDAP.
292      */
293     @Size(max = 1000)
294     public String ldapAccountFilter;
295 
296     /**
297      * LDAP filter for finding groups.
298      * Defines the search filter used to locate groups in LDAP.
299      */
300     @Size(max = 1000)
301     public String ldapGroupFilter;
302 
303     /**
304      * LDAP attribute name for group membership.
305      * Specifies which LDAP attribute contains group membership information.
306      */
307     @Size(max = 100)
308     public String ldapMemberofAttribute;
309 
310     /**
311      * Notification message displayed on the login page.
312      * This message is shown to users on the authentication page.
313      */
314     @Size(max = 3000)
315     public String notificationLogin;
316 
317     /**
318      * Notification message displayed on the search top page.
319      * This message is shown to users on the main search page.
320      */
321     @Size(max = 3000)
322     public String notificationSearchTop;
323 
324     /**
325      * System log level for controlling log verbosity.
326      * Controls the level of detail in system log messages.
327      */
328     @Size(max = 10)
329     public String logLevel;
330 
331     /**
332      * Storage service endpoint URL for cloud storage integration.
333      * Used for storing files in cloud storage services like S3.
334      */
335     @Size(max = 1000)
336     public String storageEndpoint;
337 
338     /**
339      * Access key for cloud storage authentication.
340      * Used to authenticate with cloud storage services.
341      */
342     @Size(max = 1000)
343     public String storageAccessKey;
344 
345     /**
346      * Secret key for cloud storage authentication.
347      * Used in conjunction with the access key for cloud storage.
348      */
349     @Size(max = 1000)
350     public String storageSecretKey;
351 
352     /**
353      * Storage bucket name for cloud storage operations.
354      * Specifies which bucket to use for storing files in cloud storage.
355      */
356     @Size(max = 1000)
357     public String storageBucket;
358 
359     /**
360      * Storage type for cloud storage (s3, gcs, auto).
361      * Determines which storage client to use.
362      */
363     @Size(max = 20)
364     public String storageType;
365 
366     /**
367      * Storage region for S3.
368      * AWS region where the S3 bucket is located.
369      */
370     @Size(max = 100)
371     public String storageRegion;
372 
373     /**
374      * GCS project ID.
375      * Google Cloud project ID for GCS storage.
376      */
377     @Size(max = 200)
378     public String storageProjectId;
379 
380     /**
381      * Storage credentials file path for GCS.
382      * Path to the service account credentials JSON file.
383      */
384     @Size(max = 1000)
385     public String storageCredentialsPath;
386 
387     /**
388      * RAG LLM provider name.
389      * Selects which LLM client to use for RAG operations.
390      */
391     @Size(max = 100)
392     public String ragLlmName;
393 
394     /**
395      * LLM log level.
396      * Controls the logging level for LLM-related packages.
397      */
398     @Size(max = 10)
399     public String llmLogLevel;
400 
401     /** Enable or disable search file proxy. */
402     @Size(max = 10)
403     public String searchFileProxy;
404 
405     /** Enable or disable using browser locale for search. */
406     @Size(max = 10)
407     public String searchUseBrowserLocale;
408 
409     /** SSO type (none, oic, saml, spnego, entraid). */
410     @Size(max = 100)
411     public String ssoType;
412 
413     /** User agent string for crawling operations. */
414     @Size(max = 1000)
415     public String crawlingUserAgent;
416 
417     /** Notification message displayed on the advanced search page. */
418     @Size(max = 3000)
419     public String notificationAdvanceSearch;
420 
421     /** Slack webhook URLs for notifications. */
422     @Size(max = 10000)
423     public String slackWebhookUrls;
424 
425     /** Google Chat webhook URLs for notifications. */
426     @Size(max = 10000)
427     public String googleChatWebhookUrls;
428 
429     /** Enable or disable log notification for ERROR/WARN logs. */
430     @Size(max = 10)
431     public String logNotificationEnabled;
432 
433     /** Log notification level (e.g. ERROR, WARN, INFO). */
434     @Size(max = 10)
435     public String logNotificationLevel;
436 
437     /** LDAP security authentication type. */
438     @Size(max = 1000)
439     public String ldapSecurityAuthentication;
440 
441     /** LDAP initial context factory class name. */
442     @Size(max = 1000)
443     public String ldapInitialContextFactory;
444 
445     /** OpenID Connect client ID. */
446     @Size(max = 1000)
447     public String oicClientId;
448 
449     /** OpenID Connect client secret. */
450     @Size(max = 1000)
451     public String oicClientSecret;
452 
453     /** OpenID Connect authorization server URL. */
454     @Size(max = 1000)
455     public String oicAuthServerUrl;
456 
457     /** OpenID Connect token server URL. */
458     @Size(max = 1000)
459     public String oicTokenServerUrl;
460 
461     /** OpenID Connect redirect URL. */
462     @Size(max = 1000)
463     public String oicRedirectUrl;
464 
465     /** OpenID Connect scope. */
466     @Size(max = 1000)
467     public String oicScope;
468 
469     /** OpenID Connect base URL. */
470     @Size(max = 1000)
471     public String oicBaseUrl;
472 
473     /** OpenID Connect default groups. */
474     @Size(max = 1000)
475     public String oicDefaultGroups;
476 
477     /** OpenID Connect default roles. */
478     @Size(max = 1000)
479     public String oicDefaultRoles;
480 
481     /** SAML Identity Provider Entity ID. */
482     @Size(max = 1000)
483     public String samlIdpEntityid;
484 
485     /** SAML Identity Provider Single Sign-On Service URL. */
486     @Size(max = 1000)
487     public String samlIdpSingleSignOnServiceUrl;
488 
489     /** SAML Identity Provider Single Logout Service URL. */
490     @Size(max = 1000)
491     public String samlIdpSingleLogoutServiceUrl;
492 
493     /** SAML Identity Provider X.509 Certificate. */
494     @Size(max = 10000)
495     public String samlIdpX509cert;
496 
497     /** SAML service provider base URL. */
498     @Size(max = 1000)
499     public String samlSpBaseUrl;
500 
501     /** SAML Service Provider Entity ID. */
502     @Size(max = 1000)
503     public String samlSpEntityid;
504 
505     /** SAML Assertion Consumer Service URL. */
506     @Size(max = 1000)
507     public String samlSpAssertionConsumerServiceUrl;
508 
509     /** SAML Service Provider Single Logout Service URL. */
510     @Size(max = 1000)
511     public String samlSpSingleLogoutServiceUrl;
512 
513     /** SAML Service Provider NameID Format. */
514     @Size(max = 1000)
515     public String samlSpNameidformat;
516 
517     /** SAML attribute name for group membership. */
518     @Size(max = 1000)
519     public String samlAttributeGroupName;
520 
521     /** SAML attribute name for role membership. */
522     @Size(max = 1000)
523     public String samlAttributeRoleName;
524 
525     /** SAML default groups. */
526     @Size(max = 1000)
527     public String samlDefaultGroups;
528 
529     /** SAML default roles. */
530     @Size(max = 1000)
531     public String samlDefaultRoles;
532 
533     /** SPNEGO Kerberos 5 configuration file path. */
534     @Size(max = 1000)
535     public String spnegoKrb5Conf;
536 
537     /** SPNEGO JAAS login configuration file path. */
538     @Size(max = 1000)
539     public String spnegoLoginConf;
540 
541     /** SPNEGO JAAS login client module name. */
542     @Size(max = 1000)
543     public String spnegoLoginClientModule;
544 
545     /** SPNEGO JAAS login server module name. */
546     @Size(max = 1000)
547     public String spnegoLoginServerModule;
548 
549     /** SPNEGO pre-authentication username. */
550     @Size(max = 1000)
551     public String spnegoPreauthUsername;
552 
553     /** SPNEGO pre-authentication password. */
554     @Size(max = 1000)
555     public String spnegoPreauthPassword;
556 
557     /** Enable or disable SPNEGO basic authentication. */
558     @Size(max = 10)
559     public String spnegoAllowBasic;
560 
561     /** Enable or disable SPNEGO unsecure basic authentication. */
562     @Size(max = 10)
563     public String spnegoAllowUnsecureBasic;
564 
565     /** Enable or disable SPNEGO NTLM prompt. */
566     @Size(max = 10)
567     public String spnegoPromptNtlm;
568 
569     /** Enable or disable SPNEGO localhost authentication. */
570     @Size(max = 10)
571     public String spnegoAllowLocalhost;
572 
573     /** Enable or disable SPNEGO credential delegation. */
574     @Size(max = 10)
575     public String spnegoAllowDelegation;
576 
577     /** SPNEGO directories to exclude from authentication. */
578     @Size(max = 1000)
579     public String spnegoExcludeDirs;
580 
581     /** SPNEGO logger level (0-7, auto-detected if empty). */
582     @Size(max = 10)
583     public String spnegoLoggerLevel;
584 
585     /** Entra ID application client ID. */
586     @Size(max = 1000)
587     public String entraidClientId;
588 
589     /** Entra ID application client secret. */
590     @Size(max = 1000)
591     public String entraidClientSecret;
592 
593     /** Entra ID tenant ID. */
594     @Size(max = 1000)
595     public String entraidTenant;
596 
597     /** Entra ID authority URL. */
598     @Size(max = 1000)
599     public String entraidAuthority;
600 
601     /** Entra ID OAuth2 reply URL. */
602     @Size(max = 1000)
603     public String entraidReplyUrl;
604 
605     /** Entra ID state parameter TTL in seconds. */
606     @Size(max = 100)
607     public String entraidStateTtl;
608 
609     /** Entra ID default groups. */
610     @Size(max = 1000)
611     public String entraidDefaultGroups;
612 
613     /** Entra ID default roles. */
614     @Size(max = 1000)
615     public String entraidDefaultRoles;
616 
617     /** Entra ID permission field names. */
618     @Size(max = 1000)
619     public String entraidPermissionFields;
620 
621     /** Enable or disable Entra ID domain services. */
622     @Size(max = 10)
623     public String entraidUseDs;
624 }