1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/code-server_ynh.git synced 2024-09-03 18:16:28 +02:00
This commit is contained in:
Tagadda 2023-05-08 22:16:40 +00:00 committed by Tagada
parent 6fb03731bf
commit ca9bbc8b4d
8 changed files with 19 additions and 15 deletions

View file

@ -1,10 +1,10 @@
### Installation ### Installation
* The package does not create a dedicated system user, rather during installation you are asked what user you want code-server to run as. **Don't give access to users you don't fully trust!** * VS Code will run as the user you choose during the installation.
### Limitations ### Limitations
* `code-server` files are stored inside `/home/<your-user>/.local/share/code-server` * `code-server` files are stored inside `/home/yunohost.app/<your-user>/.local/share/code-server`
### Extensions ### Extensions

View file

@ -1,10 +1,10 @@
### Installation ### Installation
* Le paquet ne crée pas d'utilisateur système dédié; on vous demandera pendant l'installation quel utilisateur vous voulez que code-serveur éxecute en tant que. **Ne donnez pas accès à des utilisateurs en lesquels vous n'avez pas complètement confiance !** * VS Code sera éxecuté en tant que l'utilisateurice sélectionnée lors de l'installation.
### Limitations ### Limitations
* Les fichiers de `code-server` sont stockés dans `/home/<votre-utilisateur>/.local/share/code-server` * Les fichiers de `code-server` sont stockés dans `/home/yunohost.app/<votre-utilisateur>/.local/share/code-server`
### Extensions ### Extensions

View file

@ -50,9 +50,8 @@ ram.runtime = "100M"
[resources.ports] [resources.ports]
[resources.system_user]
[resources.install_dir] [resources.install_dir]
dir = /opt/yunohost/__APP__
[resources.data_dir] [resources.data_dir]
subdirs = ["user-data", "extensions"] subdirs = ["user-data", "extensions"]

View file

@ -25,7 +25,7 @@ ynh_script_progression --message="Setting up source files..." --weight=5
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $user:www-data "$install_dir"
chmod +x "$install_dir/bin/code-server" chmod +x "$install_dir/bin/code-server"
#================================================= #=================================================
@ -51,11 +51,11 @@ ynh_script_progression --message="Adding a configuration file..." --weight=2
ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml" ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml"
chmod 440 "$install_dir/config.yaml" chmod 440 "$install_dir/config.yaml"
chown $app:$app "$install_dir/config.yaml" chown $admin:$admin "$install_dir/config.yaml"
ynh_add_config --template="code-server.env" --destination="$install_dir/code-server.env" ynh_add_config --template="code-server.env" --destination="$install_dir/code-server.env"
chmod 440 "$install_dir/code-server.env" chmod 440 "$install_dir/code-server.env"
chown $app:$app "$install_dir/code-server.env" chown $admin:$admin "$install_dir/code-server.env"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -65,6 +65,11 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#=================================================
# SET PERMISSION FOR THE USER
#=================================================
ynh_permission_update --permission="main" --add="$admin"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -18,7 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $admin:www-data "$install_dir"
#================================================= #=================================================
# RESTORE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
@ -27,7 +27,7 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:www-data "$data_dir" chown -R $admin:www-data "$data_dir"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION

View file

@ -79,7 +79,7 @@ then
fi fi
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $admin:www-data "$install_dir"
chmod +x "$install_dir/bin/code-server" chmod +x "$install_dir/bin/code-server"
#================================================= #=================================================
@ -104,7 +104,7 @@ then
fi fi
chmod 440 "$install_dir/config.yaml" "$install_dir/code-server.env" chmod 440 "$install_dir/config.yaml" "$install_dir/code-server.env"
chown $app:$app "$install_dir/config.yaml" "$install_dir/code-server.env" chown $admin:$admin "$install_dir/config.yaml" "$install_dir/code-server.env"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD