Commit graph

33 commits

Author SHA1 Message Date
Anders Ingemann
bbde39e4fc
admin_user: Remove verbose info about how the key is fetched
There is no need to reiterate what the user has already specified
in the manifest.
2018-07-10 15:04:03 +02:00
Carlos Meza
1ec736038c pylint E1608(old-octal-literal) 2018-04-09 22:27:43 -07:00
Carlos Meza
6e183914ac fix pylint W0403(relative-import) 2018-02-25 04:12:24 +00:00
Tomasz Melcer
9b15c52ed6 fix some typos in documentation 2017-04-23 16:59:37 +02:00
Pritpal Sabharwal
87efcc812b Pass arguments for shell command as elements in a list. When shell=False, subprocess interprets the string as the name of an executable (including spaces) and fails to run. 2017-03-16 10:49:30 +00:00
Nicolas Braud-Santoni
90da634226
Systematically use rel_path for relative paths 2016-09-12 19:11:20 +02:00
Nicolas Braud-Santoni
7fd7ba5aa1
admin_user: Properly validate SSH keys 2016-09-12 17:37:50 +02:00
Nicolas Braud-Santoni
9de36b9d99
admin_user: Allow relative paths to pubkeys
The paths are relative to the manifest.

Also, the file validation happens during the validation phase.
2016-09-12 17:37:47 +02:00
Anders Ingemann
f62c8ade99 Convert indentation from tabs to spaces (4)
Up until now I didn't see the point of using spaces for indentation.
However, the previous commit (a18bec3) was quite eye opening.
Given that python is an indentation aware language, the amount of
mistakes that went unnoticed because tabs and spaces were used
at the same time (tabs for indentation and spaces for alignment)
were unacceptable.

E101,W191 have been re-enable in the tox flake8 checker and
the documentation has been modified accordingly.

The following files have been left as-is:
* bootstrapvz/common/assets/extlinux/extlinux.conf
* bootstrapvz/common/assets/init.d/expand-root
* bootstrapvz/common/assets/init.d/generate-ssh-hostkeys
* bootstrapvz/common/assets/init.d/squeeze/generate-ssh-hostkeys
* bootstrapvz/plugins/docker_daemon/assets/init.d/docker
* bootstrapvz/providers/ec2/assets/bin/growpart
* bootstrapvz/providers/ec2/assets/grub.d/40_custom
* bootstrapvz/providers/ec2/assets/init.d/ec2-get-credentials
* bootstrapvz/providers/ec2/assets/init.d/ec2-run-user-data
* docs/_static/taskoverview.coffee
* docs/_static/taskoverview.less
* tests/unit/subprocess.sh
2016-06-04 11:38:16 +02:00
Anders Ingemann
2d6a026160 Fix a slew of indentation & spacing issues 2016-06-04 11:38:16 +02:00
Anders Ingemann
6bb654b79f Compat with new sphinx
Changed a lot of code:: to code-block::
Also added sphinx_rtd_theme to deps in tox
2016-03-04 01:21:52 +01:00
Anders Ingemann
8a8d07991e Merge pull request #291 from nbraud/admin_user
admin_user plugin: Fix non-EC2 behaviour
2016-03-01 00:01:12 +01:00
Nicolas Braud-Santoni
72a9975ed9 admin_user: Add warnings 2016-02-29 20:15:24 +01:00
Anders Ingemann
e961438904 chown/chgrp entire .ssh dir to admin_user
Fixes #295
2016-02-25 08:27:27 +01:00
Nicolas Braud-Santoni
79b3803d64 admin_user plugin: Fix non-EC2 behaviour 2016-02-24 03:20:52 +01:00
Anders Ingemann
3d2088ad2a Fixes #285 admin_user, the sshdir check didn't check in the chroot 2016-02-18 18:23:48 +01:00
Anders Ingemann
73acb1f0d3 Fix breakage of admin_user module
Fixes #284
classnames were changed without testing
2016-02-16 20:43:53 +01:00
Anders Ingemann
ddfd8a2fd3 admin_user: Allow pubkey & password to be used together
Also change README a little, add some comments and get the code
a little more in line with the style of bootstrap-vz
2016-02-10 22:12:02 +01:00
Manoj Srivastava
4a29e5eec5
Bit by os.path.join not liking leading /
join ignores all path components to the left of any component that
starts with a /. Tested and found working.

Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
2016-02-08 02:50:55 -08:00
Manoj Srivastava
32ef6fc571
[admin_user]: More cleanups. Remove uneeded tests.
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
2016-02-06 02:15:52 -08:00
Manoj Srivastava
efeddc43a8
[admin_user]: Update per comments
As requested, this commit converts to tab indentation.

Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
2016-02-06 01:18:00 -08:00
Manoj Srivastava
a56f20657b
[admin_user]: Added support for password and static pubkey auth
This commit adds authentication optionally with passwords or static
ssh pubkeys for the admin user.

There are now three ways to grant access to the admin user:
-  Set a password for the user, or
-  Provide a ssh public key to allow remote ssh login, or
-  Use the EC2 public key (EC2 machines only)

If a password is provided, this plugin sets the admin password. This
also re-enables password login (off by default in Jessie).

If the optional argument pubkey is present (it should be a full path
to a ssh public key), it will ensure that the ssh public key is used
to set up password less remote login for the admin user.

Only one of these options (password, or pubkey) may be specified.

If neither the password not a ssh public key location are specified,
and if the EC2 init scripts are installed, the script for fetching the
SSH authorized keys will be adjust to match the username specified.

Fixes: https://github.com/andsens/bootstrap-vz/issues/248

Signed-off-by: Manoj Srivastava <srivasta@google.com>
2016-02-06 00:39:20 -08:00
Manoj Srivastava
67284eaae5
[admin_user]: Added support for password and static pubkey auth
This commit adds authentication optionally with passwords or static
ssh pubkeys for the admin user.

There are now three ways to grant access to the admin user:
-  Set a password for the user, or
-  Provide a ssh public key to allow remote ssh login, or
-  Use the EC2 public key (EC2 machines only)

If a password is provided, this plugin sets the admin password. This
also re-enables password login (off by default in Jessie).

If the optional argument pubkey is present (it should be a full path
to a ssh public key), it will ensure that the ssh public key is used
to set up password less remote login for the admin user.

Only one of these options (password, or pubkey) may be specified.

If neither the password not a ssh public key location are specified,
and if the EC2 init scripts are installed, the script for fetching the
SSH authorized keys will be adjust to match the username specified.

Fixes: https://github.com/andsens/bootstrap-vz/issues/248

Signed-off-by: Manoj Srivastava <srivasta@google.com>
2016-02-06 00:39:20 -08:00
Anders Ingemann
a7f2327e42 Litter the manifest schemas with additionalProperties:false
This pretty much eliminates the possiblity of undiscovered typos in the manifest
2015-05-02 13:04:30 +02:00
Anders Ingemann
1f6f23e680 Fix #104: Don't verify default target when adding packages 2015-04-29 23:51:55 +02:00
Anders Ingemann
71c7d445ad Fix #217, by introducing class for comparison of releases 2015-04-29 21:38:06 +02:00
Anders Ingemann
2d3a0a0ce3 The change in d9e9014 failed when SSH was not installed 2015-04-29 21:36:22 +02:00
Anders Ingemann
af1fab40e0 Only disable root login on squeeze & wheezy (jessie has it disabled per default) 2015-04-29 08:40:48 +02:00
Tiago Ilieve
e409115b25 Docs: fix wrongfully escaped terms 2015-04-28 01:21:07 -03:00
Anders Ingemann
953987fddf Combine documentation from github wiki with sphinx
This is the first step in the effort of combining all documentation about
bootstrap-vz into sphinx while still being able to access it from github
(github can parse rst as well)
2015-04-11 16:40:44 +02:00
Anders Ingemann
03a0746299 Convert every JSON file to YAML
Lines removed: over 500. Readiblity gained: A shitload
Now you can actually get an overview of a manifest on a single screen height.
I am sure that it will also save a lot of hassle when modifying schema in the future.
No more "expected property name" etc. because of an extraneous comma
Comments are of course natively support, so there's no need for this minify_json hokey pokey
2014-07-09 23:17:04 +02:00
Anders Ingemann
bbb06d717e Properly fix imports and make bootstrapvz work like a package 2014-04-02 21:32:10 +02:00
Anders Ingemann
be96e4c13f Move code into proper package folder 2014-04-02 21:26:13 +02:00