201311113 / cambak

0 stars 0 forks source link

dd #1

Open 201311113 opened 1 year ago

201311113 commented 1 year ago

4665183238644399

201311113 commented 10 months ago

http://172.17.10.15:31680

201311113 commented 9 months ago

70031002425122 우체국

201311113 commented 9 months ago

4665183671639344

201311113 commented 9 months ago

http://test-dev.travel-wallet.com/api-docs/index.html?urls.primaryName=V4%20APIs%20OPENAPI3

201311113 commented 9 months ago

https://10.30.10.21/manual/manual.html

201311113 commented 9 months ago

510824

8:07 cfBSfyGzjELnjuoIqWELub:APA91bF2U-hcXcxGxlUzzfIEe-HuJ1s-F1lruQxLzkpH0iv85ezn3Y9l5LIuXGJDqGKgibHWvib4HuXCHLRbobOorvQCpNgVUSERHQDvoVp46_1vCpaHEWf5tC6bMHLPKcraxtmhwLNT

201311113 commented 9 months ago

2023-11-28 20:15:07

201311113 commented 9 months ago
tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com

travelwallet
feA2#e#P3afP
201311113 commented 9 months ago
ec_EeiPXqk5atNOFkHupoC:APA91bGVMms7QxIPDdV4B7IgjFxGnq_5RzqhycxCS5D_gpwducLizDRwqTaDxeX_vcc_MT6dkES170iw0ocQk8F4NIZBghJAhEvoQSInRyXd6-Kr6gGQ_BLpSN1ayop1hPLGDt9j5Z-e
201311113 commented 9 months ago

number.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse

201311113 commented 9 months ago

장종범 (0929) 1657513

201311113 commented 9 months ago
aZWgW9eYGMfFsCb4JUyRtg==$4AucvXa09ubb2lYZSZswFg==$1$2$1$3, aZWgW9eYGMfFsCb4JUyRtg==$A+bL15l+gvcAcDFNVI6JHw== aZWgW9eYGMfFsCb4JUyRtg==$7$0$7, aZWgW9eYGMfFsCb4JUyRtg==$0$1
201311113 commented 9 months ago

서울 은평구 연서로16길 8-2 석영빌라" travel-wallet(prod)> id.address_detail => "303호

201311113 commented 9 months ago

01079238264

201311113 commented 9 months ago

4028780046668783 469

201311113 commented 8 months ago

Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

201311113 commented 8 months ago

Kotlin: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors

201311113 commented 8 months ago

springdoc: swagger-ui: path: docs/swagger-ui

implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui")

201311113 commented 8 months ago

http://localhost:8080/docs/swagger-ui.html

201311113 commented 8 months ago

data class Response( val code: Int = SUCCESS_CODE, val message: String = EMPTY_MESSAGE, val data: T? = null, )

fun blockUser( userId: Long ): Response<>{ return Response(code = 2000, message = "", data = null) }

201311113 commented 8 months ago

https://github.travel-wallet.com/TravelWallet-V2/tw2-backoffice-server.git

201311113 commented 8 months ago

https://github.travel-wallet.com/TravelWallet-V2/tw2-travelwallet

201311113 commented 8 months ago

No server chosen by com.mongodb.reactivestreams.client.internal.ClientSessionHelper$$Lambda$3071/0x0000000801b929d8@4c82d917 from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {io.netty.channel.StacklessClosedChannelException}}]}. Waiting for 30000 ms before timing out
201311113 commented 8 months ago

4028780099621804

2812

644

201311113 commented 8 months ago
No server chosen by com.mongodb.reactivestreams.client.internal.ClientSessionHelper$$Lambda$3428/0x0000000801c50480@47f9b6da from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {io.netty.channel.StacklessClosedChannelException}}]}. Waiting for 30000 ms before timing out
201311113 commented 8 months ago

q3t6w9z$C&F)J@NcRfUjWnZr4u7x!A%D

201311113 commented 8 months ago

4665186882681336

189

2811

201311113 commented 8 months ago

@ParameterObject @PageableDefault(page = 0, size = 10) pageable: Pageable

201311113 commented 8 months ago
fun mongoClient(): MongoClient{
        val connectionString = ConnectionString("mongodb://travelwallet:2RE0oMs.o+^G,sdV@tw-dev-messaging-documentdb.cluster-cogohrcbmdks.ap-northeast-2.docdb.amazonaws.com:27017")
        val settings = MongoClientSettings.builder()
            .applyConnectionString(connectionString)
            .applyToConnectionPoolSettings {builder ->
                builder.minSize(10)
                    .maxSize(100)
                    .maintenanceFrequency(10, TimeUnit.MILLISECONDS)
                    .maintenanceInitialDelay(11,TimeUnit.MILLISECONDS)
                    .maxConnectionIdleTime(120, TimeUnit.SECONDS)
                    .maxWaitTime(15, TimeUnit.MILLISECONDS)
            }.build()
        return MongoClients.create(settings)
    }
201311113 commented 8 months ago
; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDateTime` from String "2023-12-22T17:13:26.845+09:00": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2023-12-22T17:13:26.845+09:00' could not be parsed, unparsed text found at index 23
201311113 commented 8 months ago

dev rails-db-nlb-dev.t-wal.com:6379 prod rails-db-nlb.travel-wallet.com:6379 로 각각 변경 부탁드립니다~!

201311113 commented 8 months ago

https://tw2-travelwallet-service-dev.t-wal.com/ https://tw2-travelwallet-service.travel-wallet.com/ ++ db rdb도 세팅 도메인으로 redis랑 같음

201311113 commented 8 months ago
@Repository
abstract class Querydsl4RepositorySupport(private val domainClass: Class<*>) {
    private lateinit var querydsl: Querydsl
    protected lateinit var em: EntityManager
    @Autowired
    lateinit var jpaQueryFactory: JPAQueryFactory

    @Autowired
    fun setEntityManager(em: EntityManager) {
        val entityInformation =
                JpaEntityInformationSupport.getEntityInformation(domainClass, em)
        val resolver: SimpleEntityPathResolver = SimpleEntityPathResolver.INSTANCE
        val path = resolver.createPath(entityInformation.javaType)
        this.em = em
        querydsl = Querydsl(em, PathBuilder(path.type, path.metadata))
    }

    protected fun <T> applyPagination(
            pageable: Pageable,
            contentQuery: Function1<JPAQueryFactory, JPAQuery<T>>
    ): Page<T> {
        val jpaQuery: JPAQuery<T> = contentQuery.invoke(jpaQueryFactory)
        val content: List<T> = querydsl.applyPagination(pageable, jpaQuery).fetch()
        return PageableExecutionUtils.getPage(content, pageable, jpaQuery::fetchCount)
    }
}

interface IdentificationQueryRepository {
    fun findAllWaitingStatusIdentifications()
}

@Repository
class IdentificationQueryRepositoryImpl: IdentificationQueryRepository, Querydsl4RepositorySupport(Identification::class.java){
    override fun findAllWaitingStatusIdentifications() {
        TODO("Not yet implemented")
    }

}
201311113 commented 8 months ago

https://tw2-backoffice-server-dev.t-wal.com/

201311113 commented 8 months ago
override fun searchUser(
        pageable: Pageable,
        userId: Long?,
        phone: String?,
        phoneLast4: String?,
        name: String?,
        birth: String?,
        cardNo: String?,
        email: String?,
        cardId: Long?
    ): Page<SearchUserResponse>
201311113 commented 8 months ago
val user = QUser.user
        val userAdditionalInfo = QUserAdditionalInfo.userAdditionalInfo
        val userMigration = QUserMigration.userMigration
        val userEmail = QUserAuthEmail.userAuthEmail
        val identification = QIdentification.identification

        val isMigrated = CaseBuilder()
            .`when`(userMigration.isNull.or(userMigration.isMigrated.isFalse)).then(false)
            .otherwise(true)

        var predicate: BooleanExpression? = null
        predicate = predicate?.and(if(userId != null) user.id.eq(userId) else null) ?: if(userId != null) user.id.eq(userId) else null
        predicate = predicate?.and(if(phone != null) user.encryptedPhone.eq(phone) else null) ?: if(phone != null) user.encryptedPhone.eq(phone) else null
        if (phoneLast4 != null){
            val phoneMasking = "010****$phoneLast4"
            predicate = predicate?.and(if(phoneLast4 != null) user.phoneMasking.eq(phoneMasking) else null) ?: if(phoneLast4 != null) user.phoneMasking.eq(phoneMasking) else null
        }
        predicate = predicate?.and(if(name != null) user.name.eq(name) else null) ?: if(name != null) user.name.eq(name) else null
        predicate = predicate?.and(if(birth != null) user.dateOfBirth.eq(birth.toLong()) else null) ?: if(birth != null) user.dateOfBirth.eq(birth.toLong()) else null
        predicate = predicate?.and(if(email != null) userEmail.email.eq(email) else null) ?: if(email != null) userEmail.email.eq(email) else null

        val result = applyPagination(pageable){ jpaQueryFactory ->
            jpaQueryFactory
                .select(
                    Projections.constructor(
                        SearchUserResponse::class.java,
                        user.id,
                        user.systemVersion,
                        isMigrated,
                        user.name,
                        user.encryptedPhone,
                        user.encryptedPhoneIv,
                        user.phoneMasking,
                        user.email,
                        identification.encryptedRrn,
                        identification.encryptedRrnIv,
                        user.status,
                        user.os,
                        userAdditionalInfo.latestAppVersion,
                        user.createdAt,
                        user.lastLogin
                    )
                )
                .from(user)
                .leftJoin(userMigration).on(user.id.eq(userMigration.userId))
                .leftJoin(userAdditionalInfo).on(user.id.eq(userAdditionalInfo.id))
                .leftJoin(identification).on(user.id.eq(identification.userId))
                .leftJoin(userEmail).on(user.id.eq(userEmail.userId))
                .where(predicate)
        }
        return result
201311113 commented 8 months ago
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)

    aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
    option = if identification.image_ver == 0
               {}
             else
               {
                 'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
                 'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
                 'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
               }
             end
    image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]

    send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
201311113 commented 8 months ago

개발 : tw2-backoffice-server-dev.t-wal.com 운영 : tw2-backoffice-server.travel-wallet.com 아래는 프론트 페이지 개발 : tw2-backoffice-front-v2-dev.t-wal.com 운영 : tw2-backoffice-front-v2.travel-wallet.com

201311113 commented 8 months ago

prod : https://tw2-travelwallet-service.travel-wallet.com

dev kube service : http://tw2-travelwallet-service-service.tw2:8080 url : https://tw2-travelwallet-service-dev.t-wal.com

201311113 commented 8 months ago

https://tw2-travelwallet-service-dev.t-wal.com/docs/swagger-ui/index.html#/

201311113 commented 8 months ago
{
                 'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
                 'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
                 'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
               }
201311113 commented 8 months ago
@Configuration
class AwsS3Config {

    @Value("\${cloud.aws.credentials.access-key}")
    private val accessKey: String? = null

    @Value("\${cloud.aws.credentials.secret-key}")
    private val secretKey: String? = null

    @Value("\${cloud.aws.credentials.end-point}")
    private val endPoint: String? = null

    @Bean
    fun s3ClientForIdentification(): S3Client{
        return S3Client.builder()
            .region(Region.US_EAST_1)
            .endpointOverride(URI(endPoint!!))
            .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
            .build()
    }

}
201311113 commented 8 months ago
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)

    aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
    option = if identification.image_ver == 0
               {}
             else
               {
                 'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
                 'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
                 'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
               }
             end
    image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]

    send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
201311113 commented 8 months ago

https://tw2-kibana-dev.t-wal.com:5601/

201311113 commented 8 months ago
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)

    aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
    option = if identification.image_ver == 0
               {}
             else
               {
                 'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
                 'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
                 'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
               }
             end
    image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]

    send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
201311113 commented 8 months ago
class Identification < ApplicationRecord

  mount_uploader :card_image, PassportImageUploader
  validates_integrity_of :card_image
  validates_processing_of :card_image
  validates_download_of :card_image
.
.
.
class PassportImageUploader < CarrierWave::Uploader::Base

  if Rails.env.local? || Rails.env.test?
    storage :file
  else
    storage :fog
  end

  def extension_whitelist
    %w(jpg jpeg gif png enc)
  end

  def filename
    "#{secure_token}.#{file.extension}" if original_filename.present?
  end

  protected
  def secure_token
    var = :"@#{mounted_as}_secure_token"
    model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
  end
end
201311113 commented 8 months ago
software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:102)
    at software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:47)
    at software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:211)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
201311113 commented 8 months ago
echo -n | openssl s_client -connect HOST:PORTNUMBER \
  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/server.crt
keytool -import -trustcacerts -file /tmp/server.crt -alias Server-alias -keystore $JAVA_HOME/jre/lib/security/cacerts
201311113 commented 8 months ago

echo | openssl s_client -servername hostname -connect 172.17.13.12:9000 2>/dev/null | openssl x509 -text > server.crt

201311113 commented 8 months ago
@Bean
    fun s3ClientForIdentification(): S3Client{
        return S3Client.builder()
            .region(Region.US_EAST_1)
            .endpointOverride(URI(endPoint!!))
            .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
            .build()
    }