mirror of
https://github.com/YunoHost-Apps/Cubiks-2048_ynh.git
synced 2024-09-03 18:25:55 +02:00
fist commit
This commit is contained in:
parent
c5675a58ef
commit
5480c2a5ab
7 changed files with 145 additions and 2 deletions
|
@ -1,2 +1,7 @@
|
|||
# Cubiks-2048_ynh
|
||||
Clone of 2048 game in 3D
|
||||
# Cubiks-2048 game
|
||||
|
||||
A clone of 2048 game in 3D
|
||||
* [Try the game](https://kshitij-banerjee.github.io/Cubiks-2048/)
|
||||
* [Repository](https://github.com/Kshitij-Banerjee/Cubiks-2048)
|
||||
|
||||
|
||||
|
|
13
conf/nginx.conf
Normal file
13
conf/nginx.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
location YNH_WWW_PATH {
|
||||
alias YNH_WWW_ALIAS ;
|
||||
|
||||
# Force https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
index index.html;
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
43
manifest.json
Normal file
43
manifest.json
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "Cubiks-2048",
|
||||
"id": "cubiks2048",
|
||||
"description": {
|
||||
"en": "2048 game clone in 3D",
|
||||
"fr": "Clone du jeu 2048 en 3D"
|
||||
},
|
||||
"developer": {
|
||||
"name": "Moul",
|
||||
"email": "moul@moul.re"
|
||||
},
|
||||
"multi_instance": "false",
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for Cubiks-2048",
|
||||
"fr": "Choisissez un nom de domaine pour Cubiks-2048"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for Cubiks-2048",
|
||||
"fr": "Choisissez un chemin pour Cubiks-2048"
|
||||
},
|
||||
"example": "/cubiks2048",
|
||||
"default": "/cubiks2048"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"ask": {
|
||||
"en": "Is it a public game?",
|
||||
"fr": "Est-ce un jeu public ?"
|
||||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
41
scripts/install
Executable file
41
scripts/install
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$1
|
||||
path=$2
|
||||
is_public=$3
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a cubiks2048
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Save app settings
|
||||
sudo yunohost app setting cubiks2048 is_public -v "$is_public"
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/cubiks2048
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
|
||||
# Set permissions
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
nginxconf=/etc/nginx/conf.d/$domain.d/cubiks2048.conf
|
||||
sudo cp ../conf/nginx.conf $nginxconf
|
||||
sudo chown root: $nginxconf
|
||||
sudo chmod 600 $nginxconf
|
||||
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting cubiks2048 skipped_uris -v "/"
|
||||
fi
|
||||
|
||||
# Reload web server & sso
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
6
scripts/remove
Executable file
6
scripts/remove
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
domain=$(sudo yunohost app setting cubiks2048 domain)
|
||||
|
||||
sudo rm -rf /var/www/cubiks2048
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/cubiks2048.conf
|
34
scripts/upgrade
Normal file
34
scripts/upgrade
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve settings
|
||||
domain=$(sudo yunohost app setting cubiks2048 domain)
|
||||
path=$(sudo yunohost app setting cubiks2048 path)
|
||||
is_public=$(sudo yunohost app setting cubiks2048 is_public)
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/cubiks2048
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
|
||||
# Set permissions
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
nginxconf=/etc/nginx/conf.d/$domain.d/cubiks2048.conf
|
||||
sudo cp ../conf/nginx.conf $nginxconf
|
||||
sudo chown root: $nginxconf
|
||||
sudo chmod 600 $nginxconf
|
||||
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting cubiks2048 skipped_uris -v "/"
|
||||
fi
|
||||
|
||||
# Reload web server & sso
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
1
sources
Submodule
1
sources
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit df2369883cc1a6af96370758c91196ddd593fd8c
|
Loading…
Add table
Reference in a new issue