1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: quick run script

fix: run in production mode by default
This commit is contained in:
Ferdinand Mütsch 2021-04-28 22:20:25 +02:00
parent 2b45b064eb
commit 0bccbffd80
3 changed files with 126 additions and 28 deletions

View File

@ -1,58 +1,58 @@
env: development env: production
server: server:
listen_ipv4: 127.0.0.1 # leave blank to disable ipv4 listen_ipv4: 127.0.0.1 # leave blank to disable ipv4
listen_ipv6: ::1 # leave blank to disable ipv6 listen_ipv6: ::1 # leave blank to disable ipv6
tls_cert_path: # leave blank to not use https tls_cert_path: # leave blank to not use https
tls_key_path: # leave blank to not use https tls_key_path: # leave blank to not use https
port: 3000 port: 3000
base_path: / base_path: /
public_url: http://localhost:3000 # required for links (e.g. password reset) in e-mail public_url: http://localhost:3000 # required for links (e.g. password reset) in e-mail
app: app:
aggregation_time: '02:15' # time at which to run daily aggregation batch jobs aggregation_time: '02:15' # time at which to run daily aggregation batch jobs
inactive_days: 7 # time of previous days within a user must have logged in to be considered active inactive_days: 7 # time of previous days within a user must have logged in to be considered active
custom_languages: custom_languages:
vue: Vue vue: Vue
jsx: JSX jsx: JSX
svelte: Svelte svelte: Svelte
db: db:
host: # leave blank when using sqlite3 host: # leave blank when using sqlite3
port: # leave blank when using sqlite3 port: # leave blank when using sqlite3
user: # leave blank when using sqlite3 user: # leave blank when using sqlite3
password: # leave blank when using sqlite3 password: # leave blank when using sqlite3
name: wakapi_db.db # database name for mysql / postgres or file path for sqlite (e.g. /tmp/wakapi.db) name: wakapi_db.db # database name for mysql / postgres or file path for sqlite (e.g. /tmp/wakapi.db)
dialect: sqlite3 # mysql, postgres, sqlite3 dialect: sqlite3 # mysql, postgres, sqlite3
charset: utf8mb4 # only used for mysql connections charset: utf8mb4 # only used for mysql connections
max_conn: 2 # maximum number of concurrent connections to maintain max_conn: 2 # maximum number of concurrent connections to maintain
ssl: false # whether to use tls for db connection (must be true for cockroachdb) (ignored for mysql and sqlite) ssl: false # whether to use tls for db connection (must be true for cockroachdb) (ignored for mysql and sqlite)
automgirate_fail_silently: false # whether to ignore schema auto-migration failures when starting up automgirate_fail_silently: false # whether to ignore schema auto-migration failures when starting up
security: security:
password_salt: # CHANGE ! password_salt: # change this
insecure_cookies: false # You need to set this to 'true' when on localhost insecure_cookies: true # should be set to 'false', except when not running with HTTPS (e.g. on localhost)
cookie_max_age: 172800 cookie_max_age: 172800
allow_signup: true allow_signup: true
expose_metrics: false expose_metrics: false
sentry: sentry:
dsn: # leave blank to disable sentry integration dsn: # leave blank to disable sentry integration
enable_tracing: true # whether to use performance monitoring enable_tracing: true # whether to use performance monitoring
sample_rate: 0.75 # probability of tracing a request sample_rate: 0.75 # probability of tracing a request
sample_rate_heartbeats: 0.1 # probability of tracing a heartbeat request sample_rate_heartbeats: 0.1 # probability of tracing a heartbeat request
mail: mail:
enabled: true # whether to enable mails (used for password resets, reports, etc.) enabled: true # whether to enable mails (used for password resets, reports, etc.)
provider: smtp # method for sending mails, currently one of ['smtp', 'mailwhale'] provider: smtp # method for sending mails, currently one of ['smtp', 'mailwhale']
smtp: # smtp settings when sending mails via smtp smtp: # smtp settings when sending mails via smtp
host: host:
port: port:
username: username:
password: password:
tls: tls:
sender: Wakapi <noreply@wakapi.dev> sender: Wakapi <noreply@wakapi.dev>
mailwhale: # mailwhale.dev settings when using mailwhale as sending service mailwhale: # mailwhale.dev settings when using mailwhale as sending service
url: url:
client_id: client_id:
client_secret: client_secret:

12
scripts/config.yml Normal file
View File

@ -0,0 +1,12 @@
# SQLite
source:
name: ../wakapi_db.db
# MySQL
target:
host: localhost
port: 5432
user: wakapi_user
password: wakapi
name: wakapi_local
dialect:

86
scripts/get.sh Normal file
View File

@ -0,0 +1,86 @@
#!/bin/sh
# This script installs Wakapi.
#
# Quick install: `curl https://wakapi.dev/get | bash`
#
# This script will install Wakapi to the directory you're in. To install
# somewhere else (e.g. /usr/local/bin), cd there and make sure you can write to
# that directory, e.g. `cd /usr/local/bin; curl https://wakapi.dev/get | sudo bash`
#
# Acknowledgments:
# - Micro Editor for this script: https://micro-editor.github.io/
# - ASCII art courtesy of figlet: http://www.figlet.org/
set -e -u
githubLatestTag() {
finalUrl=$(curl "https://github.com/$1/releases/latest" -s -L -I -o /dev/null -w '%{url_effective}')
printf "%s\n" "${finalUrl##*/}"
}
platform=''
machine=$(uname -m) # currently, Wakapi builds are only available for AMD64 anyway
if [ "${GETWAKAPI_PLATFORM:-x}" != "x" ]; then
platform="$GETWAKAPI_PLATFORM"
else
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in
"linux") platform='linux_amd64' ;;
"msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*) platform='win_amd64' ;;
esac
fi
if [ "x$platform" = "x" ]; then
cat << 'EOM'
/=====================================\\
| COULD NOT DETECT PLATFORM |
\\=====================================/
Uh oh! We couldn't automatically detect your operating system. You can file a
bug here: https://github.com/muety/wakapi
EOM
exit 1
else
printf "Detected platform: %s\n" "$platform"
fi
TAG=$(githubLatestTag muety/wakapi)
printf "Tag: %s" "$TAG"
extension='zip'
printf "Latest Version: %s\n" "$TAG"
printf "Downloading https://github.com/muety/wakapi/releases/download/%s/wakapi_%s.%s\n" "$TAG" "$platform" "$extension"
curl -L "https://github.com/muety/wakapi/releases/download/$TAG/wakapi_$platform.$extension" > "wakapi.$extension"
case "$extension" in
"zip") unzip -j "wakapi.$extension" -d "wakapi-$TAG" ;;
"tar.gz") tar -xvzf "wakapi.$extension" "wakapi-$TAG/wakapi" ;;
esac
mv "wakapi-$TAG/wakapi" ./wakapi
mv "wakapi-$TAG/config.yml" ./config.yml
rm "wakapi.$extension"
rm -rf "wakapi-$TAG"
cat <<-'EOM'
__ __ _ _
\ \ / /_ _| | ____ _ _ __ (_)
\ \ /\ / / _` | |/ / _` | '_ \| |
\ V V / (_| | < (_| | |_) | |
\_/\_/ \__,_|_|\_\__,_| .__/|_|
|_|
Wakapi has been downloaded to the current directory.
You can run it with:
./wakapi
For further instructions see https://github.com/muety/wakapi
EOM