Update to 2021-02-10 19:00

master
Daniel Berteaud 3 years ago
parent 4d3840e257
commit c0177e712c
  1. 3
      roles/appsmith/defaults/main.yml
  2. 1
      roles/appsmith/meta/main.yml
  3. BIN
      roles/appsmith/tasks/.install.yml.swp
  4. 2
      roles/appsmith/tasks/cleanup.yml
  5. 5
      roles/appsmith/tasks/conf.yml
  6. 29
      roles/appsmith/tasks/install.yml
  7. 34
      roles/appsmith/templates/nginx.conf.j2

@ -35,3 +35,6 @@ appsmith_email_tls: "{{ (appsmith_email_port == 587) | ternary(True,False) }}"
# Encryption settings. If not defined, random values will be created and used
# appsmith_encryption_pass: p@ssw0rd
# appsmith_encryption_salt: Salt
# Public URL used to access appsmith
appsmith_public_url: http://{{ inventory_hostname }}

@ -8,3 +8,4 @@ dependencies:
when: appsmith_redis_url | urlsplit('hostname') in ['localhost','127.0.0.1']
- role: mongodb_server
when: appsmith_mongo_url | urlsplit('hostname') in ['localhost','127.0.0.1']
- role: nginx

@ -4,4 +4,6 @@
file: path={{ item }} state=absent
loop:
- "{{ appsmith_root_dir }}/archives/{{ appsmith_current_version }}"
- "{{ appsmith_root_dir }}/tmp/appsmith-{{ appsmith_version }}"
- "{{ appsmith_root_dir }}/tmp/appsmith-{{ appsmith_version }}.tar.gz"
tags: appsmith

@ -6,3 +6,8 @@
- env
notify: restart appsmith-server
tags: appsmith
- name: Deploy nginx conf
template: src=nginx.conf.j2 dest=/etc/nginx/ansible_conf.d/appsmith.conf
notify: reload nginx
tags: appsmith

@ -79,6 +79,35 @@
copy: src={{ item }} dest={{ appsmith_root_dir }}/server/plugins/ remote_src=True
loop: "{{ appsmith_plugins_jar.stdout_lines }}"
- name: Install yarn
npm:
name: yarn
path: "{{ appsmith_root_dir }}/src/app/client"
- name: Install NodeJS dependencies
command: ./node_modules/yarn/bin/yarn install --ignore-engines
args:
chdir: "{{ appsmith_root_dir }}/src/app/client"
# Not sure why but yarn installs webpack 4.46.0 while appsmith wants 4.44.2
- name: Install correct webpack version
command: ./node_modules/yarn/bin/yarn add webpack@4.44.2 --ignore-engines
args:
chdir: "{{ appsmith_root_dir }}/src/app/client"
- name: Build the client
command: ./node_modules/.bin/craco --max-old-space-size=4096 build --config craco.build.config.js
args:
chdir: "{{ appsmith_root_dir }}/src/app/client"
- name: Move the client to its final dir
synchronize:
src: "{{ appsmith_root_dir }}/src/app/client/build/"
dest: "{{ appsmith_root_dir }}/client/"
compress: False
delete: True
delegate_to: "{{ inventory_hostname }}"
tags: appsmith
- name: Deploy systemd unit

@ -0,0 +1,34 @@
server {
listen 80;
server_name {{ appsmith_public_url | urlsplit('hostname') }};
include /etc/nginx/ansible_conf.d/acme.inc;
root {{ appsmith_root_dir }}/client;
client_max_body_size 10M;
if ($request_method !~ ^(GET|POST|HEAD|PUT|DELETE|PATCH)$ ) {
return 405;
}
# Send info about the original request to the backend
proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
proxy_set_header X-Real-IP "$remote_addr";
proxy_set_header X-Forwarded-Proto "$scheme";
proxy_set_header X-Forwarded-Host "$host";
proxy_set_header Host "$host";
location / {
try_files $uri /index.html =404;
}
location /f {
proxy_pass https://cdn.optimizely.com/;
}
location /api {
proxy_pass http://127.0.0.1:{{ appsmith_server_port }};
}
location /oauth2 {
proxy_pass http://127.0.0.1:{{ appsmith_server_port }};
}
location /login {
proxy_pass http://127.0.0.1:{{ appsmith_server_port }};
}
}
Loading…
Cancel
Save