mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
Merge pull request #26 from YunoHost-Apps/testing
Switch from log files to journalctl
This commit is contained in:
commit
467b84f92d
8 changed files with 27 additions and 30 deletions
|
@ -16,12 +16,11 @@ location ~ ^/(css|img|js|fonts)/ {
|
|||
|
||||
location __PATH__/ {
|
||||
|
||||
proxy_pass http://localhost:__PORT__/;
|
||||
proxy_pass http://localhost:__PORT__;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 10m;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_redirect off;
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
|
|
|
@ -6,8 +6,11 @@ After=network.target
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=/bin/sh -c '__FINALPATH__/writefreely >> /var/log/__APP__/__APP__.log 2>&1'
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
WorkingDirectory=__FINALPATH__
|
||||
ExecStart=__FINALPATH__/writefreely
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Write Freely is free and open source software for starting a minimalist, federated blog — or an entire community.",
|
||||
"fr": "Write Freely est un logiciel gratuit et à code source ouvert permettant de créer un blog fédéré minimaliste ou une communauté entière."
|
||||
},
|
||||
"version": "0.8.1~ynh2",
|
||||
"version": "0.8.1~ynh3",
|
||||
"url": "https://writefreely.org",
|
||||
"license": "free",
|
||||
"maintainer": {
|
||||
|
@ -65,6 +65,7 @@
|
|||
},
|
||||
{
|
||||
"name": "single_user",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose if you want a Single User Blog ?",
|
||||
"fr": "Souhaitez vous un blog pour un seul utilisateur?"
|
||||
|
@ -74,6 +75,7 @@
|
|||
},
|
||||
{
|
||||
"name": "site_name",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose a name for your WriteFreely instance",
|
||||
"fr": "Choisissez un nom pour votre instance WriteFreely"
|
||||
|
@ -82,6 +84,7 @@
|
|||
},
|
||||
{
|
||||
"name": "site_description",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose a description for your WriteFreely instance",
|
||||
"fr": "Choisissez une description pour votre instance WriteFreely"
|
||||
|
@ -90,6 +93,7 @@
|
|||
},
|
||||
{
|
||||
"name": "open_registration",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Are registrations opened to all ?",
|
||||
"fr": "Les inscriptions sont t'elles ouvertes ?"
|
||||
|
@ -99,6 +103,7 @@
|
|||
},
|
||||
{
|
||||
"name": "max_blogs",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "How many blogs each user can create ?",
|
||||
"fr": "Combien de blogs chaque utilisateur peut créer ?"
|
||||
|
@ -107,6 +112,7 @@
|
|||
},
|
||||
{
|
||||
"name": "federation",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Is it federation enabled ?",
|
||||
"fr": "Est-ce une application publique ?"
|
||||
|
@ -116,6 +122,7 @@
|
|||
},
|
||||
{
|
||||
"name": "public_stats",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Are federation stats public ?",
|
||||
"fr": "Est-ce les statistiques de federation sont publiques ?"
|
||||
|
@ -125,6 +132,7 @@
|
|||
},
|
||||
{
|
||||
"name": "private",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Are the instance metadata private ?",
|
||||
"fr": "Est-ce les metadatas de l'instance sont privée ?"
|
||||
|
@ -134,6 +142,7 @@
|
|||
},
|
||||
{
|
||||
"name": "local_timeline",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Do you want to add a local timeline ?",
|
||||
"fr": "Voulez vous afficher une timeline locale ?"
|
||||
|
|
|
@ -74,7 +74,7 @@ ynh_mysql_dump_db "$db_name" > db.sql
|
|||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/logrotate.d/$app"
|
||||
#ynh_backup "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
|
|
|
@ -259,7 +259,7 @@ ynh_add_systemd_config
|
|||
### (It's compatible with sed regular expressions syntax)
|
||||
|
||||
# setup application config
|
||||
sudo cp "../conf/config.ini" "$final_path/config.ini"
|
||||
cp "../conf/config.ini" "$final_path/config.ini"
|
||||
|
||||
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/config.ini"
|
||||
ynh_replace_string "__DBUSER__" "$db_name" "$final_path/config.ini"
|
||||
|
@ -289,13 +289,6 @@ ynh_store_file_checksum "$final_path/config.ini"
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# CREATE LOG FOLDER
|
||||
#=================================================
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# MAKE SETUP
|
||||
#=================================================
|
||||
|
@ -334,7 +327,7 @@ chown -R "$app":"$app" "$final_path"
|
|||
### - And the section "SETUP LOGROTATE" in the upgrade script
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
#ynh_use_logrotate
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
|
@ -351,7 +344,7 @@ ynh_use_logrotate
|
|||
#yunohost service add $app --log "/var/log/$app/APP.log"
|
||||
|
||||
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -91,7 +91,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
#ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
|
@ -116,7 +116,7 @@ fi
|
|||
ynh_secure_remove "/etc/$app/"
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove "/var/log/$app/"
|
||||
#ynh_secure_remove "/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -115,7 +115,7 @@ systemctl daemon-reload
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
|
@ -127,7 +127,7 @@ yunohost service add $app --description "$app daemon for WriteFreely" --log "/va
|
|||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/logrotate.d/$app"
|
||||
#ynh_restore_file "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -138,13 +138,6 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
|||
#systemctl reload php5-fpm
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# CREATE LOG FOLDER
|
||||
#=================================================
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# START SERVICE
|
||||
#=================================================
|
||||
|
|
|
@ -167,7 +167,7 @@ fi
|
|||
#=================================================
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
#ynh_use_logrotate --non-append
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
|
|
Loading…
Add table
Reference in a new issue