'2019/09'에 해당되는 글 8건

  1. 2019.09.20 [Spring] Springboot + Thymeleaf 설정 시 주의.
  2. 2019.09.19 [Nginx] nginx + ldap 연동
  3. 2019.09.18 [SpringBoot] Project Starter
  4. 2019.09.16 [SpringBoot] @PropertySource 로 yaml 파일 읽기
  5. 2019.09.09 [Spring] Could not find method annotationProcessor()..
  6. 2019.09.09 [Elasticsearch] G1GC 설정 변경 사항.
  7. 2019.09.04 [여기어때] 검색홈 개편
  8. 2019.09.03 [Javascript] 자동완성 key event 처리

[Spring] Springboot + Thymeleaf 설정 시 주의.

ITWeb/개발일반 2019. 9. 20. 13:58

springboot 에서 thymeleaf 사용 시 applicaiton.properties 내 주의 사항 정도 입니다.

 

기본 설정은 아래와 같습니다.

 

spring.thymeleaf.cache=true
spring.thymeleaf.check-template=true
spring.thymeleaf.check-template-location=true
spring.thymeleaf.enabled=true
spring.thymeleaf.enable-spring-el-compiler=false
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.excluded-view-names=
spring.thymeleaf.mode=HTML
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.reactive.chunked-mode-view-names=
spring.thymeleaf.reactive.full-mode-view-names=
spring.thymeleaf.reactive.max-chunk-size=0B
spring.thymeleaf.reactive.media-types=
spring.thymeleaf.render-hidden-markers-before-checkboxes=false
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.servlet.produce-partial-output-while-processing=true
spring.thymeleaf.suffix=.html
spring.thymeleaf.template-resolver-order=0
spring.thymeleaf.view-names=

 

이 설정 값들을 넣어 주지 않으셔도 기본 동작에는 문제가 없으나 설정 최적화와 이해를 위해서는 각각의 설정이 어떤 의미를 가지는지 아는게 중요 합니다.

 

viewResolver 관련해서 주의 점은!!

spring.thymeleaf.view-names# Comma-separated list of view names (patterns allowed) that can be resolved.

이 설정을 제거 하시거나 등록을 해주셔야 한다는 것입니다.

 

그냥 저렇게 empty value 로 놔두시면 viewResolver 오류가 발생을 하게 됩니다.

주석에 나와 있는 설명 처럼 목록으로 넣어 주시거나 패턴으로 잡아 주시면 되겠습니다.

:

[Nginx] nginx + ldap 연동

ITWeb/개발일반 2019. 9. 19. 14:38

$ nginx -V
nginx version: nginx/1.14.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.1.0h  27 Mar 2018
TLS SNI support enabled
configure arguments: --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-pcre=../pcre-8.42 --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-1.1.0h --with-http_ssl_module --add-module=../nginx-auth-ldap --user=nginx --group=nginx

 

다운로드)

http://nginx.org/en/download.html

 

소스코드 Clone)

$ git clone https://github.com/kvspb/nginx-auth-ldap.git

$ tar -xvzf nginx-1.14.2.tar.gz
$ cd nginx-1.14.2
$ ./configure --with-compat --add-dynamic-module=../nginx-auth-ldap
$ make modules

$ cp objs/ngx_http_auth_ldap_module.so /etc/nginx/modules/

$ vi /etc/nginx/nginx.conf

...중략...

load_module /etc/nginx/modules/ngx_http_auth_ldap_module.so;

...중략...

 

http {
    auth_ldap_cache_enabled on;
    auth_ldap_cache_expiration_time 10000;
    auth_ldap_cache_size 1000;

    ldap_server ipa {
         url "ldap://.................";
         binddn "uid=LDAPUSER,cn=users,cn=accounts,dc=..............,dc=kr";
         binddn_passwd "LDAPPASSWORD";
         group_attribute uniquemember;
         group_attribute_is_dn on;
         require valid_user;
    }

    server {
           location / {
           auth_ldap "Enter AD credentials e.g. 'your ID'";
           auth_ldap_servers ipa;
           root   html;
           index  index.html index.htm;
            }
    }
}

 

$ nginx -t
nginx: [emerg] module "ngx_http_auth_ldap_module" is already loaded in /etc/nginx/nginx.conf:8
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx 재시작

 

-- load_module /etc/nginx/modules/ngx_http_auth_ldap_module.so; 부분 제거


$ systemctl restart nginx

 

참고)
- nginx dynamic module build
https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/

 

이걸 어디서 사용하냐면 kibana + ldap 연동 시 사용하면 좋습니다. (ldap 연동은 elastic stack basic 이 아니라서....)

기고해 주신 보스웰 고맙습니다.

:

[SpringBoot] Project Starter

ITWeb/개발일반 2019. 9. 18. 10:10

시작 하기에 앞서 한번 읽어 보고 하면 좋은 링크 스크랩.

 

https://start.spring.io
https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/
https://docs.gradle.org/current/userguide/java_library_plugin.html

 

저 문서들을 읽고 나니 왜 스프링부트가 대세가 되었는지 알겠내요.

:

[SpringBoot] @PropertySource 로 yaml 파일 읽기

ITWeb/개발일반 2019. 9. 16. 13:34

아래 문서에 보면 설명이 잘 나와 있습니다.

기록 하는 차원에서 남겨 봅니다.

 

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-yaml-shortcomings

 

24. Externalized Configuration

Getters and setters are usually mandatory, since binding is through standard Java Beans property descriptors, just like in Spring MVC. A setter may be omitted in the following cases:Maps, as long as they are initialized, need a getter but not necessarily a

docs.spring.io

1. If you use “Starters”, SnakeYAML is automatically provided by spring-boot-starter.
2. The YamlPropertySourceLoader class can be used to expose YAML as a PropertySource in the Spring Environment. Doing so lets you use the @Value annotation with placeholders syntax to access YAML properties.

 

SnakeYAML 이 기본 탑재

@Value 로 접근 가능

 

@PropertySource("classpath:/application.yml")
...
@Value("${spring.profiles.active}")
private String profile;

@PropertySource("classpath:/application.yml")
...
@Value("${spring.profiles.active}")
private String profile;

 

:

[Spring] Could not find method annotationProcessor()..

ITWeb/개발일반 2019. 9. 9. 18:23

Intellij 에서 lombok 설정 관련 오류가 난 케이스 입니다.

 

Could not find method annotationProcessor() 이 에러는 gradle 버전 4.6 이상을 사용 하시면 발생 하지 않게 됩니다.

저는 4.4 버전으로 기본 구성을 예전에 해 놓다 보니 이번에 오류가 발생을 했었내요. 

그래서 기록해 둡니다.

 

그 이외는 intellij 설정에서 enable annotation processing 설정을 해주시면 됩니다.

:

[Elasticsearch] G1GC 설정 변경 사항.

Elastic/Elasticsearch 2019. 9. 9. 15:11

7.4.1 이상 부터 적용 될 것 같습니다.

https://github.com/elastic/elasticsearch/pull/46169/commits/f4b587257ffd9c7f3d2eecc7096a100b72cb46d6

 

Fix G1 GC default IHOP by henningandersen · Pull Request #46169 · elastic/elasticsearch

G1 GC were setup to use an InitiatingHeapOccupancyPercent of 75. This could leave used memory at a very high level for an extended duration, triggering the real memory circuit breaker even at low a...

github.com

GIGC 를 사용하고 있기 때문에 기록해 봅니다.

:

[여기어때] 검색홈 개편

Legacy 2019. 9. 4. 12:44

여기어떄 검색 홈

죽어 있던 검색 홈을 다시 살렸습니다.

지금 부터 시작 이라고 생각 하고 앞으로 다양한 변화와 실험 이어 가보겠습니다.

 

#여기어때 #검색 #개발 #기획 #디자인 모두 수고 많으셨습니다.

#아이리스 #데이빗 #에드가 #킨 #넬 #지나

:

[Javascript] 자동완성 key event 처리

ITWeb/개발일반 2019. 9. 3. 08:58

keyUp, keyDown, keyPress, onFocus, onChange 등의 이벤트들이 있습니다.

여기서 한글 처리를 위해서는 keyPress 를 사용 할 수 없는데요.

이유는 keyUp/Down 은 key code 를 리턴 하고, keyPress 는 ascii code 를 리턴 합니다.

이런 이유로 한글에 대한 처리가 되지 않습니다.

 

별거 아닌 내용이지만 또 기억 못할 까봐 기록 합니다.

: