mirror of
https://github.com/YunoHost-Apps/plume_ynh.git
synced 2024-09-03 20:15:54 +02:00
test spawn to input commands
This commit is contained in:
parent
f3812c9954
commit
fda701dc84
2 changed files with 52 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
DB_URL=postgres://__DB_USER__:__PSQLPWD__@localhost:5432/__DBNAME__
|
DB_URL=postgres://__DB_USER__:__PSQLPWD__@localhost:5432/__DBNAME__
|
||||||
BASE_URL=__DOMAIN__
|
BASE_URL=__DOMAIN__
|
||||||
ROCKET_SECRET_KEY=__RANDOM_KEY__
|
|
||||||
|
|
||||||
ROCKET_PORT=__PORT__
|
ROCKET_PORT=__PORT__
|
||||||
ROCKET_ADDRESS=127.0.0.1
|
ROCKET_ADDRESS=127.0.0.1
|
||||||
|
|
|
@ -95,10 +95,6 @@ ynh_app_setting_set $app port $port
|
||||||
|
|
||||||
ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git curl gcc make openssl libssl-dev pkg-config
|
ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git curl gcc make openssl libssl-dev pkg-config
|
||||||
|
|
||||||
# Random key genration and store it
|
|
||||||
random_key=$(openssl rand -base64 32)
|
|
||||||
ynh_app_setting_set $app random_key $random_key
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DATABASE SETUP
|
# DATABASE SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -158,13 +154,64 @@ sudo cp ../conf/.env $final_path/.env
|
||||||
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/.env"
|
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/.env"
|
||||||
ynh_replace_string "__PSQLPWD__" "$db_pwd" "$final_path/.env"
|
ynh_replace_string "__PSQLPWD__" "$db_pwd" "$final_path/.env"
|
||||||
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/.env"
|
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/.env"
|
||||||
ynh_replace_string "__RANDOM_KEY__" "$random_key" "$final_path/.env"
|
|
||||||
ynh_replace_string "__PORT__" "$port" "$final_path/.env"
|
ynh_replace_string "__PORT__" "$port" "$final_path/.env"
|
||||||
ynh_replace_string "__DB_USER__" "$app" "$final_path/.env"
|
ynh_replace_string "__DB_USER__" "$app" "$final_path/.env"
|
||||||
|
|
||||||
# Set right permissions
|
# Set right permissions
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
|
||||||
|
pass="test"
|
||||||
|
name="test"
|
||||||
|
email="test@domain.tld"
|
||||||
|
admin_pass="test123"
|
||||||
|
|
||||||
|
( spawn cd $final_path && cargo run
|
||||||
|
|
||||||
|
expect "First let's check that you have all the required dependencies. Press Enter to start."
|
||||||
|
|
||||||
|
send "\r"
|
||||||
|
|
||||||
|
expect "Password:"
|
||||||
|
|
||||||
|
send "$pass\r"
|
||||||
|
|
||||||
|
expect "Do you prefer a simple setup, or to customize everything?
|
||||||
|
|
||||||
|
1 - Simple setup
|
||||||
|
2 - Complete setup"
|
||||||
|
|
||||||
|
send "2\r"
|
||||||
|
|
||||||
|
expect "What is your instance domain?"
|
||||||
|
|
||||||
|
send "$domain\r"
|
||||||
|
|
||||||
|
expect "What is your instance name?"
|
||||||
|
|
||||||
|
send "$name\r"
|
||||||
|
|
||||||
|
expect "What is your username? (default: admin)"
|
||||||
|
|
||||||
|
send "$username\r"
|
||||||
|
|
||||||
|
expect "What is your email?"
|
||||||
|
|
||||||
|
send "$email\r"
|
||||||
|
|
||||||
|
expect "What is your password?"
|
||||||
|
|
||||||
|
send "$admin_pass\r"
|
||||||
|
|
||||||
|
expect "On which port should Plume listen? (default: 7878)"
|
||||||
|
|
||||||
|
send "$port\r"
|
||||||
|
|
||||||
|
expect "On which address should Plume listen? (default: 0.0.0.0)"
|
||||||
|
|
||||||
|
send "127.0.0.1\r"
|
||||||
|
|
||||||
|
expect eof )
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue