Update setup script

This commit is contained in:
KMY 2023-09-17 07:31:19 +09:00
parent ea2f390457
commit 18ad3a673f
4 changed files with 34 additions and 23 deletions

8
dist/nginx-before-certbot.conf vendored Normal file
View file

@ -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; }
}

View file

@ -24,16 +24,6 @@ corepack enable
yarn set version classic yarn set version classic
adduser --disabled-login mastodon 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 sudo -u postgres psql << EOF
CREATE USER mastodon WITH PASSWORD 'ohagi' CREATEDB; CREATE USER mastodon WITH PASSWORD 'ohagi' CREATEDB;
@ -43,13 +33,6 @@ su - mastodon <<EOF
git clone https://github.com/kmycode/mastodon.git live && cd live git clone https://github.com/kmycode/mastodon.git live && cd live
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1) git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
yarn install --pure-lockfile
chmod 0777 install/setup2.sh
chmod 0777 install/update.sh
ln -s install/setup2.sh /home/mastodon/setup2
ln -s install/update.sh /home/mastodon/update
EOF EOF
chmod o+x /home/mastodon chmod o+x /home/mastodon
@ -65,6 +48,7 @@ echo << EOF
Input this command to continue setup: Input this command to continue setup:
sudo su - mastodon sudo su - mastodon
cd live cd live
chmod +x install/setup2.sh
install/setup2.sh install/setup2.sh
EOF EOF

View file

@ -1,19 +1,42 @@
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.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 RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.2
rbenv global 3.2.2 rbenv global 3.2.2
gem install bundler --no-document gem install bundler --no-document
cd live
yarn install --pure-lockfile
bundle config deployment 'true' bundle config deployment 'true'
bundle config without 'development test' bundle config without 'development test'
bundle install -j$(getconf _NPROCESSORS_ONLN) bundle install -j$(getconf _NPROCESSORS_ONLN)
unlink /home/mastodon/setup2
echo << EOF echo << EOF
============== [kmyblue setup script 2 completed] ================ ============== [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: Input this command to finish setup:
cd live
RAILS_ENV=production bundle exec rake mastodon:setup RAILS_ENV=production bundle exec rake mastodon:setup
If you update kmyblue version, use following: If you update kmyblue version, use following:

View file

@ -1,4 +0,0 @@
git stash
git fetch
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)