Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Changes related to the next Meilisearch release (v1.0.0) #98

Merged
merged 5 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/first-login/000-set-meili-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MEILISEARCH_ENVIRONMENT='development'
MEILISEARCH_SERVER_PROVIDER=provider_name
USE_API_KEY='false'
MEILISEARCH_MASTER_KEY=''
MEILI_DUMPS_DIR='/var/opt/meilisearch/dumps'
MEILI_DUMP_DIR='/var/opt/meilisearch/dumps'
DOMAIN_NAME=''
USE_SSL='false'
USE_CERTBOT='false'
Expand All @@ -32,7 +32,7 @@ exit_with_message() {
echo 'export MEILISEARCH_ENVIRONMENT='$MEILISEARCH_ENVIRONMENT > /var/opt/meilisearch/env
echo 'export USE_API_KEY='$USE_API_KEY >> /var/opt/meilisearch/env
echo 'export MEILISEARCH_MASTER_KEY='$MEILISEARCH_MASTER_KEY >> /var/opt/meilisearch/env
echo 'export MEILI_DUMPS_DIR='$MEILI_DUMPS_DIR >> /var/opt/meilisearch/env
echo 'export MEILI_DUMP_DIR='$MEILI_DUMP_DIR >> /var/opt/meilisearch/env
echo 'export DOMAIN_NAME='$DOMAIN_NAME >> /var/opt/meilisearch/env
echo 'export USE_SSL='$USE_SSL >> /var/opt/meilisearch/env
echo 'export USE_CERTBOT='$USE_CERTBOT >> /var/opt/meilisearch/env
Expand Down
6 changes: 4 additions & 2 deletions scripts/first-login/001-setup-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ After=systemd-user-sessions.service

[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env $MEILISEARCH_ENVIRONMENT --dumps-dir $MEILI_DUMPS_DIR
Environment="MEILI_SERVER_PROVIDER=$MEILISEARCH_SERVER_PROVIDER"
Environment="MEILI_DUMP_DIR=$MEILI_DUMP_DIR"
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env $MEILISEARCH_ENVIRONMENT --dump-dir $MEILI_DUMP_DIR

[Install]
WantedBy=default.target
Expand All @@ -56,9 +57,10 @@ After=systemd-user-sessions.service

[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env $MEILISEARCH_ENVIRONMENT --dumps-dir $MEILI_DUMPS_DIR
Environment="MEILI_MASTER_KEY=$MEILISEARCH_MASTER_KEY"
Environment="MEILI_SERVER_PROVIDER=$MEILISEARCH_SERVER_PROVIDER"
Environment="MEILI_DUMP_DIR=$MEILI_DUMP_DIR"
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env $MEILISEARCH_ENVIRONMENT --dump-dir $MEILI_DUMP_DIR

[Install]
WantedBy=default.target
Expand Down
9 changes: 5 additions & 4 deletions scripts/providers/aws/cloud-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ users:
- name: root
shell: /bin/bash

packages:
packages:
- git
- curl
- ufw
Expand All @@ -28,8 +28,9 @@ write_files:

[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dumps-dir MEILI_DUMPS_DIR
Environment="MEILI_SERVER_PROVIDER=aws"
Environment="MEILI_DUMP_DIR=/var/opt/meilisearch/dumps"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you sometimes set Environment="MEILI_DUMP_DIR=/var/opt/meilisearch/dumps" and other places have Environment="MEILI_DUMP_DIR=$MEILI_DUMP_DIR"

Copy link
Contributor

@alallema alallema Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good question! systemd doesn't read the environment variable, so that is why there are defined directly on the file. It should probably be better to use EnvironmentFile= instead of Environment= option and create an env file I didn't take time to do it but I maybe will before v1 if I can.

ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dump-dir $MEILI_DUMP_DIR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to set as "development"?

Copy link
Contributor

@alallema alallema Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, it's set as development because we don't set any masterKey.
At the first connexion you will have to choose if you want or no a masterKey and choose the environment

Restart=on-failure
RestartSec=5s

Expand Down Expand Up @@ -64,13 +65,13 @@ write_files:
meilisearch-setup

runcmd:
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v0.30.5/meilisearch-linux-amd64
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v1.0.0/meilisearch-linux-amd64
- chmod 755 /usr/bin/meilisearch
- systemctl enable meilisearch.service
- ufw --force enable
- ufw allow 'Nginx Full'
- ufw allow 'OpenSSH'
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v0.30.5/scripts/deploy-meilisearch.sh | bash -s v0.30.5 aws
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v1.0.0/scripts/deploy-meilisearch.sh | bash -s v1.0.0 aws

power_state:
mode: reboot
Expand Down
9 changes: 5 additions & 4 deletions scripts/providers/digitalocean/cloud-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ users:
- name: root
shell: /bin/bash

packages:
packages:
- git
- curl
- ufw
Expand All @@ -28,8 +28,9 @@ write_files:

[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dumps-dir MEILI_DUMPS_DIR
Environment="MEILI_SERVER_PROVIDER=digitalocean"
Environment="MEILI_DUMP_DIR=/var/opt/meilisearch/dumps"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dump-dir $MEILI_DUMP_DIR
Restart=on-failure
RestartSec=5s

Expand Down Expand Up @@ -65,13 +66,13 @@ write_files:

runcmd:
- apt-get purge droplet-agent* -y
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v0.30.5/meilisearch-linux-amd64
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v1.0.0/meilisearch-linux-amd64
- chmod 755 /usr/bin/meilisearch
- systemctl enable meilisearch.service
- ufw --force enable
- ufw allow 'Nginx Full'
- ufw allow 'OpenSSH'
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v0.30.5/scripts/deploy-meilisearch.sh | bash -s v0.30.5 digitalocean
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v1.0.0/scripts/deploy-meilisearch.sh | bash -s v1.0.0 digitalocean
- curl https://raw.githubusercontent.com/digitalocean/marketplace-partners/master/scripts/90-cleanup.sh | bash
- curl https://raw.githubusercontent.com/digitalocean/marketplace-partners/master/scripts/99-img-check.sh | bash

Expand Down
7 changes: 4 additions & 3 deletions scripts/providers/gcp/cloud-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ write_files:

[Service]
Type=simple
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dumps-dir MEILI_DUMPS_DIR
Environment="MEILI_SERVER_PROVIDER=gcp"
Environment="MEILI_DUMP_DIR=/var/opt/meilisearch/dumps"
ExecStart=/usr/bin/meilisearch --db-path /var/lib/meilisearch/data.ms --env development --dump-dir $MEILI_DUMP_DIR
Restart=on-failure
RestartSec=5s

Expand Down Expand Up @@ -65,13 +66,13 @@ write_files:
meilisearch-setup

runcmd:
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v0.30.5/meilisearch-linux-amd64
- wget --directory-prefix=/usr/bin/ -O /usr/bin/meilisearch https://github.com/meilisearch/meilisearch/releases/download/v1.0.0/meilisearch-linux-amd64
- chmod 755 /usr/bin/meilisearch
- systemctl enable meilisearch.service
- ufw --force enable
- ufw allow 'Nginx Full'
- ufw allow 'OpenSSH'
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v0.30.5/scripts/deploy-meilisearch.sh | bash -s v0.30.5 gcp
- curl https://raw.githubusercontent.com/meilisearch/cloud-scripts/v1.0.0/scripts/deploy-meilisearch.sh | bash -s v1.0.0 gcp

power_state:
mode: reboot
Expand Down