thegraydot / barcomic_server Goto Github PK
View Code? Open in Web Editor NEWAn HTTP API for receiving comic book barcodes from the Barcomic Android application
License: GNU General Public License v3.0
An HTTP API for receiving comic book barcodes from the Barcomic Android application
License: GNU General Public License v3.0
The interactive input is a little messy. Command line arguments should be used, and defaults used if not provided by the user.
The program should print the config when running so users know. This could be under the QR code.
Put in a check to validate input from app/client. Should be under a certain size (barcode length) and only numbers.
For UPC validation:
https://github.com/nicholassm/go-ean/blob/master/ean.go
For digit check:
https://programming-idioms.org/idiom/137/check-if-string-contains-only-digits/1739/go
Could also:
Couple problems with keybd package
Research and test other solutions
Should return status 200 OK if up
When the barcode is executed into key strokes, there is an additional character. The last digit is being repeated. Could be how the buffer is converted to a string.
This makes sense, don't need the performance of sockets and could use mock tests, better ssl, auth options? And ease of use of http.
iOS doesn't support self signed certs, and Android needs a hacky fix. This means it should probably be non-default to enable https. When a managed server is implemented, https will be done on domain name, so self signed https is not needed.
Todo:
Should be able to just enter and accept default - however, no selection is crashing:
[*] barcomic dev-mode
[*] The following addresses are available...
[0] 10.10.10.1 (wlp3s1)
[1] 10.10.10.1 (br-adb8080eff94)
[2] 10.10.10.1 (br-3ed7272d5345)
[3] 10.10.10.1 (docker0)
[*] Enter IP address [0.0.0.0]:
[*] Error. Could not determine network interface selection.
exit status 1
Socket networking provides some benefits for integration with the Android app. Makes sense to add it back in, with a CLI argument.
Probably not really necessary, but strong TLS would be nice to have
If an ip isn't provided, it means an end user cannot scan the qr code and connect.
Should handle:
Add support for selecting the number of the interface to save the user from typing out the address
Feature should determine what network interface and port (get programmically, or from user), the print qr code to the terminal
Log name same as binary (with date)
Use .log extension
Also add to GitHub README
Then add to Actions pipeline
This should work with scripts, tags and GitHub actions
Initially configure to:
https://github.com/actions/setup-go
https://stackoverflow.com/questions/66918575/how-to-use-your-own-makefile-in-github-actions
Since this takes 2 seconds on Linux, create the object once, then use Clear function for subsequent barcodes.
If not run as specific user, warn and elevate. Or maybe find solution to chown and add to group for key events
Internal server should be called barcomic_server for consistency
Also update go.mod file to reflect changes
https://pkg.go.dev/tailscale.com/net/interfaces
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.