mirror of
https://github.com/YunoHost-Apps/acropolis_ynh.git
synced 2024-09-03 18:06:22 +02:00
Fixed the permissions issue
This commit is contained in:
parent
2e100327ec
commit
c42019446a
5 changed files with 21 additions and 17 deletions
|
@ -9,9 +9,10 @@ WorkingDirectory=__FINALPATH__
|
|||
Environment="RAILS_ENV=production"
|
||||
Environment="DB_POOL=25"
|
||||
Environment="MALLOC_ARENA_MAX=2"
|
||||
ExecStart=__RBENV_ROOT__/versions/__APP__/bin/bundle exec sidekiq -c 25
|
||||
TimeoutSec=15
|
||||
Restart=always
|
||||
ExecStart=__RBENV_ROOT__/versions/__APP__/bin/bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml
|
||||
TimeoutSec=60
|
||||
RestartSec=60
|
||||
Restart=on-failure
|
||||
StandardError=syslog
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -8,10 +8,11 @@ User=__APP__
|
|||
WorkingDirectory=__FINALPATH__
|
||||
Environment="RAILS_ENV=production"
|
||||
Environment="PORT=__PORT_WEB__"
|
||||
ExecStart=__RBENV_ROOT__/versions/__APP__/bin/bundle exec puma -C config/puma.rb
|
||||
ExecStart=__RBENV_ROOT__/versions/__APP__/bin/bundle exec unicorn -c config/unicorn.rb -D
|
||||
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
||||
TimeoutSec=15
|
||||
Restart=always
|
||||
TimeoutSec=60
|
||||
RestartSec=60
|
||||
Restart=on-failure
|
||||
StandardError=syslog
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"example": "/example",
|
||||
"default": "/example"
|
||||
"example": "/",
|
||||
"default": "/"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
pkg_dependencies="g++ libjemalloc1|libjemalloc2 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-dev libapr1-dev libxslt1-dev libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle brotli"
|
||||
pkg_dependencies="g++ libjemalloc1|libjemalloc2 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-dev libapr1-dev libxslt1-dev libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle brotli nodejs redis-server cmake pkg-config"
|
||||
|
||||
RUBY_VERSION="2.7.1"
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ ynh_script_progression --message="Storing installation settings..." --time --wei
|
|||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||
# ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -120,14 +120,14 @@ ynh_install_ruby --ruby_version=$RUBY_VERSION
|
|||
ynh_script_progression --message="Configuring system user..." --time --weight=1
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name="${app}_production")
|
||||
db_name=$(ynh_sanitize_dbid --db_name="diaspora_production")
|
||||
db_user=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_pwd=$(ynh_string_random --length=30)
|
||||
|
||||
|
@ -200,6 +200,7 @@ pushd "$final_path"
|
|||
ynh_use_ruby
|
||||
ynh_gem install bundler:1.17.3 --no-document
|
||||
ynh_exec_as $app echo "gem: --no-ri --no-rdoc" >> "$final_path/.gemrc"
|
||||
ynh_exec_as $app chmod +x script/server
|
||||
popd
|
||||
|
||||
|
||||
|
@ -247,16 +248,17 @@ ynh_script_progression --message="Installing acropolis..."
|
|||
|
||||
pushd "$final_path"
|
||||
sudo -u $app $ynh_ruby_load_path script/configure_bundler
|
||||
sudo -u $app $ynh_ruby_load_path bin/bundle config set path 'vendor/bundle'
|
||||
sudo -u $app $ynh_ruby_load_path bin/bundle install --full-index
|
||||
popd
|
||||
|
||||
ynh_script_progression --message="Preparing the database..."
|
||||
|
||||
|
||||
rake_exec="exec_login_as $app RAILS_ENV=production bin/rake"
|
||||
ynh_exec_warn_less $rake_exec db:migrate
|
||||
ynh_exec_warn_less $rake_exec assets:precompile
|
||||
|
||||
pushd "$final_path"
|
||||
rake_exec="sudo -u $app $ynh_ruby_load_path RAILS_ENV=production bin/rake"
|
||||
ynh_exec_warn_less $rake_exec db:migrate
|
||||
ynh_exec_warn_less $rake_exec assets:precompile
|
||||
popd
|
||||
#=================================================
|
||||
# SETUP THE CRON FILE
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue