-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from Thorfusion/dev
Update to 1.4.0
- Loading branch information
Showing
12 changed files
with
737 additions
and
648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
push_to_registry: | ||
name: push docker image to hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: login to docker registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: build and push docker image to registry | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: thorfusion/solderpy:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ name: Docker Image CI | |
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 12 * * 2' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 1.* | ||
|
||
jobs: | ||
push_to_registry: | ||
name: push docker image to hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: login to docker registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_TOKEN}} | ||
|
||
- name: build and push docker image to registry | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: thorfusion/solderpy:${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from flask import Blueprint, redirect, render_template, request, session, url_for | ||
|
||
from models.session import Session | ||
from models.user import User | ||
|
||
alogin = Blueprint("alogin", __name__) | ||
|
||
@alogin.route("/login", methods=["GET"]) | ||
def login_page(): | ||
if "key" in session and Session.verify_session(session["token"], request.remote_addr): | ||
# Already logged in | ||
return redirect(url_for('asite.index')) | ||
|
||
return render_template("login.html", failed=False) | ||
|
||
|
||
@alogin.route("/login", methods=["POST"]) | ||
def login(): | ||
if "key" in session and Session.verify_session(session["token"], request.remote_addr): | ||
# Already logged in | ||
print("already logged in") | ||
return redirect(url_for('asite.index')) | ||
|
||
user = User.get_by_username(request.form["username"]) | ||
if user is None: | ||
print("login failed") | ||
return render_template("login.html", failed=True) | ||
else: | ||
if user.verify_password(request.form["password"]): | ||
# if new_user: | ||
# return render_template("login.html", failed=True) | ||
session["token"] = Session.new_session(request.remote_addr) | ||
print("login success") | ||
return redirect(url_for('asite.index')) | ||
else: | ||
return render_template("login.html", failed=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.