Commit 4e000781 authored by Spctrl's avatar Spctrl

keep port 4000 closed

parent a8ad2a71
......@@ -36,12 +36,10 @@ What does not work:
What is not implemented:
* There is no LDAP integration. Users on Pleroma are seperate from the yunohost users
* There is no integration with a mailbox and/or -service. This means that mails won't be sent from the application
* Creation of an admin user
* Is it a public instance (registrations are open) or a private (registrations are closed)
* I'll probably want to add the Pleroma source in the package eventually. Right now I get it from the Pleroma repo directly during install
Extra info:
* On installation you'll be able to chose a dedicated domain for Pleroma. You'll also be asked for a username and password for the admin user
* On installation you'll be able to chose a dedicated domain for Pleroma. You'll also be asked for a username and password a user. This user will have moderator rights.
* Pleroma will be listed in the admin-panel under services, so you can stop and start the service there.
* Postgresql will also be listed in the admin-panel
* Registrations are open by default
......
......@@ -19,6 +19,7 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
# TODO: I'm talking about an admin user, but administration happens through the terminal. This is a user with moderator rights. I should change the var name throughout the scripts.
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
server_name=$YNH_APP_ARG_INSTANCE_NAME
......@@ -29,7 +30,6 @@ email=$admin_mail
is_public=1 # TODO make this a question. Non-public means no new subscriptions.
app=$YNH_APP_INSTANCE_NAME
db_name="pleroma_dev" # Change this to $app when DB-name can be easily chosen
port=$(ynh_find_port 4000)
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
......@@ -59,13 +59,6 @@ ynh_app_setting_set $app port $port
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# OPEN THE PORT
#=================================================
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
......@@ -123,19 +116,23 @@ su - postgres -c "psql -f $final_path/pleroma/config/setup_db.psql"
#=================================================
su - $app -c "cd $final_path/pleroma;mix local.rebar --force;mix local.hex --force;MIX_ENV=prod mix ecto.migrate;"
# creating /root/.mix/rebar
# creating /root/.mix/rebar3
## TODO Do these folders need to be removed on uninstall? (reïnstalling works, so prob not?)
#=================================================
# CUSTOM PLEROMA CONFIGURATION
#=================================================
if ! [ $is_public -eq 1 ]
then
ynh_replace_string " registrations_open: true," " registrations_open: false," "$final_path/pleroma/config/prod.secret.exs"
fi
#=================================================
# ADD ADMIN USER
#=================================================
# TODO the tasks fail, so I have to set the the pasword for the postgresql DB-user first. However when I did that after install,
# the app didn't respond anymore. Figure out what gives.
## sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
## mix register_user $admin_user $admin_user $admin_mail "Admin of this instance" $admin_password
## mix set_moderator $admin_user true
# the tasks fails, so I have to set the the pasword for the postgresql DB-user first.
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
su - $app -c "cd $final_path/pleroma; MIX_ENV=prod mix local.hex --force; MIX_ENV=prod mix register_user $admin_user $admin_user $admin_mail "Admin of this instance" $admin_password; MIX_ENV=prod mix set_moderator $admin_user true;"
#=================================================
# NGINX CONFIGURATION
......
......@@ -85,16 +85,6 @@ rm /etc/nginx/conf.d/$app-cache.conf
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port"
yunohost firewall disallow TCP $port 2>&1
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
......
......@@ -44,16 +44,6 @@ test ! -d $final_path \
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND OPEN THE PORT
#=================================================
# TODO This is prob not really needed
# Find a free port
port=$(ynh_find_port 4000)
# Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment