diff --git a/.gitignore b/.gitignore index 224daaaf0ba2228cc20073da1cebe07416079a87..1f2222baae9b1a1e345b7ea493f5e04282dbd8a9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ __pycache__ /package-lock.json /node_modules /venv -/trurt/static +/hiboo/static diff --git a/Dockerfile b/Dockerfile index 8ac3178544c96ee501eb865c289669dc28900afc..efb1503d65210e7b9d67f6cd212ff74b57c8a511 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM python:3-alpine RUN apk add --no-cache xmlsec \ && mkdir /app WORKDIR /app -COPY trurt /app/trurt +COPY hiboo /app/hiboo COPY --from=python_build /usr/local/ /usr/local/ -COPY --from=assets_build /trurt/static /app/trurt/static -CMD gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'trurt:create_app()' +COPY --from=assets_build /hiboo/static /app/hiboo/static +CMD gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'hiboo:create_app()' diff --git a/trurt/__init__.py b/hiboo/__init__.py similarity index 90% rename from trurt/__init__.py rename to hiboo/__init__.py index 354175977fa203b9cb8f96060b149a1b3ac14ea5..6fd5692d19fa6cce2f050e8e0787adcd821a30d2 100644 --- a/trurt/__init__.py +++ b/hiboo/__init__.py @@ -1,13 +1,13 @@ import flask -from trurt import models, manage, configuration, debug, utils +from hiboo import models, manage, configuration, debug, utils def create_app_from_config(config): """ Create a new application based on the given configuration """ app = flask.Flask(__name__) - app.cli.add_command(manage.trurt) + app.cli.add_command(manage.hiboo) # Initialize application extensions config.init_app(app) @@ -30,7 +30,7 @@ def create_app_from_config(config): return dict(config=app.config, utils=utils) # Import views - from trurt import account, service, sso + from hiboo import account, service, sso app.register_blueprint(account.blueprint, url_prefix='/account') app.register_blueprint(service.blueprint, url_prefix='/service') app.register_blueprint(sso.blueprint, url_prefix='/sso') diff --git a/trurt/account/__init__.py b/hiboo/account/__init__.py similarity index 66% rename from trurt/account/__init__.py rename to hiboo/account/__init__.py index 902db148d590a0108e42c662400c5573d10b5786..125e097fed4688a5d9cdcf8ba9feb0ba22a01756 100644 --- a/trurt/account/__init__.py +++ b/hiboo/account/__init__.py @@ -3,4 +3,4 @@ from flask import Blueprint blueprint = Blueprint("account", __name__, template_folder="templates") -from trurt.account import login, profiles, settings +from hiboo.account import login, profiles, settings diff --git a/trurt/account/forms.py b/hiboo/account/forms.py similarity index 100% rename from trurt/account/forms.py rename to hiboo/account/forms.py diff --git a/trurt/account/login.py b/hiboo/account/login.py similarity index 95% rename from trurt/account/login.py rename to hiboo/account/login.py index 6a9d9193a9647141bb9ff8e1d6a556817bd10f8d..6fb812f9c2c76dd18255af00effa84743d2295bc 100644 --- a/trurt/account/login.py +++ b/hiboo/account/login.py @@ -1,5 +1,5 @@ -from trurt import models, utils, security -from trurt.account import blueprint, forms +from hiboo import models, utils, security +from hiboo.account import blueprint, forms import flask_login import flask diff --git a/trurt/account/profiles.py b/hiboo/account/profiles.py similarity index 98% rename from trurt/account/profiles.py rename to hiboo/account/profiles.py index f23a7539341050d6ade16b17162cae96a28bbb13..a27af3fb732ed6bad0861e7c084daa30faf1b466 100644 --- a/trurt/account/profiles.py +++ b/hiboo/account/profiles.py @@ -1,6 +1,6 @@ -from trurt.account import blueprint, forms -from trurt.sso import forms as sso_forms -from trurt import models, utils, security +from hiboo.account import blueprint, forms +from hiboo.sso import forms as sso_forms +from hiboo import models, utils, security import flask import flask_login diff --git a/trurt/account/settings.py b/hiboo/account/settings.py similarity index 92% rename from trurt/account/settings.py rename to hiboo/account/settings.py index fb6fc3c899f4ee89d57e9ed69eb8be6b4fbd4b6e..ecdfaa9c8e90cc6e660a227811e941647eefdc7f 100644 --- a/trurt/account/settings.py +++ b/hiboo/account/settings.py @@ -1,5 +1,5 @@ -from trurt.account import blueprint, forms -from trurt import models, security +from hiboo.account import blueprint, forms +from hiboo import models, security import flask import flask_login diff --git a/trurt/account/templates/account_home.html b/hiboo/account/templates/account_home.html similarity index 100% rename from trurt/account/templates/account_home.html rename to hiboo/account/templates/account_home.html diff --git a/trurt/account/templates/account_signin.html b/hiboo/account/templates/account_signin.html similarity index 100% rename from trurt/account/templates/account_signin.html rename to hiboo/account/templates/account_signin.html diff --git a/trurt/account/templates/account_signup.html b/hiboo/account/templates/account_signup.html similarity index 100% rename from trurt/account/templates/account_signup.html rename to hiboo/account/templates/account_signup.html diff --git a/trurt/account/templates/avatar_create.html b/hiboo/account/templates/avatar_create.html similarity index 100% rename from trurt/account/templates/avatar_create.html rename to hiboo/account/templates/avatar_create.html diff --git a/trurt/account/templates/avatar_pick.html b/hiboo/account/templates/avatar_pick.html similarity index 100% rename from trurt/account/templates/avatar_pick.html rename to hiboo/account/templates/avatar_pick.html diff --git a/trurt/account/templates/profile_create.html b/hiboo/account/templates/profile_create.html similarity index 100% rename from trurt/account/templates/profile_create.html rename to hiboo/account/templates/profile_create.html diff --git a/trurt/account/templates/profile_pick.html b/hiboo/account/templates/profile_pick.html similarity index 100% rename from trurt/account/templates/profile_pick.html rename to hiboo/account/templates/profile_pick.html diff --git a/trurt/configuration.py b/hiboo/configuration.py similarity index 96% rename from trurt/configuration.py rename to hiboo/configuration.py index 6a3e8b16479806beaa01aeb63bb8e823bb69e272..d34cf95934fb2887e7a6326d94aec0dc51da2b42 100644 --- a/trurt/configuration.py +++ b/hiboo/configuration.py @@ -6,7 +6,7 @@ DEFAULT_CONFIG = { 'DEBUG': False, 'BABEL_DEFAULT_LOCALE': 'en', 'BABEL_DEFAULT_TIMEZONE': 'UTC', - 'SQLALCHEMY_DATABASE_URI': 'sqlite:////tmp/trurt.db', + 'SQLALCHEMY_DATABASE_URI': 'sqlite:////tmp/hiboo.db', 'SQLALCHEMY_TRACK_MODIFICATIONS': False, 'SECRET_KEY': 'changeMe', 'TEMPLATES_AUTO_RELOAD': False, diff --git a/trurt/debug.py b/hiboo/debug.py similarity index 100% rename from trurt/debug.py rename to hiboo/debug.py diff --git a/trurt/manage.py b/hiboo/manage.py similarity index 90% rename from trurt/manage.py rename to hiboo/manage.py index 9366cee203ea336b9953c1e8b941736925bfa9f3..881228afaa6068b7ef2b33cc210a285628fbd7fd 100644 --- a/trurt/manage.py +++ b/hiboo/manage.py @@ -1,19 +1,19 @@ from flask import current_app as app from flask import cli as flask_cli -from trurt import models +from hiboo import models import flask import click @click.group() -def trurt(cls=flask_cli.FlaskGroup): - """ Trurt command line +def hiboo(cls=flask_cli.FlaskGroup): + """ Hiboo command line """ -@trurt.command() +@hiboo.command() @click.argument("username") @click.argument("password") @flask_cli.with_appcontext @@ -30,7 +30,7 @@ def create_user(username, password): models.db.session.commit() -@trurt.command() +@hiboo.command() @click.argument("username") @click.argument("service_uuid") @click.argument("profile_username") diff --git a/trurt/models.py b/hiboo/models.py similarity index 100% rename from trurt/models.py rename to hiboo/models.py diff --git a/trurt/security.py b/hiboo/security.py similarity index 100% rename from trurt/security.py rename to hiboo/security.py diff --git a/trurt/service/__init__.py b/hiboo/service/__init__.py similarity index 76% rename from trurt/service/__init__.py rename to hiboo/service/__init__.py index 342c163f63d7ad1a0809cfb8c16196d972129f0a..148372807beeeb2193a49aeca4eb5d06c1364fd6 100644 --- a/trurt/service/__init__.py +++ b/hiboo/service/__init__.py @@ -3,4 +3,4 @@ from flask import Blueprint blueprint = Blueprint("service", __name__, template_folder="templates") -from trurt.service import admin +from hiboo.service import admin diff --git a/trurt/service/admin.py b/hiboo/service/admin.py similarity index 92% rename from trurt/service/admin.py rename to hiboo/service/admin.py index 1aca12fc88f50845799010a01dba7226764a6e71..a47fe15d60e765a720010a054f2c22322f5e86f9 100644 --- a/trurt/service/admin.py +++ b/hiboo/service/admin.py @@ -1,6 +1,6 @@ -from trurt import models, utils, security -from trurt.service import blueprint, forms -from trurt.sso import protocols +from hiboo import models, utils, security +from hiboo.service import blueprint, forms +from hiboo.sso import protocols import flask import uuid diff --git a/trurt/service/forms.py b/hiboo/service/forms.py similarity index 96% rename from trurt/service/forms.py rename to hiboo/service/forms.py index 485df48ae7bca8fd0ada04dcb19e7847a380d23e..bdf19bcf64a847978cf362f51adf97d4c045e7f5 100644 --- a/trurt/service/forms.py +++ b/hiboo/service/forms.py @@ -1,7 +1,7 @@ from wtforms import validators, fields, widgets from flask_babel import lazy_gettext as _ -from trurt import models +from hiboo import models import flask_wtf diff --git a/trurt/service/templates/service_create.html b/hiboo/service/templates/service_create.html similarity index 100% rename from trurt/service/templates/service_create.html rename to hiboo/service/templates/service_create.html diff --git a/trurt/service/templates/service_create_form.html b/hiboo/service/templates/service_create_form.html similarity index 100% rename from trurt/service/templates/service_create_form.html rename to hiboo/service/templates/service_create_form.html diff --git a/trurt/service/templates/service_details.html b/hiboo/service/templates/service_details.html similarity index 100% rename from trurt/service/templates/service_details.html rename to hiboo/service/templates/service_details.html diff --git a/trurt/service/templates/service_list.html b/hiboo/service/templates/service_list.html similarity index 100% rename from trurt/service/templates/service_list.html rename to hiboo/service/templates/service_list.html diff --git a/trurt/sso/__init__.py b/hiboo/sso/__init__.py similarity index 82% rename from trurt/sso/__init__.py rename to hiboo/sso/__init__.py index 76e28a7a02b3435e36fce20f7b103ba2a2a334d6..a845b1ff61518710fba0afacd7245b6ed9fd7a31 100644 --- a/trurt/sso/__init__.py +++ b/hiboo/sso/__init__.py @@ -3,7 +3,7 @@ from flask import Blueprint blueprint = Blueprint("sso", __name__, template_folder="templates") -from trurt.sso import saml, oidc +from hiboo.sso import saml, oidc protocols = { "saml": saml, diff --git a/trurt/sso/forms.py b/hiboo/sso/forms.py similarity index 100% rename from trurt/sso/forms.py rename to hiboo/sso/forms.py diff --git a/trurt/sso/oidc.py b/hiboo/sso/oidc.py similarity index 100% rename from trurt/sso/oidc.py rename to hiboo/sso/oidc.py diff --git a/trurt/sso/saml.py b/hiboo/sso/saml.py similarity index 98% rename from trurt/sso/saml.py rename to hiboo/sso/saml.py index ffd137d34f0ad3d2fd1853865e0598ee5bf79027..332a39b0dd3a67330079998573c2f2b098a5b2d1 100644 --- a/trurt/sso/saml.py +++ b/hiboo/sso/saml.py @@ -5,8 +5,8 @@ def security_context(conf): from saml2 import sigver sigver.security_context = security_context -from trurt.sso import blueprint, forms -from trurt import models, utils, account, security +from hiboo.sso import blueprint, forms +from hiboo import models, utils, account, security from saml2 import server, saml, config, mdstore, assertion from cryptography import x509 from cryptography.hazmat import primitives, backends @@ -106,7 +106,7 @@ class MetaData(mdstore.InMemoryMetaData): 'cert_file': "".join(service.config["sp_cert"].strip().split("\n")[1:-1]), 'service':{'idp': idp_service}, 'metadata':[ - {'class':'trurt.sso.saml.MetaData', + {'class':'hiboo.sso.saml.MetaData', 'metadata':[(service.config["entityid"], )]} ] } diff --git a/trurt/sso/templates/protocol_oidc.html b/hiboo/sso/templates/protocol_oidc.html similarity index 100% rename from trurt/sso/templates/protocol_oidc.html rename to hiboo/sso/templates/protocol_oidc.html diff --git a/trurt/sso/templates/protocol_saml.html b/hiboo/sso/templates/protocol_saml.html similarity index 100% rename from trurt/sso/templates/protocol_saml.html rename to hiboo/sso/templates/protocol_saml.html diff --git a/trurt/sso/templates/sso_redirect.html b/hiboo/sso/templates/sso_redirect.html similarity index 100% rename from trurt/sso/templates/sso_redirect.html rename to hiboo/sso/templates/sso_redirect.html diff --git a/trurt/templates/base.html b/hiboo/templates/base.html similarity index 96% rename from trurt/templates/base.html rename to hiboo/templates/base.html index 674081f74ff00541fb7754f9aa061f90889c1c14..b0c651d1038fb555df0116920f660a6a6140f487 100644 --- a/trurt/templates/base.html +++ b/hiboo/templates/base.html @@ -11,8 +11,8 @@ <header class="main-header"> <a href="#" class="logo"> - <span class="logo-mini">RЯ</span> - <span class="logo-lg">TRUЯT</span> + <span class="logo-mini">H</span> + <span class="logo-lg">Hiboo</span> </a> <nav class="navbar navbar-static-top"> @@ -96,7 +96,7 @@ </div> <footer class="main-footer"> - TRUЯT is free software distributed under the MIT license + Hiboo is free software distributed under the MIT license </footer> </div> diff --git a/trurt/templates/form.html b/hiboo/templates/form.html similarity index 100% rename from trurt/templates/form.html rename to hiboo/templates/form.html diff --git a/trurt/templates/macros.html b/hiboo/templates/macros.html similarity index 100% rename from trurt/templates/macros.html rename to hiboo/templates/macros.html diff --git a/trurt/templates/sidebar.html b/hiboo/templates/sidebar.html similarity index 100% rename from trurt/templates/sidebar.html rename to hiboo/templates/sidebar.html diff --git a/trurt/utils.py b/hiboo/utils.py similarity index 100% rename from trurt/utils.py rename to hiboo/utils.py diff --git a/package.json b/package.json index 953bbdc4a3dc17a7a3e33b65666e737102aa4306..68076b117ec03ae30935b212b03cf5d4eff3c3a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "trurt", + "name": "hiboo", "version": "1.0.0", - "description": "TRURT", + "description": "Hiboo", "main": "assest/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/webpack.config.js b/webpack.config.js index 6a40f8e40defd239f7f394a50601fca2586e5ded..fc08a129888e2161afc7796b728becbf22ba8166 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { vendor: "./assets/vendor.js" }, output: { - path: path.resolve(__dirname, "trurt/static/"), + path: path.resolve(__dirname, "hiboo/static/"), filename: "[name].js" }, module: {