From 7e6c83a9cd5f01c91e8bc8b1c32b6be52b158edd Mon Sep 17 00:00:00 2001 From: kaiyou <pierre@jaury.eu> Date: Sat, 19 Oct 2019 18:07:11 +0200 Subject: [PATCH] Rename trurt to hiboo --- .gitignore | 2 +- Dockerfile | 6 +++--- {trurt => hiboo}/__init__.py | 6 +++--- {trurt => hiboo}/account/__init__.py | 2 +- {trurt => hiboo}/account/forms.py | 0 {trurt => hiboo}/account/login.py | 4 ++-- {trurt => hiboo}/account/profiles.py | 6 +++--- {trurt => hiboo}/account/settings.py | 4 ++-- {trurt => hiboo}/account/templates/account_home.html | 0 {trurt => hiboo}/account/templates/account_signin.html | 0 {trurt => hiboo}/account/templates/account_signup.html | 0 {trurt => hiboo}/account/templates/avatar_create.html | 0 {trurt => hiboo}/account/templates/avatar_pick.html | 0 {trurt => hiboo}/account/templates/profile_create.html | 0 {trurt => hiboo}/account/templates/profile_pick.html | 0 {trurt => hiboo}/configuration.py | 2 +- {trurt => hiboo}/debug.py | 0 {trurt => hiboo}/manage.py | 10 +++++----- {trurt => hiboo}/models.py | 0 {trurt => hiboo}/security.py | 0 {trurt => hiboo}/service/__init__.py | 2 +- {trurt => hiboo}/service/admin.py | 6 +++--- {trurt => hiboo}/service/forms.py | 2 +- {trurt => hiboo}/service/templates/service_create.html | 0 .../service/templates/service_create_form.html | 0 .../service/templates/service_details.html | 0 {trurt => hiboo}/service/templates/service_list.html | 0 {trurt => hiboo}/sso/__init__.py | 2 +- {trurt => hiboo}/sso/forms.py | 0 {trurt => hiboo}/sso/oidc.py | 0 {trurt => hiboo}/sso/saml.py | 6 +++--- {trurt => hiboo}/sso/templates/protocol_oidc.html | 0 {trurt => hiboo}/sso/templates/protocol_saml.html | 0 {trurt => hiboo}/sso/templates/sso_redirect.html | 0 {trurt => hiboo}/templates/base.html | 6 +++--- {trurt => hiboo}/templates/form.html | 0 {trurt => hiboo}/templates/macros.html | 0 {trurt => hiboo}/templates/sidebar.html | 0 {trurt => hiboo}/utils.py | 0 package.json | 4 ++-- webpack.config.js | 2 +- 41 files changed, 36 insertions(+), 36 deletions(-) rename {trurt => hiboo}/__init__.py (90%) rename {trurt => hiboo}/account/__init__.py (66%) rename {trurt => hiboo}/account/forms.py (100%) rename {trurt => hiboo}/account/login.py (95%) rename {trurt => hiboo}/account/profiles.py (98%) rename {trurt => hiboo}/account/settings.py (92%) rename {trurt => hiboo}/account/templates/account_home.html (100%) rename {trurt => hiboo}/account/templates/account_signin.html (100%) rename {trurt => hiboo}/account/templates/account_signup.html (100%) rename {trurt => hiboo}/account/templates/avatar_create.html (100%) rename {trurt => hiboo}/account/templates/avatar_pick.html (100%) rename {trurt => hiboo}/account/templates/profile_create.html (100%) rename {trurt => hiboo}/account/templates/profile_pick.html (100%) rename {trurt => hiboo}/configuration.py (96%) rename {trurt => hiboo}/debug.py (100%) rename {trurt => hiboo}/manage.py (90%) rename {trurt => hiboo}/models.py (100%) rename {trurt => hiboo}/security.py (100%) rename {trurt => hiboo}/service/__init__.py (76%) rename {trurt => hiboo}/service/admin.py (92%) rename {trurt => hiboo}/service/forms.py (96%) rename {trurt => hiboo}/service/templates/service_create.html (100%) rename {trurt => hiboo}/service/templates/service_create_form.html (100%) rename {trurt => hiboo}/service/templates/service_details.html (100%) rename {trurt => hiboo}/service/templates/service_list.html (100%) rename {trurt => hiboo}/sso/__init__.py (82%) rename {trurt => hiboo}/sso/forms.py (100%) rename {trurt => hiboo}/sso/oidc.py (100%) rename {trurt => hiboo}/sso/saml.py (98%) rename {trurt => hiboo}/sso/templates/protocol_oidc.html (100%) rename {trurt => hiboo}/sso/templates/protocol_saml.html (100%) rename {trurt => hiboo}/sso/templates/sso_redirect.html (100%) rename {trurt => hiboo}/templates/base.html (96%) rename {trurt => hiboo}/templates/form.html (100%) rename {trurt => hiboo}/templates/macros.html (100%) rename {trurt => hiboo}/templates/sidebar.html (100%) rename {trurt => hiboo}/utils.py (100%) diff --git a/.gitignore b/.gitignore index 224daaa..1f2222b 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 8ac3178..efb1503 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 3541759..6fd5692 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 902db14..125e097 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 6a9d919..6fb812f 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 f23a753..a27af3f 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 fb6fc3c..ecdfaa9 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 6a3e8b1..d34cf95 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 9366cee..881228a 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 342c163..1483728 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 1aca12f..a47fe15 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 485df48..bdf19bc 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 76e28a7..a845b1f 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 ffd137d..332a39b 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 674081f..b0c651d 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 953bbdc..68076b1 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 6a40f8e..fc08a12 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: { -- GitLab