1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 17:26:15 +02:00
Commit Graph

322 Commits

Author SHA1 Message Date
c7af0e458f Use Field.get_callback to handle quiet/verbose and http_debug/http_full_debug options 2024-01-24 15:47:37 +01:00
a8c7661627 Implement 'quiet' conf option 2024-01-24 15:47:37 +01:00
0413179709 Fix Password.encode() on python < 3.8 2024-01-23 20:07:13 +01:00
116be57b53 Password can be an empty string (commonly used with ssh auth) 2024-01-09 11:11:52 +01:00
82216c72b4 Implement reading credentials from environmental variables
Options for apiurls can be set via OSC_HOST_<ALIAS>_<OPTION>=...
This requires a configured alias in the config file.

Setting the default apiurl via OSC_APIURL=... was working already.
Also OSC_CONFIG= / --config= was already implemented to skip loading configuration entirely.

Options for the default apiurl can be now set via:
  OSC_USERNAME=...
  OSC_CREDENTIALS_MGR_CLASS=...
  OSC_PASSWORD=...

This, for example, makes running osc in containers with
credentials stored in environmental variables possible:
OSC_CONFIG= OSC_APIURL=<url> OSC_USERNAME=<user> OSC_PASSWORD=<password> osc ...
2024-01-08 15:21:45 +01:00
b41afde2c9 Allow starting with an empty config if --configfile is either empty or points to /dev/null 2024-01-08 15:21:45 +01:00
Dirk Müller
a0a7865ca1
Convert to using f-strings 2024-01-06 10:00:38 +01:00
587c094f61 Limit model attributes to predefined fields by forbidding creating new attributes on fly 2024-01-03 21:21:38 +01:00
608fc76cd2 docs: Update models to avoid including lazy defaults in the rendered man pages
Lazy defaults may return different results under different circumstances
and we always want man pages rendered consistently.
2023-12-01 16:22:13 +01:00
69a68b06b3 Fix conf.write_initial_config() to use read_file() instead of deprecated readfp() 2023-11-15 09:18:22 +01:00
c790134aa4 Fix apiurl_aliases handling in OscOptions.__getitem__ 2023-10-24 00:33:21 +02:00
a2e7383eca Allow undefined fields in Options and HostOptions
Plugins seem to be using oscrc and osc.conf.config to store their config options.
All fields that are not known to osc are now stored in the 'extra_fields' dictionary
and handled in __getitem__() and __setitem__() as they were regular fields.
Such values are not checked for their types and the dictionary simply holds
strings obtained from oscrc or anything the plugins set through the python API.
2023-10-19 14:23:33 +02:00
bacac66fd3 Restore 'passx' host option that contains an obfuscated password 2023-10-13 21:06:25 +02:00
53968bf91c Fix retrieving a password in case a function returns another callable 2023-10-13 19:14:34 +02:00
c0e2f8c1a3 Always display apiurl when asking for credentials 2023-10-10 16:32:50 +02:00
61b5f7bebc Ask for new credentials when user is missing from an apiurl section in the config file 2023-10-10 16:32:50 +02:00
a16654663b
Merge pull request #1415 from dmach/rootless-kvm-and-podman
Rootless kvm and podman
2023-10-04 09:12:18 +02:00
ce72ffb225 Fix loading password from keyring 2023-10-03 09:12:28 +02:00
a6946587e1 Fix reading configuration from ENV 2023-09-29 09:54:50 +02:00
47f32e6ef1 Update list of supported vm_type values in conf.Options.vm_type 2023-09-27 23:24:31 +02:00
28efb4396a Rename conf.Options.build_type to vm_type to be consistent with obs build and osc --vm-type option 2023-09-27 23:24:31 +02:00
8eb360234e Add rootless build support to 'build' command for 'kvm' and 'podman' vm types
To avoid filesystem permission collisions with the builds using su_wrapper,
use an alternative buildroot path that appends username to '/var/tmp/build-root' for the rootless builds.
2023-09-27 23:24:31 +02:00
2f1cb0edb1 Remove any duplicated code loading configuration from ENV
The current conf.get_config() function already handles loading from ENV.
Also, always use osc.build.calculate_build_root() instead of making a custom variable substitution.
2023-09-27 23:24:31 +02:00
4b5534b070 Load empty optional configuration values as 'None' 2023-09-25 10:15:52 +02:00
1a42b7a2c9 Fix validating configuration by wrapping password into Password object 2023-09-13 14:25:47 +02:00
848f5fe48f Switch 'osc.conf.config' from dict to Options class with type checking 2023-09-11 21:14:45 +02:00
Tammo Oepkes
b9014ccd56
Fix api_host_options for custom CAs (#1403) 2023-09-11 21:06:34 +02:00
4255711344 Implement 'exclude_files' and 'include_files' config options that allow skipping files in the 'checkout' command
Examples:
    osc checkout --setopt='include_files=*.spec *.changes'
    osc checkout --setopt='exclude_files=*.tar.* *.obscpio'
2023-08-30 11:28:30 +02:00
f9dc3122f9 Add more config options among integer options 2023-08-15 14:29:18 +02:00
9ec1b24c2e Add '--setopt' option for setting config options from the command-line 2023-07-17 09:15:28 +02:00
5f912a8d7d conf: Display apiurl when asking for a username or a password 2023-04-11 11:25:24 +02:00
cf6e33a59b conf: If apiurl is not set in interactive_config_setup(), use apiurl from DEFAULTS 2023-04-11 11:11:25 +02:00
a25ea8d175 conf: Do not error out if oscrc is owned by another user 2023-04-03 08:59:25 +02:00
7c826dc605 conf: Fix a cut&paste error in setting 'disable_hdrmd5_check' config option
This set credentials_mgr_class to 'False', which caused
TransientCredentialsManager to ask for a password even when doing ssh auth.
2023-03-17 14:13:21 +01:00
0ad39a9ec9 build: New option 'disable_hdrmd5_check' to ignore hdrmd5 mismatches 2023-02-21 14:53:08 +01:00
2a9edeec5b conf: Change how api_host_options determine option types
The _integer_opts and _boolean_opts specify option types for both
global options as well as api_host_options
2023-02-21 14:42:30 +01:00
Dirk Müller
adb1a9b4ef mark boolean and integer_opts as private
It is unused elsewhere, and only used for unit-testing
2022-12-01 10:05:32 +01:00
7e67269b74 Replace 'if not <cond> in ...' with 'if <cond> not in ...' 2022-09-12 14:15:34 +02:00
fe59986e1c Run autopep8 to fix whitespace issues 2022-09-12 13:45:19 +02:00
b511be20ff Always import at the toplevel 2022-09-12 13:45:19 +02:00
ff63226c2f Properly test for None 2022-09-09 09:33:51 +02:00
b55384a914 Fix undefined variable in conf.apply_option_types() 2022-09-09 09:33:51 +02:00
a5b8729f2f Fix usage of super() 2022-09-09 09:33:51 +02:00
f8a8c9c91c Print user and apiurl when prompting for a password
It's not a good idea to send a password to a different server
than it belongs. Now the server identity is obvious.
2022-09-08 10:51:04 +02:00
3d8efe2d15 ssh auth: Avoid password prompt when using TransientCredentialsManager 2022-09-06 12:49:47 +02:00
ed5def96ba Remove deprecated 'plaintext_passwd' config option 2022-08-25 13:20:25 +02:00
41ceb4b5f8 Remove deprecated 'GnomeKeyringCredentialsManager' and related code 2022-08-25 13:20:25 +02:00
b306bf0b91 Convert defaults to their expected types
Fixes problems in reading conf values before the configuration
is fully initialized.
2022-08-22 15:08:49 +02:00
6cb7412749 Remove duplicated --debug and --verbose options
Additional changes:
* rename getbinaries --debug to --debuginfo to avoid conflicts
* switch conf['verbose'] from int to bool

The changes were needed because the new argparser behaves differently
and commands such as `osc ls` ran in verbose mode by default.
2022-08-12 10:06:00 +02:00
e469c2c184
Merge pull request #1041 from AdamMajer/master
Add support for project separator
2022-08-12 10:03:23 +02:00