Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
card-access-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bc. Petr Elexa
card-access-system
Commits
3369b7fd
Commit
3369b7fd
authored
Oct 14, 2019
by
Bc. Petr Elexa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: update readme
parent
59d72043
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
24 deletions
+41
-24
readme.txt
acs-server/readme.txt
+41
-24
No files found.
acs-server/readme.txt
View file @
3369b7fd
********************************************************************
This is readme for Access control system server (ACS server/master).
********************************************************************
Its main job is to respond to authentication requests from RFID readers connected on CAN bus.
The server is designed to be not accessible from ethernet network and be administred through ssh from outside
...
...
@@ -7,51 +10,63 @@ or from administrative application over secured channel.
Redis server should be on the same machine or network as it is designed to be accesed only from trusted clients
inside trusted environments.
------------------
Interactive usage:
------------------
1. Read prerequisites
2. Install python modules
2. Install python modules
(pip module requred)
python3 -m pip install -r requirements.txt --user
3. Use script start.sh (see parameters inside) or run src/acs-server.py --help for more info
3. Adjust parameters in start.sh
4. Run script start.sh or run src/acs-server.py --help for more info
Install permanently as service (for systemd):
---------------------------------------------
Install permanently as service (for systemd init):
---------------------------------------------
1. Read prerequisites
2. Create system user for the service:
2. Create system user for the
acs
service:
sudo useradd --system acs-srvc
sudo mkdir /var/log/acs-server
sudo chown acs-srvc:acs-srvc /var/log/acs-server
3. Install python modules system wide
sudo python3 -m pip install -r requirements.txt
2
. Run build.sh (see parameters inside)
3. Use bundled acs-server.service (see parameters inside) and register as service:
4
. Run build.sh (see parameters inside)
5. Use bundled acs-server.service (you may need to adjust settings inside)
sudo cp acs-server.service /lib/systemd/system/acs-server.service
6. Enabble the service:
sudo systemctl daemon-reload
sudo systemctl enable acs-server
4. log files
will be in /var/log/acs-server
7. Log file(s)
will be in /var/log/acs-server
--------------
Prerequisites:
Linux (with SocketCAN)
CAN 2.0 controller supported by SocketCAN
Python 3.5 or higher (see below for module install)
Redis database (see below)
- It is the only implemented but others can be added.
--------------
* Linux with SocketCAN (tested on 3.13.0)
* CAN 2.0 controller supported by SocketCAN
* Python 3.5 or higher + pip
* Redis database >= 2.0 (see below)
- It is the the only implemented but support for others can be added.
----------------------------------------
Example steps for meeting prerequisites:
----------------------------------------
CAN interface
* Connect CAN controller (USB-CAN, SPI-CAN, USB-UART-CAN, ...)
* You may need driver if not included in linux kernel
* You may need to add CAN controller to your device tree (only if using ARM platform with real CAN hardware)
* Enable auto setup of the CAN interface at startup -- add to /etc/network/interfaces:
1. You may need to install driver if not included in linux kernel
2. You may need to add CAN controller to your device tree (only if using ARM platform with real CAN hardware)
3. Add setup of the CAN interface at startup -- add to /etc/network/interfaces:
auto can0
iface can0 can static
bitrate 125000
restart-ms 200
restart-ms 1000
txqueuelen 1000
4. Reboot
5. Connect CAN controller (USB-CAN, SPI-CAN, USB-UART-CAN, ...)
Redis
database
server setup example on port 6379 (steps for Debian distribution)
Redis server setup example on port 6379 (steps for Debian distribution)
* Add "vm.overcommit_memory = 1" to /etc/sysctl.conf
*
(optional) Disable transparent huge pages
:
*
[optional] Disable transparent huge pages (improves latency). Add to /etc/rc.local following line
:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
*
Build and install Redis
(assumes /usr/local/bin in PATH)
*
Compile and install Redis server
(assumes /usr/local/bin in PATH)
sudo apt-get install build-essential tcl
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
...
...
@@ -60,13 +75,15 @@ Example steps for meeting prerequisites:
sudo make install
* Use configuration and init script bundled with this server
sudo mkdir /etc/redis
sudo mkdir -
r
/var/redis/6379
sudo mkdir -
p
/var/redis/6379
sudo cp ./redis_files/acs_redis_config.conf /etc/redis/redis_6379.conf
sudo cp ./redis_files/asc_redis_init_script /etc/init.d/redis_6379
*
(Optional) Modify maxmemory option in configuration file
to suit your system
*
[recommended] Modify maxmemory option in redis_6379.conf
to suit your system
* Enable Redis to run at startup
sudo chmod +x /etc/init.d/redis_6379
sudo update-rc.d redis_6379 defaults
* Allow connection to redis in firewall if on separate machine
* [recommended] Secure redis by adding password to /etc/redis/redis_6379.conf if accessible remotely
* Reboot
*
log files
will be in /var/redis/6379
*
allow connection to redis in firewall settings if on separate machine
*
Redis database file
will be in /var/redis/6379
*
Redis log file will be in /var/log/redis_6379.log
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment