Skip to content

Commit

Permalink
feat: add /# topic acl
Browse files Browse the repository at this point in the history
  • Loading branch information
lsxredrain committed Dec 30, 2021
1 parent 57d5bfe commit c381d51
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 33 deletions.
84 changes: 51 additions & 33 deletions dgiot_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ else
echo " This is an officially unverified linux system,"
echo " if there are any problems with the installation and operation, "
echo " please feel free to contact www.iotn2n.com for support."
os_type=1
os_type=3
fi

# ============================= get input parameters =================================================
Expand Down Expand Up @@ -1164,44 +1164,62 @@ function devops() {
cp ./${software}.tar.gz ${install_dir}/go_fastdfs/files/package/
}

function install_windows() {
# initdb -D /data/dgiot/dgiot_pg_writer/data/
# pg_ctl -D /data/dgiot/dgiot_pg_writer/data/ -l logfile start
# pg_ctl.exe register -N pgsql -D /data/dgiot/dgiot_pg_writer/data/
# net stop pgsql
# net start pgsql
/usr/local/lib/erlang/install
cd /data
./dgiot_hub.exe start
echo -e "`date +%F_%T` $LINENO: ${GREEN} install parse_server success${NC}"
}

## ==============================Main program starts from here============================

set -e
#set -x
echo -e "`date +%F_%T` $LINENO: ${GREEN} dgiot ${verType} deploy start${NC}"
if [ "${verType}" == "single" ]; then
# Install server and client
if [ -x ${install_dir}/dgiot ]; then
update_flag=1
update_dgiot
else
pre_install
clean_services
deploy_postgres
deploy_parse_server # 配置数据
install_postgres_exporter
deploy_tdengine_server # 时序数据
install_go_fastdfs # 文件数据
install_erlang_otp
install_dgiot
#install_prometheus #占用资源较多,先去除
#install_grafana #占用资源较多,先去除
#install_nginx
build_nginx
fi
elif [ "${verType}" == "cluster" ]; then
# todo
if [ -x ${install_dir}/dgiot ]; then
update_flag=1
#update_dgiot_cluster
else
echo "install_update_dgiot_cluster"
#install_update_dgiot_cluster
fi
elif [ "${verType}" == "devops" ]; then
devops
if [ "${os_type}" == 3 ]; then
echo -e "`date +%F_%T` $LINENO: ${GREEN} dgiot ${verType} windos deploy start${NC}"
set +uxe
install_windows
else
echo "please input correct verType"
if [ "${verType}" == "single" ]; then
# Install server and client
if [ -x ${install_dir}/dgiot ]; then
update_flag=1
update_dgiot
else
pre_install
clean_services
deploy_postgres
deploy_parse_server # 配置数据
install_postgres_exporter
deploy_tdengine_server # 时序数据
install_go_fastdfs # 文件数据
install_erlang_otp
install_dgiot
#install_prometheus #占用资源较多,先去除
#install_grafana #占用资源较多,先去除
#install_nginx
build_nginx
fi
elif [ "${verType}" == "cluster" ]; then
# todo
if [ -x ${install_dir}/dgiot ]; then
update_flag=1
#update_dgiot_cluster
else
echo "install_update_dgiot_cluster"
#install_update_dgiot_cluster
fi
elif [ "${verType}" == "devops" ]; then
devops
else
echo "please input correct verType"
fi
fi

echo -e "`date +%F_%T` $LINENO: ${GREEN} dgiot ${verType} deploy end${NC}"
8 changes: 8 additions & 0 deletions etc/acl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,13 @@

{deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.

{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$dg/#", "#"]}.

{allow, all, pubsub, ["$dg/%c/#"]}.

{allow, all, pubsub, ["$dg/%u/#"]}.

{deny, all, subscribe, ["$dg/#", {eq, "#"}]}.

{allow, all}.

94 changes: 94 additions & 0 deletions logfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
2021-12-28 17:22:09.175 HKT [8848] ��־: listening on IPv6 address "::1", port 5432
2021-12-28 17:22:09.175 HKT [8848] ��־: listening on IPv4 address "127.0.0.1", port 5432
2021-12-28 17:22:09.375 HKT [17504] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:21:53 HKT
2021-12-28 17:22:09.649 HKT [8848] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:23:16.241 HKT [8848] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 17:23:16.245 HKT [8848] ��־: �ж��κμ�������
2021-12-28 17:23:16.249 HKT [8848] ��־: ��������: logical replication launcher (PID 12536) ���˳�, �˳����� 1
2021-12-28 17:23:16.252 HKT [15436] ��־: ���ڹر�
2021-12-28 17:23:16.278 HKT [8848] ��־: ���ݿ�ϵͳ�ѹر�
2021-12-28 17:23:33.576 HKT [10400] ��־: listening on IPv6 address "::1", port 5432
2021-12-28 17:23:33.577 HKT [10400] ��־: listening on IPv4 address "127.0.0.1", port 5432
2021-12-28 17:23:33.772 HKT [17188] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:23:16 HKT
2021-12-28 17:23:34.052 HKT [10400] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:23:37.688 HKT [10400] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 17:23:37.691 HKT [10400] ��־: �ж��κμ�������
2021-12-28 17:23:37.696 HKT [10400] ��־: ��������: logical replication launcher (PID 7384) ���˳�, �˳����� 1
2021-12-28 17:23:37.698 HKT [16368] ��־: ���ڹر�
2021-12-28 17:23:37.723 HKT [10400] ��־: ���ݿ�ϵͳ�ѹر�
2021-12-28 17:23:48.334 HKT [16416] ��־: listening on IPv6 address "::1", port 5432
2021-12-28 17:23:48.335 HKT [16416] ��־: listening on IPv4 address "127.0.0.1", port 5432
2021-12-28 17:23:48.527 HKT [17128] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:23:37 HKT
2021-12-28 17:23:48.845 HKT [16416] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:26:57.818 HKT [16416] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 17:26:57.822 HKT [16416] ��־: �ж��κμ�������
2021-12-28 17:26:57.827 HKT [16416] ��־: ��������: logical replication launcher (PID 15376) ���˳�, �˳����� 1
2021-12-28 17:26:57.829 HKT [5168] ��־: ���ڹر�
2021-12-28 17:26:57.856 HKT [16416] ��־: ���ݿ�ϵͳ�ѹر�
2021-12-28 17:27:03.095 CST [16748] ��־: ���� "dynamic_shared_memory_type" ��ֵ��Ч: "posix"
2021-12-28 17:27:03.095 CST [16748] ��ʾ: Available values: windows, none.
2021-12-28 17:27:03.095 CST [16748] ��������: �����ļ� "D:/msys64/data/dgiot/dgiot_pg_writer/data/postgresql.conf" �д�
2021-12-28 17:28:16.119 CST [13500] ��־: ���� "dynamic_shared_memory_type" ��ֵ��Ч: "posix"
2021-12-28 17:28:16.119 CST [13500] ��ʾ: Available values: windows, none.
2021-12-28 17:28:16.119 CST [13500] ��������: �����ļ� "D:/msys64/data/dgiot/dgiot_pg_writer/data/postgresql.conf" �д�
2021-12-28 17:29:11.086 HKT [14580] ��־: listening on IPv6 address "::1", port 5432
2021-12-28 17:29:11.087 HKT [14580] ��־: listening on IPv4 address "127.0.0.1", port 5432
2021-12-28 17:29:11.283 HKT [6680] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:28:57 HKT
2021-12-28 17:29:11.565 HKT [14580] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:30:52.696 HKT [14580] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 17:30:52.700 HKT [14580] ��־: �ж��κμ�������
2021-12-28 17:30:52.704 HKT [14580] ��־: ��������: logical replication launcher (PID 8448) ���˳�, �˳����� 1
2021-12-28 17:30:52.706 HKT [16696] ��־: ���ڹر�
2021-12-28 17:30:52.732 HKT [14580] ��־: ���ݿ�ϵͳ�ѹر�
2021-12-28 17:31:06.838 HKT [17856] ��־: listening on IPv6 address "::1", port 7432
2021-12-28 17:31:06.839 HKT [17856] ��־: listening on IPv4 address "127.0.0.1", port 7432
2021-12-28 17:31:07.035 HKT [76] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:30:52 HKT
2021-12-28 17:31:07.305 HKT [17856] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:35:47.585 HKT [18016] ��������: ���ݿ� "jonhl" ������
2021-12-28 17:36:50.490 HKT [18268] ��������: ���ݿ� "jonhl" ������
2021-12-28 17:42:28.424 HKT [17856] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 17:42:28.427 HKT [17856] ��־: �ж��κμ�������
2021-12-28 17:42:28.431 HKT [17856] ��־: ��������: logical replication launcher (PID 13672) ���˳�, �˳����� 1
2021-12-28 17:42:28.433 HKT [18424] ��־: ���ڹر�
2021-12-28 17:42:28.456 HKT [17856] ��־: ���ݿ�ϵͳ�ѹر�
2021-12-28 17:42:32.852 HKT [15164] ��־: listening on IPv6 address "::1", port 7432
2021-12-28 17:42:32.852 HKT [15164] ��־: listening on IPv4 address "127.0.0.1", port 7432
2021-12-28 17:42:33.048 HKT [5052] ��־: ���ݿ��ϴιر�ʱ��Ϊ 2021-12-28 17:42:28 HKT
2021-12-28 17:42:33.321 HKT [15164] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:47:54.820 HKT [9068] ��������: ��ɫ "postgres" ������
2021-12-28 17:48:05.459 HKT [2944] ��������: ��ɫ "johnliu" ������
2021-12-28 17:48:12.656 HKT [17308] ��������: ���ݿ� "jonhl" ������
2021-12-28 17:49:12.719 HKT [10508] ��������: ��ɫ "postgres" ������
2021-12-28 17:49:20.903 HKT [17888] ��������: ���ݿ� "jonhl" ������
2021-12-28 17:53:27.715 HKT [15164] ��־: autovacuum�������� (PID 10688) ���˳�, �˳����� 1
2021-12-28 17:53:27.715 HKT [15164] ��־: �ж��κ������Ѽ���ķ���������
2021-12-28 17:53:27.727 HKT [15164] ��־: ���еķ��������̱���ֹ; ���³�ʼ��
2021-12-28 17:53:28.027 HKT [17032] ��־: ���ݿ�ϵͳ�жϣ���һ�ε�����ʱ������2021-12-28 17:47:33 HKT
2021-12-28 17:53:28.523 HKT [17032] ��־: ���ݿ�ϵͳû����ȷ�Ĺر�; �����Զ��ָ�״̬��
2021-12-28 17:53:28.527 HKT [17032] ��־: redo �� 0/162C9A8 ��ʼ
2021-12-28 17:53:28.527 HKT [17032] ��־: 0/162CA88 ���ļ�¼���Ȳ��Ϸ�����Ҫ 24�����õ����� 0
2021-12-28 17:53:28.527 HKT [17032] ��־: redo �� 0/162CA50 ���
2021-12-28 17:53:28.816 HKT [15164] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:53:32.289 HKT [15164] ��־: autovacuum�������� (PID 3240) ���˳�, �˳����� 1
2021-12-28 17:53:32.289 HKT [15164] ��־: �ж��κ������Ѽ���ķ���������
2021-12-28 17:53:32.300 HKT [15164] ��־: ���еķ��������̱���ֹ; ���³�ʼ��
2021-12-28 17:53:32.489 HKT [10936] ��־: ���ݿ�ϵͳ�жϣ���һ�ε�����ʱ������2021-12-28 17:53:28 HKT
2021-12-28 17:53:32.954 HKT [10936] ��־: ���ݿ�ϵͳû����ȷ�Ĺر�; �����Զ��ָ�״̬��
2021-12-28 17:53:32.958 HKT [10936] ��־: 0/162CAF8 ���ļ�¼���Ȳ��Ϸ�����Ҫ 24�����õ����� 0
2021-12-28 17:53:32.958 HKT [10936] ��־: ����Ҫ redo
2021-12-28 17:53:33.243 HKT [15164] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:53:36.224 HKT [15164] ��־: autovacuum�������� (PID 7160) ���˳�, �˳����� 1
2021-12-28 17:53:36.225 HKT [15164] ��־: �ж��κ������Ѽ���ķ���������
2021-12-28 17:53:36.233 HKT [15164] ��־: ���еķ��������̱���ֹ; ���³�ʼ��
2021-12-28 17:53:36.416 HKT [16708] ��־: ���ݿ�ϵͳ�жϣ���һ�ε�����ʱ������2021-12-28 17:53:32 HKT
2021-12-28 17:53:36.903 HKT [16708] ��־: ���ݿ�ϵͳû����ȷ�Ĺر�; �����Զ��ָ�״̬��
2021-12-28 17:53:36.906 HKT [16708] ��־: 0/162CB68 ���ļ�¼���Ȳ��Ϸ�����Ҫ 24�����õ����� 0
2021-12-28 17:53:36.906 HKT [16708] ��־: ����Ҫ redo
2021-12-28 17:53:37.187 HKT [15164] ��־: ���ݿ�ϵͳ׼����������
2021-12-28 17:57:30.948 HKT [18424] ��������: ��ɫ "postgres" ������
2021-12-28 17:59:38.241 HKT [11380] ��������: ��ɫ "postgres" ������
2021-12-28 18:04:59.124 HKT [15164] ��־: ���յ����� (fast) ֹͣ����
2021-12-28 18:04:59.129 HKT [15164] ��־: �ж��κμ�������
2021-12-28 18:04:59.137 HKT [15164] ��־: ��������: logical replication launcher (PID 18156) ���˳�, �˳����� 1
2021-12-28 18:04:59.139 HKT [10184] ��־: ���ڹر�
2021-12-28 18:04:59.167 HKT [15164] ��־: ���ݿ�ϵͳ�ѹر�

0 comments on commit c381d51

Please sign in to comment.