From 18ad3a673f52c66c53e7a9e2d0d9ea61264b0d0d Mon Sep 17 00:00:00 2001 From: KMY Date: Sun, 17 Sep 2023 07:31:19 +0900 Subject: [PATCH] Update setup script --- dist/nginx-before-certbot.conf | 8 ++++++++ install/setup1.sh | 18 +----------------- install/setup2.sh | 27 +++++++++++++++++++++++++-- install/update.sh | 4 ---- 4 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 dist/nginx-before-certbot.conf delete mode 100644 install/update.sh diff --git a/dist/nginx-before-certbot.conf b/dist/nginx-before-certbot.conf new file mode 100644 index 0000000000..221b949e70 --- /dev/null +++ b/dist/nginx-before-certbot.conf @@ -0,0 +1,8 @@ +server { + listen 80; + listen [::]:80; + server_name example.com; + root /home/mastodon/live/public; + location /.well-known/acme-challenge/ { allow all; } + location / { return 301 https://$host$request_uri; } +} diff --git a/install/setup1.sh b/install/setup1.sh index a99814ddb8..72d910c2ad 100644 --- a/install/setup1.sh +++ b/install/setup1.sh @@ -24,16 +24,6 @@ corepack enable yarn set version classic adduser --disabled-login mastodon -su - mastodon << EOF - -git clone https://github.com/rbenv/rbenv.git /home/mastodon/.rbenv -cd /home/mastodon/.rbenv && src/configure && make -C src -echo 'export PATH="/home/mastodon/.rbenv/bin:$PATH"' >> /home/mastodon/.bashrc -echo 'eval "\$(rbenv init -)"' >> /home/mastodon/.bashrc -exec bash -git clone https://github.com/rbenv/ruby-build.git /home/mastodon/.rbenv/plugins/ruby-build - -EOF sudo -u postgres psql << EOF CREATE USER mastodon WITH PASSWORD 'ohagi' CREATEDB; @@ -43,13 +33,6 @@ su - mastodon <> ~/.bashrc +echo 'eval "$(rbenv init -)"' >> ~/.bashrc +exec bash +git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build + RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2 rbenv global 3.2.2 gem install bundler --no-document +cd live + +yarn install --pure-lockfile + bundle config deployment 'true' bundle config without 'development test' bundle install -j$(getconf _NPROCESSORS_ONLN) -unlink /home/mastodon/setup2 - echo << EOF ============== [kmyblue setup script 2 completed] ================ +PostgreSQL and Redis are now available on localhost. + +* PostgreSQL + host : /var/run/postgresql + user : mastodon + database : mastodon_production + password : ohagi + +* Redis + host : localhost + +[IMPORTANT] Check PostgreSQL password before setup! + Input this command to finish setup: + cd live RAILS_ENV=production bundle exec rake mastodon:setup If you update kmyblue version, use following: diff --git a/install/update.sh b/install/update.sh deleted file mode 100644 index 722d6d35f3..0000000000 --- a/install/update.sh +++ /dev/null @@ -1,4 +0,0 @@ -git stash - -git fetch -git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)