Put URL in separate config to avoid Git change
This commit is contained in:
parent
6b812e849e
commit
4438a027ec
3 changed files with 17 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ __pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
*.bak
|
*.bak
|
||||||
*~
|
*~
|
||||||
|
/config
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
To run in development mode, change `MATTERMOST_REMOTE` in `rundev.sh` to a server where you have an
|
To run in development mode, execute `rundev.sh`.
|
||||||
account, then execute `rundev.sh`.
|
|
||||||
This will start a web server, and mitmproxy to avoid CORS problems.
|
This will start a web server, and mitmproxy to avoid CORS problems.
|
||||||
Dependencies for that: Bash, Python and [`mitmproxy`](https://mitmproxy.org/).
|
Dependencies for that: Bash, Python and [`mitmproxy`](https://mitmproxy.org/).
|
||||||
|
|
||||||
|
|
19
rundev.sh
19
rundev.sh
|
@ -1,18 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
# Config
|
|
||||||
MATTERMOST_REMOTE="https://gitlab.mattermost.com"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
check_remote() {
|
||||||
if [[ $MATTERMOST_REMOTE == */ ]]; then
|
if [[ $MATTERMOST_REMOTE == */ ]]; then
|
||||||
echo "MATTERMOST_REMOTE should not end with a slash (it should only the protocol and the domain; no path)" >&2
|
echo "MATTERMOST_REMOTE should not end with a slash (it should only the protocol and the domain; no path)" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -f config ]]; then
|
||||||
|
read -p 'Server URL (e.g. `https://mattermost.example.com`): ' MATTERMOST_REMOTE
|
||||||
|
check_remote
|
||||||
|
echo "MATTERMOST_REMOTE='$MATTERMOST_REMOTE'" > config
|
||||||
|
echo 'You can change this later by editing the file `config`.'
|
||||||
|
fi
|
||||||
|
source "config"
|
||||||
|
check_remote
|
||||||
|
|
||||||
server_pid=0
|
server_pid=0
|
||||||
finish() {
|
finish() {
|
||||||
|
|
Loading…
Reference in a new issue