Skip to content

Commit

Permalink
feat: Jans linux setup ubuntu22 Installation (#1325)
Browse files Browse the repository at this point in the history
* feat: ubuntu22 install

* fix: ubuntu22 dependencies

* fix: jans-linux-setup update package dependency
  • Loading branch information
devrimyatar authored May 12, 2022
1 parent 0148bc8 commit 8597750
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
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

0 comments on commit 8597750

Please sign in to comment.