mirror of
https://github.com/YunoHost-Apps/coin_ynh.git
synced 2024-09-03 18:16:26 +02:00
Merge branch 'enh-refactoring' of https://github.com/YunoHost-Apps/coin_ynh into enh-refactoring
This commit is contained in:
commit
b19793db1e
3 changed files with 35 additions and 34 deletions
|
@ -68,7 +68,7 @@ AUTHENTICATION_BACKENDS = (
|
|||
'django.contrib.auth.backends.ModelBackend',
|
||||
)
|
||||
AUTH_LDAP_SERVER_URI = "ldap://localhost:389"
|
||||
AUTH_LDAP_USER_SEARCH = LDAPSearch("uid=YNH_APP_ARG_ADMIN,ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
|
||||
AUTH_LDAP_USER_SEARCH = LDAPSearch("uid={{ admin }},ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
|
||||
AUTH_LDAP_USER_ATTR_MAP = {
|
||||
"username": "uid",
|
||||
"first_name": "givenName",
|
||||
|
|
|
@ -1,30 +1,31 @@
|
|||
location PATHTOCHANGE {
|
||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||
location __PATH__/ {
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
try_files $uri @YNH_APP_INSTANCE_NAME;
|
||||
try_files $uri @__NAME__;
|
||||
}
|
||||
location /protected/ {
|
||||
location __PATH__/protected/ {
|
||||
internal;
|
||||
alias /opt/YNH_APP_INSTANCE_NAME/YNH_APP_INSTANCE_NAME/smedia/;
|
||||
alias /opt/__NAME__/__NAME__/smedia/;
|
||||
}
|
||||
|
||||
location PATHTOCHANGEmedia {
|
||||
alias /opt/YNH_APP_INSTANCE_NAME/media;
|
||||
location __PATH__/media {
|
||||
alias /opt/__NAME__/media;
|
||||
}
|
||||
|
||||
location PATHTOCHANGEstatic {
|
||||
alias /opt/YNH_APP_INSTANCE_NAME/static;
|
||||
location __PATH__/static {
|
||||
alias /opt/__NAME__/static;
|
||||
}
|
||||
|
||||
location PATHTOCHANGEassets {
|
||||
alias /opt/YNH_APP_INSTANCE_NAME/static;
|
||||
location __PATH__/assets {
|
||||
alias /opt/__NAME__/static;
|
||||
}
|
||||
|
||||
location @YNH_APP_INSTANCE_NAME {
|
||||
location @__NAME__ {
|
||||
proxy_set_header Host $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;
|
||||
proxy_pass http://unix:/opt/YNH_APP_INSTANCE_NAME/sock;
|
||||
proxy_pass http://unix:/opt/__NAME__/sock;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ export db_name=$(ynh_sanitize_dbid --db_name=$app)
|
|||
export db_user=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
export db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
export db_pwd
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -128,8 +128,8 @@ virtualenv "$final_path/venv"
|
|||
|
||||
export prefix="${path_url#"/"}/"
|
||||
prefix=${prefix%"/"}
|
||||
ynh_render_template ../conf/local.py.j2 "$final_path/app/settings_local.py"
|
||||
ynh_store_file_checksum --file="$final_path/app/settings_local.py"
|
||||
ynh_render_template ../conf/local.py.j2 "$final_path/coin/settings_local.py"
|
||||
ynh_store_file_checksum --file="$final_path/coin/settings_local.py"
|
||||
|
||||
#=================================================
|
||||
# SERVE STATIC FILES IN PRODUCTION MODE
|
||||
|
|
Loading…
Reference in a new issue