Skip to content

Commit

Permalink
Merge branch 'feature/AncientApparition' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Oct 20, 2023
2 parents 262d8f2 + 1b22fd7 commit a4e68b3
Show file tree
Hide file tree
Showing 221 changed files with 6,554 additions and 4,018 deletions.
4 changes: 0 additions & 4 deletions example/winx-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,5 @@
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Unlike sentry.properties, this config is used by the Sentry Starter.
sentry.dsn=${SENTRY_DSN:}
# Set traces-sample-rate to 1.0 to capture 100% of transactions for performance monitoring.
# We recommend adjusting this value in production.
## Set traces-sample-rate to 1.0 to capture 100% of transactions for performance monitoring.
## We recommend adjusting this value in production.
sentry.traces-sample-rate=1.0
#sentry.traces-sample-rate=0.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ management.metrics.tags.application=wings-winx

spring.boot.admin.monitor.status-interval=30000

# https://codecentric.github.io/spring-boot-admin/current/#spring-boot-admin-client
## https://codecentric.github.io/spring-boot-admin/current/#spring-boot-admin-client
spring.boot.admin.client.enabled=true
spring.boot.admin.client.url=http://localhost:8093

# client can register at the protected server api
## client can register at the protected server api
spring.boot.admin.client.username=boot-admin-server
spring.boot.admin.client.password=${DING_TALK_TOKEN:!!!YOU_MUST_USE_STRONG_PASSWORD_HERE!!!}

# server can access the protected client endpoints
## server can access the protected client endpoints
spring.boot.admin.client.instance.metadata.user.name=boot-admin-client
spring.boot.admin.client.instance.metadata.user.password=${spring.boot.admin.client.password}

spring.boot.admin.client.instance.metadata.tags.environment=${os.name}

#
wings.warlock.security.mem-user[boot-admin-server].user-id=78
wings.warlock.security.mem-user[boot-admin-server].username=${spring.boot.admin.client.username}
wings.warlock.security.mem-user[boot-admin-server].password={basic}${spring.boot.admin.client.password}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DROP TABLE IF EXISTS `winx_user_detail`; -- 210/用户详情;
DROP TABLE IF EXISTS `winx_user_detail`; -- 210/User Detail;
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-- 时区统一(GMT+8),编码统一(utf8mb4)
-- Unify timezone (GMT+8), Unify charset (utf8mb4)
-- CREATE DATABASE `wings_example` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;

CREATE TABLE `winx_user_detail` (
`id` BIGINT(20) NOT NULL COMMENT '主键',
`create_dt` DATETIME(3) NOT NULL DEFAULT NOW(3) COMMENT '创建日时(系统)',
`modify_dt` DATETIME(3) NOT NULL DEFAULT '1000-01-01' ON UPDATE NOW(3) COMMENT '修改日时(系统)',
`delete_dt` DATETIME(3) NOT NULL DEFAULT '1000-01-01' COMMENT '标记删除',
`commit_id` BIGINT(20) NOT NULL COMMENT '提交id',
`id` BIGINT(20) NOT NULL COMMENT 'primary key',
`create_dt` DATETIME(3) NOT NULL DEFAULT NOW(3) COMMENT 'created datetime(sys)',
`modify_dt` DATETIME(3) NOT NULL DEFAULT '1000-01-01' ON UPDATE NOW(3) COMMENT 'modified datetime(sys)',
`delete_dt` DATETIME(3) NOT NULL DEFAULT '1000-01-01' COMMENT 'logic deleted datetime',
`commit_id` BIGINT(20) NOT NULL COMMENT 'commit id',
`user_id` BIGINT(20) NOT NULL COMMENT 'win_user_basis.id',
`user_type` INT(11) NOT NULL DEFAULT '0' COMMENT '用户类型/21001##:用户|运营|客服',
`email` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '用户邮箱',
`user_type` INT(11) NOT NULL DEFAULT '0' COMMENT 'user type/21001##:customer|operator|helpdesk',
`email` VARCHAR(100) NOT NULL DEFAULT '' COMMENT 'user email',
PRIMARY KEY (`id`),
UNIQUE INDEX uq_user_id (`user_id`),
UNIQUE INDEX ix_email (`email`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='210/用户详情';
DEFAULT CHARSET = utf8mb4 COMMENT ='210/User Detail';

-- -----------

INSERT IGNORE INTO `sys_light_sequence` (`seq_name`, `block_id`, `next_val`, `step_val`, `comments`)
VALUES ('winx_user_detail', 0, 1000, 100, '动态插入5位起,静态5位');
VALUES ('winx_user_detail', 0, 1000, 100, 'dynamic 5+ digits, static 5 digits');

REPLACE INTO `sys_constant_enum` (`id`, `type`, `code`, `hint`, `info`)
VALUES (2100100, 'user_type', 'user_type', '用户类型', 'classpath:/wings-tmpl/ConstantEnumTemplate.java'),
(2100101, 'user_type', 'customer', '用户', '用户'),
(2100102, 'user_type', 'operator', '运营', '运营'),
(2100103, 'user_type', 'helpdesk', '客服', '客服');
VALUES (2100100, 'user_type', 'user_type', 'User Type', 'classpath:/wings-tmpl/ConstantEnumTemplate.java'),
(2100101, 'user_type', 'customer', 'customer', 'customer'),
(2100102, 'user_type', 'operator', 'operator', 'operator'),
(2100103, 'user_type', 'helpdesk', 'helpdesk', 'helpdesk');
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://codecentric.github.io/spring-boot-admin/current/#spring-boot-admin-client
## https://codecentric.github.io/spring-boot-admin/current/#spring-boot-admin-client

spring.boot.admin.server.enabled=true
wings.warlock.security.login-forward=false
Expand Down
2 changes: 1 addition & 1 deletion observe/mirana
17 changes: 13 additions & 4 deletions observe/scripts/wings-mysql-dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if [[ "$database" == "" ]]; then
echo -e "\033[0;31mWARN: need database(at param-2) to dump, eg.\033[m"
echo "./wings-mysql-dump.sh wings-mysql-client.cnf database --no-data"
echo -e "\033[0;33mNOTE:current databases \033[m"
# shellcheck disable=SC2086
mysql $confopts -N -e "show databases;"
exit
fi
Expand Down Expand Up @@ -116,32 +117,40 @@ ls -lsh |grep "$dump_head" | tee -a "$dump_tbl_file"

echo -e "\033[0;33mNOTE: tips for zip, scp, restore \033[m"
tee -a "$dump_tip_file" << EOF
## checksum
md5sum -c $dump_md5_file # checksum
## extract
tar -tzf $dump_tar_file # list files
tar -xzf $dump_tar_file # extract files
tar -xzf $dump_tar_file $dump_tip_file # extract tips
## transfer
scp -P 2022 ${dump_head}.* trydofor@moilioncircle:/data/mysql-dump/
rsync -azP -e "ssh -p 2022" ${dump_head}.* trydofor@moilioncircle:/data/mysql-dump/
## restore
unalias mysql
newdb="$dump_head"
mycnf="$extracnf"
# with progress
## with progress
cat $dump_logs_file $dump_main_file \\
| pv -Ipert \\
| sed -E 's/DEFINER=[^*]+/DEFINER=CURRENT_USER/g' \\
| mysql $confopts \\
| mysql --defaults-extra-file=\$mycnf \\
--init-command="CREATE DATABASE IF NOT EXISTS \$newdb; use \$newdb;"
# nohup
## nohup
nohup \\
cat $dump_logs_file $dump_main_file \\
| sed -E 's/DEFINER=[^*]+/DEFINER=CURRENT_USER/g' \\
| mysql $confopts \\
| mysql --defaults-extra-file=\$mycnf \\
--init-command="CREATE DATABASE IF NOT EXISTS \$newdb; use \$newdb;" \\
&
## masking
./reset-password.sh \$mycnf \$newdb;
EOF

echo -e "\033[0;33mNOTE: tar files into $dump_tar_file \033[m"
Expand Down
2 changes: 1 addition & 1 deletion observe/scripts/wings-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function build_auto() {
echo -e "\033[37;42;1mINFO: ==== boot env ==== \033[0m"
this_file="$0"
if [[ -L "$this_file" ]]; then
link_file=$(realpath $this_file)
link_file=$(realpath "$this_file")
link_envs=${link_file%.*}.env
if [[ -f "$link_envs" ]]; then
echo "env-link=$link_envs"
Expand Down
61 changes: 40 additions & 21 deletions observe/scripts/wings-starter.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
THIS_VERSION=2023-06-22
THIS_VERSION=2023-10-18
################ modify the following params ################
WORK_DIR='' # directory of script-generated files and logs. default empty (script location)
TAIL_LOG='log' # the log to tail, (log|out|new|ask)
Expand Down Expand Up @@ -296,7 +296,6 @@ case "$ARGS_RUN" in
check_cmd head
check_cmd id
check_cmd java
check_cmd jstat
check_cmd kill
check_cmd ln
check_cmd ls
Expand Down Expand Up @@ -419,13 +418,13 @@ case "$ARGS_RUN" in
cat "$BOOT_OUT"
exit
else
echo -e "\033[37;43;1mNOTE: current PID=$cid of $BOOT_JAR \033[0m"
echo -e "\033[37;42;1mINFO: current PID=$cid of $BOOT_JAR \033[0m"
# shellcheck disable=SC2086
ps -fwww $cid
fi

if [[ "$ARGS_RUN" != "start" ]]; then
echo -e "\033[37;43;1mNOTE: tail -f $BOOT_OUT \033[0m"
echo -e "\033[37;42;1mINFO: tail -f $BOOT_OUT \033[0m"
timeout -s 9 10 tail -f "$BOOT_OUT"
echo -e "\033[37;43;1m====== ${BOOT_JAR//?/=} ======\033[0m"
echo -e "\033[37;43;1m====== $BOOT_JAR ======\033[0m"
Expand Down Expand Up @@ -464,7 +463,7 @@ case "$ARGS_RUN" in
fi

if [[ -f "$tail_log" ]]; then
echo -e "\033[37;43;1mNOTE: tail -f $tail_log, Ctrl-C to break \033[0m"
echo -e "\033[37;42;1mINFO: tail -f $tail_log, Ctrl-C to break \033[0m"
tail -f "$tail_log"
fi
;;
Expand Down Expand Up @@ -537,17 +536,17 @@ case "$ARGS_RUN" in

tail_num=20
if [[ -f "$BOOT_OUT" ]]; then
echo -e "\033[37;43;1mNOTE: tail -n $tail_num $BOOT_OUT \033[0m"
echo -e "\033[37;42;1mINFO: tail -n $tail_num $BOOT_OUT \033[0m"
tail -n $tail_num "$BOOT_OUT"
fi
if [[ -f "$BOOT_LOG" ]]; then
echo -e "\033[37;43;1mNOTE: tail -n $tail_num $BOOT_LOG \033[0m"
echo -e "\033[37;42;1mINFO: tail -n $tail_num $BOOT_LOG \033[0m"
tail -n $tail_num "$BOOT_LOG"
fi
pid=$(awk '{print $1}' "$BOOT_PID")
cid=$(pgrep -f "$grep_key")
echo -e "\033[37;43;1mNOTE: boot.pid=$pid \033[0m"
echo -e "\033[33mNOTE: current PID=$cid of $BOOT_JAR \033[0m"
echo -e "\033[37;42;1mINFO: boot.pid=$pid \033[0m"
echo -e "\033[32m current PID=$cid of $BOOT_JAR \033[0m"
ps -fwww "$cid" || exit

if [[ $pid -ne $cid ]]; then
Expand All @@ -558,20 +557,40 @@ case "$ARGS_RUN" in
mrs=$(ps -o rss "$cid" | grep -v RSS | numfmt --grouping)
# shellcheck disable=SC2009
mvs=$(ps -o vsz "$cid" | grep -v VSZ | numfmt --grouping)
echo -e "\033[37;43;1mNOTE: ps -o rss -o vsz $cid \033[0m"
echo -e "\033[32m Resident= $mrs Kb\033[m"
echo -e "\033[32m Virtual= $mvs Kb\033[m"
echo -e "\033[37;42;1mINFO: ps -o rss -o vsz $cid \033[0m"
echo -e "Resident (RSS) = $(printf "%*s" 12 $mrs) Kb"
echo -e "Virtual (VSZ) = $(printf "%*s" 12 $mvs) Kb"

if [[ "$USER_RUN" == "$USER" ]]; then
echo -e "\033[37;42;1mINFO: $(which jstat) -gcutil $cid 1000 3 \033[0m"
jstat -gcutil "$cid" 1000 3
echo -e "\033[37;42;1mINFO: $(which jstat) -gc $cid 1000 3 \033[0m"
jstat -gc "$cid" 1000 3
else
echo -e "\033[37;43;1mNOTE: sudo $(which jstat) -gcutil $cid 1000 3 \033[0m"
echo -e "\033[37;43;1mNOTE: sudo $(which jstat) -gc $cid 1000 3 \033[0m"
fi

echo -e "\033[37;43;1mNOTE: ==== other useful command ==== \033[0m"
echo -e "\033[32m jmap -heap $cid \033[m mac's bug=8161164, lin's ptrace_scope"
echo -e "\033[32m profiler.sh -d 30 -f profile.svg $cid \033[m https://github.com/jvm-profiling-tools/async-profiler"
echo -e "\033[32m java -jar arthas-boot.jar $cid \033[m https://github.com/alibaba/arthas"

check_user
echo -e "\033[37;43;1mNOTE: jstat -gcutil $cid 1000 1 \033[0m"
jstat -gcutil "$cid" 1000 1
echo -e "\033[37;43;1mNOTE: jstat -gc $cid 1000 1 \033[0m"
jstat -gc "$cid" 1000 1
if id | grep -q '(sudo)'; then
if which jhsdb &> /dev/null; then
echo -e "\033[37;42;1mINFO: sudo $(which jhsdb) jmap --heap --pid $cid \033[m"
sudo jhsdb jmap --heap --pid "$cid"
else
echo -e "\033[37;42;1mINFO: sudo $(which jmap) -heap $cid \033[m"
sudo jmap -heap "$cid"
fi
else
if which jhsdb &> /dev/null; then
echo -e "\033[37;43;1mNOTE: sudo $(which jhsdb) jmap --heap --pid $cid \033[m"
else
echo -e "\033[37;43;1mNOTE: sudo $(which jmap) -heap $cid \033[m"
fi
fi

echo -e "\033[37;43;1mNOTE: ==== useful tool ==== \033[0m"
echo -e "\033[32m profiler.sh -d 30 -f profile.svg $cid \033[m https://github.com/jvm-profiling-tools/async-profiler"
echo -e "\033[32m $(which java) -jar arthas-boot.jar $cid \033[m https://github.com/alibaba/arthas"
;;
tail)
file_log=$BOOT_LOG
Expand Down
4 changes: 2 additions & 2 deletions observe/scripts/wings-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ mvn --version || exit
MAVEN_OPTS="-Xmx2048m"

## install
[[ "$*" =~ .*init.* ]] && mvn -U clean install -Dmaven.test.skip=true
[[ "$*" == "" || "$*" =~ .*init.* ]] && mvn -U clean install -Dmaven.test.skip=true

## auto test
[[ "$*" =~ .*auto.* ]] && (mvn test -ff -Dmaven.test.skip=false \
[[ "$*" == "" || "$*" =~ .*auto.* ]] && (mvn test -ff -Dmaven.test.skip=false \
-Dtesting-json='{"debug":"false",
"sentry.logging.enabled":"false",
"spring.wings.silencer.enabled.verbose":"false",
Expand Down
22 changes: 20 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.7</version> <!-- https://github.com/spring-projects/spring-boot/releases -->
<version>3.0.9</version> <!-- https://github.com/spring-projects/spring-boot/releases -->
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand All @@ -21,7 +21,7 @@

<properties>
<!-- https://github.com/spring-projects/spring-boot/releases -->
<revision>3.0.7</revision>
<revision>3.0.9</revision>
<!-- https://maven.apache.org/maven-ci-friendly.html -->
<changelist>300-SNAPSHOT</changelist>
<!-- https://docs.spring.io/spring-boot/docs/3.0.3/reference/html/dependency-versions.html -->
Expand All @@ -43,6 +43,9 @@
<mapstruct.version>1.5.5.Final</mapstruct.version> <!-- https://github.com/mapstruct/mapstruct/releases -->
<guava.version>32.1.1-jre</guava.version> <!-- https://github.com/google/guava/releases/ -->
<commons-io.version>2.13.0</commons-io.version> <!-- https://commons.apache.org/proper/commons-io/ -->
<commons-collections4.version>4.4</commons-collections4.version> <!-- https://commons.apache.org/proper/commons-collections/ -->
<commons-text.version>1.10.0</commons-text.version> <!-- https://commons.apache.org/proper/commons-text/ -->
<joda-convert.version>2.2.3</joda-convert.version> <!-- https://github.com/JodaOrg/joda-convert/releases -->
<!-- wings project -->
<mirana.version>2.6.0-SNAPSHOT</mirana.version> <!-- https://github.com/trydofor/pro.fessional.mirana -->
<meepo.version>1.4.1-SNAPSHOT</meepo.version> <!-- https://github.com/trydofor/pro.fessional.meepo -->
Expand Down Expand Up @@ -362,6 +365,21 @@
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
<version>${joda-convert.version}</version>
</dependency>
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
Expand Down
23 changes: 23 additions & 0 deletions radiant/devs-mvndep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<artifactId>faceless-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>faceless-codegen</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pro.fessional.wings</groupId>
<artifactId>warlock-codegen</artifactId>
Expand Down Expand Up @@ -74,6 +79,24 @@
<version>${commons-io.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
<version>${joda-convert.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
Expand Down
Loading

0 comments on commit a4e68b3

Please sign in to comment.