Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
16357fc3
authored
Aug 08, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloud-init clean, fix typo
parent
14291839
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
circle/dashboard/static/dashboard/dashboard.css
+10
-2
circle/dashboard/templates/dashboard/_ci-data-help.html
+5
-1
circle/vm/models/instance.py
+9
-2
No files found.
circle/dashboard/static/dashboard/dashboard.css
View file @
16357fc3
...
...
@@ -1364,5 +1364,13 @@ textarea[name="new_members"] {
height
:
18px
;
margin-right
:
8px
;
}
#ace-meta-data
{
position
:
absolute
;
width
:
95%
;
height
:
150px
;
}
#ace-user-data
{
position
:
absolute
;
width
:
95%
;
height
:
350px
;
}
circle/dashboard/templates/dashboard/_ci-data-help.html
View file @
16357fc3
...
...
@@ -23,6 +23,10 @@
<li>
{% trans "
<code>
ci.rndstr(len: int)
</code>
- function: make random string with 'len' charachters lenght" %}
</li>
</ul>
<p>
{% trans "Filters: hash - sha512 hash method" %}
</p>
<p>
{% trans "Use this commands, to clean cloud-init setup (for save as template example):" %}
</p>
<pre>
cloud-init clean
userdel -p -f cloud # delete default user
</pre>
<b>
Example:
</b>
<pre>
{% verbatim %}
#cloud-config
...
...
@@ -39,7 +43,7 @@ users:
ssh_authorized_keys:
- {{ ssh.keys['my-key'] }}
{% for u in acl.operators %}
- name: {{
i
}}
- name: {{
u
}}
shell: /bin/bash
{% endfor %}
{% endverbatim %}
</pre>
...
...
circle/vm/models/instance.py
View file @
16357fc3
...
...
@@ -43,7 +43,7 @@ import jinja2
from
passlib.hash
import
sha512_crypt
import
yaml
import
re
import
urllib3
,
json
from
model_utils
import
Choices
from
model_utils.managers
import
QueryManager
...
...
@@ -86,7 +86,6 @@ CI_USER_DATA_DEF = """
#cloud-config
users:
- default
- name: {{ sysuser }}
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups: sudo
...
...
@@ -259,6 +258,14 @@ class CITemplate:
def
rndstr
(
self
,
len
):
return
''
.
join
(
random
.
choice
(
string
.
ascii_letters
)
for
i
in
range
(
int
(
len
)))
def
jsonload
(
self
,
url
):
http
=
urllib3
.
PoolManager
()
r
=
http
.
request
(
'GET'
,
url
)
if
r
.
status
!=
200
:
raise
forms
.
ValidationError
(
f
'Status code: {r.status}'
)
myjson
=
r
.
data
.
decode
(
'utf8'
)
return
json
.
loads
(
myjson
)
def
j2_hash
(
value
,
hash
=
'sha512'
):
return
sha512_crypt
.
hash
(
value
)
...
...
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