Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hiboo
Compare revisions
a2ae106cb6b7ae6b6a4452a5ee512bbbb74ee81c to dev
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
acides/hiboo
Select target project
No results found
dev
Select Git revision
Swap
Target
felinn-glotte/hiboo
Select target project
acides/hiboo
frju365/hiboo
pascoual/hiboo
thedarky/hiboo
jeremy/hiboo
cyrinux/hiboo
a.f/hiboo
mickge/hiboo
llaq/hiboo
vaguelysalaried/hiboo
felinn-glotte/hiboo
AntoninDelFabbro/hiboo
docemmetbrown/hiboo
13 results
a2ae106cb6b7ae6b6a4452a5ee512bbbb74ee81c
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
trurt/manage.py
+0
-11
0 additions, 11 deletions
trurt/manage.py
trurt/models.py
+0
-115
0 additions, 115 deletions
trurt/models.py
trurt/utils.py
+0
-35
0 additions, 35 deletions
trurt/utils.py
webpack.config.js
+60
-56
60 additions, 56 deletions
webpack.config.js
with
60 additions
and
217 deletions
trurt/manage.py
deleted
100644 → 0
View file @
a2ae106c
from
flask
import
current_app
as
app
from
flask
import
cli
as
flask_cli
import
flask
import
click
@click.group
()
def
trurt
(
cls
=
flask_cli
.
FlaskGroup
):
"""
Trurt command line
"""
This diff is collapsed.
Click to expand it.
trurt/models.py
deleted
100644 → 0
View file @
a2ae106c
from
passlib
import
context
,
hash
from
flask
import
current_app
as
app
from
sqlalchemy.ext
import
declarative
from
datetime
import
date
import
flask_sqlalchemy
import
sqlalchemy
class
Base
(
flask_sqlalchemy
.
Model
):
"""
Base class for all models
"""
metadata
=
sqlalchemy
.
schema
.
MetaData
(
naming_convention
=
{
"
fk
"
:
"
%(table_name)s_%(column_0_name)s_fkey
"
,
"
pk
"
:
"
%(table_name)s_pkey
"
}
)
@declarative.declared_attr
def
id
(
cls
):
return
sqlalchemy
.
Column
(
sqlalchemy
.
Integer
(),
primary_key
=
True
)
@declarative.declared_attr
def
created_at
(
cls
):
return
sqlalchemy
.
Column
(
sqlalchemy
.
Date
,
nullable
=
False
,
default
=
date
.
today
)
@declarative.declared_attr
def
updated_at
(
cls
):
return
sqlalchemy
.
Column
(
sqlalchemy
.
Date
,
nullable
=
True
,
onupdate
=
date
.
today
)
@declarative.declared_attr
def
comment
(
cls
):
return
sqlalchemy
.
Column
(
sqlalchemy
.
String
(
255
),
nullable
=
True
)
db
=
flask_sqlalchemy
.
SQLAlchemy
(
model_class
=
Base
)
class
JSONEncoded
(
db
.
TypeDecorator
):
"""
Represents an immutable structure as a json-encoded string.
"""
impl
=
db
.
String
def
process_bind_param
(
self
,
value
,
dialect
):
return
json
.
dumps
(
value
)
if
value
else
None
def
process_result_value
(
self
,
value
,
dialect
):
return
json
.
loads
(
value
)
if
value
else
None
class
User
(
db
.
Model
):
"""
A user is the local representation of an authenticated person.
"""
__tablename__
=
"
user
"
username
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
,
unique
=
True
)
# Flask-login attributes
is_authenticated
=
True
is_active
=
True
is_anonymous
=
False
@classmethod
def
get
(
cls
,
id
):
return
cls
.
query
.
get
(
id
)
def
get_id
(
self
):
return
self
.
id
class
Auth
(
db
.
Model
):
"""
An authenticator is a method to authenticate a user.
"""
__tablename__
=
"
auth
"
user_id
=
db
.
Column
(
db
.
Integer
(),
db
.
ForeignKey
(
User
.
id
))
user
=
db
.
relationship
(
User
,
backref
=
db
.
backref
(
'
auths
'
,
cascade
=
'
all, delete-orphan
'
))
# TODO: support multiple authentication realms, therefore more than
# passwords
value
=
db
.
Column
(
db
.
String
)
extra
=
db
.
Column
(
JSONEncoded
)
def
set_password
(
self
,
password
):
self
.
value
=
hash
.
pbkdf2_sha256
.
hash
(
password
)
def
check_password
(
self
,
password
):
return
hash
.
pbkdf2_sha256
.
verify
(
password
,
self
.
password
)
class
Service
(
db
.
Model
):
"""
A service is a client application (SP or RP typically).
"""
__tablename__
=
"
service
"
spn
=
db
.
Column
(
db
.
String
(
255
),
unique
=
True
)
protocol
=
db
.
Column
(
db
.
String
(
25
))
config
=
db
.
Column
(
JSONEncoded
)
class
Profile
(
db
.
Model
):
"""
A profile is a user instance for a given service.
"""
__tablename__
=
"
profile
"
user_id
=
db
.
Column
(
db
.
Integer
(),
db
.
ForeignKey
(
User
.
id
))
service_id
=
db
.
Column
(
db
.
Integer
(),
db
.
ForeignKey
(
Service
.
id
))
user
=
db
.
relationship
(
User
,
backref
=
db
.
backref
(
'
profiles
'
,
cascade
=
'
all, delete-orphan
'
))
service
=
db
.
relationship
(
Service
,
backref
=
db
.
backref
(
'
profiles
'
,
cascade
=
'
all, delete-orphan
'
))
username
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
)
This diff is collapsed.
Click to expand it.
trurt/utils.py
deleted
100644 → 0
View file @
a2ae106c
import
flask
import
flask_login
import
flask_migrate
import
flask_babel
import
flask_limiter
from
werkzeug.contrib
import
fixers
# Login configuration
login
=
flask_login
.
LoginManager
()
login
.
login_view
=
"
account.login
"
@login.unauthorized_handler
def
handle_needs_login
():
return
flask
.
redirect
(
flask
.
url_for
(
'
account.login
'
,
next
=
flask
.
request
.
endpoint
)
)
# Request rate limitation
limiter
=
flask_limiter
.
Limiter
(
key_func
=
lambda
:
current_user
.
id
)
# Application translation
babel
=
flask_babel
.
Babel
()
@babel.localeselector
def
get_locale
():
translations
=
list
(
map
(
str
,
babel
.
list_translations
()))
return
flask
.
request
.
accept_languages
.
best_match
(
translations
)
# Data migrate
migrate
=
flask_migrate
.
Migrate
()
This diff is collapsed.
Click to expand it.
webpack.config.js
View file @
e38ec328
var
path
=
require
(
"
path
"
);
var
webpack
=
require
(
"
webpack
"
);
var
css
=
require
(
"
mini-css-extract-plugin
"
);
const
path
=
require
(
'
path
'
);
const
webpack
=
require
(
'
webpack
'
);
const
css
=
require
(
'
mini-css-extract-plugin
'
);
const
mini
=
require
(
'
css-minimizer-webpack-plugin
'
);
const
terse
=
require
(
'
terser-webpack-plugin
'
);
const
compress
=
require
(
'
compression-webpack-plugin
'
);
module
.
exports
=
{
mode
:
"
development
"
,
entry
:
{
app
:
"
./assets/app.js
"
,
vend
or
:
"
./assets/
vendor
.js
"
mode
:
"
production
"
,
entry
:
{
app
:
{
imp
or
t
:
'
./assets/
app
.js
'
,
},
output
:
{
path
:
path
.
resolve
(
__dirname
,
"
static/
"
),
filename
:
"
[name].js
"
},
module
:
{
rules
:
[
{
test
:
/
\.
js$/
,
use
:
[
'
babel-loader
'
]
},
{
test
:
/
\.
scss$/
,
use
:
[
css
.
loader
,
'
css-loader
'
,
'
sass-loader
'
]
},
{
test
:
/
\.
less$/
,
use
:
[
css
.
loader
,
'
css-loader
'
,
'
less-loader
'
]
},
{
test
:
/
\.
css$/
,
use
:
[
css
.
loader
,
'
css-loader
'
]
},
{
test
:
/
\.
woff
(
$|
\?)
|
\.
woff2
(
$|
\?)
|
\.
ttf
(
$|
\?)
|
\.
eot
(
$|
\?)
|
\.
svg
(
$|
\?)
/
,
use
:
[
'
url-loader
'
]
},
{
// Exposes jQuery for use outside Webpack build
test
:
require
.
resolve
(
'
jquery
'
),
use
:
[{
loader
:
'
expose-loader
'
,
options
:
'
jQuery
'
},
{
loader
:
'
expose-loader
'
,
options
:
'
$
'
}]
}
]
},
plugins
:
[
new
css
({
filename
:
"
[name].css
"
,
chunkFilename
:
"
[id].css
"
}),
new
webpack
.
ProvidePlugin
({
$
:
"
jquery
"
,
jQuery
:
"
jquery
"
})
},
output
:
{
path
:
path
.
resolve
(
__dirname
,
'
hiboo/static/
'
),
filename
:
'
[name].js
'
,
assetModuleFilename
:
'
[name][ext]
'
,
},
module
:
{
rules
:
[
{
test
:
/
\.
js$/
,
use
:
[
'
babel-loader
'
,
'
import-glob
'
],
},
{
test
:
/
\.
s
?
css$/i
,
use
:
[
css
.
loader
,
'
css-loader
'
,
'
sass-loader
'
],
},
{
test
:
/
\.(
json|png|svg|jpg|jpeg|gif
)
$/i
,
type
:
'
asset/resource
'
,
}
]
},
plugins
:
[
new
css
({
filename
:
'
[name].css
'
,
chunkFilename
:
'
[id].css
'
}),
new
compress
({
filename
:
'
[path][base].gz
'
,
algorithm
:
"
gzip
"
,
exclude
:
/
\.(
png|gif|jpe
?
g
)
$/
,
threshold
:
5120
,
minRatio
:
0.8
,
deleteOriginalAssets
:
false
,
}),
],
optimization
:
{
minimize
:
true
,
minimizer
:
[
new
terse
(),
new
mini
({
minimizerOptions
:
{
preset
:
[
'
default
'
,
{
discardComments
:
{
removeAll
:
true
},
},
],
},
}),
],
},
}
This diff is collapsed.
Click to expand it.
Prev
1
…
6
7
8
9
10
Next