mirror of
https://github.com/YunoHost-Apps/gitea_ynh.git
synced 2024-09-03 20:36:22 +02:00
Fix
This commit is contained in:
parent
a6f52c8a30
commit
5026d1c591
4 changed files with 43 additions and 40 deletions
|
@ -1,10 +1,13 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
proxy_pass http://localhost:__PORT__/;
|
|
||||||
|
proxy_pass http://127.0.0.1:__PORT__/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_buffering off;
|
|
||||||
client_max_body_size 200M;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
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 200M;
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
|
|
|
@ -1,24 +1,15 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Gitea
|
Description=Gitea: Git Service
|
||||||
After=syslog.target
|
After=syslog.target network.target mysql.service slapd.service
|
||||||
After=network.target
|
|
||||||
After=mysql.service
|
|
||||||
After=slapd.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# Modify these two values and uncomment them if you have
|
|
||||||
# repos with lots of files and get an HTTP error 500 because
|
|
||||||
# of that
|
|
||||||
###
|
|
||||||
#LimitMEMLOCK=infinity
|
|
||||||
#LimitNOFILE=65535
|
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=/home/yunohost.app/__APP__
|
WorkingDirectory=__DATADIR__/
|
||||||
ExecStart=/opt/__APP__/gitea web
|
ExecStart=__FINALPATH__/gitea web -p __PORT__
|
||||||
Restart=always
|
Restart=always
|
||||||
Environment=USER=__APP__ HOME=/home/yunohost.app/__APP__
|
Environment=USER=__APP__ HOME=__DATADIR__/
|
||||||
|
|
||||||
# Sandboxing options to harden security
|
# Sandboxing options to harden security
|
||||||
# Depending on specificities of your service/app, you may need to tweak these
|
# Depending on specificities of your service/app, you may need to tweak these
|
||||||
|
|
|
@ -3,12 +3,10 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Load common variables and helpers
|
|
||||||
source ../settings/scripts/experimental_helper.sh
|
|
||||||
source ../settings/scripts/_common.sh
|
|
||||||
|
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -69,6 +67,14 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC BACKUP
|
||||||
|
#=================================================
|
||||||
|
# BACKUP LOGROTATE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP VARIOUS FILES
|
# BACKUP VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,19 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC STARTING
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Import common cmd
|
source _common.sh
|
||||||
source ./experimental_helper.sh
|
|
||||||
source ./_common.sh
|
|
||||||
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -31,12 +26,17 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
admin=$(ynh_app_setting_get --app=$app --key=adminusername)
|
key=$(ynh_app_setting_get --app=$app --key=key)
|
||||||
key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
|
||||||
lfs_key=$(ynh_app_setting_get --app=$app --key=lfs_key)
|
lfs_key=$(ynh_app_setting_get --app=$app --key=lfs_key)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=web_port)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
upstream_version=$(ynh_app_setting_get --app=$app --key=upstream_version)
|
upstream_version=$(ynh_app_setting_get --app=$app --key=upstream_version)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -113,13 +113,16 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC MODIFICATIONS
|
# SPECIFIC MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating gitea configuration..."
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
config_gitea
|
domain=$new_domain
|
||||||
|
path_url=$new_path
|
||||||
|
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||||
|
|
||||||
# Store the checksum with the 'INTERNAL_TOKEN' value.
|
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini"
|
||||||
# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed
|
|
||||||
ynh_store_file_checksum --file "$final_path/custom/conf/app.ini"
|
chmod 640 "$final_path/custom/conf/app.ini"
|
||||||
|
chown $app:$app "$final_path/custom/conf/app.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue