Commit 7b4ced0f authored by root's avatar root

Make linter happy

parent 2d3f7bf7
......@@ -3,11 +3,11 @@
"id": "pleroma_ynh",
"packaging_format": 1,
"description": {
"en": "Pleroma package for YunoHost"
"en": "Pleroma is an OStatus and Activity Pub-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon. It is high-performance and can run on small devices like a briqueinternet/internet cube."
},
"version": "0.9.9-beta-2~ynh1",
"url": "https://git.pleroma.social/pleroma/pleroma",
"license": "free",
"license": "AGPL-3.0-only",
"maintainer": {
"name": "Ilja",
"email": "spctrl@spectraltheorem.be",
......@@ -32,6 +32,7 @@
},
{
"name": "instance_name",
"type": "string",
"ask": {
"en": "Give a name for your instance. This will be shown on the tab of the browser"
},
......@@ -55,6 +56,7 @@
},
{
"name": "instance_user",
"type": "string",
"ask": {
"en": "A admin/moderator user will be created. Give a username for this user."
},
......@@ -78,6 +80,7 @@
},
{
"name": "instance_user_mail",
"type": "string",
"ask": {
"en": "The mailadress for the admin user. This will be the mailadres for the admin user and will also be publicly visseble"
},
......
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# GIVE FAIL MESSAGE
#=================================================
ynh_die "Due to the nature of federation, changing the URL is NOT possible. You'll have to uninstall this application and install it on the new domain. You WILL loose your data!"
......@@ -79,7 +79,7 @@ ynh_app_setting_set $app db_name $db_name
ynh_print_info "Installing dependencies"
# In case https capability for apt insn't installed yet
apt-get install --yes apt-transport-https
ynh_install_app_dependencies apt-transport-https
if ! [ -e /etc/apt/sources.list.d/erlang-solutions.list ]
then
......@@ -153,7 +153,7 @@ pleroma_ynh_add_setting "config :pleroma, :instance" "registrations_open" "$(ple
ynh_print_info "Adding user to the instance"
# We have to set the the pasword for the postgresql DB-user first, otherwise the task fails.
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
su - postgres -c "psql -c \"ALTER USER postgres PASSWORD 'postgres';\""
ynh_print_OFF
su - $app -c "cd $final_path/pleroma; MIX_ENV=prod mix local.hex --force;MIX_ENV=prod mix pleroma.user new $instance_user $instance_user_mail --name $instance_user --bio 'admin and moderator of this instance' --password $instance_user_password --moderator --admin --assume-yes > /dev/null;"
......
......@@ -13,8 +13,7 @@ source _common.sh
# MANAGE SCRIPT FAILURE
#=================================================
# TODO: This doesn't look like it'll always work well ^^'
#ynh_abort_if_errors
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
......@@ -24,7 +23,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
path_url=$(ynh_app_setting_get $app path)
port=$(ynh_app_setting_get $app port)
db_name=$(ynh_app_setting_get $app db_name)
......@@ -32,15 +31,15 @@ db_name=$(ynh_app_setting_get $app db_name)
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_print_info "Checking for conflicts"
test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Check web path availability
ynh_webpath_available $domain $path_url
# Register (book) web path
# ynh_webpath_register $app $domain $path_url
ynh_webpath_available $domain $path_url || ynh_die "$domain$path_url is no longer available"
# Check if port is still free
test $port = $(ynh_find_port $port) || ynh_die "Port $port is no longer available"
[ $port -eq $(ynh_find_port $port) ] || ynh_die "Port $port is no longer available"
# TODO: use different port when needed
#=================================================
......@@ -52,7 +51,7 @@ test $port = $(ynh_find_port $port) || ynh_die "Port $port is no longer availabl
ynh_print_info "Installing dependencies"
# In case https capability for apt insn't installed yet
apt-get install --yes apt-transport-https
ynh_install_app_dependencies apt-transport-https
if ! [ -e /etc/apt/sources.list.d/erlang-solutions.list ]
then
......@@ -143,3 +142,4 @@ systemctl restart $app
ynh_print_info "If you're not afraid of the terminal, check out https://git.pleroma.social/pleroma/pleroma/wikis/home to see what more you can do with your awesome instance!"
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