Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
d61fa286
Commit
d61fa286
authored
Apr 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
820e33b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
15 deletions
+24
-15
backend/config.ini
backend/config.ini
+1
-1
backend/controller/apps_manager.py
backend/controller/apps_manager.py
+3
-2
backend/controller/build_logs_manager.py
backend/controller/build_logs_manager.py
+2
-1
backend/utils/epk.py
backend/utils/epk.py
+18
-11
No files found.
backend/config.ini
View file @
d61fa286
...
...
@@ -21,4 +21,4 @@ backup_dir = backup
evueapps_dir
=
evueapps
launcher_dir
=
launcher
host
=
127.0.0.1
port
=
5000
\ No newline at end of file
port
=
5001
\ No newline at end of file
backend/controller/apps_manager.py
View file @
d61fa286
...
...
@@ -80,7 +80,8 @@ class AppsManager(object):
app_info
=
epk
.
pack
()
epk_filename
=
os
.
sep
.
join
([
os
.
path
.
dirname
(
epk_path
)
.
replace
(
config
.
get
(
"UPLOAD_PATH"
),
""
),
"{}.epk"
.
format
(
app
.
app_name
)])
.
replace
(
'
\\
'
,
'/'
)
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
if
app_info
:
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
result
=
BuildLogs
(
app
=
app
,
app_path
=
epk_filename
,
app_info
=
app_info
,
create_by
=
editor
,
create_at
=
datetime
.
now
(),
update_by
=
editor
,
update_at
=
datetime
.
now
())
commit
()
...
...
@@ -200,7 +201,7 @@ class AppsManager(object):
temp
.
append
(
item
.
to_dict
(
only
=
[
"uuid"
,
"app_name"
]))
return
temp
,
len
(
temp
),
"get app {}."
.
format
(
"success"
if
temp
else
"fail"
)
result
=
Apps
.
select
()
.
where
(
**
temp
)
.
order_by
(
Apps
.
sort
)
.
page
(
data
.
get
(
"pagenum"
,
1
),
pagesize
=
data
.
get
(
"pagesize"
,
10
))
result
=
Apps
.
select
()
.
where
(
**
temp
)
.
order_by
(
Apps
.
sort
)
.
sort_by
(
desc
(
Apps
.
create_at
))
.
page
(
data
.
get
(
"pagenum"
,
1
),
pagesize
=
data
.
get
(
"pagesize"
,
10
))
count
=
Apps
.
select
()
.
where
(
**
temp
)
.
count
()
if
result
and
len
(
result
):
...
...
backend/controller/build_logs_manager.py
View file @
d61fa286
...
...
@@ -72,7 +72,8 @@ class BuildLogsManager(object):
params
[
'algorithm'
]
=
"h"
epk
=
EpkApp
(
**
params
)
app_info
=
epk
.
pack
()
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
if
app_info
:
app_info
[
'md5'
]
=
str
(
app_info
[
'md5'
])
# 更新数据库对应文件路径
for
sf
in
source_files
:
...
...
backend/utils/epk.py
View file @
d61fa286
...
...
@@ -52,6 +52,10 @@ def str_to_bin(s):
def
bin_to_str
(
s
):
return
''
.
join
([
chr
(
i
)
for
i
in
[
int
(
b
,
2
)
for
b
in
s
.
split
(
' '
)]])
def
eprint
(
*
args
,
**
kwargs
):
# print(*args, **kwargs)
pass
class
EpkApp
(
object
):
...
...
@@ -61,10 +65,10 @@ class EpkApp(object):
self
.
_appName
=
appName
self
.
_appDir
=
os
.
path
.
abspath
(
appDir
)
self
.
algorithm
=
algorithm
print
(
sys
.
argv
)
print
(
appName
)
print
(
appDir
)
print
(
self
.
_appDir
)
e
print
(
sys
.
argv
)
e
print
(
appName
)
e
print
(
appDir
)
e
print
(
self
.
_appDir
)
self
.
_appVersion
=
appVersion
self
.
_appCRCCode
=
None
self
.
_files
=
[]
...
...
@@ -114,7 +118,7 @@ class EpkApp(object):
}
if
self
.
_infoPath
==
os
.
sep
.
join
([
path
,
fname
]):
print
(
finfo
)
e
print
(
finfo
)
files
.
insert
(
0
,
finfo
)
else
:
files
.
append
(
finfo
)
...
...
@@ -159,7 +163,7 @@ class EpkApp(object):
md5
=
hashlib
.
md5
()
#获取一个md5加密算法对象
md5
.
update
(
content
)
#指定需要加密的字符串
newmd5
=
md5
.
hexdigest
()
#获取加密后的16进制字符串
print
(
"md5 == "
,
newmd5
)
e
print
(
"md5 == "
,
newmd5
)
content
=
self
.
sign
(
newmd5
)
ret
=
b
""
...
...
@@ -186,8 +190,8 @@ class EpkApp(object):
fileBytes
+=
struct
.
pack
(
"<
%
ds"
%
len
(
_name
),
fname
.
encode
(
"utf-8"
))
with
open
(
fpath
,
"rb"
)
as
fc
:
fileContentBytes
=
fc
.
read
()
print
(
info
[
"name"
])
print
(
len
(
fileContentBytes
))
e
print
(
info
[
"name"
])
e
print
(
len
(
fileContentBytes
))
fileBytes
+=
struct
.
pack
(
"<L"
,
len
(
fileContentBytes
))
if
fext
==
"md5"
:
...
...
@@ -195,11 +199,11 @@ class EpkApp(object):
else
:
fileCompressBytes
=
self
.
compress
()(
fileContentBytes
,
level
)
print
(
"==="
,
fileCompressBytes
[
0
])
print
(
fileCompressBytes
)
e
print
(
"==="
,
fileCompressBytes
[
0
])
e
print
(
fileCompressBytes
)
fileBytes
+=
struct
.
pack
(
"<L"
,
len
(
fileCompressBytes
))
print
(
fileBytes
)
e
print
(
fileBytes
)
fileBytes
+=
fileCompressBytes
...
...
@@ -212,6 +216,7 @@ class EpkApp(object):
# infos = self.epkInfo()
epkFileBytes
=
b
""
ret
=
None
epkFileContentBytes
=
b
""
file_count
=
len
(
infos
[
"files"
])
with
open
(
self
.
_epkName
,
"wb"
)
as
f
:
...
...
@@ -251,6 +256,8 @@ class EpkApp(object):
pprint
.
pprint
(
ret
)
return
ret
def
main
(
path
,
appName
,
algorithm
):
epk
=
EpkApp
(
appName
,
path
,
algorithm
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment