1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitea_ynh.git synced 2024-09-03 20:36:22 +02:00
This commit is contained in:
Éric Gaspar 2022-07-23 09:31:49 +02:00
parent a6f52c8a30
commit 5026d1c591
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 43 additions and 40 deletions

View file

@ -1,10 +1,13 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass http://localhost:__PORT__/;
proxy_pass http://127.0.0.1:__PORT__/;
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-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 200M;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;

View file

@ -1,24 +1,15 @@
[Unit]
Description=Gitea
After=syslog.target
After=network.target
After=mysql.service
After=slapd.service
Description=Gitea: Git Service
After=syslog.target network.target mysql.service slapd.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
User=__APP__
Group=__APP__
WorkingDirectory=/home/yunohost.app/__APP__
ExecStart=/opt/__APP__/gitea web
WorkingDirectory=__DATADIR__/
ExecStart=__FINALPATH__/gitea web -p __PORT__
Restart=always
Environment=USER=__APP__ HOME=/home/yunohost.app/__APP__
Environment=USER=__APP__ HOME=__DATADIR__/
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

View file

@ -3,12 +3,10 @@
#=================================================
# GENERIC START
#=================================================
# Load common variables and helpers
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
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/filter.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP VARIOUS FILES
#=================================================

View file

@ -1,19 +1,14 @@
#!/bin/bash
#=================================================
# GENERIC START
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Import common cmd
source ./experimental_helper.sh
source ./_common.sh
# IMPORT GENERIC HELPERS
source _common.sh
source /usr/share/yunohost/helpers
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
@ -31,12 +26,17 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
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)
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)
admin=$(ynh_app_setting_get --app=$app --key=adminusername)
key=$(ynh_app_setting_get --app=$app --key=secret_key)
key=$(ynh_app_setting_get --app=$app --key=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)
#=================================================
@ -113,13 +113,16 @@ fi
#=================================================
# 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.
# 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"
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$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