Browse Source

use su instead of sudo. disable docker compute by default.

tags/v1.5.4
Jonathan Cobb 4 years ago
parent
commit
35a02e79f5
7 changed files with 28 additions and 22 deletions
  1. +1
    -1
      bubble-server/src/main/resources/ansible/roles/bubble/tasks/postgresql_data.yml
  2. +4
    -4
      bubble-server/src/main/resources/ansible/roles/common/tasks/main.yml
  3. +1
    -1
      bubble-server/src/main/resources/ansible/roles/finalizer/templates/supervisor_bubble.conf.j2
  4. +1
    -1
      bubble-server/src/main/resources/ansible/roles/mitmproxy/templates/supervisor_mitmproxy.conf.j2
  5. +2
    -2
      bubble-server/src/main/resources/packer/roles/mitmproxy/files/bubble_conn_check.py
  6. +14
    -13
      config/activation.json
  7. +5
    -0
      docs/README.md

+ 1
- 1
bubble-server/src/main/resources/ansible/roles/bubble/tasks/postgresql_data.yml View File

@@ -12,4 +12,4 @@
- "bubble.sql.gz"

- name: Populate database
shell: sudo -H -u postgres bash -c "cd && full_reset_db.sh"
shell: su - postgres bash -c "full_reset_db.sh"

+ 4
- 4
bubble-server/src/main/resources/ansible/roles/common/tasks/main.yml View File

@@ -4,15 +4,15 @@
- name: Set hostname to {{ hostname }}
hostname:
name: '{{ hostname }}'
when: bubble_set_hostname == 'true'
when: bubble_set_hostname

- name: Set system timezone via timedatectl
shell: timedatectl set-timezone {{ time_zone }}
when: bubble_set_timezone_script != 'true'
shell: timedatectl set-timezone {{ time_zone }} || echo "bubble_set_timezone_script was {{ bubble_set_timezone_script }}" >> /tmp/WTF.txt
when: not bubble_set_timezone_script

- name: Set system timezone via script
shell: bash -c "function set_tz () { TZ=${1:?no timezone} ; ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ; } ; set_tz {{ time_zone }}"
when: bubble_set_timezone_script == 'true'
when: bubble_set_timezone_script

- name: Set log flag to true with EX of 7 days for non-sage nodes
shell: echo 'set bubble.StandardSelfNodeService.bubble_server_logs_enabled "true" EX 604800' | redis-cli


+ 1
- 1
bubble-server/src/main/resources/ansible/roles/finalizer/templates/supervisor_bubble.conf.j2 View File

@@ -5,7 +5,7 @@ stderr_logfile = /var/log/bubble/api-server-err.log
command=bash -c 'chmod 0666 /dev/null && \
rm -rf /var/log/bubble/postgresql/* && \
service postgresql restart && \
sudo -u bubble bash -c "/usr/bin/java \
su - bubble bash -c "/usr/bin/java \
-Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true \
-XX:+UseG1GC -XX:MaxGCPauseMillis=400 {{ bubble_java_opts }} \
-cp /home/bubble/api/bubble.jar \


+ 1
- 1
bubble-server/src/main/resources/ansible/roles/mitmproxy/templates/supervisor_mitmproxy.conf.j2 View File

@@ -2,6 +2,6 @@
[program:mitm{{ port }}]
stdout_logfile = /var/log/bubble/mitm{{ port }}-out.log
stderr_logfile = /var/log/bubble/mitm{{ port }}-err.log
command=sudo -H -u mitmproxy bash -c "/home/mitmproxy/mitmproxy/run_mitm.sh {{ port }}"
command=su - mitmproxy bash -c "/home/mitmproxy/mitmproxy/run_mitm.sh {{ port }}"
stopasgroup=true
stopsignal=QUIT

+ 2
- 2
bubble-server/src/main/resources/packer/roles/mitmproxy/files/bubble_conn_check.py View File

@@ -89,11 +89,11 @@ def show_block_stats(client_addr, fqdns):
for fqdn in fqdns:
show = REDIS.get(REDIS_KEY_DEVICE_SHOW_BLOCK_STATS+client_addr+':'+fqdn)
if show is not None:
return show.decode() == 'true'
return show.decode().lower() == 'true'
show = REDIS.get(REDIS_KEY_DEVICE_SHOW_BLOCK_STATS+client_addr)
if show is None:
return False
return show.decode() == 'true'
return show.decode().lower() == 'true'


def conn_check_cache_prefix(client_addr, server_addr):


+ 14
- 13
config/activation.json View File

@@ -71,19 +71,20 @@
},

// Docker can be used for testing or for advanced use cases
"DockerCompute": {
"config": {},
"credentials": {
// these are the default settings, change as needed
"host": "unix:///var/run/docker.sock",
"tlsVerify": "false", // if tlsVerify is "true" then certPath must be set
"certPath": null,
"registryUrl": null,
"registryUsername": null,
"registryEmail": null,
"registryPassword": null
}
},
// Leave this out if you're not going to use it
// "DockerCompute": {
// "config": {},
// "credentials": {
// // these are the default settings, change as needed
// "host": "unix:///var/run/docker.sock",
// "tlsVerify": "false", // if tlsVerify is "true" then certPath must be set
// "certPath": null,
// "registryUrl": null,
// "registryUsername": null,
// "registryEmail": null,
// "registryPassword": null
// }
// },

///////////////////////
// Storage


+ 5
- 0
docs/README.md View File

@@ -0,0 +1,5 @@
Bubble Docs
===========
The best place to start is on the [Bubble Main Page](../README.md).

Or maybe you want to check out the [Bubble Website](https://getbubblenow.com/)?

Loading…
Cancel
Save