https://github.com/code-hex/laputa
Key certification system for Department of Information Engineering, University of the Ryukyu.
https://github.com/code-hex/laputa
Last synced: 6 months ago
JSON representation
Key certification system for Department of Information Engineering, University of the Ryukyu.
- Host: GitHub
- URL: https://github.com/code-hex/laputa
- Owner: Code-Hex
- Created: 2016-11-18T08:38:02.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-21T04:43:49.000Z (almost 9 years ago)
- Last Synced: 2025-05-31T03:33:59.281Z (6 months ago)
- Language: Go
- Homepage:
- Size: 4.66 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laputa
Key certification system for Department of Information Engineering, University of the Ryukyu.
```
( ヽ , ⌒ヽ , ⌒ヽ
, ⌒ヽ ( ヽ _,=''''''^~~~~~~~~~^''''=,,,,( ( '
( ' ( ,-='''~ -=^~~~^-^~~~^==- '=,,, ゝ `ヽ
ゝ `ヽ <~ -==^~~~^ =^~~^=-=^~~^'=-~'=, ( )
( ヽ'^' __,,,,,,i~~~l===|~~i==|~~|_,,,,,..ノ ( ヽ
( (⌒ ヽi~ | |__レ、l--l--レ.;---i i-、 ( )
( r'^~~~~l l | :| ∩ ∩|,-=,__,-,_| |~i^i,, ヽ
( `) l^^|,,,,--==.i~~l~~~~~~~~~~| i l .|~^''''l~^i,,,, ヽ
,ゝ /i~~i' l ∩∩l .l ∩ ∩ l |__| .| .∩| .| l-,
( ' ,,,,,='~| | |' |,,=i~~i==========|~~|^^|~ ~'i----i==i,, | 'i
( ( | l ,==,-'''^^ l |. ∩. ∩. ∩. | |∩| |∩∩| |~~^i~'i、
( ,=i^~~.| |.∩.∩ |,...,|__|,,|__|,,|__|,,|__|,....,||,,|.|,.....,||,|_|,|.|,....,| | |~i
( l~| .| | ,,,---== ヽノ i ヽノ~~~ ヽノ ~ ソ^=-.i,,,,|,,,|
,ゝ .|..l i,-=''~~--,,, \ \ l / / / __,-=^~
( |,-''~ -,,,_ ~-,,. \ .\ | ./ / _,,,-~ / ヽ
, ⌒ヽ ~^''=、_ _ ^'- i=''''''^~~~~~~~~~~~~~~~~~~~~^''''''''=i -'^~ ( ヽ
ヽ ~^^''ヽ ヽ i | l i / / ノ ( )
, ⌒ヽ ヽ 、 l | l l / ./ / ( (
, ⌒ヽ⌒ヽ \_ 、i ヽ i / ,,==' ( ヽ
, ⌒ヽ ''==,,,,___,,,=='~ ,ゝ ヽ
⌒ ( ヽ
ノ ヽ
```
# What is this?
It is a felica reader that exists in the 1st building of the Faculty of Engineering Building of the University of the Ryukyus.
# Logic
```
check
felica id (felica id searcher)
+--------------+ +---------------+
| <--------+ | | felica data
| Akatsuki | | | Levistone <------------------+
| +----+ | | | |
+--+---+----+--+ | | +-------+-------+ |
| ^ | | | | |
| | | | | | +--------+-------+
initialize | | | | | | | |
to | | | | | | | nfc reader |
authenticate | | | | | | | |
| | | | | | send felica id +----------------+
| | | | | |
+--v---+----v--+ | | +-------v-------+
| | | +---+ |
| Laputa | | | Balus +-------------------------->
| | +-------> |
+--------------+ +---------------+ open the door
recieve
(RESTful API Server) (Unix domain socket)
+ ^
| |
| |
| +-------------+ |
| | | |
+------> leveldb +-------+
put secret | | get secret
+-------------+
```
# Build
There are build modes for development and staging.
- for develop
make build-dev
- for staging
make build-staging
# Setup
## Ansible
Run below script after setting SSH-KEY.
ansible-playbook ./ansible/migrate.yml --praivate-key=SSH-KEY
# Run
After setup, you can run
carton exec ./run
# Restart
You can run without finish after program is modified(Golang projects only).
make restart-staging
# Configuration
Please open `run` with your favorite editor.
By editing the env function, you can change the behavior at program execution.
Environment variable
- `LAPUTA_CERTFILE` Specify the file path of the certificate
- `LAPUTA_KEYFILE` Specify the file path of the key
- `LAPUTA_AKATSUKI` Specify the URL of the api for authentication
- `LAPUTA_FLOOR` Floor code for registration