Update to 2021-02-10 21:00

master
Daniel Berteaud 4 years ago
parent c0177e712c
commit ff8cd29863
  1. 5
      roles/appsmith/defaults/main.yml
  2. 4
      roles/appsmith/tasks/directories.yml
  3. 22
      roles/appsmith/tasks/install.yml
  4. 2
      roles/appsmith/templates/appsmith-server.service.j2
  5. 2
      roles/appsmith/templates/env.j2
  6. 19
      roles/appsmith/templates/pre-start.sh.j2

@ -38,3 +38,8 @@ appsmith_email_tls: "{{ (appsmith_email_port == 587) | ternary(True,False) }}"
# Public URL used to access appsmith # Public URL used to access appsmith
appsmith_public_url: http://{{ inventory_hostname }} appsmith_public_url: http://{{ inventory_hostname }}
# User signup can be disabled
appsmith_user_signup: True
# If signup is disabled, you can set a list of whitelisted email which will be allowed
appsmith_admin_emails: []

@ -12,12 +12,16 @@
owner: "{{ appsmith_user }}" owner: "{{ appsmith_user }}"
mode: 700 mode: 700
- dir: "{{ appsmith_root_dir }}/src" - dir: "{{ appsmith_root_dir }}/src"
owner: "{{ appsmith_user }}"
- dir: "{{ appsmith_root_dir }}/server" - dir: "{{ appsmith_root_dir }}/server"
owner: "{{ appsmith_user }}"
- dir: "{{ appsmith_root_dir }}/server/plugins" - dir: "{{ appsmith_root_dir }}/server/plugins"
owner: "{{ appsmith_user }}"
- dir: "{{ appsmith_root_dir }}/client" - dir: "{{ appsmith_root_dir }}/client"
- dir: "{{ appsmith_root_dir }}/meta" - dir: "{{ appsmith_root_dir }}/meta"
mode: 700 mode: 700
- dir: "{{ appsmith_root_dir }}/etc" - dir: "{{ appsmith_root_dir }}/etc"
group: "{{ appsmith_user }}" group: "{{ appsmith_user }}"
mode: 750 mode: 750
- dir: "{{ appsmith_root_dir }}/bin"
tags: appsmith tags: appsmith

@ -5,6 +5,7 @@
name: name:
- nodejs - nodejs
- java-11-openjdk - java-11-openjdk
- java-11-openjdk-devel
- mongodb-org-tools - mongodb-org-tools
tags: appsmith tags: appsmith
@ -96,18 +97,19 @@
chdir: "{{ appsmith_root_dir }}/src/app/client" chdir: "{{ appsmith_root_dir }}/src/app/client"
- name: Build the client - name: Build the client
command: ./node_modules/.bin/craco --max-old-space-size=4096 build --config craco.build.config.js command: ./node_modules/.bin/craco --max-old-space-size=2048 build --config craco.build.config.js
args: args:
chdir: "{{ appsmith_root_dir }}/src/app/client" chdir: "{{ appsmith_root_dir }}/src/app/client"
- name: Move the client to its final dir # - name: Move the client to its final dir
synchronize: # synchronize:
src: "{{ appsmith_root_dir }}/src/app/client/build/" # src: "{{ appsmith_root_dir }}/src/app/client/build/"
dest: "{{ appsmith_root_dir }}/client/" # dest: "{{ appsmith_root_dir }}/client/"
compress: False # compress: False
delete: True # delete: True
delegate_to: "{{ inventory_hostname }}" # delegate_to: "{{ inventory_hostname }}"
become_user: "{{ appsmith_user }}"
tags: appsmith tags: appsmith
- name: Deploy systemd unit - name: Deploy systemd unit
@ -123,6 +125,10 @@
when: appsmith_units.results | selectattr('changed','equalto',True) | list | length > 0 when: appsmith_units.results | selectattr('changed','equalto',True) | list | length > 0
tags: appsmith tags: appsmith
- name: Install pre-start script
template: src=pre-start.sh.j2 dest={{ appsmith_root_dir }}/bin/pre-start mode=755
tags: appsmith
- name: Install pre/post backup hoooks - name: Install pre/post backup hoooks
template: src={{ item }}-backup.sh.j2 dest=/etc/backup/{{ item }}.d/appsmith mode=700 template: src={{ item }}-backup.sh.j2 dest=/etc/backup/{{ item }}.d/appsmith mode=700
loop: loop:

@ -8,6 +8,8 @@ User={{ appsmith_user }}
Group={{ appsmith_user }} Group={{ appsmith_user }}
EnvironmentFile={{ appsmith_root_dir }}/etc/env EnvironmentFile={{ appsmith_root_dir }}/etc/env
WorkingDirectory={{ appsmith_root_dir }}/server WorkingDirectory={{ appsmith_root_dir }}/server
PermissionsStartOnly=yes
ExecStartPre={{ appsmith_root_dir }}/bin/pre-start
ExecStart=/bin/java -Djava.net.preferIPv4Stack=true -Dserver.port={{ appsmith_server_port }} -Djava.security.egd="file:/dev/./urandom" -jar server-1.0-SNAPSHOT.jar ExecStart=/bin/java -Djava.net.preferIPv4Stack=true -Dserver.port={{ appsmith_server_port }} -Djava.security.egd="file:/dev/./urandom" -jar server-1.0-SNAPSHOT.jar
PrivateTmp=yes PrivateTmp=yes
ProtectSystem=full ProtectSystem=full

@ -13,3 +13,5 @@ APPSMITH_MONGODB_URI={{ appsmith_mongo_url }}
APPSMITH_DISABLE_TELEMETRY=true APPSMITH_DISABLE_TELEMETRY=true
APPSMITH_ENCRYPTION_PASSWORD={{ appsmith_encryption_pass }} APPSMITH_ENCRYPTION_PASSWORD={{ appsmith_encryption_pass }}
APPSMITH_ENCRYPTION_SALT={{ appsmith_encryption_salt }} APPSMITH_ENCRYPTION_SALT={{ appsmith_encryption_salt }}
APPSMITH_SIGNUP_DISABLED={{ appsmith_user_signup | ternary('false','true') }}
APPSMITH_ADMIN_EMAILS={{ appsmith_admin_emails | join(',') }}

@ -0,0 +1,19 @@
#!/bin/bash -e
# If the conf changed since the last client deployement, then re-deploy
if [ {{ appsmith_root_dir }}/etc/env -nt {{ appsmith_root_dir }}/client/ ]; then
rsync -a --delete {{ appsmith_root_dir }}/src/app/client/build/ {{ appsmith_root_dir }}/client/
find {{ appsmith_root_dir }}/client/ -type f | xargs \
sed -i \
{% for var in [
"APPSMITH_SENTRY_DSN","APPSMITH_SMART_LOOK_ID","APPSMITH_OAUTH2_GOOGLE_CLIENT_ID",
"APPSMITH_OAUTH2_GITHUB_CLIENT_ID","APPSMITH_MARKETPLACE_ENABLED",
"APPSMITH_SEGMENT_KEY","APPSMITH_OPTIMIZELY_KEY","APPSMITH_ALGOLIA_API_ID",
"APPSMITH_ALGOLIA_SEARCH_INDEX_NAME","APPSMITH_ALGOLIA_API_KEY","APPSMITH_CLIENT_LOG_LEVEL",
"APPSMITH_GOOGLE_MAPS_API_KEY","APPSMITH_TNC_PP","APPSMITH_VERSION_ID",
"APPSMITH_VERSION_RELEASE_DATE","APPSMITH_INTERCOM_APP_ID","APPSMITH_MAIL_ENABLED","APPSMITH_DISABLE_TELEMETRY"] %}
-e "s/__{{ var }}__/${{ '{' ~ var ~ '}' }}/g"{% if not loop.last %} \{% endif %}
{% endfor %}
fi
Loading…
Cancel
Save