Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Jans linux setup ubuntu22 Installation #1325

Merged
merged 3 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jans-cli/cli/pylib/tabulate/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
from platform import python_version_tuple
import re
import math
import sys


if python_version_tuple() >= ("3", "3", "0"):
if sys.version_info.major >= 3 and sys.version_info.minor >= 3:
from collections.abc import Iterable
else:
from collections import Iterable


if python_version_tuple()[0] < "3":
from itertools import izip_longest
from functools import partial
Expand Down
16 changes: 8 additions & 8 deletions jans-linux-setup/jans_setup/setup_app/data/package_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"centos 7": {
"optional": "",
"mondatory": "httpd mod_ssl curl mod_auth_openidc wget tar xz unzip bzip2 rsyslog ",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "certifi":"python3-certifi", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit"}
"mondatory": "httpd mod_ssl curl mod_auth_openidc wget tar xz unzip bzip2 rsyslog python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit"}
},
"centos 8": {
"optional": "",
Expand All @@ -34,14 +34,14 @@
"mondatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit"}
},
"ubuntu 18": {
"ubuntu 20": {
"optional": "",
"mondatory": "apache2 curl wget xz-utils unzip rsyslog net-tools bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit"}
"mondatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit"}
},
"ubuntu 20": {
"ubuntu 22": {
"optional": "",
"mondatory": "apache2 curl wget xz-utils unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit"}
"mondatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "pymysql":"python3-pymysql", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "certifi":"python3-certifi"}
}
}
6 changes: 2 additions & 4 deletions jans-linux-setup/jans_setup/setup_app/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def download_gcs():
shutil.unpack_archive(target_fn, base.pylib_dir)

grpcio_fn = os.path.join(tmp_dir, 'grpcio_fn.json')
base.download('https://pypi.org/pypi/grpcio/1.37.0/json', grpcio_fn, verbose=True)
base.download('https://pypi.org/pypi/grpcio/1.46.0/json', grpcio_fn, verbose=True)
data = base.readJsonFile(grpcio_fn)

package = get_grpcio_package(data)
Expand All @@ -61,9 +61,7 @@ def download_gcs():
whl_zip = zipfile.ZipFile(target_whl_fn)

for member in whl_zip.filelist:
fn = os.path.basename(member.filename)
if fn.startswith('cygrpc.cpython') and fn.endswith('x86_64-linux-gnu.so'):
whl_zip.extract(member, gcs_dir)
whl_zip.extract(member, gcs_dir)

whl_zip.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def render_import_templates(self):
Config.templateRenderingDict['configOauthEnabled'] = 'false' if base.argsp.disable_config_api_security else 'true'
Config.templateRenderingDict['apiApprovedIssuer'] = base.argsp.approved_issuer or 'https://{}'.format(Config.hostname)

oxauth_config_str = base64.decodestring(Config.templateRenderingDict['oxauth_config_base64'].encode())
oxauth_config_str = base64.decodebytes(Config.templateRenderingDict['oxauth_config_base64'].encode())
oxauth_config = json.loads(oxauth_config_str.decode())
for param in ('issuer', 'openIdConfigurationEndpoint', 'introspectionEndpoint', 'tokenEndpoint', 'tokenRevocationEndpoint'):
Config.templateRenderingDict[param] = oxauth_config[param]
Expand Down
7 changes: 5 additions & 2 deletions jans-linux-setup/jans_setup/setup_app/pylib/jproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
import re
import sys
import time
from collections import MutableMapping, namedtuple

import six

from collections import namedtuple
try:
from collections import MutableMapping
except Exception:
from collections.abc import MutableMapping

# This represents a combination of a value and metadata for a property key.
PropertyTuple = namedtuple("PropertyTuple", ["data", "meta"])
Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/utils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
sys.exit()

os_name = os_type + os_version
deb_sysd_clone = os_name in ('ubuntu18', 'ubuntu20', 'debian9', 'debian10')
deb_sysd_clone = os_name in ('ubuntu18', 'ubuntu20', 'ubuntu22', 'debian9', 'debian10')

# Determine service path
if (os_type in ('centos', 'red', 'fedora', 'suse') and os_initdaemon == 'systemd') or deb_sysd_clone:
Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/utils/crypto64.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def generate_base64_string(self, lines, num_spaces):
return None

plain_text = ''.join(lines)
plain_b64encoded_text = base64.encodestring(plain_text.encode('utf-8')).decode('utf-8').strip()
plain_b64encoded_text = base64.encodebytes(plain_text.encode('utf-8')).decode('utf-8').strip()

if num_spaces > 0:
plain_b64encoded_text = self.reindent(plain_b64encoded_text, num_spaces)
Expand Down