Skip to content

Commit

Permalink
v2.3.0: revert updates, moved in the new release v2.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
npeditto committed Oct 23, 2018
1 parent 26558c4 commit bb959ad
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 56 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ RUN apt-get update && apt-get install -y \
socat dsniff fuse libfuse-dev git ntpdate python pkg-config build-essential gdb \
&& rm -rf /var/lib/apt/lists/*

RUN npm install -g --unsafe gyp [email protected] [email protected] nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net node-red lsof\

RUN npm install -g --unsafe gyp autobahn nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net node-red lsof\
&& npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0 \
&& npm cache --force clean

Expand All @@ -22,13 +23,10 @@ RUN git clone --depth=1 git://github.com/MDSLab/s4t-lightning-rod.git ./@mdslab/
ENV NODE_PATH=/usr/local/lib/node_modules
ENV IOTRONIC_HOME=/var/lib/iotronic
ENV LIGHTNINGROD_HOME=/usr/local/lib/node_modules/@mdslab/iotronic-lightning-rod
ENV NODE_TLS_REJECT_UNAUTHORIZED=0

RUN cp /usr/local/lib/node_modules/@mdslab/iotronic-lightning-rod/modules/plugins-manager/plugins.example.json /var/lib/iotronic/plugins/plugins.json \
&& cp /usr/local/lib/node_modules/@mdslab/iotronic-lightning-rod/modules/drivers-manager/drivers.example.json /var/lib/iotronic/drivers/drivers.json

RUN cp /usr/local/lib/node_modules/@mdslab/iotronic-lightning-rod/etc/logrotate.d/lightning-rod.log /etc/logrotate.d/lightning-rod.log

WORKDIR /usr/local/lib/node_modules/@mdslab/iotronic-lightning-rod/

VOLUME /var/lib/iotronic
Expand Down
4 changes: 2 additions & 2 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ points at the folder that you created in the first step (e.g: /etc/iotronic/):

* for "x86_64":
```
docker run -d -v lr_data:/var/lib/iotronic -v </CONFIG/PATH/>/settings.json:/var/lib/iotronic/settings.json -v </CONFIG/PATH/>/authentication.json:/etc/iotronic/authentication.json --net=host --name=lightning-rod mdslab/iotronic-lightning-rod
docker run -d -v lr_data:/var/lib/iotronic -v </CONFIG/PATH/>/settings.json:/var/lib/iotronic/settings.json -v </CONFIG/PATH/>/authentication.json:/etc/iotronic/authentication.json -net=host --name=lightning-rod mdslab/iotronic-lightning-rod
```

* for "ARMv7l" on Raspberry Pi 3:
```
docker run -d -v lr_data:/var/lib/iotronic -v </CONFIG/PATH/>/settings.json:/var/lib/iotronic/settings.json -v </CONFIG/PATH/>/authentication.json:/etc/iotronic/authentication.json --net=host --name=lightning-rod mdslab/rpi-iotronic-lightning-rod
docker run -d -v lr_data:/var/lib/iotronic -v </CONFIG/PATH/>/settings.json:/var/lib/iotronic/settings.json -v </CONFIG/PATH/>/authentication.json:/etc/iotronic/authentication.json -net=host --name=lightning-rod mdslab/rpi-iotronic-lightning-rod
```
2 changes: 1 addition & 1 deletion docs/raspberrypi2.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ reboot

##### Install required NodeJS modules via npm:
```
npm install -g --unsafe gyp autobahn@18.10.2 [email protected] nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe gyp autobahn nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0
```

Expand Down
2 changes: 1 addition & 1 deletion docs/raspberrypi3.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ reboot

##### Install required NodeJS modules via npm:
```
npm install -g --unsafe gyp autobahn@18.10.2 [email protected] nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe gyp autobahn nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0
```

Expand Down
2 changes: 1 addition & 1 deletion docs/ubuntu1404.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ reboot

##### Install required NodeJS modules via npm:
```
npm install -g --unsafe gyp autobahn@18.10.2 [email protected] nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe gyp autobahn nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0
```

Expand Down
2 changes: 1 addition & 1 deletion docs/ubuntu1604.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ reboot

##### Install required NodeJS modules via npm:
```
npm install -g --unsafe gyp autobahn@18.10.2 [email protected] nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe gyp autobahn nconf @mdslab/wstun fuse-bindings requestify is-running connection-tester [email protected] q fs-access mknod jsonfile md5 python-shell net lsof
npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0
```

Expand Down
4 changes: 1 addition & 3 deletions lightning-rod.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ manageBoard.Init_Ligthning_Rod(function (check) {
wampConnection = new autobahn.Connection({
url: wampUrl,
realm: wampRealm,
tlsConfiguration: {},
max_retries: -1
});

Expand Down Expand Up @@ -474,8 +473,7 @@ manageBoard.Init_Ligthning_Rod(function (check) {
logger.info("[SYSTEM] - Lightning-rod "+ lyt_device.name +" starting...");
lyt_device.Main(wampConnection, logger);

}
catch (e) {
}catch (e) {

logger.error('[SYSTEM] - Loading IoT device failure: ', e);
logger.error('[SYSTEM] - Device "' + device + '" not supported!');
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"uninstall": "./scripts/postuninst"
},
"dependencies": {
"autobahn": "18.10.2",
"ws":"6.1.0",
"autobahn": "17.5.2",
"ws":"4.1.0",
"connection-tester": ">=0.1.1",
"fs-access": ">=1.0.1",
"fuse-bindings": "2.8.1",
Expand Down
21 changes: 4 additions & 17 deletions scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ IOTRONIC_AUTH="/etc/iotronic"

if [ -d "$IOTRONIC_AUTH" ]; then


LR_INSTALLED_VERSION=`cat /var/lib/iotronic/patches/package.json | grep \"version\" | awk '{print $2}' | tr -d , | tr -d \"`
logger -t DEBUG "Authentication settings file already present (LR v$LR_INSTALLED_VERSION)"

rm_check=
echo -n "Do you want to keep Lightning-rod authentication settings (in /etc/iotronic) ? (yes/no) "
read rm_check
Expand All @@ -56,22 +52,15 @@ if [ -d "$IOTRONIC_AUTH" ]; then

echo "--> Lightning-rod authentication settings are save!"


if [ "$LR_INSTALLED_VERSION" == "2.2.0" ]; then
echo "--> APPLY THE 2.3.0 PATCH"
patch /etc/iotronic/authentication.json $NODE_PATH/@mdslab/iotronic-lightning-rod/utils/patches/authentication.patch
fi


fi

if [ "$rm_check" = "no" ] || [ ! -d "$IOTRONIC_HOME" ]; then
fi

mkdir -p /etc/iotronic/
if [ "$rm_check" = "no" ] || [ ! -d "$IOTRONIC_HOME" ]; then

cp $NODE_PATH/@mdslab/iotronic-lightning-rod/utils/templates/authentication.example.json /etc/iotronic/authentication.json
mkdir -p /etc/iotronic/

fi
cp $NODE_PATH/@mdslab/iotronic-lightning-rod/utils/templates/authentication.example.json /etc/iotronic/authentication.json

fi

Expand All @@ -80,8 +69,6 @@ fi





echo "Configuring..."

# Set Environment variables
Expand Down
2 changes: 1 addition & 1 deletion utils/install/arancino/configure_LR_arancino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sed -i "s/\"bin\":.*\"wstun\"/\"bin\":\"\/usr\/lib\/node_modules\/@mdslab\/wstun
echo " - authentication.json file configured."


#cp /etc/init-cfg/lightning-rod /etc/init.d/
cp /etc/init-cfg/lightning-rod /etc/init.d/
/etc/init.d/lightning-rod enable
echo " - Lightning-rod enabled at boot."

Expand Down
19 changes: 9 additions & 10 deletions utils/install/docker/configure_LR_docker.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/bin/sh

if [ "$#" -ne 3 ]; then
echo "Usage: ./configure_LR_arancino.sh <BOARD_ID> <BOARD_PASSWORD> <WAMP_URL> <WSTUN_URL> </CONFIG/PATH/>"
exi
echo "Usage: ./configure_LR_arancino.sh <BOARD_ID> <BOARD_PASSWORD> <WAMP_URL> </CONFIG/PATH/>"
exit
fi

echo "Stack4Things Lightning-rod configuration with the following parameters:"
echo " --> Device UUID: "$1
echo " --> Device password: "$2
echo " --> WAMP URL: "$3
echo " --> WSTUN URL: "$4
echo " --> Configuration file path: "$5
echo " --> Configuration file path: "$4

sed -i "s/\"layout\":.*\"\"/\"layout\": \"server\"/g" $5
sed -i "s/\"code\":.*\"\"/\"code\": \"$1\"/g" $5
sed -i "s/\"password\":.*\"\"/\"password\": \"$2\"/g" $5
sed -i "s,\"url_wamp\":.*,\"url_wamp\": \"$3\"\,,g" $5
sed -i "s,\"ws_url\":.*,\"ws_url\": \"$4\"\,,g" $5
sed -i "s/\"bin\":.*\"\"/\"bin\": \"\/usr\/lib\/node_modules\/@mdslab\/wstun\/bin\/wstun.js\"/g" $5
sed -i "s/\"layout\":.*\"\"/\"layout\": \"server\"/g" $4
sed -i "s/\"code\":.*\"\"/\"code\": \"$1\"/g" $4
sed -i "s/\"password\":.*\"\"/\"password\": \"$1\"/g" $4
sed -i "s,\"url_wamp\":.*,\"url_wamp\": \"$3\"\,,g" $4
sed -i "s,\"ws_url\":.*,\"ws_url\": \"$3\"\,,g" $4
sed -i "s/\"bin\":.*\"\"/\"bin\": \"\/usr\/lib\/node_modules\/@mdslab\/wstun\/bin\/wstun.js\"/g" $4
echo -e "\nauthentication.json file configured."
13 changes: 0 additions & 13 deletions utils/patches/authentication.patch

This file was deleted.

0 comments on commit bb959ad

Please sign in to comment.