Browse Source

add code for 1.7.0

master^2
bengt@fredhs.net 2 years ago
parent
commit
b7f8933f9e
  1. 2
      bin/start
  2. 2
      bin/stop
  3. 2
      bin/utils/db_backup
  4. 2
      bin/utils/db_init
  5. 11
      conf/app/agent.app.config.yaml
  6. 28
      conf/app/api.app.config.yaml
  7. 44
      conf/database/seed_data/default_images.yaml
  8. 219
      conf/database/seed_data/default_properties.yaml
  9. 9
      conf/nginx/services.d/subscription_api.conf
  10. 28
      docker/docker-compose-agent.yaml
  11. 83
      docker/docker-compose-all.yaml
  12. 37
      docker/docker-compose-api.yaml
  13. 69
      docker/docker-compose-app.yaml
  14. 22
      docker/docker-compose-db.yaml
  15. 178
      install.sh
  16. 30
      install_dependencies.sh
  17. 14
      www/fonts/ag.cce32c739dde31fdbee1e421de18aeac.svg
  18. 763
      www/fonts/ai.c2f29c4d57cfcba3c9b2374b2c7e461f.svg
  19. 5
      www/fonts/aq.65448909a82325121a92bb71012091d7.svg
  20. 5
      www/fonts/aq.65afe1f1ffb9d9a23d25d2327ba2c3d3.svg
  21. 33
      www/fonts/as.16f433a627bc83a007bba2cbaa686aee.svg
  22. 186
      www/fonts/aw.47ea7038c8fea471afdd906694068310.svg
  23. 18
      www/fonts/ax.c26f83744d3df6899632e575d390681a.svg
  24. 12
      www/fonts/ba.3223166179b08490c6c2291ace1894f0.svg
  25. 9
      www/fonts/bh.90ad3cbd95a2834f0a787db075cdb4fc.svg
  26. 9
      www/fonts/bh.ef135f3ca77838cbb6e329d57d250c9a.svg
  27. 15
      www/fonts/bi.06f36479b44476f25fc935175ac8a596.svg
  28. 14
      www/fonts/bj.c81e891543509717b02a594b40afa14a.svg
  29. 676
      www/fonts/bo.4128202a176b10fa597f1221f8e7e4cd.svg
  30. 678
      www/fonts/bo.eab17936c2d9dd56edd3f134c8e6f29c.svg
  31. 13
      www/fonts/bs.9f8a4eae81ab5bc495dd7fa4f7b26d87.svg
  32. 13
      www/fonts/bv.78bef9106e11eade7698e39f6ed831c7.svg
  33. 20
      www/fonts/by.f4cbd761094b27fc253729dfbacfceeb.svg
  34. 15
      www/fonts/cf.2171101e459db58cc9311ec6a0926648.svg
  35. 12
      www/fonts/cg.4396b867b33acac643e6d978fb99f1ac.svg
  36. 13
      www/fonts/cl.8949f9e6d4f88c4f5bc1fe5f3b4e44c4.svg
  37. 13
      www/fonts/cu.750c91b200d29892cf10f9887253105f.svg
  38. 13
      www/fonts/cv.f9922e019e929da267a67ee784bdde66.svg
  39. 14
      www/fonts/cw.f1b3043c88d52ecf9222b5987791bbac.svg
  40. 5
      www/fonts/cz.2339f3df385beb6667b8fd621e6a53dd.svg
  41. 5
      www/fonts/cz.80879b0e86919c6859d875da48efd0e0.svg
  42. 13
      www/fonts/dj.423c41561146de8c3017bbe35919e0bd.svg
  43. 152
      www/fonts/dm.46f58d408f6a338114dbd063b87f97f7.svg
  44. 6745
      www/fonts/do.79f8bf8c1a68481e09267f5215ef80ca.svg
  45. 15
      www/fonts/eh.3b662831ee7dd98f8995817929c38fe5.svg
  46. 189
      www/fonts/es-ga.151714df0fea994ff25db833a9e9fea1.svg
  47. 189
      www/fonts/es-ga.2618e21f1cd5dcbd95d7b119f7b4e33a.svg
  48. 14
      www/fonts/et.2ebb0d3d6e63baf78a33bca7e1ae9326.svg
  49. 90
      www/fonts/fk.519e3de544b46b3524a5a2bbbc383625.svg
  50. 93
      www/fonts/fk.aeb2d58832c6dc501253d235d5467fe3.svg
  51. 11
      www/fonts/fm.59c5190c55c637cc6786bcab140eb22c.svg
  52. 12
      www/fonts/fo.037e466d03f81cd46e76b58aa73fe492.svg
  53. 7
      www/fonts/gb.5db9fea0ec9e05cfb98e7387be5d0aa7.svg
  54. 6
      www/fonts/ge.16f859b527e54ef4c757aba84595516f.svg
  55. 6
      www/fonts/ge.d3665bf12d34ff71ab308c6f4e32fd25.svg
  56. 14
      www/fonts/gm.50fe2799b099599b89f80b4d25376134.svg
  57. 204
      www/fonts/gt.656c9899d22b166292448de76509d46c.svg
  58. 204
      www/fonts/gt.d6b5b664755ae293fefaab4511db8b9b.svg
  59. 30
      www/fonts/hk.7428ec1c480645e3654a2729c9f6e07f.svg
  60. 14
      www/fonts/il.874270d66e9553b21e76dc1d433ba4a9.svg
  61. 36
      www/fonts/im.8c10222d11a27a76e0bb29224c6f743c.svg
  62. 138
      www/fonts/io.3ddd1280f6e320712021a1f68ee5ae11.svg
  63. 219
      www/fonts/ir.23e0f96c3fa45df393a3c1d184b2df34.svg
  64. 12
      www/fonts/is.2ce20c50765b6cccf87ee4b269d8c507.svg
  65. 29
      www/fonts/je.ab89781e75ca3440dcb86aa8dbd620f3.svg
  66. 29
      www/fonts/je.e0932aed817435f70cf058dd3261ae1c.svg
  67. 16
      www/fonts/jo.9e2f2b3ac5784152799cde822b9ebc29.svg
  68. 11
      www/fonts/jp.3e72015c537875435192c3b2d832042e.svg
  69. 15
      www/fonts/kg.1cfa1c79dd521076fb17f8d024e3d19f.svg
  70. 36
      www/fonts/ki.db7e40f60e21ad4b6b6465409ce745b3.svg
  71. 16
      www/fonts/km.9b06043d7f9a227bc63532af67999125.svg
  72. 14
      www/fonts/kn.bde74c6da4f2cff6fe3ae84b510b1857.svg
  73. 15
      www/fonts/kp.9c53429167b92e260e1ec30e1686b93b.svg
  74. 24
      www/fonts/kr.60fde7fc2f6005c1131b87ce63370ffd.svg
  75. 13
      www/fonts/kw.496fa4662f48d2d7e3bd946177905dc4.svg
  76. 12
      www/fonts/la.0f124ae33af5a9291262592979c90f55.svg
  77. 15
      www/fonts/lb.e33a49a9a071a76dd393f2928ce0f808.svg
  78. 14
      www/fonts/lr.309ccbd814f8f4ab23dd5a3116f9f2ac.svg
  79. 13
      www/fonts/ly.d089645e2ba9f431431b479cc902bf43.svg
  80. 9
      www/fonts/mo.67acac75dc2e1cb667560972d6996ea6.svg
  81. 9
      www/fonts/mo.b6d4d1f6c34ca7e148035b1aea886080.svg
  82. 86
      www/fonts/mp.c5eb7f233b097ecfc5f78b3959907dcc.svg
  83. 70
      www/fonts/ms.ad88044d48d7c401d3bec290c5048a0b.svg
  84. 78
      www/fonts/ms.e147bd2bb2aa7f31e3804673c8564340.svg
  85. 21
      www/fonts/mz.ef4657da4e39ea91de728d93ce59d7c9.svg
  86. 16
      www/fonts/na.bb49a4035c384be9926bac6004bea21f.svg
  87. 14
      www/fonts/nc.b8c9f5e4fa65dc17c5f07773616fa3cb.svg
  88. 14
      www/fonts/nc.d393b8faea4e68b19f4d3d920480dbcd.svg
  89. 129
      www/fonts/ni.7b131ab3ceaf55696b688d2617f21f54.svg
  90. 129
      www/fonts/ni.baafd7d7fc1b69642270c1c1fee58bed.svg
  91. 19
      www/fonts/np.27f0f4e72e359732d04452c336db37fb.svg
  92. 14
      www/fonts/np.b66578a5c732da35e2c8af86e46ff93b.svg
  93. 12
      www/fonts/nr.d16edc69065bf2bd0b0ba47650201d6b.svg
  94. 26
      www/fonts/nu.433deb3d047d08459797f7a9da38685f.svg
  95. 41
      www/fonts/nz.3241e92770d44bbe8518b3ed7cabab9a.svg
  96. 41
      www/fonts/nz.7dab6e5e9d9e0d4f95e588ae563d5d77.svg
  97. 115
      www/fonts/om.1798270ba5e7dc130458959dccc26b22.svg
  98. 14
      www/fonts/pa.d0787677f0d7c9cdaa8f6acca3f19245.svg
  99. 18
      www/fonts/pf.2a69c581854033f017ef92651bf103ad.svg
  100. 19
      www/fonts/pf.bab3b7a56aa5cd5f44235c47ea55f5e9.svg
  101. Some files were not shown because too many files have changed in this diff Show More

2
bin/start

@ -5,7 +5,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
KASM_VERSION="1.6.0"
KASM_VERSION="1.7.0"
KASM_INSTALL_BASE="/opt/kasm/${KASM_VERSION}"
pushd ${KASM_INSTALL_BASE}/docker > /dev/null

2
bin/stop

@ -5,7 +5,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
KASM_VERSION="1.6.0"
KASM_VERSION="1.7.0"
KASM_INSTALL_BASE="/opt/kasm/${KASM_VERSION}"
pushd ${KASM_INSTALL_BASE}/docker > /dev/null

2
bin/utils/db_backup

@ -59,7 +59,7 @@ docker-compose rm -f db > /dev/null
docker stop ${TEMP_DB_CONTAINER_NAME} || true && docker rm ${TEMP_DB_CONTAINER_NAME} || true
echo "Creating temporary database backup container..."
docker-compose run -v ${DB_BACKUP_DIR}:/tmp -d --name ${TEMP_DB_CONTAINER_NAME} db
docker-compose run -v ${DB_BACKUP_DIR}/:/tmp/ -d --name ${TEMP_DB_CONTAINER_NAME} db
sleep 10
echo "Executing Backup"

2
bin/utils/db_init

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
KASM_VERSION="1.6.0"
KASM_VERSION="1.7.0"
KASM_INSTALL_BASE="/opt/kasm/${KASM_VERSION}"
if [[ $EUID -ne 0 ]]; then

11
conf/app/agent.app.config.yaml

@ -1,6 +1,6 @@
agent:
default_host_key: 1234
heartbeat_interval: 10000
heartbeat_interval: 30000
images_interval: 300
nginx_container_dir: /etc/nginx/conf.d/containers.d/
port: 4444
@ -43,6 +43,14 @@ logging:
formatter: standard
level: DEBUG
maxBytes: 10485760
file_handler_json:
backupCount: 5
class: logging.handlers.RotatingFileHandler
encoding: utf8
filename: /opt/kasm/current/log/agent_json.log
formatter: logmatic
level: DEBUG
maxBytes: 10485760
stream:
class: logging.StreamHandler
formatter: standard
@ -57,6 +65,7 @@ logging:
- stream
- syslog
- file_handler
- file_handler_json
level: DEBUG
propagate: true
tornado:

28
conf/app/api.app.config.yaml

@ -25,6 +25,14 @@ logging:
formatter: standard
level: DEBUG
maxBytes: 10485760
file_handler_json:
backupCount: 20
class: logging.handlers.RotatingFileHandler
encoding: utf8
filename: /opt/kasm/current/log/agent_json.log
formatter: logmatic
level: DEBUG
maxBytes: 10485760
stream:
class: logging.StreamHandler
formatter: standard
@ -39,6 +47,7 @@ logging:
- stream
- syslog
- file_handler
- file_handler_json
level: DEBUG
propagate: true
version: 1
@ -57,6 +66,14 @@ logging:
formatter: standard
level: DEBUG
maxBytes: 10485760
file_handler_json:
backupCount: 20
class: logging.handlers.RotatingFileHandler
encoding: utf8
filename: /opt/kasm/current/log/share_json.log
formatter: logmatic
level: DEBUG
maxBytes: 10485760
stream:
class: logging.StreamHandler
formatter: standard
@ -71,6 +88,7 @@ logging:
- stream
- syslog
- file_handler
- file_handler_json
level: DEBUG
propagate: true
tornado.application:
@ -99,6 +117,15 @@ logging:
level: DEBUG
maxBytes: 10485760
filters: [ forwarded_log_filter ]
file_handler_json:
backupCount: 20
class: logging.handlers.RotatingFileHandler
encoding: utf8
filename: /opt/kasm/current/log/manager_api_server_json.log
formatter: logmatic
level: DEBUG
maxBytes: 10485760
filters: [ forwarded_log_filter ]
stream:
class: logging.StreamHandler
formatter: standard
@ -115,6 +142,7 @@ logging:
- stream
- syslog
- file_handler
- file_handler_json
level: DEBUG
propagate: true
__main__.handler:

44
conf/database/seed_data/default_images.yaml

@ -0,0 +1,44 @@
images:
Kasm Desktop:
cores: 1.0
description: Kasm Desktop Environment
docker_registry: https://index.docker.io/v1/
enabled: true
image_src: img/thumbnails/desktop.png
add_to_all_users_group: true
memory: 1768000000
name: kasmweb/desktop:1.7.0
run_config: '{"hostname": "kasm"}'
x_res: 800
y_res: 600
Kasm Desktop Deluxe:
description: Kasm Desktop Environment with additional productivity Software
docker_registry: https://index.docker.io/v1/
name: kasmweb/desktop-deluxe:1.7.0
run_config: '{"hostname": "kasm"}'
image_src: img/thumbnails/desktop-deluxe.png
add_to_all_users_group: true
Kasm Firefox:
description: 'Single-Application : Firefox'
docker_registry: https://index.docker.io/v1/
image_src: img/thumbnails/firefox.png
add_to_all_users_group: true
name: kasmweb/firefox:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"cmd":"bash -c ''$STARTUPDIR/custom_startup.sh \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''firefox -width ${VNC_RESOLUTION/x*/} -height ${VNC_RESOLUTION/*x/} --new-tab \"$KASM_URL\"''"}}'
Kasm Chrome:
description: 'Single-Application : Chrome'
docker_registry: https://index.docker.io/v1/
image_src: img/thumbnails/chrome.png
add_to_all_users_group: true
name: kasmweb/chrome:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"cmd":"bash -c ''$STARTUPDIR/custom_startup.sh \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''google-chrome --start-maximized \"$KASM_URL\"''"}}'
Kasm Tor-Browser:
description: 'Single-Application : Tor-Browser'
docker_registry: https://index.docker.io/v1/
image_src: img/thumbnails/tor-browser.png
add_to_all_users_group: true
name: kasmweb/tor-browser:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"environment": {"LAUNCH_URL": ""}, "cmd":"bash -c ''/tmp/tor-browser_en-US/Browser/start-tor-browser --detach --allow-remote --new-tab \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''/tmp/tor-browser_en-US/Browser/start-tor-browser --detach --allow-remote --new-tab --detach \"$KASM_URL\"''"}}'

219
conf/database/seed_data/default_properties.yaml

@ -52,6 +52,12 @@ global_settings:
value: 4
value_type: int
description: "Number of hours to retain local Kasm debug logs. WARNING - See Kasm documentation before adjusting."
minimize_local_logging:
title: Minimize Local logging
value: false
value_type: bool
restart: manager
description: "When using a remote logging solution like Splunk, minimize local database logging for better scalability."
auth:
notice_message:
value:
@ -113,47 +119,6 @@ global_settings:
value: a5b89ebd-779e-4bcf-9040-115fdab1056a
value_type: string
description: An authentication token used the communication between Kasm Agents and the Manager API server.
nginx:
cert_in:
title: Certificate In
value: /opt/kasm/current/certs/kasm_nginx.crt
value_type: string
description: The nginx cert will be read from this location on the Manager API server when automatically provisioning Agents.
cert_out:
title: Certificate Out
value: /opt/kasm/current/certs/kasm_nginx.crt
value_type: string
description: The nginx cert will be placed at this directory path for automatically provisioned Agents
key_in:
title: Key In
value: /opt/kasm/current/certs/kasm_nginx.key
value_type: string
description: The nginx key will be read from this location on the Manager API server when automatically provisioning Agents.
key_out:
title: Key Out
value: /opt/kasm/current/certs/kasm_nginx.key
value_type: string
description: The nginx key will be placed at this directory path for automatically provisioned Agents.
proxy_connections:
title: Proxy Connections
value: true
value_type: bool
description: When creating a Kasm, instruct the client to connect to the Kasm via another proxy server. When false, the client connects directly to the Kasm via the Agent's address.
proxy_hostname:
title: Proxy Hostname
value: $request_host$
value_type: string
description: The IP or DNS name used in the url for proxied connections to the Kasm i.e (https://<proxy_hostname>:<proxy_port>/<proxy_path>) . This setting only applies if proxy_connections is set to true.
proxy_path:
title: Proxy Path
value: desktop
value_type: string
description: The url path used in the proxied connections. i.e (https://<proxy_hostname>:<proxy_port>/<proxy_path>) . This setting only applies if proxy_connections is set to true.
proxy_port:
value: 443
value_type: int
description: The Port used in the proxied connection url. i.e (https://<proxy_hostname>:<proxy_port>/<proxy_path>) . This setting only applies if proxy_connections is set to true.
title: Proxy Port
scale:
default_image_cores:
title: Default Image Cores
@ -196,6 +161,13 @@ global_settings:
value: true
value_type: bool
description: Automatically add images to default group when new images are added.
web_filter:
web_filter_update_url:
title: Web Filter Update URL
value: https://filter.kasmweb.com
value_type: string
description: Url used to updated the Web Filter Categorization database
restart: api
group_settings:
administrator:
description: Allows users to see and edit all attributes of the Kasm application.
@ -205,6 +177,10 @@ group_settings:
description: Allow audio streaming for a Kasm.
value: 'True'
value_type: bool
allow_kasm_microphone:
description: Allow microphone passthrough to a Kasm.
value: 'True'
value_type: bool
allow_kasm_clipboard_down:
description: Allows users to paste text from the Kasm to their local computer.
value: 'True'
@ -297,6 +273,22 @@ group_settings:
description: Locks video quality to static resolution of 720p when sharing is enabled. Recomended for best performance.
value: 'True'
value_type: bool
usage_limit:
description: "Enable usage limits for the group. \
\n Specify a Type, Interval and number of Hours to set limit.\
\n Type is either per_user or per_group. \
\n Interval is one of Daily, Weekly, Monthly, or Total.\
\n Hours is a positive number of hours for the limit cap."
value: '{}'
value_type: usage_limit
web_filter_policy:
description: Sets the Web Filter Policy to be applied.
value: ''
value_type: filter_policy
metadata:
description: Arbitrary metadata for the group.
value: '{}'
value_type: json
groups:
Administrators:
description: Default Administrators Group
@ -305,10 +297,10 @@ groups:
settings:
administrator:
value: 'True'
enable_totp_two_factor:
value: 'True'
allow_kasm_audio:
value: 'True'
allow_kasm_microphone:
value: 'True'
allow_kasm_clipboard_down:
value: 'True'
allow_kasm_clipboard_seamless:
@ -335,66 +327,8 @@ groups:
value: '3600'
run_config:
value: '{"environment": {"GROUP": "%s"}}'
images:
Kasm Desktop:
cores: 1.0
description: Kasm Desktop Environment
docker_registry: https://index.docker.io/v1/
enabled: true
image_id: 11111111-1111-1111-1111-111111111111
image_src: img/thumbnails/desktop.png
available: false
memory: 768000000
name: kasmweb/desktop:1.7.0
run_config: '{"hostname": "kasm"}'
x_res: 800
y_res: 600
Kasm Desktop Deluxe:
description: Kasm Desktop Environment with additional productivity Software
docker_registry: https://index.docker.io/v1/
name: kasmweb/desktop-deluxe:1.7.0
run_config: '{"hostname": "kasm"}'
image_src: img/thumbnails/desktop-deluxe.png
available: false
Kasm Desktop Seafile:
description: Kasm Desktop Environment with Seafile GUI
docker_registry: https://registry.fredhs.net/v2
name: registry.fredhs.net/r/kasmweb-desktop-seafile:latest
run_config: '{"hostname": "kasm"}'
image_src: img/thumbnails/desktop-seafile.png
available: false
Kasm Firefox:
description: 'Single-Application : Firefox'
docker_registry: https://index.docker.io/v1/
image_id: 22222222-2222-2222-2222-222222222222
image_src: img/thumbnails/firefox.png
available: false
name: kasmweb/firefox:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"cmd":"bash -c ''firefox -width ${VNC_RESOLUTION/x*/} -height ${VNC_RESOLUTION/*x/} --new-tab \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''firefox -width ${VNC_RESOLUTION/x*/} -height ${VNC_RESOLUTION/*x/} --new-tab \"$KASM_URL\"''"}}'
Kasm Firefox for Touch:
description: 'Single-Application : Firefox for Touch and Mobile Systems'
docker_registry: https://index.docker.io/v1/
name: kasmweb/firefox-mobile:1.7.0
run_config: '{"hostname": "kasm"}'
image_src: img/thumbnails/touch.png
available: false
Kasm Chrome:
description: 'Single-Application : Chrome'
docker_registry: https://index.docker.io/v1/
image_src: img/thumbnails/chrome.png
available: false
name: kasmweb/chrome:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"environment": {"LAUNCH_URL": ""}, "cmd":"bash -c ''google-chrome --start-maximized \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''google-chrome --start-maximized \"$KASM_URL\"''"}}'
Kasm Tor-Browser:
description: 'Single-Application : Tor-Browser'
docker_registry: https://index.docker.io/v1/
image_src: img/thumbnails/tor-browser.png
available: false
name: kasmweb/tor-browser:1.7.0
run_config: '{"hostname": "kasm"}'
exec_config: '{"first_launch":{"environment": {"LAUNCH_URL": ""}, "cmd":"bash -c ''/tmp/tor-browser_en-US/Browser/start-tor-browser --detach --allow-remote --new-tab \"$KASM_URL\"''"},"go":{"cmd":"bash -c ''/tmp/tor-browser_en-US/Browser/start-tor-browser --detach --allow-remote --new-tab --detach \"$KASM_URL\"''"}}'
usage_limit:
value: '{"type":"per_user","interval":"daily","hours": 2}'
users:
admin@kasm.local:
groups:
@ -404,20 +338,23 @@ users:
password: user
zones:
default:
load_strategy: least_load
prioritize_static_agents: true
search_alternate_zones: true
minimum_available_slots: 0
agent_cores_override: 2
agent_memory_override_gb: 1
aws_enabled: False
aws_region: us-east-1
aws_access_key_id: changeme
aws_secret_access_key: changeme
ec2_agent_ami_id: ami-aa2ea6d0
ec2_agent_ami_id: changeme
ec2_agent_instance_type: t3.micro
ec2_agent_cores_override: 2
ec2_agent_memory_override_gb: 1
ec2_agent_key_pair_name: Production
ec2_agent_key_pair_name: changeme
aws_max_ec2_nodes: 10
ec2_agent_security_group_id: sg-0a0bb97e
ec2_agent_subnet_id: subnet-f8e008f7
ec2_agent_iam: CloudWatchRole
ec2_agent_security_group_id: changeme
ec2_agent_subnet_id: changeme
ec2_agent_iam: changeme
ec2_agent_ebs_volume_type: gp2
ec2_agent_ebs_volume_size_gb: 20
ec2_agent_startup_script: |
@ -443,8 +380,68 @@ zones:
PUBLIC_DNS=(`curl -s http://169.254.169.254/latest/meta-data/hostname`)
bash kasm_release/install.sh -e -a -p $PUBLIC_DNS -m {manager_hostname} -i {server_id} -r aws
bash kasm_release/install.sh -e -a -p $PUBLIC_DNS -m {upstream_auth_address} -i {server_id} -r aws
echo -e "{nginx_cert_in}" > {nginx_cert_out}
echo -e "{nginx_key_in}" > {nginx_key_out}
register_dns: False
dns_registration_provider: aws
base_domain_name: example.com
allow_origin_domain: '$request_host$'
upstream_auth_address: '$request_host$'
proxy_connections: True
proxy_hostname: '$request_host$'
proxy_path: desktop
proxy_port: 443
nginx_cert: ''
nginx_key: ''
digital_ocean_enabled: False
digital_ocean_max_droplets: 2
digital_ocean_token: changeme
digital_ocean_region: nyc1
digital_ocean_droplet_image: docker-18-04
digital_ocean_droplet_size: s-1vcpu-1gb
digital_ocean_tags: 'change,me'
digital_ocean_sshkey_name: changeme
digital_ocean_firewall_name: changeme
digital_ocean_startup_script: |
#!/bin/bash
set -ex
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=2048
/sbin/mkswap /var/swap.1
chmod 600 /var/swap.1
/sbin/swapon /var/swap.1
cd /tmp
wget {release_url} -O kasm_backend.tar.gz
tar -xf kasm_backend.tar.gz
PUBLIC_IP=(`hostname -I | cut -d ' ' -f1 | tr -d '\\n'`)
GIVEN_HOSTNAME={server_hostname}
if [ -z "$GIVEN_HOSTNAME" ]
then
HN=$PUBLIC_IP
else
HN=$GIVEN_HOSTNAME
fi
#bash kasm_release/install_dependencies.sh
#docker login
bash kasm_release/install.sh -e -a -p $HN -m {upstream_auth_address} -i {server_id} -r digital_ocean
echo -e "{nginx_cert_in}" > /opt/kasm/current/certs/kasm_nginx.crt
echo -e "{nginx_key_in}" > /opt/kasm/current/certs/kasm_nginx.key

9
conf/nginx/services.d/subscription_api.conf

@ -1,4 +1,13 @@
location /api/subscriptions/ {
add_header 'Access-Control-Allow-Origin' 'https://www.kasmweb.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';
add_header 'Access-Control-Allow-Credentials' 'true';
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;

28
docker/docker-compose-agent.yaml

@ -3,32 +3,40 @@ services:
kasm_agent:
container_name: kasm_agent
user: root
image: "kasmweb/agent:1.6.0"
ports:
- "127.0.0.1::4444"
image: "kasmweb/agent:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /opt/kasm/1.6.0/conf/nginx:/etc/nginx/conf.d
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
proxy:
container_name: kasm_proxy
image: "nginx:alpine"
ports:
- "127.0.0.1:443:443"
- "443:443"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.6.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.6.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.6.0/www:/srv/www:ro
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.7.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.7.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.7.0/www:/srv/www:ro
restart: always
depends_on:
- kasm_agent
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
networks:
kasm_default_network:
external: true

83
docker/docker-compose-all.yaml

@ -4,8 +4,6 @@ services:
container_name: kasm_db
image: postgres:9.5-alpine
restart: always
ports:
- "127.0.0.1:5432:5432"
networks:
- kasm_default_network
environment:
@ -13,99 +11,124 @@ services:
POSTGRES_USER: kasmapp
POSTGRES_DB: kasm
volumes:
- /opt/kasm/1.6.0/conf/database/data.sql:/docker-entrypoint-initdb.d/data.sql
- /opt/kasm/1.6.0/conf/database/:/tmp/
- kasm_db_1.6.0:/var/lib/postgresql/data
- /opt/kasm/1.7.0/conf/database/data.sql:/docker-entrypoint-initdb.d/data.sql
- /opt/kasm/1.7.0/conf/database/:/tmp/
- kasm_db_1.7.0:/var/lib/postgresql/data
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_redis:
container_name: kasm_redis
command: ["sh", "-c", "redis-server --requirepass $${REDIS_PASSWORD}"]
user: "${KASM_UID?}:${KASM_GID?}"
image: redis:5-alpine
restart: always
ports:
- "127.0.0.1:6379:6379"
networks:
- kasm_default_network
environment:
REDIS_PASSWORD: changeme
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_api:
container_name: kasm_api
user: "${KASM_UID?}:${KASM_GID?}"
image: "kasmweb/api:1.6.0"
ports:
- "127.0.0.1::8080"
image: "kasmweb/api:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
depends_on:
- db
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_manager:
container_name: kasm_manager
user: "${KASM_UID?}:${KASM_GID?}"
image: "kasmweb/manager:1.6.0"
ports:
- "127.0.0.1::8181"
image: "kasmweb/manager:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
depends_on:
- db
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_agent:
container_name: kasm_agent
user: root
image: "kasmweb/agent:1.6.0"
ports:
- "127.0.0.1::4444"
image: "kasmweb/agent:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /opt/kasm/1.6.0/conf/nginx:/etc/nginx/conf.d
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d
depends_on:
- kasm_manager
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_share:
container_name: kasm_share
user: root
image: "kasmweb/share:1.6.0"
ports:
- "127.0.0.1::8182"
image: "kasmweb/share:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
depends_on:
- db
- kasm_redis
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
proxy:
container_name: kasm_proxy
image: "nginx:alpine"
ports:
- "127.0.0.1:443:443"
- "443:443"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.6.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.6.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.6.0/www:/srv/www:ro
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.7.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.7.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.7.0/www:/srv/www:ro
depends_on:
- kasm_manager
- kasm_api
- kasm_agent
- kasm_share
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
volumes:
kasm_db_1.6.0:
kasm_db_1.7.0:
external: true
networks:

37
docker/docker-compose-api.yaml

@ -3,40 +3,51 @@ services:
kasm_api:
container_name: kasm_api
user: "${KASM_UID?}:${KASM_GID?}"
image: "kasmweb/api:1.6.0"
ports:
- "127.0.0.1::8080"
image: "kasmweb/api:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
proxy:
container_name: kasm_proxy
image: "nginx:alpine"
ports:
- "127.0.0.1:443:443"
- "443:443"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.6.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.6.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.6.0/www:/srv/www:ro
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.7.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.7.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.7.0/www:/srv/www:ro
depends_on:
- kasm_api
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_share:
container_name: kasm_share
user: root
image: "kasmweb/share:1.6.0"
ports:
- "127.0.0.1::8182"
image: "kasmweb/share:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.6.0:/opt/kasm/current
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
networks:
kasm_default_network:
external: true

69
docker/docker-compose-app.yaml

@ -0,0 +1,69 @@
version: '3'
services:
kasm_api:
container_name: kasm_api
user: "${KASM_UID?}:${KASM_GID?}"
image: "kasmweb/api:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_manager:
container_name: kasm_manager
user: "${KASM_UID?}:${KASM_GID?}"
image: "kasmweb/manager:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
proxy:
container_name: kasm_proxy
image: "nginx:alpine"
ports:
- "443:443"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.7.0/conf/nginx:/etc/nginx/conf.d:ro
- /opt/kasm/1.7.0/certs/kasm_nginx.key:/etc/ssl/private/kasm_nginx.key
- /opt/kasm/1.7.0/certs/kasm_nginx.crt:/etc/ssl/certs/kasm_nginx.crt
- /opt/kasm/1.7.0/www:/srv/www:ro
depends_on:
- kasm_manager
- kasm_api
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_share:
container_name: kasm_share
user: root
image: "kasmweb/share:1.7.0"
networks:
- kasm_default_network
volumes:
- /opt/kasm/1.7.0:/opt/kasm/current
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
networks:
kasm_default_network:
external: true

22
docker/docker-compose-db.yaml

@ -5,7 +5,7 @@ services:
image: postgres:9.5-alpine
restart: always
ports:
- "127.0.0.1:5432:5432"
- "5432:5432"
networks:
- kasm_default_network
environment:
@ -13,10 +13,15 @@ services:
POSTGRES_USER: kasmapp
POSTGRES_DB: kasm
volumes:
- /opt/kasm/1.6.0/conf/database/data.sql:/docker-entrypoint-initdb.d/data.sql
- /opt/kasm/1.6.0/conf/database/:/tmp/
- kasm_db_1.6.0:/var/lib/postgresql/data
- /opt/kasm/1.7.0/conf/database/data.sql:/docker-entrypoint-initdb.d/data.sql
- /opt/kasm/1.7.0/conf/database/:/tmp/
- kasm_db_1.7.0:/var/lib/postgresql/data
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
kasm_redis:
container_name: kasm_redis
command: ["sh", "-c", "redis-server --requirepass $${REDIS_PASSWORD}"]
@ -24,14 +29,19 @@ services:
image: redis:5-alpine
restart: always
ports:
- "127.0.0.1:6379:6379"
- "6379:6379"
networks:
- kasm_default_network
environment:
REDIS_PASSWORD: changeme
restart: always
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "20"
volumes:
kasm_db_1.6.0:
kasm_db_1.7.0:
external: true
networks:
kasm_default_network:

178
install.sh

@ -6,15 +6,12 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
KASM_VERSION="1.6.0"
KASM_VERSION="1.7.0"
KASM_INSTALL_BASE="/opt/kasm/${KASM_VERSION}"
DO_DATABASE_INIT='true'
VERBOSE='false'
ACCEPT_EULA='false'
AGENT_INSTALL='false'
MANAGER_INSTALL='false'
API_INSTALL='false'
DATABASE_INSTALL='false'
PUBLIC_HOSTNAME='false'
DEFAULT_PROXY_LISTENING_PORT='443'
DATABASE_HOSTNAME='false'
@ -30,6 +27,7 @@ DEFAULT_ADMIN_PASSWORD="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 )"
DEFAULT_USER_PASSWORD="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 )"
DEFAULT_DATABASE_PASSWORD="false"
DEFAULT_REDIS_PASSWORD="false"
ROLE="all"
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
KASM_RELEASE="$(realpath $SCRIPT_PATH)"
@ -66,7 +64,7 @@ function set_listening_port(){
FILE=${KASM_INSTALL_BASE}/conf/database/seed_data/default_properties.yaml
if [ -f "${FILE}" ]; then
sed -ie "/proxy_port:/,/value:/c\ proxy_port:\n value: ${DEFAULT_PROXY_LISTENING_PORT}" ${FILE}
sed -i "s/proxy_port:.*/proxy_port: ${DEFAULT_PROXY_LISTENING_PORT}/g" ${FILE}
fi
FILE=${KASM_INSTALL_BASE}/conf/app/agent.app.config.yaml
@ -263,15 +261,14 @@ function base_install() {
echo "Initializing Database"
set_default_user_passwords
${KASM_INSTALL_BASE}/bin//utils/db_init -i -s ${KASM_INSTALL_BASE}/conf/database/seed_data/default_properties.yaml
${KASM_INSTALL_BASE}/bin//utils/db_init -s ${KASM_INSTALL_BASE}/conf/database/seed_data/default_images.yaml
rm ${KASM_INSTALL_BASE}/conf/database/seed_data/default_properties.yaml
fi
}
function pull_images() {
echo "Pulling default Kasm Images"
grep "name: kasmweb" ${KASM_RELEASE}/conf/database/seed_data/default_properties.yaml | cut -d ":" -f2-3 | xargs -L 1 sudo docker pull
grep "name: registry.fredhs.net" ${KASM_RELEASE}/conf/database/seed_data/default_properties.yaml | cut -d ":" -f2-3 | xargs -L 1 sudo docker pull
grep "name: kasmweb" ${KASM_RELEASE}/conf/database/seed_data/default_images.yaml | cut -d ":" -f2-3 | xargs -L 1 sudo docker pull
}
function copy_manager_configs() {
@ -340,18 +337,26 @@ function accept_eula() {
}
function check_role() {
if [ "${ROLE}" != "all" ] && [ "${ROLE}" != "agent" ] && [ "${ROLE}" != "app" ] && [ "${ROLE}" != "db" ] ;
then
echo "Invalid Role Defined"
display_help
exit 1
fi
}
function display_help() {
echo "Usage: ${0}"
echo "-a Agent Install Only"
echo "-h Display this help menu"
echo "-v Verbose output"
echo "-e Accept End User License Agreement"
echo "-S Role service to install: [all | app | db | agent ]"
echo "-p Agent <IP/Hostname>"
echo "-d Skip database initialization"
echo "-D Don't start services at the end of installation"
echo "-m Manager IP/Hostname"
echo "-s Manager Install"
echo "-b Database Install"
echo "-Q Default Database Password"
echo "-U Default User Password"
echo "-P Default Admin Password"
@ -360,14 +365,8 @@ function display_help() {
echo "-R Redis Password"
}
while getopts 'abestdhvDp:P:q:m:n:i:r:U:Q:L:z:R:' flag; do
while getopts 'etdhvDp:P:q:m:n:i:r:U:Q:L:z:R:S:' flag; do
case "${flag}" in
a)
AGENT_INSTALL='true'
;;
b)
DATABASE_INSTALL='true'
;;
e)
ACCEPT_EULA='true'
;;
@ -406,6 +405,11 @@ while getopts 'abestdhvDp:P:q:m:n:i:r:U:Q:L:z:R:' flag; do
DEFAULT_REDIS_PASSWORD=$OPTARG
echo "Setting Default Redis Password as ${DEFAULT_REDIS_PASSWORD}"
;;
S)
ROLE=$OPTARG
check_role
echo "Setting Default Redis Password as ${DEFAULT_REDIS_PASSWORD}"
;;
q)
DATABASE_HOSTNAME=$OPTARG
echo "Setting Database Hostname as ${DATABASE_HOSTNAME}"
@ -422,13 +426,6 @@ while getopts 'abestdhvDp:P:q:m:n:i:r:U:Q:L:z:R:' flag; do
PROVIDER=$OPTARG
echo "Setting Agent Provider as ${PROVIDER}"
;;
s)
MANAGER_INSTALL='true'
;;
t)
API_INSTALL='true'
DO_DATABASE_INIT='false'
;;
D)
START_SERVICES='false'
;;
@ -449,13 +446,6 @@ done
is_port_ok
if [ "${AGENT_INSTALL}" == "true" ] && [ "${MANAGER_INSTALL}" == "true" ] ;
then
echo "Installing all components"
AGENT_INSTALL='false'
MANAGER_INSTALL='false'
fi
if [ "${ACCEPT_EULA}" == "false" ] ;
then
accept_eula
@ -481,11 +471,13 @@ mkdir -p ${KASM_INSTALL_BASE}/log
chmod 777 ${KASM_INSTALL_BASE}/log
chmod 777 ${KASM_INSTALL_BASE}/conf/nginx/containers.d
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${KASM_INSTALL_BASE}/certs/kasm_nginx.key -out ${KASM_INSTALL_BASE}/certs/kasm_nginx.crt -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=$(hostname)/emailAddress=none@none.none" 2> /dev/null
sudo openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout ${KASM_INSTALL_BASE}/certs/kasm_nginx.key -out ${KASM_INSTALL_BASE}/certs/kasm_nginx.crt -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=$(hostname)/emailAddress=none@none.none" 2> /dev/null
cp -r ${KASM_RELEASE}/conf/app/* ${KASM_INSTALL_BASE}/conf/app/
cp ${KASM_RELEASE}/conf/database/data.sql ${KASM_INSTALL_BASE}/conf/database/
cp ${KASM_RELEASE}/conf/database/seed_data/default_properties.yaml ${KASM_INSTALL_BASE}/conf/database/seed_data/
cp ${KASM_RELEASE}/conf/database/seed_data/default_images.yaml ${KASM_INSTALL_BASE}/conf/database/seed_data/
chmod -R 444 ${KASM_INSTALL_BASE}/conf/database
cp -r ${KASM_RELEASE}/conf/nginx/orchestrator.conf ${KASM_INSTALL_BASE}/conf/nginx/orchestrator.conf
@ -497,130 +489,84 @@ cp ${EULA_PATH} ${KASM_INSTALL_BASE}/
if [ "${DATABASE_INSTALL}" == "true" ] && [ "${MANAGER_INSTALL}" == "true" ] ;
if [ "${ROLE}" == "all" ] ;
then
cp ${KASM_RELEASE}/docker/docker-compose-db-manager.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
echo "Installing All Services"
cp -r ${KASM_RELEASE}/conf/nginx/upstream_agent.conf ${KASM_INSTALL_BASE}/conf/nginx/upstream_agent.conf
cp -r ${KASM_RELEASE}/conf/nginx/services.d/agent.conf ${KASM_INSTALL_BASE}/conf/nginx/services.d/agent.conf
cp ${KASM_RELEASE}/docker/docker-compose-all.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
set_agent_server_id
set_provider
copy_manager_configs
copy_api_configs
set_api_hostname
set_api_server_id
set_share_id
set_server_zone
set_manager_id
set_listening_port
create_docker_network
set_random_database_password
set_database_password
set_random_redis_password
set_redis_password
set_manager_id
set_listening_port
create_docker_network
base_install
pull_images
else
if [ "${DATABASE_INSTALL}" == "true" ] ;
then
cp ${KASM_RELEASE}/docker/docker-compose-db.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
create_docker_network
set_random_database_password
set_database_password
set_random_redis_password
set_redis_password
set_listening_port
base_install
fi
if [ "${MANAGER_INSTALL}" == "true" ] ;
then
cp ${KASM_RELEASE}/docker/docker-compose-manager.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
copy_manager_configs
get_database_hostname
set_database_hostname
get_database_password
set_database_password
get_redis_password
set_redis_password
set_api_hostname
set_api_server_id
set_share_id
set_server_zone
set_manager_id
set_listening_port
create_docker_network
DO_DATABASE_INIT='false'
base_install
fi
fi
if [ "${AGENT_INSTALL}" == "true" ] ;
then
cp -r ${KASM_RELEASE}/conf/nginx/upstream_agent.conf ${KASM_INSTALL_BASE}/conf/nginx/upstream_agent.conf
cp -r ${KASM_RELEASE}/conf/nginx/services.d/agent.conf ${KASM_INSTALL_BASE}/conf/nginx/services.d/agent.conf
cp ${KASM_RELEASE}/docker/docker-compose-agent.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
get_manager_hostname
set_manager_hostname
get_public_hostname
set_public_hostname
set_agent_server_id
set_provider
set_listening_port
create_docker_network
DO_DATABASE_INIT='false'
fi
if [ "${API_INSTALL}" == "true" ] ;
elif [ "${ROLE}" == "app" ] ;
then
cp ${KASM_RELEASE}/docker/docker-compose-api.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
echo "Installing App Role"
cp ${KASM_RELEASE}/docker/docker-compose-app.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
copy_manager_configs
get_database_hostname
set_database_hostname
get_database_password
set_database_password
get_redis_password
set_redis_password
copy_api_configs
set_api_hostname
set_api_server_id
set_share_id
set_server_zone
set_manager_id
set_listening_port
create_docker_network
DO_DATABASE_INIT='false'
base_install
fi
if [ "${AGENT_INSTALL}" == "false" ] && [ "${MANAGER_INSTALL}" == "false" ] && [ "${API_INSTALL}" == "false" ] && [ "${DATABASE_INSTALL}" == "false" ] ;
elif [ "${ROLE}" == "agent" ] ;
then
echo "Installing Agent Role"
cp -r ${KASM_RELEASE}/conf/nginx/upstream_agent.conf ${KASM_INSTALL_BASE}/conf/nginx/upstream_agent.conf
cp -r ${KASM_RELEASE}/conf/nginx/services.d/agent.conf ${KASM_INSTALL_BASE}/conf/nginx/services.d/agent.conf
cp ${KASM_RELEASE}/docker/docker-compose-all.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
cp ${KASM_RELEASE}/docker/docker-compose-agent.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
get_manager_hostname
set_manager_hostname
get_public_hostname
set_public_hostname
set_agent_server_id
set_provider
copy_manager_configs
copy_api_configs
set_api_hostname
set_api_server_id
set_share_id
set_server_zone
set_manager_id
set_listening_port
create_docker_network
DO_DATABASE_INIT='false'
elif [ "${ROLE}" == "db" ] ;
then
echo "Installing Database Role"
cp ${KASM_RELEASE}/docker/docker-compose-db.yaml ${KASM_INSTALL_BASE}/docker/docker-compose.yaml
create_docker_network
set_random_database_password
set_database_password
set_random_redis_password
set_redis_password
set_listening_port
base_install
pull_images
else
exit -1
fi
chmod +x ${KASM_INSTALL_BASE}/bin/*
chmod +x ${KASM_INSTALL_BASE}/bin/utils/*
chmod -R 777 ${KASM_INSTALL_BASE}/conf/nginx
@ -644,7 +590,7 @@ else
fi
if [ "${MANAGER_INSTALL}" == "false" ] && [ "${API_INSTALL}" == "false" ] && [ "${DATABASE_INSTALL}" == "false" ] ;
if [ "${ROLE}" == "agent" ] || [ "${ROLE}" == "all" ] ;
then
if [[ $(sudo swapon --show) ]]; then
echo 'Swap Exists'

30
install_dependencies.sh

@ -23,9 +23,15 @@ function check_docker_dependencies (){
fi
}
function install_centos_7 (){
echo "CentOS 7.x Install"
function install_centos (){
echo "CentOS 7.x/8.x Install"
echo "Installing Base CentOS Packages"
NO_BEST=""
if [ "${1}" == '"8"' ] ; then
NO_BEST="--nobest"
fi
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2 \
@ -36,19 +42,19 @@ function install_centos_7 (){
https://download.docker.com/linux/centos/docker-ce.repo
echo "Installing Docker-CE"
yum install -y docker-ce
yum install -y docker-ce $NO_BEST
systemctl start docker
if [ ! -f /usr/local/bin/docker-compose ]; then
echo "Installing Docker Compose"
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m) -o /bin/docker-compose
chmod +x /bin/docker-compose
fi
}
function install_ubuntu_16 (){
echo "Ubuntu 16.04/18.04 Install"
function install_ubuntu (){
echo "Ubuntu 16.04/18.04/20.04 Install"
echo "Installing Base Ubuntu Packages"
apt-get update
apt-get install -y \
@ -70,7 +76,7 @@ function install_ubuntu_16 (){
if [ ! -f /usr/local/bin/docker-compose ]; then
echo "Installing Docker Compose"
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
}
@ -99,7 +105,7 @@ function install_debian (){
if [ ! -f /usr/local/bin/docker-compose ]; then
echo "Installing Docker Compose"
curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
@ -112,9 +118,9 @@ if [ -f /etc/os-release ] ; then
OS_VERSION_ID="$(awk -F= '/^VERSION_ID/{print $2}' /etc/os-release)"
fi
if [ "${OS_ID}" == "ubuntu" ] && ( [ "${OS_VERSION_ID}" == '"16.04"' ] || [ "${OS_VERSION_ID}" == '"18.04"' ] ) ; then
if [ "${OS_ID}" == "ubuntu" ] && ( [ "${OS_VERSION_ID}" == '"16.04"' ] || [ "${OS_VERSION_ID}" == '"18.04"' ] || [ "${OS_VERSION_ID}" == '"20.04"' ]) ; then