1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/codimd_ynh.git synced 2024-09-03 18:16:32 +02:00
This commit is contained in:
liberodark 2018-11-21 16:35:21 +01:00
parent 91d85a1b68
commit 4aa06569b8
2 changed files with 154 additions and 4 deletions

125
conf/config.json.example Normal file
View file

@ -0,0 +1,125 @@
{
"test": {
"db": {
"dialect": "sqlite",
"storage": ":memory:"
}
},
"development": {
"hsts": {
"enable": false
},
"db": {
"dialect": "sqlite",
"storage": "./db.codimd.sqlite"
}
},
"production": {
"domain": "localhost",
"hsts": {
"enable": true,
"maxAgeSeconds": "31536000",
"includeSubdomains": true,
"preload": true
},
"csp": {
"enable": true,
"directives": {
},
"upgradeInsecureRequests": "auto",
"addDefaults": true,
"addDisqus": true,
"addGoogleAnalytics": true
},
"db": {
"username": "",
"password": "",
"database": "codimd",
"host": "localhost",
"port": "5432",
"dialect": "postgres"
},
"facebook": {
"clientID": "change this",
"clientSecret": "change this"
},
"twitter": {
"consumerKey": "change this",
"consumerSecret": "change this"
},
"github": {
"clientID": "change this",
"clientSecret": "change this"
},
"gitlab": {
"baseURL": "change this",
"clientID": "change this",
"clientSecret": "change this",
"scope": "use 'read_user' scope for auth user only or remove this property if you need gitlab snippet import/export support (will result to be default scope 'api')",
"version": "use 'v4' if gitlab version > 11, 'v3' otherwise. Default to 'v4'"
},
"mattermost": {
"baseURL": "change this",
"clientID": "change this",
"clientSecret": "change this"
},
"dropbox": {
"clientID": "change this",
"clientSecret": "change this",
"appKey": "change this"
},
"google": {
"clientID": "change this",
"clientSecret": "change this",
"apiKey": "change this"
},
"ldap": {
"url": "ldap://change_this",
"bindDn": null,
"bindCredentials": null,
"searchBase": "change this",
"searchFilter": "change this",
"searchAttributes": ["change this"],
"usernameField": "change this e.g. cn",
"useridField": "change this e.g. uid",
"tlsOptions": {
"changeme": "See https://nodejs.org/api/tls.html#tls_tls_connect_options_callback"
}
},
"saml": {
"idpSsoUrl": "change: authentication endpoint of IdP",
"idpCert": "change: certificate file path of IdP in PEM format",
"issuer": "change or delete: identity of the service provider (default: serverurl)",
"identifierFormat": "change or delete: name identifier format (default: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress')",
"groupAttribute": "change or delete: attribute name for group list (ex: memberOf)",
"requiredGroups": [ "change or delete: group names that allowed" ],
"externalGroups": [ "change or delete: group names that not allowed" ],
"attribute": {
"id": "change or delete this: attribute map for `id` (default: NameID)",
"username": "change or delete this: attribute map for `username` (default: NameID)",
"email": "change or delete this: attribute map for `email` (default: NameID)"
}
},
"imgur": {
"clientID": "change this"
},
"minio": {
"accessKey": "change this",
"secretKey": "change this",
"endPoint": "change this",
"secure": true,
"port": 9000
},
"s3": {
"accessKeyId": "change this",
"secretAccessKey": "change this",
"region": "change this"
},
"s3bucket": "change this",
"azure":
{
"connectionString": "change this",
"container": "change this"
}
}
}

View file

@ -76,17 +76,42 @@ ynh_app_setting_set $app is_public $is_public
### - Remove the section "CLOSE A PORT" in the remove script ### - Remove the section "CLOSE A PORT" in the remove script
# Find a free port # Find a free port
port=$(ynh_find_port 8096) port=$(ynh_find_port 443)
# Open this port # Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1 yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port ynh_app_setting_set $app port $port
#============================================== #==============================================
# INSTALL EMBY # INSTALL POSTGRES
#============================================== #==============================================
wget --no-verbose 'https://github.com/MediaBrowser/Emby.Releases/releases/download/3.5.3.0/emby-server-deb_3.5.3.0_amd64.deb' ynh_install_app_dependencies postgresql apt-transport-https
dpkg --install emby-server-deb_3.5.3.0_amd64.deb
#sudo apt-get install -y postgresql apt-transport-https
#=================================================
# INSTALL NODEJS
#=================================================
# Use Helper instead of package from the repo
ynh_install_nodejs 8.12.0
#curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
#==============================================
# CREATE DB
#==============================================
sudo -i -u postgres psql -c "CREATE DATABASE codimd;"
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'codimd';"
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO codimd;"
#==============================================
# INSTALL CODIMD
#==============================================
wget --no-verbose 'https://github.com/hackmdio/codimd/archive/1.2.1.tar.gz'
tar -xvf codimd-1.2.1.tar.gz
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION