mirror of
https://github.com/YunoHost-Apps/ulogger_ynh.git
synced 2024-10-01 13:34:45 +02:00
Modify config file
This commit is contained in:
parent
ce6204e191
commit
3959bfe8ac
3 changed files with 28 additions and 71 deletions
|
@ -1,2 +1,2 @@
|
||||||
INSERT INTO `users` (`id`, `login`, `password`) VALUES (NULL, '__admin__', '__admin_pwd__');
|
INSERT INTO `users` (`id`, `login`, `password`) VALUES (NULL, '__ADMIN__', '__ADMIN_PWD__');
|
||||||
|
|
||||||
|
|
|
@ -16,68 +16,26 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This is default configuration file.
|
// This is default configuration file.
|
||||||
// Copy it to config.php and customize
|
// Copy it to config.php and customize
|
||||||
// default map drawing framework
|
|
||||||
//$mapapi = "gmaps"; // google maps
|
// Database config
|
||||||
//$mapapi = "openlayers"; // openlayers 2
|
|
||||||
$mapapi = "openlayers3"; // openlayers 3+
|
// PDO data source name, eg.:
|
||||||
// openlayers additional map layers in XYZ format
|
// mysql:host=localhost;port=3307;dbname=ulogger;charset=utf8
|
||||||
// name => url
|
// mysql:unix_socket=/tmp/mysql.sock;dbname=ulogger;charset=utf8
|
||||||
$ol_layers['OpenCycleMap'] = 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'; // ?apikey=[API_KEY]
|
// pgsql:host=localhost;port=5432;dbname=ulogger
|
||||||
$ol_layers['OpenTopoMap'] = 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png';
|
// sqlite:/tmp/ulogger.db
|
||||||
$ol_layers['ESRI'] = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}';
|
$dbdsn = "mysql:host=localhost;port=3307;dbname=__DB_USER__;charset=utf8";
|
||||||
$ol_layers['UMP'] = 'http://{1-3}.tiles.ump.waw.pl/ump_tiles/{z}/{x}/{y}.png';
|
|
||||||
$ol_layers['Osmapa.pl'] = 'http://{a-c}.tile.openstreetmap.pl/osmapa.pl/{z}/{x}/{y}.png';
|
// Database user name
|
||||||
// default coordinates for initial map
|
$dbuser = "__DB_USER__";
|
||||||
$init_latitude = 52.23;
|
|
||||||
$init_longitude = 21.01;
|
// Database user password
|
||||||
// you may set your google maps api key
|
$dbpass = "__DB_PWD__";
|
||||||
$gkey = "";
|
|
||||||
// MySQL config
|
// Optional table names prefix, eg. "ulogger_"
|
||||||
$dbhost = "localhost"; // mysql host, eg. localhost
|
$dbprefix = "";
|
||||||
$dbuser = "__dbuser__"; // database user
|
|
||||||
$dbpass = "__dbpass__"; // database pass
|
|
||||||
$dbname = "__dbuser__"; // database name
|
|
||||||
$dbprefix = ""; // optional table names prefix, eg. "ulogger_"
|
|
||||||
// other
|
|
||||||
// require login/password authentication
|
|
||||||
// (0 = no, 1 = yes)
|
|
||||||
$require_authentication = 1;
|
|
||||||
// all users tracks are visible to authenticated user
|
|
||||||
// (0 = no, 1 = yes)
|
|
||||||
$public_tracks = 0;
|
|
||||||
// admin user, who
|
|
||||||
// - can add new users
|
|
||||||
// - can edit all tracks, users
|
|
||||||
// - has access to all users locations
|
|
||||||
// none if empty
|
|
||||||
$admin_user = "__admin__";
|
|
||||||
// miniumum required length of user password
|
|
||||||
$pass_lenmin = 12;
|
|
||||||
// required strength of user password
|
|
||||||
// 0 = no requirements,
|
|
||||||
// 1 = require mixed case letters (lower and upper),
|
|
||||||
// 2 = require mixed case and numbers,
|
|
||||||
// 3 = require mixed case, numbers and non-alphanumeric characters
|
|
||||||
$pass_strength = 2;
|
|
||||||
// Default interval in seconds for live auto reload
|
|
||||||
$interval = 10;
|
|
||||||
// Default language
|
|
||||||
// (en, pl, de, hu)
|
|
||||||
$lang = "__lang__";
|
|
||||||
//$lang = "pl";
|
|
||||||
//$lang = "de";
|
|
||||||
//$lang = "hu";
|
|
||||||
//$lang = "fr";
|
|
||||||
//$lang = "it";
|
|
||||||
// units
|
|
||||||
// (metric, imperial)
|
|
||||||
$units = "metric";
|
|
||||||
//$units = "imperial";
|
|
||||||
//$units = "nautical";
|
|
||||||
// These need to be copied to config.php
|
|
||||||
$strokeWeight = 2;
|
|
||||||
$strokeColor = '#FF0000';
|
|
||||||
$strokeOpacity = 1.0;
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -43,7 +43,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||||
# Register (book) web path
|
# Register (book) web path
|
||||||
ynh_webpath_register $app $domain $path_url
|
ynh_webpath_register $app $domain $path_url
|
||||||
|
|
||||||
admin_password=$(openssl passwd -1 -salt xyz $password)
|
admin_pwd=$(openssl passwd -1 -salt xyz $password)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
|
@ -112,14 +112,13 @@ chown -R $app: $final_path
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_replace_string "__dbuser__" "$db_name" "$final_path/config.php"
|
ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
|
||||||
ynh_replace_string "__dbpass__" "$db_pwd" "$final_path/config.php"
|
|
||||||
ynh_replace_string "__admin__" "$admin" "$final_path/config.php"
|
|
||||||
ynh_replace_string "__lang__" "$language" "$final_path/config.php"
|
|
||||||
ynh_replace_string "^\$enabled = false;" "\$enabled = true;" "$final_path/scripts/setup.php"
|
ynh_replace_string "^\$enabled = false;" "\$enabled = true;" "$final_path/scripts/setup.php"
|
||||||
# Replace variables in sql scripts
|
|
||||||
ynh_replace_string "__admin__" "$admin" ../conf/admin.sql
|
# Replace variables in SQL scripts
|
||||||
ynh_replace_string "__admin_pwd__" "$admin_password" ../conf/admin.sql
|
ynh_replace_string "__ADMIN__" "$admin" ../conf/admin.sql
|
||||||
|
ynh_replace_string "__ADMIN_PWD__" "$admin_pwd" ../conf/admin.sql
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP APPLICATION WITH CURL
|
# SETUP APPLICATION WITH CURL
|
||||||
|
|
Loading…
Reference in a new issue