In a makerspace like HackPGH where diverse paths cross, each member carries a unique story. The DINGUS project resonates with this notion, a silent observer at the crossroads of the maker spirit and collaboration.
Hesse writes, "The river is everywhere at the same time, at the source and at the mouth... in the ocean and in the mountains." Similarly, each tag's journey through this access control system is unique, yet part of a greater flow.
This project, therefore, is more than a functional necessity; it is a symbol of curiosity and, importantly, trust. In the simple act of swiping a tag, members not only access a physical space but also reaffirm their place in a collaborative history. This microcosm of an event cystallizes the trust we place in our fellow makers to create with passion, care, and mutual respect.
In this confluence of technology and humanity, this server becomes a 'river running everywhere' connecting our stories, echoing the interconnectedness Hesse so eloquently depicted, and reminding us that while our journeys are our own, they are made richer for our intersections with the paths of others.
|\ _,,,---,,_ "Uh-huh..."
ZZZzz /,`.-'`' -. ;-;;,_
|,4- ) )-,_. ,\ ( `'-'
'---''(_/--' `-'\_)
This project is an RFID access control system's backend server written in Golang for the HackPGH makerspace. It uses Wild Apricot API as its source of truth for member data.
- Wild Apricot Integration: Synchronizes member contact data from the Wild Apricot API.
- Distributed RFID Access Control: Synchronizes authorization data caches for Wiegand26 RFID tag readers.
- SSO OAuth2 Authentication: Implements Wild Apricot SSO OAuth2 for secure access to web-based interfaces.
- SQLite Database: Maintains persistent data, including Wild Apricot Contact IDs, RFID tags and safety training records.
- Automated Data Sync: Regular updates from the Wild Apricot API as well as real-time Contact and Membership webhook support.
- Secure Web UI: Web interface for configuration and device management, secured via HTTPS.
- Configuration Screen: Modify server settings, effective upon reboot.
- Device Management: Monitor and manage RFID devices.
- User Authentication: Secured with Wild Apricot SSO OAuth2, restricting access to authorized users.
auth
: Authentication logic, including OAuth2 SSO.config
: Configuration file parsing and loading.db
: Database initialization and schema management.handlers
: HTTP server endpoint handlers.models
: Database and API response structures.services
: Business logic for API and database interactions.setup
: Server and component initialization.utils
: General utility functions.webhooks
: Wild Apricot webhook handling.web-ui
: Frontend assets.
- Go (latest stable version)
- Access to Wild Apricot API
- SSL certificate and key
- GCC for SQLite Go package compilation (requires cgo)
To successfully build and run this project, CGO_ENABLED
must be set to 1
. This allows for the compilation of C code, a requirement for the SQLite package used in the project.
- Bash:
export CGO_ENABLED=1
- PowerShell:
set CGO_ENABLED=1
- OpenSSL installed on your system. For Windows, you can download it from here. Most Linux distributions and MacOS have it pre-installed.
-
Open a terminal.
-
Run the following command to generate a private key and a certificate:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
-
You will be prompted to enter details for the certificate and a passphrase for the private key.
-
Remove the passphrase from the private key (optional):
openssl rsa -in key.pem -out key.unencrypted.pem
mv key.unencrypted.pem key.pem
-
Download and install OpenSSL from the provided link.
-
Open OpenSSL via the command prompt (you might need to navigate to the OpenSSL
bin
directory). -
Run the following command:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
-
Enter the required information when prompted, and set a passphrase for the private key.
-
Remove the passphrase from the private key (optional):
openssl rsa -in key.pem -out key.unencrypted.pem
move key.unencrypted.pem key.pem
After generating the key.pem
and cert.pem
files, place them in the appropriate directory as specified in your config.yaml
file for the server to use them for HTTPS.
Update the config.yaml
file to point to the location of your newly generated cert.pem
and key.pem
files under the SSL certificate and key file paths, respectively.
You can start the server with go run main.go
Swagger documentation can be accessed by navigating to https://localhost/swagger/index.html
once the server is running. This provides an interactive UI to explore and test the available API endpoints.
Run go test
to execute the unit tests.
/
: Update Configuration web UI. Server reboot required for changes to take effect./webhooks
: Wild Apricot webhooks endpoint./registerDevice
: DEPRECATED - Process registration requests from ESP controllers on the network.
Contributions to improve the DINGUS project are welcome. Please follow the standard pull request process for your contributions.