mirror of
https://github.com/YunoHost-Apps/tandoor_ynh.git
synced 2024-09-03 20:35:56 +02:00
commit
dddbb0ea6b
20 changed files with 167 additions and 121 deletions
|
@ -5,4 +5,5 @@
|
|||
- [Irakurri README euskaraz](README_eu.md)
|
||||
- [Lire le README en français](README_fr.md)
|
||||
- [Le o README en galego](README_gl.md)
|
||||
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
|
||||
- [阅读中文(简体)的 README](README_zh_Hans.md)
|
||||
|
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Shipped version:** 1.5.18~ynh1
|
||||
**Shipped version:** 1.5.18~ynh2
|
||||
|
||||
**Demo:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Versión actual:** 1.5.18~ynh1
|
||||
**Versión actual:** 1.5.18~ynh2
|
||||
|
||||
**Demo:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Paketatutako bertsioa:** 1.5.18~ynh1
|
||||
**Paketatutako bertsioa:** 1.5.18~ynh2
|
||||
|
||||
**Demoa:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Version incluse :** 1.5.18~ynh1
|
||||
**Version incluse :** 1.5.18~ynh2
|
||||
|
||||
**Démo :** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Versión proporcionada:** 1.5.18~ynh1
|
||||
**Versión proporcionada:** 1.5.18~ynh2
|
||||
|
||||
**Demo:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
77
README_id.md
Normal file
77
README_id.md
Normal file
|
@ -0,0 +1,77 @@
|
|||
<!--
|
||||
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
Ini TIDAK boleh diedit dengan tangan.
|
||||
-->
|
||||
|
||||
# Tandoor untuk YunoHost
|
||||
|
||||
[![Tingkat integrasi](https://dash.yunohost.org/integration/tandoor.svg)](https://ci-apps.yunohost.org/ci/apps/tandoor/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/tandoor.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/tandoor.maintain.svg)
|
||||
|
||||
[![Pasang Tandoor dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tandoor)
|
||||
|
||||
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
|
||||
|
||||
> *Paket ini memperbolehkan Anda untuk memasang Tandoor secara cepat dan mudah pada server YunoHost.*
|
||||
> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
|
||||
|
||||
## Ringkasan
|
||||
|
||||
This application is meant for people with a collection of recipes they want to share with family and friends or simply
|
||||
store them in a nicely organized way. A basic permission system exists but this application is not meant to be run as
|
||||
a public page.
|
||||
|
||||
### Core Features
|
||||
|
||||
- 🥗 **Manage your recipes** - Manage your ever growing recipe collection
|
||||
- 📆 **Plan** - multiple meals for each day
|
||||
- 🛒 **Shopping lists** - via the meal plan or straight from recipes
|
||||
- 📚 **Cookbooks** - collect recipes into books
|
||||
- 👪 **Share and collaborate** on recipes with friends and family
|
||||
|
||||
### Made by and for power users
|
||||
|
||||
- 🔍 Powerful & customizable **search** with fulltext support and [TrigramSimilarity](https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search/#trigram-similarity)
|
||||
- 🏷️ Create and search for **tags**, assign them in batch to all files matching certain filters
|
||||
- ↔️ Quickly merge and rename ingredients, tags and units
|
||||
- 📥️ **Import recipes** from thousands of websites supporting [ld+json or microdata](https://schema.org/Recipe)
|
||||
- ➗ Support for **fractions** or decimals
|
||||
- 🎨 Customize your interface with **themes**
|
||||
- 📦 **Sync** files with Dropbox and Nextcloud
|
||||
|
||||
### All the must haves
|
||||
|
||||
- 📱Optimized for use on **mobile** devices
|
||||
- 🌍 localized in many languages thanks to the awesome community
|
||||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**Versi terkirim:** 1.5.18~ynh2
|
||||
|
||||
**Demo:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
## Tangkapan Layar
|
||||
|
||||
![Tangkapan Layar pada Tandoor](./doc/screenshots/example.jpg)
|
||||
|
||||
## Dokumentasi dan sumber daya
|
||||
|
||||
- Website aplikasi resmi: <https://tandoor.dev>
|
||||
- Dokumentasi pengguna resmi: <https://docs.tandoor.dev>
|
||||
- Dokumentasi admin resmi: <https://docs.tandoor.dev>
|
||||
- Repositori kode aplikasi hulu: <https://github.com/TandoorRecipes/recipes>
|
||||
- Gudang YunoHost: <https://apps.yunohost.org/app/tandoor>
|
||||
- Laporkan bug: <https://github.com/YunoHost-Apps/tandoor_ynh/issues>
|
||||
|
||||
## Info developer
|
||||
|
||||
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/tandoor_ynh/tree/testing).
|
||||
|
||||
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/tandoor_ynh/tree/testing --debug
|
||||
atau
|
||||
sudo yunohost app upgrade tandoor -u https://github.com/YunoHost-Apps/tandoor_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>
|
|
@ -45,7 +45,7 @@ a public page.
|
|||
- 📥️ **Import your collection** from many other [recipe managers](https://docs.tandoor.dev/features/import_export/)
|
||||
- ➕ Many more like recipe scaling, image compression, printing views and supermarkets
|
||||
|
||||
**分发版本:** 1.5.18~ynh1
|
||||
**分发版本:** 1.5.18~ynh2
|
||||
|
||||
**演示:** <https://app.tandoor.dev/accounts/login/?demo>
|
||||
|
||||
|
|
17
conf/dot_env
17
conf/dot_env
|
@ -12,12 +12,10 @@ TANDOOR_PORT=__PORT__
|
|||
ALLOWED_HOSTS=__DOMAIN__
|
||||
|
||||
# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
|
||||
# ---------------------------- REQUIRED -------------------------
|
||||
SECRET_KEY=__SECRETKEY__
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# your default timezone See https://timezonedb.com/time-zones for a list of timezones
|
||||
TIMEZONE=__TIMEZONE__
|
||||
TZ=__TIMEZONE__
|
||||
|
||||
# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
|
||||
DB_ENGINE=django.db.backends.postgresql
|
||||
|
@ -25,9 +23,7 @@ DB_ENGINE=django.db.backends.postgresql
|
|||
POSTGRES_HOST=127.0.0.1
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_USER=__DB_USER__
|
||||
# ---------------------------- REQUIRED -------------------------
|
||||
POSTGRES_PASSWORD=__DB_PWD__
|
||||
# ---------------------------------------------------------------
|
||||
POSTGRES_DB=__DB_NAME__
|
||||
|
||||
# the default value for the user preference 'fractions' (enable/disable fraction support)
|
||||
|
@ -53,12 +49,13 @@ SHOPPING_MIN_AUTOSYNC_INTERVAL=5
|
|||
# If staticfiles are stored at a different location uncomment and change accordingly, MUST END IN /
|
||||
# this is not required if you are just using a subfolder
|
||||
# This can either be a relative path from the applications base path or the url of an external host
|
||||
#sub_path_only STATIC_URL=__INSTALL_DIR__/source/static/
|
||||
#sub_path_only
|
||||
#STATIC_URL=/static/
|
||||
|
||||
# If mediafiles are stored at a different location uncomment and change accordingly, MUST END IN /
|
||||
# this is not required if you are just using a subfolder
|
||||
# This can either be a relative path from the applications base path or the url of an external host
|
||||
MEDIA_URL=/media/
|
||||
#MEDIA_URL=/media/
|
||||
|
||||
# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
|
||||
# provided that include an additional nxginx container to handle media file serving.
|
||||
|
@ -85,8 +82,8 @@ GUNICORN_MEDIA=0
|
|||
# Required for email confirmation and password reset (automatically activates if host is set)
|
||||
EMAIL_HOST='127.0.0.1'
|
||||
EMAIL_PORT=25
|
||||
EMAIL_HOST_USER=
|
||||
EMAIL_HOST_PASSWORD=
|
||||
EMAIL_HOST_USER='__APP__'
|
||||
EMAIL_HOST_PASSWORD='__MAIL_PWD__'
|
||||
EMAIL_USE_TLS=0
|
||||
EMAIL_USE_SSL=0
|
||||
# email sender address (default 'webmaster@localhost')
|
||||
|
@ -97,7 +94,7 @@ DEFAULT_FROM_EMAIL=tandoor@__DOMAIN__
|
|||
# allow authentication via reverse proxy (e.g. authelia), leave off if you dont know what you are doing
|
||||
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
|
||||
# when unset: 0 (false)
|
||||
REVERSE_PROXY_AUTH=0
|
||||
REMOTE_USER_AUTH=0
|
||||
|
||||
# Default settings for spaces, apply per space and can be changed in the admin view
|
||||
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
|
||||
|
|
|
@ -20,5 +20,3 @@ location __PATH__/ {
|
|||
location /media/ {
|
||||
alias __INSTALL_DIR__/mediafiles/;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,16 +1,50 @@
|
|||
[Unit]
|
||||
Description=Tandoor, smart recipe mangement
|
||||
Description=Tandoor: smart recipe mangement
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__INSTALL_DIR__/source/
|
||||
WorkingDirectory=__INSTALL_DIR__/
|
||||
EnvironmentFile=__INSTALL_DIR__/.env
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/gunicorn --bind 127.0.0.1:__PORT__ recipes.wsgi:application
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
### Depending on specificities of your service/app, you may need to tweak these
|
||||
### .. but this should be a good baseline
|
||||
# Sandboxing options to harden security
|
||||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
DevicePolicy=closed
|
||||
ProtectClock=yes
|
||||
ProtectHostname=yes
|
||||
ProtectProc=invisible
|
||||
ProtectSystem=full
|
||||
ProtectControlGroups=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelTunables=yes
|
||||
LockPersonality=yes
|
||||
SystemCallArchitectures=native
|
||||
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged
|
||||
|
||||
# Denying access to capabilities that should not be relevant for webapps
|
||||
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
|
||||
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
|
||||
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
|
||||
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
|
||||
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
|
||||
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
|
||||
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
||||
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
||||
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
||||
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
### Known limitations:
|
||||
|
||||
* Requires a full dedicated domain for now
|
|
@ -4,10 +4,10 @@ packaging_format = 2
|
|||
|
||||
id = "tandoor"
|
||||
name = "Tandoor"
|
||||
description.en = "Application for managing and sharing recipes, planning meals, building shopping lists and much much more!"
|
||||
description.fr = "Gérez et partagez vos recettes, planifiez vos repas, créez vos listes de courses et beaucoup plus encore !"
|
||||
description.en = "Manage and share recipes, plan meals, build shopping lists"
|
||||
description.fr = "Gérez et partagez des recettes, planifiez des repas, créez des listes de courses"
|
||||
|
||||
version = "1.5.18~ynh1"
|
||||
version = "1.5.18~ynh2"
|
||||
|
||||
maintainers = ["Navan Chauhan"]
|
||||
|
||||
|
@ -21,14 +21,14 @@ code = "https://github.com/TandoorRecipes/recipes"
|
|||
cpe = "cpe:2.3:a:tandoor:recipes"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2"
|
||||
yunohost = ">= 11.2.20"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
ldap = false
|
||||
sso = false
|
||||
disk = "50M"
|
||||
ram.build = "50M"
|
||||
ram.runtime = "50M"
|
||||
disk = "1000M"
|
||||
ram.build = "2000M"
|
||||
ram.runtime = "1500M"
|
||||
|
||||
[install]
|
||||
[install.domain]
|
||||
|
@ -47,13 +47,17 @@ ram.runtime = "50M"
|
|||
autoupdate.asset = "tarball"
|
||||
|
||||
[resources.system_user]
|
||||
allow_email = true
|
||||
|
||||
[resources.install_dir]
|
||||
|
||||
[resources.data_dir]
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
api.url = "/api"
|
||||
api.allowed = "visitors"
|
||||
api.auth_header = false
|
||||
api.show_tile = false
|
||||
api.protected = true
|
||||
|
||||
[resources.ports]
|
||||
main.default = 8095
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
nodejs_version=16
|
||||
|
||||
# Used in .env
|
||||
timezone="$(cat /etc/timezone)"
|
||||
|
||||
#=================================================
|
||||
|
@ -17,18 +16,17 @@ _tandoor_venv_install() {
|
|||
ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv"
|
||||
venvpy="$install_dir/venv/bin/python3"
|
||||
|
||||
pushd "$install_dir/source"
|
||||
pushd "$install_dir"
|
||||
ynh_exec_as "$app" "$venvpy" -m pip install -r requirements.txt
|
||||
popd
|
||||
}
|
||||
|
||||
_tandoor_build_frontend() {
|
||||
pushd "$install_dir/source/vue"
|
||||
pushd "$install_dir/vue"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn install
|
||||
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn build
|
||||
popd
|
||||
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
@ -38,26 +36,3 @@ _tandoor_build_frontend() {
|
|||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
_mopidy_install() {
|
||||
python3 -m venv --upgrade "$install_dir/venv"
|
||||
chown -R "$app" "$install_dir"
|
||||
|
||||
venvpy="$install_dir/venv/bin/python3"
|
||||
|
||||
ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir pip
|
||||
|
||||
ynh_exec_as "$app" "$venvpy" -m pip install PyGObject
|
||||
|
||||
# install essential packages
|
||||
ynh_exec_as "$app" "$venvpy" -m pip install --no-cache-dir \
|
||||
Mopidy=="$(ynh_app_upstream_version)" \
|
||||
Mopidy-local==3.2.1 \
|
||||
Mopidy-MusicBox-Webclient==3.1.0 \
|
||||
Mopidy-YouTube==3.7 \
|
||||
Mopidy-YTMusic==0.3.8 \
|
||||
Mopidy-RadioNet==0.2.2 \
|
||||
Mopidy-Podcast==3.0.1 \
|
||||
Mopidy-Podcast-iTunes==3.0.1 \
|
||||
Mopidy-SoundCloud==3.0.2 \
|
||||
Mopidy-MPD==3.3.0
|
||||
}
|
||||
|
|
|
@ -21,12 +21,6 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
|
||||
ynh_backup --src_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE DATA DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$data_dir" --is_big
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -44,12 +38,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
|
|||
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE PostgreSQL DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||
|
||||
ynh_change_url_nginx_config
|
||||
|
||||
|
@ -40,12 +40,12 @@ chown "$app:$app" "$install_dir/.env"
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
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="systemd"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --time --last
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
|
|
|
@ -38,16 +38,10 @@ ynh_psql_execute_as_root --sql="ALTER USER $db_name WITH SUPERUSER;"
|
|||
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir/source"
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir"
|
||||
chown -R "$app:www-data" "$data_dir"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -60,9 +54,10 @@ chown "$app:$app" "$install_dir/.env"
|
|||
|
||||
version=$(ynh_app_upstream_version)
|
||||
|
||||
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
|
||||
chmod 400 "$install_dir/source/recipes/version.py"
|
||||
chown "$app:$app" "$install_dir/source/recipes/version.py"
|
||||
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
|
||||
|
||||
chmod 400 "$install_dir/recipes/version.py"
|
||||
chown "$app:$app" "$install_dir/recipes/version.py"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -74,10 +69,9 @@ ynh_script_progression --message="Installing Tandoor and its python dependencies
|
|||
_tandoor_venv_install
|
||||
|
||||
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
|
||||
pushd "$install_dir/source"
|
||||
pushd "$install_dir"
|
||||
(
|
||||
source "$install_dir/.env"
|
||||
|
||||
ynh_exec_as "$app" "$venvpy" manage.py migrate
|
||||
ynh_psql_execute_as_root --sql="ALTER USER $app WITH NOSUPERUSER;"
|
||||
ynh_exec_as "$app" "$venvpy" manage.py collectstatic --no-input
|
||||
|
@ -106,7 +100,7 @@ ynh_use_logrotate
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
# 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="systemd"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -28,8 +28,6 @@ ynh_remove_nginx_config
|
|||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
# Remove the log files
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -17,21 +17,8 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
||||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir"
|
||||
chown -R "$app:www-data" "$data_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PostgreSQL DATABASE
|
||||
#=================================================
|
||||
|
@ -52,12 +39,6 @@ yunohost service add "$app" --description="Smart recipe management" --log="/var/
|
|||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RESTORE VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -65,7 +46,7 @@ ynh_restore_file --origin_path="/var/log/$app/"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||
|
||||
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="systemd"
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
|
@ -31,7 +31,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env mediafiles"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
|
@ -49,24 +49,26 @@ chown "$app:$app" "$install_dir/.env"
|
|||
|
||||
version=$(ynh_app_upstream_version)
|
||||
|
||||
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
|
||||
chmod 400 "$install_dir/source/recipes/version.py"
|
||||
chown "$app:$app" "$install_dir/source/recipes/version.py"
|
||||
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
|
||||
|
||||
chmod 400 "$install_dir/recipes/version.py"
|
||||
chown "$app:$app" "$install_dir/recipes/version.py"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building frontend..." --weight=5
|
||||
|
||||
_tandoor_build_frontend
|
||||
|
||||
ynh_script_progression --message="Installing Tandoor and its python dependencies..." --weight=1
|
||||
|
||||
_tandoor_venv_install
|
||||
|
||||
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
|
||||
pushd "$install_dir/source"
|
||||
pushd "$install_dir"
|
||||
(
|
||||
source "$install_dir/.env"
|
||||
|
||||
ynh_exec_as "$app" "$venvpy" manage.py migrate
|
||||
ynh_psql_execute_as_root --sql="ALTER USER $app WITH NOSUPERUSER;"
|
||||
ynh_exec_as "$app" "$venvpy" manage.py collectstatic --no-input
|
||||
|
@ -94,7 +96,7 @@ ynh_use_logrotate --non-append
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
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="systemd"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
Loading…
Reference in a new issue