mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
Merge branch 'master' of https://github.com/YunoHost-Apps/mastodon_ynh
This commit is contained in:
commit
1f948e706a
6 changed files with 15 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
# Mastodon for YunoHost
|
||||
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
|
||||
[](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
client_max_body_size 100M;
|
||||
|
||||
# add to v1.4 assets
|
||||
root /opt/mastodon/live/public;
|
||||
root __FINALPATH__/live/public;
|
||||
|
||||
location / {
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ domain=$(ynh_app_setting_get "$app" domain)
|
|||
final_path="/opt/${app}"
|
||||
ynh_backup "$final_path" "sources" 1
|
||||
|
||||
# final_path on nginx
|
||||
sudo sed -i "s@$final_path@__FINALPATH__@g" /etc/nginx/conf.d/${domain}.d/${app}.conf
|
||||
|
||||
# Copy the nginx conf files
|
||||
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|
||||
ynh_backup "/etc/cron.d/${app}" "cron.conf"
|
||||
|
@ -32,6 +35,9 @@ ynh_backup "/etc/systemd/system/mastodon-streaming.service" "systemd_streaming.s
|
|||
ynh_backup "/etc/apt/sources.list.d/backports.list" "apt_backports.list"
|
||||
ynh_backup "/etc/apt/sources.list.d/yarn.list" "apt_yarn.list"
|
||||
|
||||
# final_path on nginx
|
||||
sudo sed -i "s@__FINALPATH__@$final_path@g" /etc/nginx/conf.d/${domain}.d/${app}.conf
|
||||
|
||||
# Backup db
|
||||
sudo su - postgres <<COMMANDS
|
||||
pg_dump --role=mastodon -U postgres --no-password mastodon_production > mastodon_db.sql
|
||||
|
|
|
@ -214,7 +214,9 @@ RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=$admin_m
|
|||
RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon_mail
|
||||
ACOMMANDS
|
||||
|
||||
# Copy nginx config
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sudo sed -i "s@__PATH__@$app@g" ../conf/nginx.conf*
|
||||
sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf*
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Install crontab
|
||||
|
|
|
@ -162,7 +162,9 @@ yarn install --pure-lockfile
|
|||
#RAILS_ENV=production bin/bundle exec rails assets:precompile
|
||||
RCOMMANDS
|
||||
|
||||
# Restore nginx configuration files
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sudo sed -i "s@__PATH__@$app@g" ./nginx.conf
|
||||
sudo sed -i "s@__FINALPATH__@$final_path@g" ./nginx.conf
|
||||
sudo cp -a ./nginx.conf "$nginx_conf"
|
||||
# Restore crontab
|
||||
sudo cp -a ./cron.conf "$crontab_conf"
|
||||
|
|
|
@ -31,7 +31,7 @@ db_name=$app
|
|||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sudo sed -i "s@__PATH__@$app@g" ../conf/nginx.conf*
|
||||
sudo sed -i "s@__FINALPATH__@$final_path/@g" ../conf/nginx.conf*
|
||||
sudo sed -i "s@__FINALPATH__@$final_path@g" ../conf/nginx.conf*
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Stop Mastodon Services
|
||||
|
|
Loading…
Add table
Reference in a new issue