Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding very basic authentication and keeping track of known devices #7

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cdd34db
Changed platform and code tag in binary
Mar 11, 2021
cd8ee98
Changed platform and code tag (fix readme)
Mar 11, 2021
0e14b14
Don't crash if no version has been uploaded.
marcovannoord Mar 14, 2021
d8b5549
Keep track of ESP devices seen before, to make it easier to add them …
marcovannoord Mar 14, 2021
2799931
added gitignore
marcovannoord Mar 14, 2021
15d5a38
Update readme to reflect changes in the new way of parsing.
marcovannoord Mar 14, 2021
3f57c56
Update README.md
marcovannoord Mar 14, 2021
e51a61d
Added a list of ESP devices that have been seen.
marcovannoord Mar 14, 2021
2bcf76c
added some very very basic (pun intended) authentication.
marcovannoord Mar 14, 2021
1da3344
make the documentation more clear
marcovannoord Mar 15, 2021
18b23f4
version bump due to incompatibility with original fork
marcovannoord Mar 15, 2021
619d8d0
🐛 fixed bug where uploading a file would only work when uploading for…
marcovannoord Mar 15, 2021
c7973b4
update readme to reflect recent changes.
marcovannoord Mar 15, 2021
eb456c1
Update README.md
marcovannoord Mar 15, 2021
64f3554
Merge pull request #1 from marcovannoord/patch-1
dloeckx Mar 15, 2021
f6ac9fc
Merge pull request #2 from marcovannoord/master
dloeckx Mar 15, 2021
3206353
Update README.md
marcovannoord Jul 5, 2021
f6a192b
Made maclist table a bit more readable by stretching it to full width
marcovannoord Jul 26, 2021
9ae6df9
add favicon
marcovannoord Jul 26, 2021
55c14c3
Style whitelist to make it more readable
marcovannoord Jul 26, 2021
fd80593
the "first seen" and "last seen" date and time are now show in the lo…
marcovannoord Jul 26, 2021
8d5a4cc
added "checkmark" to show the user which devices are new, and which d…
marcovannoord Jul 26, 2021
29e8c4a
update readme to show users how to build the docker-file
marcovannoord Jul 26, 2021
a3b5c30
Update whitelist image to reflect recent changes
marcovannoord Jul 26, 2021
0485547
Remove link
marcovannoord Jul 26, 2021
8f8fd64
add sentry to help debugging
marcovannoord Dec 22, 2021
97fcaba
upgrade to flask 2, add sqlalchemy to prepare for sql database
marcovannoord Dec 31, 2021
4eaddf8
add templates, basic login and register boilerplate
marcovannoord Dec 31, 2021
52b9842
fix login system
marcovannoord Dec 31, 2021
a55f7a8
Auto-create database on index load
marcovannoord Dec 31, 2021
578fa43
added status screen, started working on the Update mechanics
marcovannoord Dec 31, 2021
0ca6039
allow sending uploaded data to client, add filename and downloadcounter
marcovannoord Dec 31, 2021
86c796b
formatting
marcovannoord Dec 31, 2021
b654c1f
add upload ability
marcovannoord Dec 31, 2021
9280fe0
add page to whitelist devices
marcovannoord Dec 31, 2021
a654beb
more meaningful stuff in status-screen
marcovannoord Dec 31, 2021
7da94c0
update Bulma, make stuff prettier
marcovannoord Dec 31, 2021
b4342be
start migrating status screen and whitelist screen. Added visually im…
marcovannoord Jan 1, 2022
598c8a3
Finished merging the status and whitelist page
marcovannoord Jan 1, 2022
d3eac7c
added footer, made content wider
marcovannoord Jan 1, 2022
8c4fd73
prettier layout
marcovannoord Jan 1, 2022
6aa4a87
Update README.md
marcovannoord Jan 1, 2022
2d5ecb2
update dockerfile
marcovannoord Jan 2, 2022
645334e
restrict login to admins only
marcovannoord Jan 2, 2022
b678241
update readme to reflect changes in the rewrite
marcovannoord Jan 2, 2022
8149ffd
removed debug-tool where any device would get auto-whitelisted
marcovannoord Jan 2, 2022
1c547f3
check platform-name for illegal characters
marcovannoord Jan 2, 2022
ebb6057
allow adding a device that was never seen to the whitelist. This can …
marcovannoord Jan 2, 2022
634bdff
check if the requested update is for the correct platform
marcovannoord Jan 2, 2022
d045fdc
add venv to gitignore
marcovannoord Jan 3, 2022
4a988f6
fix docker volume pointing to wrong directory
marcovannoord Jan 3, 2022
44edb6f
added multiple colors for user-notifications
marcovannoord Jan 3, 2022
cf3438a
Fixed issue where manually added device would have a not-Null value f…
marcovannoord Jan 4, 2022
58bb76f
fixed bug where manually added device would never have first_seen, ev…
marcovannoord Jan 4, 2022
b457ce6
fix typo in environment variables
marcovannoord Jan 4, 2022
ce51ad7
forgot elif
marcovannoord Jan 4, 2022
e916d7b
making sure not to overwrite any existing notes when adding device to…
marcovannoord Jan 4, 2022
1b85a92
titelize platform-names
marcovannoord Jan 4, 2022
78a0902
more verbose logging when serving files
marcovannoord Jan 6, 2022
60d44cb
update docker to a more recent version of python
marcovannoord Jan 6, 2022
1f82f53
add info note when updating device
marcovannoord Jan 7, 2022
c8b65f3
already select the correct platform when adding a new device; this pr…
marcovannoord Jan 7, 2022
5a9ce01
docker run command: add -dt instead of -d, so the tty output will be …
marcovannoord Jan 7, 2022
ea350b0
fix notification message having wrong color and being unreadable
marcovannoord Feb 2, 2022
2244b64
Add very basic user-manager
marcovannoord Feb 2, 2022
ff876ff
allow deleting users
marcovannoord Feb 2, 2022
1420aa8
fix some UI bugs, check for lowercase platformname when adding a plat…
marcovannoord Feb 2, 2022
39fc551
prettier toggle-switch for admin-rights
marcovannoord Feb 3, 2022
7c89c93
use the HTTP_X_FORWARDED_FOR header so we have the correct IP address…
marcovannoord Feb 4, 2022
3f01d81
allow us to forget about any unbound devices
marcovannoord Feb 4, 2022
466f22e
typofix
marcovannoord Feb 4, 2022
2e9be19
lower sentry trace sample rate to prevent hitting the free-tier limit
marcovannoord Feb 7, 2022
7e97fed
if -> elif bug fixed
marcovannoord Feb 9, 2022
52f633b
Create docker-publish.yml
marcovannoord Feb 9, 2022
3de2e1c
Update docker-publish.yml
marcovannoord Mar 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
# schedule:
# - cron: '41 22 * * *'
push:
branches: [ master ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ master ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@1e95c1de343b5b0c23352d6417ee3e48d5bcd422
with:
cosign-release: 'v1.4.0'


# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
211 changes: 211 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig

# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,flask,venv
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,visualstudiocode,flask,venv

### Flask ###
instance/*
!instance/.gitignore
.webassets-cache
.env

### Flask.Python Stack ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

### venv ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope
!.vscode/*.code-snippets

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,flask,venv

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

server/bin/*
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "server",
"FLASK_ENV": "development"
},
"args": [
"run",
"--no-debugger"
],
"jinja": true
}
]
}
Loading