mirror of
https://github.com/YunoHost-Apps/simplex_ynh.git
synced 2024-09-03 20:26:28 +02:00
fix
This commit is contained in:
parent
eb25e09ffe
commit
a6b4eb6339
3 changed files with 57 additions and 0 deletions
32
conf/file-server.ini
Normal file
32
conf/file-server.ini
Normal file
|
@ -0,0 +1,32 @@
|
|||
1,1 All
|
||||
[STORE_LOG]
|
||||
# The server uses STM memory for persistence,
|
||||
# that will be lost on restart (e.g., as with redis).
|
||||
# This option enables saving memory to append only log,
|
||||
# and restoring it when the server is started.
|
||||
# Log is compacted on start (deleted objects are removed).
|
||||
enable: on
|
||||
|
||||
log_stats: off
|
||||
|
||||
[AUTH]
|
||||
# Set new_files option to off to completely prohibit uploading new files.
|
||||
# This can be useful when you want to decommission the server, but still allow downloading the existing files.
|
||||
new_files: on
|
||||
|
||||
# Use create_password option to enable basic auth to upload new files.
|
||||
# The password should be used as part of server address in client configuration:
|
||||
# xftp://fingerprint:password@host1,host2
|
||||
# The password will not be shared with file recipients, you must share it only
|
||||
# with the users who you want to allow uploading files to your server.
|
||||
# create_password: password to upload files (any printable ASCII characters without whitespace, '@', ':' and '/')
|
||||
|
||||
[TRANSPORT]
|
||||
# host is only used to print server address on start
|
||||
host: __PUBLIC_IP4__
|
||||
port: __PORT__
|
||||
log_tls_errors: off
|
||||
|
||||
[FILES]
|
||||
path: __DATA_DIR__
|
||||
storage_quota: 20gb
|
|
@ -43,9 +43,21 @@ ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
|
|||
xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)
|
||||
ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
|
||||
|
||||
ynh_replace_string --match_string="port: 443" --replace_string="port:$port_xftp" --target_file=target_file
|
||||
|
||||
chown -R $app:$app "/etc/opt/simplex"
|
||||
chown -R $app:$app "/etc/opt/simplex-xftp"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini"
|
||||
|
||||
chmod 400 "/etc/opt/simplex-xftp/file-server.ini"
|
||||
chown $app:$app "/etc/opt/simplex-xftp/file-server.ini"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -47,11 +47,24 @@ then
|
|||
ynh_setup_source --dest_dir="$install_dir" --source_id="xftp"
|
||||
fi
|
||||
|
||||
mkdir -p /var/opt/simplex-xftp /etc/opt/simplex-xftp
|
||||
chown -R $app:$app /var/opt/simplex-xftp /etc/opt/simplex-xftp
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chmod +x $install_dir/smp-server
|
||||
chmod +x $install_dir/xftp-server
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini"
|
||||
|
||||
chmod 400 "/etc/opt/simplex-xftp/file-server.ini"
|
||||
chown $app:$app "/etc/opt/simplex-xftp/file-server.ini"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue