mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fed2a09b89
719 files changed
+14375
-4003
No files matched your search
@@ -0,0 +1,71 @@
|
||||
name: Create Docker Image
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [release]
|
||||
types: [completed]
|
||||
branches: [main, docker-17]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: Release
|
||||
default: ''
|
||||
jobs:
|
||||
create-docker-image-job:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.workflow_dispatch.ref || github.event.workflow_run.head_branch }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to ghcr.io to upload sailing-analytics image
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Copy a few files
|
||||
shell: bash
|
||||
run: |
|
||||
cp "java/target/env.sh" docker/
|
||||
cp "java/target/start" docker/
|
||||
cp "java/target/configuration/JavaSE-11.profile" docker/
|
||||
- name: Determine release
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BRANCH=$( git branch --show-current )
|
||||
RELEASE_PREFIX=$( if [ "${{ github.event.inputs.release }}" = "" ]; then
|
||||
echo "$( git branch --show-current )-"
|
||||
else
|
||||
echo "${{ github.event.inputs.release }}"
|
||||
fi )
|
||||
BEARER_TOKEN=${{ secrets.GITHUB_TOKEN }}" >>${GITHUB_ENV}
|
||||
- name: Download release
|
||||
shell: bash
|
||||
run: |
|
||||
RELEASE_TAR_GZ_FILENAME=$( configuration/github-download-release-assets.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.RELEASE_PREFIX }} )
|
||||
RELEASE=$( echo ${RELEASE_TAR_GZ_FILENAME} | sed -e 's/\.tar\.gz$//' )
|
||||
if [ -n ${RELEASE_TAR_GZ_FILENAME} ]; then
|
||||
mv ${RELEASE_TAR_GZ_FILENAME} docker/
|
||||
fi
|
||||
echo "RELEASE=${RELEASE}" >>${GITHUB_ENV}
|
||||
- name: Build & push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
build-args: RELEASE=${{ env.RELEASE }}
|
||||
tags: ghcr.io/sap/sailing-analytics:${{ env.RELEASE }}${{ env.BRANCH == 'main' && github.event.inputs.release == '' && ',ghcr.io/sap/sailing-analytics:latest' || env.BRANCH == 'docker-17' && github.event.inputs.release == '' && ',ghcr.io/sap/sailing-analytics:latest-17' || '' }}
|
||||
annotations: |
|
||||
maintainer=axel.uhl@sap.com
|
||||
index:org.opencontainers.image.title=Sailing Analytics
|
||||
index:org.opencontainers.image.description=The Sailing Analytics Web Application
|
||||
file: ${{ env.BRANCH == 'docker-17' && 'docker/Dockerfile_sapsailing_on_sapmachine17' || 'docker/Dockerfile' }}
|
||||
context: docker/
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
- name: Clean up copied files
|
||||
shell: bash
|
||||
run: rm docker/start docker/env.sh docker/JavaSE-11.profile docker/${{ env.RELEASE }}.tar.gz release-notes.txt
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Merge main branch into docker-17 after successful build
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [release]
|
||||
types: [completed]
|
||||
branches: [main]
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
merge-main-into-docker-17:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: docker-17
|
||||
fetch-depth: 0 # fetch the whole thing to make sure the histories merge
|
||||
- name: Merge main into docker-17
|
||||
uses: devmasx/merge-branch@master
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }}
|
||||
with:
|
||||
type: now
|
||||
from_branch: main
|
||||
target_branch: docker-17
|
||||
message: Auto-merging main into docker-17 after successful release build
|
||||
github_token: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }}
|
||||
@@ -0,0 +1,31 @@
|
||||
# One of the reasons to have this workflow is that the Gollum-based Wiki
|
||||
# at wiki.sapsailing.com is operating on a Git workspace at wiki@sapsailing.com:gitwiki
|
||||
# which has been cloned from ssh://trac@sapsailing.com/home/trac/git. Its changes
|
||||
# shall be synchronized to the Github repo at github.com/SAP/sailing-analytics
|
||||
name: Merge master from sapsailing.com
|
||||
on:
|
||||
schedule:
|
||||
- cron: "53 * * * *" # every hour, at :53 minutes
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
merge-master-from-sapsailing-com:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # fetch the whole thing to make sure the histories merge
|
||||
- name: Create SSH key and fetch repo from sapsailing.com
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY_FOR_TRAC_SAPSAILING_COM }}" >~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
git remote add sapsailing ssh://trac@sapsailing.com/home/trac/git
|
||||
git remote -v
|
||||
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git fetch sapsailing
|
||||
git config --global user.email "github@sapsailing.com"
|
||||
git config --global user.name "Github Auto-Merger"
|
||||
git merge sapsailing/master
|
||||
git push
|
||||
@@ -0,0 +1,149 @@
|
||||
name: release
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'wiki/**'
|
||||
- '.github/workflows/*'
|
||||
- '**/*.md'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
skip_tests:
|
||||
description: Skip tests (set to "true" to skip all tests)
|
||||
default: 'false'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest-64cpu
|
||||
#runs-on: ubuntu-latest-4cpu
|
||||
steps:
|
||||
- name: Allocate swap space
|
||||
shell: bash
|
||||
run: |
|
||||
sudo dd if=/dev/zero of=/mnt/large-swapfile bs=1G count=10
|
||||
sudo chmod 600 /mnt/large-swapfile
|
||||
sudo mkswap /mnt/large-swapfile
|
||||
sudo chown root:root /mnt/large-swapfile
|
||||
sudo swapon /mnt/large-swapfile
|
||||
- name: Collect Workflow Telemetry
|
||||
uses: catchpoint/workflow-telemetry-action@v2
|
||||
with:
|
||||
comment_on_pr: false
|
||||
- name: Check out the repository to the runner
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: '500'
|
||||
- name: Install JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||
java-version: '8'
|
||||
mvn-toolchain-id: 'JavaSE-1.8'
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
with:
|
||||
log-accepted-android-sdk-licenses: 'false'
|
||||
cmdline-tools-version: 9123335 # This corresponds to human-friendly version number 8.0
|
||||
- name: Start MongoDB
|
||||
uses: supercharge/mongodb-github-action@1.10.0
|
||||
with:
|
||||
mongodb-version: 4.4
|
||||
- name: Start RabbitMQ
|
||||
uses: namoshek/rabbitmq-github-action@v1
|
||||
with:
|
||||
version: '3.8.9'
|
||||
ports: '5672:5672'
|
||||
- shell: bash
|
||||
env: # Or as an environment variable
|
||||
APP_PARAMETERS: "-Daws.region=eu-west-1 -Dgoogle.maps.authenticationparams=${{ secrets.GOOGLE_MAPS_AUTHENTICATIONPARAMS }} -Daws.s3.test.s3AccessId=${{ secrets.AWS_S3_TEST_S3ACCESSID }} -Daws.s3.test.s3AccessKey=${{ secrets.AWS_S3_TEST_S3ACCESSKEY }}"
|
||||
JAVA8_HOME: ${{env.JAVA_HOME_8_X64}}
|
||||
run: |
|
||||
./configuration/buildAndUpdateProduct.sh -x 60 ${{ github.event.inputs.skip_tests == 'true' && '-t' || '' }} build 2>&1
|
||||
- name: Upload build log
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: build.log
|
||||
path: build.log
|
||||
retention-days: 90
|
||||
- name: Collect Test Reports
|
||||
uses: dorny/test-reporter@v1
|
||||
if: always()
|
||||
with:
|
||||
name: Maven Tests
|
||||
path: '**/TEST-*.xml'
|
||||
max-annotations: '1'
|
||||
list-suites: failed
|
||||
list-tests: failed
|
||||
reporter: java-junit
|
||||
fail-on-error: true
|
||||
- name: Build Release
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
|
||||
shell: bash
|
||||
run: |
|
||||
./configuration/buildAndUpdateProduct.sh -u -L ${{ github.event.inputs.skip_tests == 'true' && '-n untested' || '' }} release
|
||||
- name: Determine release name
|
||||
run: |
|
||||
echo "SIMPLE_VERSION_INFO=$( basename dist/* )" >>${GITHUB_ENV}
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: test-results
|
||||
path: |
|
||||
**/surefire-reports/**
|
||||
retention-days: 90
|
||||
- name: Upload distribution artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
|
||||
with:
|
||||
name: ${{ env.SIMPLE_VERSION_INFO }}
|
||||
path: dist/**/*
|
||||
retention-days: 90
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.SIMPLE_VERSION_INFO }}
|
||||
name: ${{ env.SIMPLE_VERSION_INFO }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload Release Asset tar.gz
|
||||
id: upload-release-asset-tar-gz
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||
asset_path: ./dist/${{ env.SIMPLE_VERSION_INFO }}/${{ env.SIMPLE_VERSION_INFO }}.tar.gz
|
||||
asset_name: ${{ env.SIMPLE_VERSION_INFO }}.tar.gz
|
||||
asset_content_type: application/x-tar
|
||||
- name: Upload Release Asset release_notes.txt
|
||||
id: upload-release-asset-release-notes-txt
|
||||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docker-17' || startsWith(github.ref, 'refs/heads/releases/') }}
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||
asset_path: ./dist/${{ env.SIMPLE_VERSION_INFO }}/release-notes.txt
|
||||
asset_name: release-notes.txt
|
||||
asset_content_type: text/plain
|
||||
- name: Trigger Hudson job
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||
if [ "${{ github.event.inputs.skip_tests }}" = "true" ]; then
|
||||
JOB=SAPSailingAnalytics-master-fasttrack-no-tests
|
||||
else
|
||||
JOB=SAPSailingAnalytics-master
|
||||
fi
|
||||
elif [[ "${{ github.ref }}" =~ refs/heads/releases/.* ]]; then
|
||||
JOB=$( echo "${{ github.ref }}" | sed -e 's/^refs\/heads\/releases\///' )
|
||||
else
|
||||
JOB=$( echo "${{ github.ref }}" | sed -e 's/^refs\/heads\///' )
|
||||
fi
|
||||
echo "Identified Hudson job: ${JOB}"
|
||||
curl https://${{ secrets.HUDSON_JOB_USERNAME }}:${{ secrets.HUDSON_JOB_PASSWORD}}@hudson.sapsailing.com/job/${JOB}/build?token=${{ secrets.HUDSON_JOB_TOKEN }}
|
||||
@@ -0,0 +1,15 @@
|
||||
name: "Launch Metadata Creation Tool for REUSE"
|
||||
on:
|
||||
workflow_dispatch: ~
|
||||
|
||||
jobs:
|
||||
create_metadata_proposal:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Metadata Creation Tool"
|
||||
steps:
|
||||
- uses: SAP/metadata-creation-tool-for-reuse@main
|
||||
with:
|
||||
repository_url: "${{ github.server_url }}/${{ github.repository }}"
|
||||
access_token: "${{ secrets.REUSE_ACCESS_TOKEN }}"
|
||||
copyright_owner: "SAP SE or an SAP affiliate company"
|
||||
upstream_contact: "Axel Uhl <axel.uhl@sap.com>"
|
||||
@@ -0,0 +1,7 @@
|
||||
This folder contains an Azure pipeline definition that is used for building our
|
||||
Android companion apps, in particular the Sailing Race Manager app and the
|
||||
Buoy Pinger app. See also the mobile/ folder for their source code. The
|
||||
gradle build that is used at the core of this build pipeline is controlled
|
||||
by the ``build.gradle``and ``gradle.properties`` file in the root folder.
|
||||
A local Android app build can be achieved by running the ``gradlew``
|
||||
wrapper script from the root folder.
|
||||
@@ -0,0 +1,3 @@
|
||||
This folder is used by the workflow defined in ``.github/workflows/reuse-tool-license-updates.yml``
|
||||
and produces machine-readable licensing information for the entire repository into the dep5 file
|
||||
in this same folder.
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: sailing-analytics
|
||||
Upstream-Contact: SAP Open Source Program Office ospo@sap.com
|
||||
Source: https://github.com/SAP/sailing-analytics
|
||||
|
||||
Files: java/com.google.gwt.servlet/*
|
||||
Copyright: 2024 com.google.gwt.servlet contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/net.sf.marineapi/doc/*
|
||||
Copyright: 2024 doc contributors.
|
||||
License: GPL-3.0-only
|
||||
|
||||
Files: java/com.google.gwt.user/*
|
||||
Copyright: 2024 com.google.gwt.user contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/com.googlecode.java-diff-utils.test/*
|
||||
Copyright: 2024 com.googlecode.java-diff-utils.test contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: *
|
||||
Copyright: 2024 SAP SE or an SAP affiliate company and sailing-analytics contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/com.google.gwt.dev/*
|
||||
Copyright: 2024 com.google.gwt.dev contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/org.mp4parser.isoparser/*
|
||||
Copyright: 2024 org.mp4parser.isoparser contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/elemental2/*
|
||||
Copyright: 2024 elemental2 contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/org.json.simple/*
|
||||
Copyright: 2024 org.json.simple contributors.
|
||||
License: MIT
|
||||
|
||||
Files: java/org.openqa.selenium.osgi/*
|
||||
Copyright: 2024 org.openqa.selenium.osgi contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/com.google.gwt.ajaxloader/*
|
||||
Copyright: 2024 com.google.gwt.ajaxloader contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/com.googlecode.java-diff-utils/*
|
||||
Copyright: 2024 com.googlecode.java-diff-utils contributors.
|
||||
License: Apache-2.0
|
||||
|
||||
Files: java/com.sap.sailing.gwt.ui/qrcode/*
|
||||
Copyright: 2024 qrcode contributors.
|
||||
License: MIT
|
||||
|
||||
Files: ios/SAPTracker/src/xcode/SAPTracker/flags/*
|
||||
Copyright: 2024 flags contributors.
|
||||
License: MIT
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
# Contributing to the Sailing Analytics
|
||||
|
||||
Thank you for your interest in the Sailing Analytics! We welcome contributions in all forms.
|
||||
|
||||
Here are some of the ways you can contribute to Sailing Analytics
|
||||
|
||||
Note: This is a living document. Like the Sailing Analytics, this document will be improved over time with the help of our community. Feedback welcome.
|
||||
|
||||
----
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
Bug reports welcome! We are currently still using [Bugzilla](https://bugzilla.sapsailing.com) for tracking user stories and bugs.
|
||||
|
||||
### Determining if an Issue Should be Created
|
||||
|
||||
Analyzing reports is a bit of work, so please ask yourself these questions before creating an issue:
|
||||
|
||||
* Does the bug really apply to Sailing Analytics
|
||||
|
||||
There may be reasons the problem is occurring that have nothing to do with the Sailing Anlaytics code. Consider the following:
|
||||
|
||||
* The problem may be caused by code that is not part of Sailing Analytics.
|
||||
* The problem may be caused by data being sent to Sailing Analytics through REST API calls.
|
||||
* The behavior may be different from what you expect, but may be working as designed. Or the feature may need improvement. In this case, it would be an enhancement request. Feature requests can also be submitted to [Bugzilla](https://bugzilla.sapsailing.com).
|
||||
|
||||
* Is the problem reproducible in the latest release?
|
||||
|
||||
* If you are not using the latest libraries or source code, please try to reproduce with the latest code first.
|
||||
* Make sure the problem is consistently reproducible using repeatable steps.
|
||||
* Has this bug already been reported?
|
||||
* Please search the issue tracker for a similar bug before reporting the issue as a new bug.
|
||||
|
||||
If the bug does indeed apply to Sailing Analytics code, please create an issue.
|
||||
|
||||
### Providing the Right Information for the Issue
|
||||
|
||||
* Summarize the issue well. The following are some guidelines:
|
||||
|
||||
* Precisely state what you expected as compared to the actual behavior you're seeing.
|
||||
* Include only those details that apply to the issue.
|
||||
* Be concise, but include details important for helping us in understanding the problem and finding the root cause.
|
||||
* State the version you are testing, which browser you are using, and on which device.
|
||||
|
||||
If it is possible to indicate what you've seen in other browser and device combinations, that is even better! For example, does the issue occur in all browsers, or just one browser on one particular operating system? (For example, "only in Firefox on Windows 10.)
|
||||
* If possible, include the last version where the bug was not present.
|
||||
* If the bug is more visual, please attach a screenshot and mark up the problem.
|
||||
* Generally, provide as much detail as necessary, but balance our need for information with how obvious the problem is.
|
||||
|
||||
* Provide detailed, step-by-step instructions for reproducing the issue with an example, including, if possible:
|
||||
|
||||
* A URL to your example
|
||||
* Screenshots if it helps us understand better.
|
||||
* Do not include more than one bug per issue created. This helps us to analyze bugs more easily.
|
||||
|
||||
Please report issues in English.
|
||||
|
||||
### About Reporting Security Issues
|
||||
|
||||
If you find a security issue, we'd like to encourage you to tell us directly instead of creating a public issue. This way we can fix it before it can be exploited.
|
||||
|
||||
* Researchers/non-Customers: please send the relevant information to support@sapsailing.com.
|
||||
|
||||
### How We Process Issues
|
||||
|
||||
New issues are reviewed regularly for validity and prioritization. Confirmed issues are given the "Approved" label, and the rest are either sent back to the reporter with a request for more details, or closed with an explanation.
|
||||
|
||||
Validated issues are then moved into one of these buckets:
|
||||
|
||||
* Priority issues will be assigned to one of our developers
|
||||
* Issues that are less urgent will be left open as "contribution welcome"
|
||||
* Certain issues may be moved to our internal issue tracking system if we don't think they belong to the Sailing Analytics.
|
||||
|
||||
Issues are closed when the fix is merged to develop. The release that contains the fix will be noted in the comments and the release changelog.
|
||||
|
||||
### How We Use Bugzilla Priorities
|
||||
|
||||
Our Bugzilla set-up supports five priorities (1-5):
|
||||
|
||||
* "1" is meant for show stoppers where, e.g., the website locks up, wrong data is being reported or the application crashes. Issues with thie priority need immediate action to unblock a live event using the solution.
|
||||
* "2" is used for things that definitely need fixing but that are not necessarily holding up general operations at a live event.
|
||||
* "3" identifies nice to have things we would like to see fixed at some point, but there is no specific urgency. Topics with this priority may be good candidates to start working on the project.
|
||||
* "4" and "5" are what you use to make sure an idea is recorded and not forgotten, but other than when searching for a neat onboarding task for someone who would like to join the project, tasks with these priorities are hardly ever looked at.
|
||||
|
||||
### Issue Reporting Disclaimer
|
||||
|
||||
Feedback, especially bug reports, are always welcome. However, our capacity as a team is limited -- we cannot answer specific project or consultation requests, nor can we invest time in fleshing out what might be a bug. Because of this, we reserve the right to close or not process issue reports that do not contain enough information. We also do not guarantee that every well-documented issue will be fixed.
|
||||
|
||||
That being said, we will try our very best to ensure the Sailing Analytics codebase is of high quality.
|
||||
|
||||
----
|
||||
|
||||
## Contributing Code
|
||||
|
||||
We welcome contributions to the Sailing Analytics codebase. Before you start your first contribution, here are some things you should know:
|
||||
|
||||
1. You must be aware of the Apache License (which describes contributions), and you must agree to the [Contributors License Agreement](LICENSE.md). This is common practice for most open source projects.
|
||||
|
||||
* For company contributors, special rules apply. See the respective section below for details.
|
||||
|
||||
1. Contributions must be compliant with the project code style, quality, and standards. We also follow them :-)
|
||||
|
||||
The `Contribution Content Guidelines` section below gives more details on the coding guidelines.
|
||||
|
||||
1. Not all contributions will be accepted.
|
||||
* The code you are submitting must fit the overall vision and direction of the Sailing Analytics and really improve it. Bug fixes are simple cases, for example, but new features may work better as third-party extensions.
|
||||
* Major feature implementations should be discussed on the issue tracker.
|
||||
|
||||
### Contributor License Agreement
|
||||
|
||||
When you contribute anything to the Sailing Analytics (code, documentation, analysis, anything), be aware that your contribution is covered by the same [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0) that is applied to the Sailing Analytics itself.
|
||||
|
||||
This applies to all contributors, including those contributing on behalf of a company.
|
||||
|
||||
### Developer Certificate of Origin (DCO)
|
||||
|
||||
Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
|
||||
|
||||
#### Company Contributors
|
||||
|
||||
If employees of a company contribute code, in **addition** to the individual agreement above, there needs to be one company agreement submitted. This is mainly for the protection of the contributing employees.
|
||||
|
||||
A company representative authorized to do so must fill out the following [Corporate Contributor License Agreement](/docs/SAP%20Corporate%20Contributor%20License%20Agreement.pdf) form. The form contains a list of employees who are authorized to contribute on behalf of your company. When this list changes, please let us know.
|
||||
|
||||
Submit the form to us through one of the following methods:
|
||||
|
||||
* Email to [opensource@sap.com](mailto:opensource@sap.com) and [support@sapsailing.com](mailto:support@sapsailing.com)
|
||||
* Fax to +49 6227 78-45813
|
||||
* Mail to:
|
||||
|
||||
Industry Standards & Open Source Team
|
||||
Dietmar-Hopp-Allee 16
|
||||
69190 Walldorf, Germany
|
||||
|
||||
### Contribution Content Guidelines
|
||||
|
||||
A contribution will be considered for inclusion in the Sailing Analytics if it meets the following criteria:
|
||||
|
||||
* The contribution fits the overall vision and direction of the Sailing Analytics
|
||||
* The contribution truly improves the solution
|
||||
* The contribution follows the applicable guidelines and standards.
|
||||
|
||||
The "guidelines and standards" requirement could fill entire books and still lack a 100% clear definition, but rest assured that you will receive feedback if something is not right. That being said, please consult the [Onboarding Document](https://wiki.sapsailing.com/wiki/howto/onboarding).
|
||||
|
||||
### Contribution Process
|
||||
|
||||
1. Make sure the change would be welcome, as described above.
|
||||
|
||||
1. Create a fork of the Sailing Analytics sources.
|
||||
|
||||
1. Work on the change in your fork (either on the `master` branch or on a feature branch, typically named after the Bugzilla issue, such as ``bug1234``).
|
||||
|
||||
1. Commit and push your changes.
|
||||
|
||||
1. Give reasonable commit messages; a short first line, and if you'd like to write additional, more verbose comments, finish the first line with a semicolon, add an empty line, then add more comments.
|
||||
|
||||
1. If your change fixes an issue reported in Bugzilla, add the following line to the commit message:
|
||||
|
||||
```bug{issueNumber}: ...```
|
||||
|
||||
1. Create a pull request so that we can review your change.
|
||||
1. Wait for our code review and approval, possibly enhancing your change on request.
|
||||
|
||||
Note: This may take time, depending on the required effort for reviewing, testing, and clarification. Sailing Analytics developers are also working their regular duties.
|
||||
|
||||
1. After the change has been approved, we will inform you in a comment.
|
||||
|
||||
1. Due to internal SAP processes, your pull request cannot be merged directly into the branch. It will be merged internally, and will also immediately appear in the public repository.
|
||||
1. We will close the pull request. At that point, you can delete your branch.
|
||||
|
||||
We look forward to hearing from you!
|
||||
+9
-3
@@ -1,7 +1,9 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.6)
|
||||
CFPropertyList (3.0.7)
|
||||
base64
|
||||
nkf
|
||||
rexml
|
||||
addressable (2.8.5)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
@@ -24,6 +26,7 @@ GEM
|
||||
aws-sigv4 (1.6.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
base64 (0.2.0)
|
||||
claide (1.1.0)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
@@ -161,6 +164,7 @@ GEM
|
||||
multipart-post (2.3.0)
|
||||
nanaimo (0.3.0)
|
||||
naturally (2.2.1)
|
||||
nkf (0.2.0)
|
||||
optparse (0.1.1)
|
||||
os (1.1.4)
|
||||
plist (3.7.0)
|
||||
@@ -171,7 +175,8 @@ GEM
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.6)
|
||||
rexml (3.2.8)
|
||||
strscan (>= 3.0.9)
|
||||
rouge (2.0.7)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
@@ -184,6 +189,7 @@ GEM
|
||||
simctl (1.6.10)
|
||||
CFPropertyList
|
||||
naturally
|
||||
strscan (3.1.0)
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
@@ -199,7 +205,7 @@ GEM
|
||||
unicode-display_width (2.5.0)
|
||||
webrick (1.8.1)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.23.0)
|
||||
xcodeproj (1.24.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@ This is the <img src="https://www.sapsailing.com/images/sap-logo_grey.png"/> Wik
|
||||
|
||||
Like businesses, sailors need the latest information to make strategic decisions - but they need it even faster. One wrong tack, a false estimation of the current, or the slightest wind shift can cost the skipper the entire race. As premium sponsor of the Kieler Woche 2011, and co-sponsor of Sailing Team Germany (STG), SAP is showing how innovative IT solutions providing real time data analysis can give teams the competitive edge.
|
||||
|
||||
SAP is at the center of today’s technology revolution, developing innovations that not only help businesses run like never before, but also improve the lives of people everywhere. As market leader in enterprise application software, SAP SE (NYSE: SAP) helps companies of all sizes and industries run better. From back office to boardroom, warehouse to storefront, desktop to mobile device – SAP empowers people and organizations to work together more efficiently and use business insight more effectively to stay ahead of the competition. SAP applications and services enable more than 258,000 customers to operate profitably, adapt continuously, and grow sustainably.
|
||||
SAP is at the center of today’s technology revolution, developing innovations that not only help businesses run like never before, but also improve the lives of people everywhere. As market leader in enterprise application software, SAP SE (NYSE: SAP) helps companies of all sizes and industries run better. From back office to boardroom, warehouse to storefront, desktop to mobile device – SAP empowers people and organizations to work together more efficiently and use business insight more effectively to stay ahead of the competition. SAP applications and services enable more than 400,000 customers to operate profitably, adapt continuously, and grow sustainably.
|
||||
|
||||
# Table of Contents
|
||||
|
||||
@@ -68,7 +68,7 @@ SAP is at the center of today’s technology revolution, developing innovations
|
||||
* [[Data consumption of mobile apps|wiki/info/mobile/data-consumption]]
|
||||
* [[Mobile Sailing Analytics|wiki/info/mobile/mobilesailinganalytics]]
|
||||
* [[Push Notifications|wiki/info/mobile/push-notifications]]
|
||||
* [[NMEA|wiki/info/mobile/nmea]]
|
||||
* [[NMEA|wiki/info/mobile/NMEA]]
|
||||
|
||||
### API
|
||||
|
||||
@@ -117,7 +117,7 @@ SAP is at the center of today’s technology revolution, developing innovations
|
||||
* [[Java De(Serialization) and Circular Dependencies|wiki/howto/development/java-de-serialization-and-circular-dependencies]]
|
||||
* [[JMX Support|wiki/howto/development/jmx]]
|
||||
* [[Working with GWT Locally|wiki/howto/development/local-gwt]]
|
||||
* [[Log File Analysis|wiki/howto/development/log-file-analysis]]
|
||||
* [[Log File Analysis|wiki/howto/development/Log-File-Analysis]]
|
||||
* [[Old Log Compression|wiki/howto/development/Log-File-Compression]]
|
||||
* [[UI Tests with Selenium|wiki/howto/development/selenium-ui-tests]]
|
||||
* [[Profiling|wiki/howto/development/profiling]]
|
||||
@@ -132,7 +132,7 @@ SAP is at the center of today’s technology revolution, developing innovations
|
||||
* [[Operating Igtimi WindBots|wiki/howto/eventmanagers/windbot-operations]]
|
||||
* [[Linking Race Videos|wiki/howto/eventmanagers/linking-race-videos]]
|
||||
* [[Import official results|wiki/howto/eventmanagers/results-import]]
|
||||
* [[Pairing lists|wiki/howto/eventmanagers/pairing-lists]]
|
||||
* [[Pairing lists|wiki/howto/eventmanagers/Pairing-Lists]]
|
||||
* [[Manage media content|wiki/howto/eventmanagers/Manage-media-content]]
|
||||
* [[Import Event into Archive|wiki/howto/eventmanagers/import-into-archive]]
|
||||
|
||||
@@ -167,7 +167,7 @@ SAP is at the center of today’s technology revolution, developing innovations
|
||||
* [[505 worlds Kiel 2014 event page|wiki/events/505-worlds-kiel-2014]]
|
||||
* [[Kieler Woche event page|wiki/events/kieler-woche-2015]]
|
||||
* [[Charleston Race Week 2016|wiki/events/Charleston-Race-Week-2016]]
|
||||
* [[Sailing Leagues 2016|wiki/events/sailing-Leagues-2016]]
|
||||
* [[Sailing Leagues 2016|wiki/events/Sailing-Leagues-2016]]
|
||||
* [[Media Content|wiki/events/Sailing-events-media-content]]
|
||||
|
||||
## Planning
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [2024] [SAP SE or an SAP affiliate company and sailing-analytics contributors]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,73 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,28 +1,100 @@
|
||||
# SAP Sailing Analytics
|
||||
|
||||
The SAP Sailing Analytics platform as seen on [sapsailing.com](https://sapsailing.com)
|
||||
## About this Project
|
||||
|
||||
The Sailing Analytics, formerly known as the "SAP Sailing Analytics," are a solution for portraying and analyzing sailing regattas, supporting training scenarios, and powering the vast archive at https://sapsailing.com. The solution consists of a cloud application with a web-based user interface, as well as three companion apps that integrate with the cloud application. This repository has the code for the cloud-based web application, and two of the three mobile apps (Buoy Pinger and Race Manager). The third companion app (Sail Insight) is found in [another repository](https://github.com/SailTracks/sailinsight).
|
||||
|
||||
## Description
|
||||
|
||||
This is the software running the SAP Sailing Analytics platform as seen on [sapsailing.com](https://sapsailing.com)
|
||||
|
||||
Sailing provides the perfect platform for SAP to showcase solutions and help the sport run like never before. SAP’s involvement in the sport has transformed the sailing experience by providing tools, which:
|
||||
|
||||
Help sailors analyze performance and optimize strategy
|
||||
Bring fans closer to the action
|
||||
Provide the media with information and insights to deliver a greater informed commentary
|
||||
- Help sailors analyze performance and optimize strategy
|
||||
- Bring fans closer to the action
|
||||
- Provide the media with information and insights to deliver a greater informed commentary
|
||||
|
||||
SAP has a longstanding involvement with sailing and has established a portfolio spanning across teams and regattas.
|
||||
|
||||
Start contributing: [https://wiki.sapsailing.com/wiki/howto/onboarding](https://wiki.sapsailing.com/wiki/howto/onboarding)
|
||||
## Quick Start with Docker Compose
|
||||
|
||||
If you have built or obtained the ``ghcr.io/sap/sailing-analytics:latest`` multi-platform image (currently available for linux/amd64 and linux/arm64 architectures), try this:
|
||||
```
|
||||
cd docker
|
||||
docker-compose up
|
||||
```
|
||||
Based on the ``docker/docker-compose.yml`` definition you should end up with three running Docker containers:
|
||||
- a MongoDB server, listening on default port 27017
|
||||
- a RabbitMQ server, listening on default port
|
||||
- a Sailing Analytics server, listening for HTTP requests on port 8888 and for telnet connections to the OSGi console on port 14888
|
||||
|
||||
Try a request to [``http://127.0.0.1:8888/index.html``](http://127.0.0.1:8888/index.html) or [``http://127.0.0.1:8888/gwt/status``](http://127.0.0.1:8888/gwt/status) to see if things worked.
|
||||
|
||||
To use Java 17, use the ``docker-compose-17.yml`` file instead:
|
||||
|
||||
```
|
||||
cd docker
|
||||
docker-compose -f docker-compose-17.yml up
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
The software can be run on any Linux or Windows machine with ``bash`` installed; it has also been compiled successfully for the ARM platform and was deployed to a Raspberry Pi computer. As a database, MongoDB is required, tested with releases 4.4, 5.0, and 6.0. For use in a replicated scenario (scale-out, high availability), RabbitMQ is required. A simple Docker Compose set-up can be used to tie these three components together, e.g., for a quick local test and to familiarize yourself with the application, as Docker images are produced on a regular basis.
|
||||
|
||||
Compute node and database sizing depends on several aspects of your workloads, such as whether live or replay data is to be served, how many different classes with separate leaderboard are racing concurrently, how many competitors are racing in each class, or how many concurrent viewers produce how many requests and which type (e.g., analytical, data mining, or watching a live race).
|
||||
|
||||
To quantify this at least approximately, here are a few examples for typical node sizes that can handle such types of events reasonably well:
|
||||
|
||||
- National sailing league event; six boats, 18 competitors, a single live leaderboard: 8GB of RAM and 4-8 CPUs
|
||||
- Large multi-class event with 15 classes with their separate leaderboards, concurrently racing on six course areas: 16GB of RAM, 16 CPUs
|
||||
- Archive of 30,000 races with a few thousand visitors per day with varying analytical and replay workloads: 64GB RAM, 2TB NVMe swap, 8 CPUs
|
||||
|
||||
A single node typically handles up to 500-1000 concurrent viewers for live events. You will want to scale out accordingly, using the replication pattern offered by the solution which uses RabbitMQ for transaction log shipping.
|
||||
|
||||
## Contributing
|
||||
|
||||
To start contributing, read the onboarding document at the following URL: [https://wiki.sapsailing.com/wiki/howto/onboarding](https://wiki.sapsailing.com/wiki/howto/onboarding). Further documentation can be found in our Wiki at [https://wiki.sapsailing.com](https://wiki.sapsailing.com), serving the content from this repo's ``wiki/`` folder.
|
||||
|
||||
The project welcomes contributions in the form of pull requests, for example, enhancements of the Data Mining functionality, including any sailing-specific metric or dimension you may think of and that you find is still missing so far; or additional features for the race viewer; or a map visualization that does not require a Google Map but uses Open Street Map / Open Layers; landscape automation; improved start sequence analytics; major UI improvements for the administrative layer ("AdminConsole"), etc.
|
||||
|
||||
The issue tracker at [https://bugzilla.sapsailing.com](https://bugzilla.sapsailing.com) is currently used for any sort of issue and enhancement request tracking. Help to migrate this smoothly to Github Issues would be much appreciated, ideally keeping issue numbers stable due to many references to those Bugzilla bug numbers, be it in the source code, the Wiki, or the build infrastructure.
|
||||
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md) at all times.
|
||||
|
||||
## Licensing
|
||||
|
||||
Copyright 2024 SAP SE or an SAP affiliate company and sailing-analytics contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/sailing-analytics).
|
||||
|
||||
See [here](https://www.sapsailing.com/gwt/Home.html#/imprint/:) for a list of components used by the project, as well as their licenses, also to be found in the file ``java/com.sap.sailing.gwt.ui/imprint.json``.
|
||||
|
||||
## Building and Running
|
||||
|
||||
To build, invoke
|
||||
This assumes you have completed the onboarding (see again [here](https://wiki.sapsailing.com/wiki/howto/onboarding)) successfully. To build, then invoke
|
||||
|
||||
```
|
||||
configuration/buildAndUpdateProduct.sh build
|
||||
```
|
||||
If the build was successful you can install the product locally by invoking
|
||||
This will build the Android companion apps first, then the web application. If the build was successful you can install the product locally by invoking
|
||||
|
||||
```
|
||||
configuration/buildAndUpdateProduct.sh install [ -s <server-name> ]
|
||||
```
|
||||
|
||||
The default server name is taken to be your current branch name, e.g., ``master``. The install goes to ``${HOME}/servers/{server-name}``. You will find a ``start`` script there which you can use to launch the product.
|
||||
|
||||
Or you create a release by running
|
||||
|
||||
```
|
||||
configuration/buildAndUpdateProduct.sh -L -u -n <release-name> release
|
||||
```
|
||||
which produces a tarball under ``dist/{release-name}-{timestamp}/{release-name}-{timestamp}.tar.gz`` which can then be used for ``scp``-based downloads with the ``refreshInstance.sh`` script under ``java/target``.
|
||||
|
||||
Run the ``buildAndUpdateProduct.sh`` without any arguments to see the sub-commands and options available.
|
||||
|
||||
|
||||
## Downloading, Installing and Running an Official Release
|
||||
|
||||
You need to have Java 8 installed. Get one from [here](https://tools.eu1.hana.ondemand.com/#cloud). Either ensure that this JVM's ``java`` executable in on the ``PATH`` or set ``JAVA_HOME`` appropriately.
|
||||
@@ -33,8 +105,17 @@ At [https://releases.sapsailing.com](https://releases.sapsailing.com) you find o
|
||||
cd sailinganalytics
|
||||
echo "MONGODB_URI=mongodb://localhost/winddb" | ${GIT_ROOT}/java/target/refreshInstance.sh auto-install-from-stdin
|
||||
```
|
||||
|
||||
This will download and install the latest release and configure it such that it will connect to a MongoDB server running locally (``localhost``) and listening on the default port ``27017``, using the database called ``winddb``.
|
||||
|
||||
In addition to the necessary ``MONGODB_URI`` variable you may need to inject a few secrets into your runtime environment:
|
||||
|
||||
- ``MANAGE2SAIL_ACCESS_TOKEN`` access token for result and regatta structure import from the Manage2Sail regatta management system
|
||||
- ``IGTIMI_CLIENT_ID`` / ``IGTIMI_CLIENT_SECRET`` credentials for ``igtimi.com`` in case you have one or more WindBot devices that you would like to integrate with
|
||||
- ``GOOGLE_MAPS_AUTHENTICATION_PARAMS`` as in ``"key=..."`` or ``"client=..."``, required to display the Google Map in the race viewer. Obtain a Google Maps key from the Google Cloud Developer console, e.g., [here](https://console.cloud.google.com/apis/dashboard).
|
||||
|
||||
In the ``configuration/mail.properties`` file make the necessary adjustments in case you would like to enable the application to send out e-mails, e.g., for user notifications or invitations.
|
||||
|
||||
Launch the server from the directory to which you just installed it:
|
||||
```
|
||||
./start
|
||||
@@ -47,10 +128,13 @@ Connect to your server at ``http://localhost:8888`` and find its administration
|
||||
|
||||
## Docker
|
||||
|
||||
To build a docker image, try ``docker/makeImageForLatestRelease``. The upload to the default (private) Dockerhub repository will usually fail unless you are a collaborator for that repository, but you should see a local image tagged ``docker.sapsailing.com/sapsailing:...`` result from the build. To run that docker image, try something like
|
||||
To build a docker image, try ``docker/makeImageForLatestRelease``. The upload to the default Github Package Registry (``ghcr.io``) will usually fail unless you are a collaborator for that repository, but you should see a local image tagged ``ghcr.io/sap/sailing-analytics:...`` resulting from the build. To run that docker image, try something like
|
||||
```
|
||||
docker run -d -e "MEMORY=4g" -e "MONGODB_URI=mongodb://my.mongohost.org?replicaSet=rs0&retryWrites=true" -P <yourimage>
|
||||
```
|
||||
|
||||
As explained above for the non-Docker scenario, add any variable assignments for secrets you need to pass to the runtime by adding more ``-e`` arguments.
|
||||
|
||||
Do a "docker ps" to figure out the port exposing the web application:
|
||||
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 79f6faf19b6a docker.sapsailing.com/sapsailing:latest "/home/sailing/serve…" 33 seconds ago Up 32 seconds 0.0.0.0:32782->6666/tcp, 0.0.0.0:32781->7091/tcp, 0.0.0.0:32780->8000/tcp, 0.0.0.0:32779->8888/tcp, 0.0.0.0:32778->14888/tcp modest_dhawan
|
||||
@@ -61,19 +145,31 @@ In this example, find your web application at http://localhost:32779 which is wh
|
||||
```
|
||||
to connect to the server's OSGi console.
|
||||
|
||||
## Docker Compose
|
||||
|
||||
If you have built or obtained the ``docker.sapsailing.com/sapsailing:latest`` image, try this:
|
||||
Alternatively, use an "environment" definition that sets useful defaults, e.g., like this:
|
||||
```
|
||||
cd docker
|
||||
docker-compose up
|
||||
docker run -P -it --rm -e "SERVER_NAME=test77" -e "USE_ENVIRONMENT=live-master-server" -e "REPLICATE_MASTER_BEARER_TOKEN=BRxGpF0nr68Z4m/f13/MgiYhdRB3xoDCYd+rLc17rTs=" ghcr.io/sap/sailing-analytics:latest \
|
||||
bash -c "rm env.sh; echo \"
|
||||
SERVER_NAME=test77
|
||||
USE_ENVIRONMENT=live-master-server
|
||||
REPLICATE_MASTER_BEARER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" | ./refreshInstance.sh auto-install-from-stdin; ./start fg"
|
||||
```
|
||||
Based on the ``docker/docker-compose.yml`` definition you should end up with three running Docker containers:
|
||||
- a MongoDB server, listening on default port 27017
|
||||
- a RabbitMQ server, listening on default port
|
||||
- a Sailing Analytics server, listening for HTTP requests on port 8888 and for telnet connections to the OSGi console on port 14888
|
||||
|
||||
Try a request to [``http://127.0.0.1:8888/index.html``](http://127.0.0.1:8888/index.html) or [``http://127.0.0.1:8888/gwt/status``](http://127.0.0.1:8888/gwt/status) to see if things worked.
|
||||
This will download and install the latest release and set up a primary/master instance, here as an example for server name "test77" and synchronize security data from ``security-service.sapsailing.com`` using the bearer token specified as ``REPLICA_MASTER_BEARER_TOKEN``.
|
||||
|
||||
The default Docker image built by ``docker/makeImageForLatestRelease`` uses the ``eclipse-temurin:8-jdk`` base image. If you'd like to use the SAP JVM 8 which gives you great profiling and reversible on-the-fly debugging capabilities, you may build a Docker image for it, using ``docker/Dockerfile_sapjvm``. Using it to build an image will accept version 3.2 of the SAP tools developer license on your behalf. Build the image, e.g., like this:
|
||||
|
||||
```
|
||||
cd ${GITROOT}/docker
|
||||
docker build --build-arg SAPJVM_VERSION=8.1.099 -t sapjvm8:8.1.099 -f Dockerfile_sapjvm .
|
||||
```
|
||||
|
||||
Then patch or copy ``docker/Dockerfile`` so that it has
|
||||
|
||||
```
|
||||
FROM sapjvm8:8.1.099
|
||||
```
|
||||
|
||||
(of course with the version tag adjusted to what you used above when you built/tagged the image). This will give you an SAP JVM 8 under ``/opt/sapjvm_8`` in the container which in particular includes the useful ``jvmmon`` utility specific to the SAP JVM 8.
|
||||
|
||||
## Configuration Options, Environment Variables
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.4.118
|
||||
1.4.119
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Requires a checked out copy of the git workspace at /home/sailing/code
|
||||
sourceanalyzer -b com.sap.sailing.domain -Xmx4000m -debug -logfile FortifyScan.log -extdirs /home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins -cp "/home/sailing/code/java/com.google.gwt.osgi/lib/gwt-user.jar:/home/sailing/gwt-2.7.0/validation-api-1.0.0.GA.jar:/home/sailing/gwt-2.7.0/gwt-codeserver.jar:/home/sailing/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar:/home/sailing/gwt-2.7.0/gwt-user.jar:/home/sailing/gwt-2.7.0/gwt-dev.jar:/home/sailing/code/java/com.google.gwt.dev/lib/gwt-dev.jar:/home/sailing/code/java/com.tractrac.clientmodule/lib/TracAPI.jar:/home/sailing/code/java/com.sap.sailing.dashboards.gwt/WEB-INF/lib/gwt-ajaxloader.jar:/home/sailing/code/java/com.sap.sailing.dashboards.gwt/WEB-INF/lib/gwt-maps-api-3.9.0-build-17.jar:/home/sailing/code/java/com.googlecode.mgwt/lib/mgwt-2.0.0.jar:/home/sailing/code/java/com.sap.sailing.gwt.ui/WEB-INF/lib/gwt-maps-api-3.9.0-build-17.jar:/home/sailing/code/java/com.sap.sailing.gwt.ui/WEB-INF/lib/gwt-ajaxloader.jar" -source 1.8 "/home/sailing/code/java/com.sap.sailing.ess40.resultimport" "/home/sailing/code/java/com.sap.sailing.manage2sail" "/home/sailing/code/java/com.sap.sailing.manage2sail.resultimport" "/home/sailing/code/java/com.tractrac.clientmodule" "/home/sailing/code/java/com.sap.sse.filestorage" "/home/sailing/code/java/com.sap.sailing.domain.swisstimingreplayadapter" "/home/sailing/code/java/com.sap.sse.mongodb" "/home/sailing/code/java/com.sap.sailing.udpconnector" "/home/sailing/code/java/com.sap.sailing.server.gateway" "/home/sailing/code/java/com.sap.sse" "/home/sailing/code/java/com.sap.sse.datamining" "/home/sailing/code/java/com.sap.sailing.domain.racelogtrackingadapter" "/home/sailing/code/java/com.sap.sailing.datamining.shared" "/home/sailing/code/java/com.sap.sailing.domain.igtimiadapter.persistence" "/home/sailing/code/java/com.sap.sailing.monitoring" "/home/sailing/code/java/com.sap.sailing.domain" "/home/sailing/code/java/com.sap.sse.datamining.annotations" "/home/sailing/code/java/com.sap.sailing.domain.swisstimingadapter.persistence" "/home/sailing/code/java/com.sap.sse.threadmanager" "/home/sailing/code/java/com.sap.sailing.xrr.structureimport" "/home/sailing/code/java/com.sap.sailing.freg.resultimport" "/home/sailing/code/java/com.sap.sailing.domain.igtimiadapter" "/home/sailing/code/java/com.sap.sailing.server.gateway.ess40" "/home/sailing/code/java/com.sap.sailing.xrr.schema" "/home/sailing/code/java/com.sap.sse.common" "/home/sailing/code/java/com.sap.sailing.expeditionconnector" "/home/sailing/code/java/com.sap.sailing.declination" "/home/sailing/code/java/com.sap.sailing.geocoding" "/home/sailing/code/java/com.sap.sailing.server.gateway.serialization" "/home/sailing/code/java/com.sap.sailing.kiworesultimport" "/home/sailing/code/java/com.sap.sailing.polars.datamining" "/home/sailing/code/java/com.sap.sailing.simulator" "/home/sailing/code/java/com.sap.sse.replication" "/home/sailing/code/java/com.sap.sailing.www" "/home/sailing/code/java/com.sap.sse.gwt.adminconsole" "/home/sailing/code/java/com.sap.sailing.dashboards.gwt" "/home/sailing/code/java/com.sap.sailing.news" "/home/sailing/code/java/com.sap.sailing.polars.datamining.shared" "/home/sailing/code/java/com.sap.sailing.barbados.resultimport" "/home/sailing/code/java/com.sap.sse.security.common" "/home/sailing/code/java/com.sap.sse.security.ui" "/home/sailing/code/java/com.sap.sse.shared.android" "/home/sailing/code/java/org.json.simple" "/home/sailing/code/java/com.sap.sailing.resultimport" "/home/sailing/code/java/com.sap.sse.security" "/home/sailing/code/java/com.sap.sailing.gwt.ui" "/home/sailing/code/java/com.sap.sailing.domain.tractracadapter" "/home/sailing/code/java/com.sap.sailing.server.trackfiles" "/home/sailing/code/java/com.googlecode.java-diff-utils" "/home/sailing/code/java/com.sap.sse.operationaltransformation" "/home/sailing/code/java/com.sap.sailing.domain.swisstimingadapter" "/home/sailing/code/java/com.sap.sse.gwt.theme" "/home/sailing/code/java/com.sap.sailing.domain.persistence" "/home/sailing/code/java/com.sap.sailing.sailwave.resultimport" "/home/sailing/code/java/com.sap.sailing.xmlexport" "/home/sailing/code/java/com.sap.sse.mail" "/home/sailing/code/java/com.sap.sailing.velum.resultimport" "/home/sailing/code/java/com.sap.sse.security.userstore.mongodb" "/home/sailing/code/java/com.sap.sailing.server.gateway.serialization.shared.android" "/home/sailing/code/java/com.sap.sse.datamining.shared" "/home/sailing/code/java/org.moxieapps.gwt.highcharts" "/home/sailing/code/java/com.sap.sailing.autoload" "/home/sailing/code/java/com.googlecode.mgwt" "/home/sailing/code/java/com.sap.sailing.datamining" "/home/sailing/code/java/com.sap.sailing.polars" "/home/sailing/code/java/com.sap.sailing.www.events" "/home/sailing/code/java/com.sap.sailing.domain.common" "/home/sailing/code/java/com.sap.sailing.domain.shared.android" "/home/sailing/code/java/com.sap.sailing.domain.deckmanadapter" "/home/sailing/code/java/com.sap.saLine truncated
|
||||
#sourceanalyzer -b com.sap.sailing -Xmx10g -debug -logfile FortifyScan.log "-show-build-warnings" "-machine-output" "-cp" "/home/sailing/code/java/com.sap.sse.gwt.theme/WEB-INF/classes:/home/sailing/code/java/com.sap.sailing.dashboards.gwt/WEB-INF/classes:/home/sailing/code/java/com.sap.sailing.gwt.ui/WEB-INF/classes:/home/sailing/code/java/com.sap.sse.security.ui/WEB-INF/classes:/home/sailing/code/java/com.sap.sailing.www.events/WEB-INF/classes:/home/sailing/code/java/com.google.gwt.osgi/lib/gwt-user.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.osgi_3.10.2.v20150203-1939.jar:/home/sailing/gwt-2.7.0/validation-api-1.0.0.GA.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.osgi.npn.fragment_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/javax.servlet_3.1.0.v20140303-1611.jar:/home/sailing/gwt-2.7.0/gwt-codeserver.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.servicemix.bundles.zxing_3.1.0.1.jar:/home/sailing/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar:/home/sailing/gwt-2.7.0/gwt-user.jar:/home/sailing/gwt-2.7.0/gwt-dev.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.commons.math_2.1.0.v201105210652.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.fasterxml.jackson.core.jackson-databind_2.5.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.junit4_4.8.2.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.fasterxml.jackson.core.jackson-annotations_2.5.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.rabbitmq.client_2.8.4.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/lz4-java_1.3.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.servicemix.bundles.aws-java-sdk_1.9.8.1.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.commons.logging_1.1.3.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/javax.validation_1.0.0.GA_v201205091237.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.webapp_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.fasterxml.jackson.core.jackson-core_2.5.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.server_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.mongodb.mongo-java-driver_2.13.0.RELEASE.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.httpcomponents.httpclient_4.2.6.v201311072007.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.commons.io_2.2.0.v201405211200.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.sun.mail.javax.mail_1.4.5.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.io_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/javax.ws.rs_1.1.1.v20130318-1750.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.jvnet.mimepull_1.9.4.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.shiro.ehcache_1.2.3.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.commons.lang_2.6.0.v201404270220.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.shiro.core_1.2.2.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.websocket.servlet_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.apache.commons.beanutils_1.9.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/com.sun.jersey.contribs.jersey-multipart_1.17.0.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jetty.websocket.client_9.2.2.v20140723.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.objectweb.asm_5.0.1.v201404251740.jar:/home/sailing/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.jdom_1.1.1.v201101151400.jar:/home/sailing/workspace/.metadaLine truncated
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Requires a checked out copy of the git workspace at /home/sailing/code
|
||||
#sourceanalyzer -b com.sap.sailing.domain -scan
|
||||
sourceanalyzer -b com.sap.sailing.domain -Xmx6000m -scan "-f" "/home/sailing/code/java/com.sap.sailing_scan.fpr"
|
||||
@@ -1,15 +0,0 @@
|
||||
# Use like this:
|
||||
# . awsmfalogon.sh {mfaDeviceArn} {tokenCode}
|
||||
# It will set the necessary environment variables that will allow the "aws" client to work
|
||||
# with a session token
|
||||
# Use with a bash alias definition like this, replacing {ARN-of-your-MFA-device} with the ARN of your MFA device:
|
||||
# alias awsmfa='echo -n "Token: "; read aws_mfa_token; . awsmfalogon.sh "{ARN-of-your-MFA-device}" ${aws_mfa_token}'
|
||||
# Then, you can invoke the alias "awsmfa" on your bash command line, and you will get prompted for an MFA token
|
||||
# which, when entered, will add the necessary environment variables to your bash session that will allow your aws
|
||||
# client to function with a valid session key.
|
||||
mfaDeviceArn=$1
|
||||
tokenCode=$2
|
||||
jsonOutput="$(aws sts get-session-token --serial-number "${mfaDeviceArn}" --token-code ${tokenCode})"
|
||||
export AWS_ACCESS_KEY_ID=$( echo "${jsonOutput}" | jq --raw-output '.Credentials.AccessKeyId' )
|
||||
export AWS_SECRET_ACCESS_KEY=$( echo "${jsonOutput}" | jq --raw-output '.Credentials.SecretAccessKey' )
|
||||
export AWS_SESSION_TOKEN=$( echo "${jsonOutput}" | jq --raw-output '.Credentials.SessionToken' )
|
||||
@@ -0,0 +1 @@
|
||||
../environments_scripts/repo/usr/local/bin/awsmfalogon.sh
|
||||
@@ -65,7 +65,7 @@ function shared_instance_execute() {
|
||||
local readme_file="$servers_dir/README"
|
||||
local comment_out_line_in_env_with_pattern='JAVA_HOME=\/opt\/jdk1.8.0_20'
|
||||
local comment_in_line_in_env_with_pattern='sapjvm_gc'
|
||||
local refreshInstance_file='/home/sailing/code/java/target/refreshInstance.sh'
|
||||
local refreshInstance_file='/usr/local/bin/refreshInstance.sh'
|
||||
|
||||
header "Sub instance setup"
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@ if [ $# -eq 0 ]; then
|
||||
echo "buildAndUpdateProduct [-b -u -g -t -a -r -o -c -p -v -m <config> -n <package> -l <port> -x <gwt-workers> -j <test-package>] [build|install|all|hot-deploy|remote-deploy|local-deploy|release]"
|
||||
echo ""
|
||||
echo "-g Disable GWT compile, no gwt files will be generated, old ones will be preserved."
|
||||
echo "-G Build forked GWT and gwt-maven-plugin locally instead of downloading Github release."
|
||||
echo "-b Build GWT permutation only for one browser and English language."
|
||||
echo "-t Disable tests"
|
||||
echo "-a Disable mobile projects (RaceCommittee App, e.g., in case no AndroidSDK is installed)"
|
||||
@@ -140,6 +141,7 @@ if [ $# -eq 0 ]; then
|
||||
echo " com.sap.sailing.monitoring. Only works if there is a fully built server available."
|
||||
echo " This parameter can also hold the name of the release if you are using the release command."
|
||||
echo "-l <telnet port> Telnet port the OSGi server is running. Optional but enables fully automatic hot-deploy."
|
||||
echo "-L in conjunction with the release sub-command, build the release only locally to dist/ and do not upload"
|
||||
echo "-s <target server> Name of server you want to use as target for install, hot-deploy or remote-reploy. This overrides default behaviour."
|
||||
echo "-w <ssh target> Target for remote-deploy and release. Must comply with the following format: user@server."
|
||||
echo "-u Run without confirmation messages. Use with extreme care."
|
||||
@@ -182,11 +184,12 @@ echo SERVERS_HOME is $SERVERS_HOME
|
||||
echo BRANCH is $active_branch
|
||||
echo VERSION is $VERSION_INFO
|
||||
|
||||
options=':bgtocpaArvm:n:l:s:w:x:j:u'
|
||||
options=':bgtocpaArvmLG:n:l:s:w:x:j:u'
|
||||
while getopts $options option
|
||||
do
|
||||
case $option in
|
||||
g) gwtcompile=0;;
|
||||
G) BUILD_GWT_FORK=1;;
|
||||
t) testing=0;;
|
||||
b) onegwtpermutationonly=1;;
|
||||
o) offline=1;;
|
||||
@@ -199,6 +202,7 @@ do
|
||||
m) MAVEN_SETTINGS=$OPTARG;;
|
||||
n) OSGI_BUNDLE_NAME=$OPTARG;;
|
||||
l) OSGI_TELNET_PORT=$OPTARG;;
|
||||
L) LOCAL_RELEASE_ONLY=1;;
|
||||
s) TARGET_SERVER_NAME=$OPTARG
|
||||
HAS_OVERWRITTEN_TARGET=1;;
|
||||
w) REMOTE_SERVER_LOGIN=$OPTARG;;
|
||||
@@ -358,12 +362,16 @@ INSTALL_FROM_RELEASE=$SIMPLE_VERSION_INFO
|
||||
|
||||
echo "Packaged release $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO.tar.gz! I've put an env.sh that matches the current branch to $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO/env.sh!"
|
||||
|
||||
echo "Checking the remote connection..."
|
||||
REMOTE_HOME=`ssh $REMOTE_SERVER_LOGIN 'echo $HOME/releases'`
|
||||
echo "Now uploading release to $REMOTE_SERVER_LOGIN:$REMOTE_HOME. Can take quite a while!"
|
||||
if [ "${LOCAL_RELEASE_ONLY}" != "1" ]; then
|
||||
echo "Checking the remote connection..."
|
||||
REMOTE_HOME=`ssh $REMOTE_SERVER_LOGIN 'echo $HOME/releases'`
|
||||
echo "Now uploading release to $REMOTE_SERVER_LOGIN:$REMOTE_HOME. Can take quite a while!"
|
||||
|
||||
`which scp` -r $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO $REMOTE_SERVER_LOGIN:$REMOTE_HOME/
|
||||
echo "Uploaded release to $REMOTE_HOME! Make sure to also put an updated env.sh if needed to the right place ($REMOTE_HOME/environment in most cases)"
|
||||
`which scp` -r $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO $REMOTE_SERVER_LOGIN:$REMOTE_HOME/
|
||||
echo "Uploaded release to $REMOTE_HOME! Make sure to also put an updated env.sh if needed to the right place ($REMOTE_HOME/environment in most cases)"
|
||||
else
|
||||
echo "Release available at $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO/, tarball at $PROJECT_HOME/dist/$SIMPLE_VERSION_INFO/$SIMPLE_VERSION_INFO.tar.gz"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$@" == "local-deploy" ]]; then
|
||||
@@ -659,10 +667,13 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
||||
echo "ANDROID_HOME=$ANDROID_HOME"
|
||||
PATH=$PATH:$ANDROID_HOME/tools/bin
|
||||
PATH=$PATH:$ANDROID_HOME/platform-tools
|
||||
SDK_MANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
|
||||
SDK_MANAGER="$ANDROID_HOME/cmdline-tools/8.0/bin/sdkmanager"
|
||||
if [ \! -x "$SDK_MANAGER" ]; then
|
||||
SDK_MANAGER="$ANDROID_HOME/tools/bin/sdkmanager.bat"
|
||||
fi
|
||||
echo "SDK_MANAGER=${SDK_MANAGER}"
|
||||
echo "cmdline-tools:"
|
||||
ls -l "$ANDROID_HOME/cmdline-tools/"
|
||||
|
||||
BUILD_TOOLS_VERSION=`grep "buildTools = " build.gradle | cut -d "\"" -f 2`
|
||||
echo "BUILD_TOOLS_VERSION=$BUILD_TOOLS_VERSION"
|
||||
@@ -748,8 +759,13 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
||||
|
||||
extra="$extra -P with-not-android-relevant,!with-mobile"
|
||||
if [ $gwtcompile -eq 1 ]; then
|
||||
echo "Building and installing forked GWT version..."
|
||||
JAVA_HOME="${JAVA8_HOME}" `dirname $0`/install-gwt "${PROJECT_HOME}"
|
||||
if [ "${BUILD_GWT_FORK}" = "1" ]; then
|
||||
echo "Building and installing forked GWT version..."
|
||||
JAVA_HOME="${JAVA8_HOME}" `dirname $0`/install-gwt "${PROJECT_HOME}"
|
||||
else
|
||||
echo "Downloading and installing forked GWT version..."
|
||||
`dirname $0`/install-gwt-from-fork-releases https://github.com/SAP/gwt-forward-serialization-rpc https://github.com/SAP/gwt-maven-plugin-forward-serialization-rpc 2.11.0 .
|
||||
fi
|
||||
fi
|
||||
echo "Using following command: mvn $extra -DargLine=\"$APP_PARAMETERS\" -fae -s $MAVEN_SETTINGS $clean install"
|
||||
echo "Maven version used: `mvn --version`"
|
||||
|
||||
@@ -1,30 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "$0 [-t -r ] <bugid>"
|
||||
echo "$0 <bugid>"
|
||||
echo ""
|
||||
echo "-t Disable tests"
|
||||
echo "-r Build release"
|
||||
echo
|
||||
echo "Constructs a Hudson job for the given bugid"
|
||||
echo "Example: $0 -r 4221"
|
||||
echo "Builds a Hudson job for bug branch bug4221, linking to the Bugzilla bug and building a release"
|
||||
echo "Example: $0 4221"
|
||||
echo "Builds a Hudson job for bug branch bug4221, linking to the Bugzilla bug and copying a release"
|
||||
echo "from Github to https://releases.sapsailing.com if the Github Actions Workflow built one"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
options='tr'
|
||||
while getopts $options option
|
||||
do
|
||||
case $option in
|
||||
t) SKIP_TESTS=1;;
|
||||
r) BUILD_RELEASE=1;;
|
||||
\?) echo "Invalid option"
|
||||
exit 4;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
||||
BUG_ID="$1"
|
||||
|
||||
CONFIGFILE=$(mktemp mylocalconfigXXXX.xml)
|
||||
@@ -42,25 +27,47 @@ curl -s -X GET $COPY_TEMPLATE_CONFIG_URL -u "$USERNAME:$PASSWORD" -o "$CONFIGFIL
|
||||
# On macosx is gnu-sed needed
|
||||
if [[ "$OSTYPE" == *"$OS_FOR_GSED"* ]]; then
|
||||
echo "Using gsed"
|
||||
gsed -i'' -e 's|<description>..*</description>|<description>This is the build job for \<a href=\"'$BUGZILLA_BASE'/show_bug.cgi?id='$BUG_ID'\"\>Bug '$BUG_ID'\</a\></description>|' -e 's|<disabled>true</disabled>|<disabled>false</disabled>|' "$CONFIGFILE"
|
||||
gsed -i'' -e 's|<description>..*</description>|<description>This is the CI job for \<a href=\"'$BUGZILLA_BASE'/show_bug.cgi?id='$BUG_ID'\"\>Bug '$BUG_ID'\</a\></description>|' -e 's|<disabled>true</disabled>|<disabled>false</disabled>|' "$CONFIGFILE"
|
||||
else
|
||||
sed -i -e 's|<description>..*</description>|<description>This is the build job for \<a href=\"'$BUGZILLA_BASE'/show_bug.cgi?id='$BUG_ID'\"\>Bug '$BUG_ID'\</a\></description>|' -e 's|<disabled>true</disabled>|<disabled>false</disabled>|' "$CONFIGFILE"
|
||||
sed -i -e 's|<description>..*</description>|<description>This is the CI job for \<a href=\"'$BUGZILLA_BASE'/show_bug.cgi?id='$BUG_ID'\"\>Bug '$BUG_ID'\</a\></description>|' -e 's|<disabled>true</disabled>|<disabled>false</disabled>|' "$CONFIGFILE"
|
||||
fi
|
||||
|
||||
if [ "$SKIP_TESTS" = "1" ]; then
|
||||
if [[ "$OSTYPE" == *"$OS_FOR_GSED"* ]]; then
|
||||
gsed -i'' -e 's|<command>\([^<]*\)build *</command>|<command>\1-t build</command>|' "$CONFIGFILE"
|
||||
else
|
||||
sed -i -e 's|<command>\([^<]*\)build *</command>|<command>\1-t build</command>|' "$CONFIGFILE"
|
||||
fi
|
||||
fi
|
||||
if [ "$BUILD_RELEASE" = "1" ]; then
|
||||
if [[ "$OSTYPE" == *"$OS_FOR_GSED"* ]]; then
|
||||
gsed -i'' -e 's|<command>\([^<]*\)</command>|<command>\1 \&\& PATH=/usr/local/bin:${PATH} configuration/buildAndUpdateProduct.sh -n bug'$BUG_ID' -w trac@sapsailing.com -u release</command>|' "$CONFIGFILE"
|
||||
else
|
||||
sed -i -e 's|<command>\([^<]*\)</command>|<command>\1 \&\& PATH=/usr/local/bin:${PATH} configuration/buildAndUpdateProduct.sh -n bug'$BUG_ID' -w trac@sapsailing.com -u release</command>|' "$CONFIGFILE"
|
||||
fi
|
||||
# On macosx is gnu-sed needed
|
||||
if [[ "$OSTYPE" == *"$OS_FOR_GSED"* ]]; then
|
||||
echo "Using gsed"
|
||||
gsed -i'' -n -e ':loop
|
||||
/<command>/b InCommand
|
||||
p
|
||||
$b
|
||||
N
|
||||
D
|
||||
b loop
|
||||
:InCommand
|
||||
s/BRANCH/'bug${BUG_ID}'/g
|
||||
/<\/command>/p
|
||||
/<\/command>/b End
|
||||
N
|
||||
b InCommand
|
||||
:End
|
||||
' "$CONFIGFILE"
|
||||
else
|
||||
sed -i -n -e ':loop
|
||||
/<command>/b InCommand
|
||||
p
|
||||
$b
|
||||
N
|
||||
D
|
||||
b loop
|
||||
:InCommand
|
||||
s/BRANCH/'bug${BUG_ID}'/g
|
||||
/<\/command>/p
|
||||
/<\/command>/b End
|
||||
N
|
||||
b InCommand
|
||||
:End
|
||||
' "$CONFIGFILE"
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" == *"$OS_FOR_GSED"* ]]; then
|
||||
gsed -i'' -e '/<branches>$/{
|
||||
N
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
* * * * * export PATH=/bin:/usr/bin:/usr/local/bin; sleep $(( $RANDOM * 60 / 32768 )); update_authorized_keys_for_landscape_managers_if_changed $( cat /root/ssh-key-reader.token ) https://security-service.sapsailing.com /root 2>&1 >>/var/log/sailing.err
|
||||
# NOTICE: Please try to reference the customised crontabs at $GIT_HOME/configuration/crontabs or use
|
||||
# the build_crontab_and_setup_files command in imageupgrade_functions.sh. This file has been maintained for continuity, but is deprecated.
|
||||
@@ -1,7 +1,27 @@
|
||||
This is the crontab repo and it contains one line crontabs for all the different environments.
|
||||
These files are concatenated by the build-crontab-and-cp-files script. Any time the crontab should contain
|
||||
a user's home directory, instead write PATH_OF_HOME_DIR_TO_REPLACE; if the crontab should
|
||||
contain the path to the git directory, instead write PATH_OF_GIT_HOME_DIR_TO_REPLACE.
|
||||
These are replaced by the build-crontab-and-cp-filesscript.
|
||||
a user's home directory, instead write PATH_OF_HOME_DIR_TO_REPLACE.
|
||||
These are replaced by the build-crontab-and-cp-files script found under
|
||||
configuration/environments_scripts.
|
||||
|
||||
Further replacements in the crontab snippets can be controlled by the names used for the
|
||||
files or symbolic links used in the users/ directories, as follows:
|
||||
|
||||
crontab-snippet@{PARAM1}={VALUE1}@{PARAM2}={VALUE2}...
|
||||
|
||||
will replace all occurrences of PARAM1 in the snippet by VALUE1, etc. The values can be
|
||||
empty. If a value shall contain an @ sign, use @@ instead. For a / (slash) character
|
||||
use an underscore _ character, and to produce a single underscore, double it (__), as
|
||||
illustrated by the following example:
|
||||
|
||||
crontab-snippet@EMAIL_ADDRESS=john.doe@@example.com@HOME_DIR=_home_john__doe_
|
||||
|
||||
It is good practice to name a reusable crontab snippet such that its parameters are
|
||||
listed in its name, separated from the name and from each other with @-signs, as in
|
||||
|
||||
crontab-snippet@USER@EMAIL_ADDRESS
|
||||
|
||||
which would indicate that two placeholders exist in the snippet that a name for a symbolic
|
||||
link referencing this snippet shall configure.
|
||||
|
||||
Note: theses files are symbolically linked to, so beware of the ramifications of changes.
|
||||
@@ -1 +0,0 @@
|
||||
15 12 * * * PATH_OF_GIT_HOME_DIR_TO_REPLACE/configuration/downloadNewArchivedTracTracEvents.sh PATH_OF_HOME_DIR_TO_REPLACE/static/TracTracTracks "PATH_OF_GIT_HOME_DIR_TO_REPLACE">PATH_OF_HOME_DIR_TO_REPLACE/downloadNewArchivedTracTracEvents.out 2>PATH_OF_HOME_DIR_TO_REPLACE/downloadNewArchivedTracTracEvents.err
|
||||
@@ -1 +1 @@
|
||||
* * * * * PATH_OF_GIT_HOME_DIR_TO_REPLACE/configuration/notify-unhealthy-mongodb 2>PATH_OF_HOME_DIR_TO_REPLACE/notify-unhealthy-mongodb.err >PATH_OF_HOME_DIR_TO_REPLACE/notify-unhealthy-mongodb.out
|
||||
* * * * * export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin; notify-unhealthy-mongodb 2>/var/log/notify-unhealthy-mongodb.err >/var/log/notify-unhealthy-mongodb.out
|
||||
@@ -1 +0,0 @@
|
||||
*/10 * * * * export PATH=/bin:/usr/bin:/usr/local/bin; syncgit PATH_OF_GIT_HOME_DIR_TO_REPLACE
|
||||
@@ -1 +0,0 @@
|
||||
* * * * * export PATH=/bin:/usr/bin:/usr/local/bin; sleep $(( $RANDOM * 60 / 32768 )); update_authorized_keys_for_landscape_managers_if_changed $( cat PATH_OF_HOME_DIR_TO_REPLACE/ssh-key-reader.token ) https://security-service.sapsailing.com PATH_OF_HOME_DIR_TO_REPLACE # 2>&1 >>/var/log/sailing.err
|
||||
+1
-1
@@ -1 +1 @@
|
||||
* * * * * export PATH=/bin:/usr/bin:/usr/local/bin; sleep $(( $RANDOM * 60 / 32768 )); update_authorized_keys_for_landscape_managers_if_changed $( cat PATH_OF_HOME_DIR_TO_REPLACE/ssh-key-reader.token ) https://security-service.sapsailing.com /home/ec2-user # 2>&1 >>/var/log/sailing.err
|
||||
* * * * * export PATH=/bin:/usr/bin:/usr/local/bin; sleep $(( $RANDOM * 60 / 32768 )); update_authorized_keys_for_landscape_managers_if_changed $( cat PATH_OF_HOME_DIR_TO_REPLACE/ssh-key-reader.token ) https://security-service.sapsailing.com USER_HOME_DIR # 2>&1 >>/var/log/sailing.err
|
||||
@@ -1 +1 @@
|
||||
10 12 * * * PATH_OF_GIT_HOME_DIR_TO_REPLACE/configuration/update-tractrac-urls-to-archive.sh "PATH_OF_GIT_HOME_DIR_TO_REPLACE" >PATH_OF_HOME_DIR_TO_REPLACE/update-tractrac-urls-to-archive.out 2>PATH_OF_HOME_DIR_TO_REPLACE/update-tractrac-urls-to-archive.err
|
||||
10 12 * * * export PATH=/bin:/usr/bin:/usr/local/bin; update-tractrac-urls-to-archive.sh "/root/code" >/var/log/update-tractrac-urls-to-archive.out 2>/var/log/update-tractrac-urls-to-archive.err
|
||||
@@ -1 +0,0 @@
|
||||
environments_scripts/central_reverse_proxy/files/usr/local/bin/downloadNewArchivedTracTracEvents.sh
|
||||
@@ -1,5 +1,19 @@
|
||||
TELNET_PORT=14888
|
||||
SERVER_PORT=8888
|
||||
MONGODB_HOST=dbserver.internal.sapsailing.com
|
||||
MONGODB_PORT=10202
|
||||
EXPEDITION_PORT=2010
|
||||
DEPLOY_TO=security_service
|
||||
REPLICATE_MASTER_SERVLET_PORT=8888
|
||||
REPLICATE_MASTER_QUEUE_HOST=rabbit.internal.sapsailing.com
|
||||
REPLICATE_MASTER_QUEUE_PORT=5672
|
||||
REPLICATION_HOST=rabbit.internal.sapsailing.com
|
||||
ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -Dorg.eclipse.jetty.LEVEL=OFF -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -Drestore.tracked.races=true -Dpolardata.source.url=https://www.sapsailing.com -XX:ThreadPriorityPolicy=2"
|
||||
SERVER_STARTUP_NOTIFY=axel.uhl@sap.com
|
||||
BUILD_COMPLETE_NOTIFY=axel.uhl@sap.com
|
||||
|
||||
# To enable the use of the shared SecurityService and SharedSailingData from security-service.sapsailing.com:
|
||||
ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -Dsecurity.sharedAcrossSubdomainsOf=sapsailing.com -Dsecurity.baseUrlForCrossDomainStorage=https://security-service.sapsailing.com -Dgwt.acceptableCrossDomainStorageRequestOriginRegexp=https?://(.*\.)?sapsailing\.com(:[0-9]*)?$"
|
||||
ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -Dsecurity.sharedAcrossSubdomainsOf=sapsailing.com -Dsecurity.baseUrlForCrossDomainStorage=https://security-service.sapsailing.com -Dgwt.acceptableCrossDomainStorageRequestOriginRegexp=https?://((.*\.)?sapsailing\.com)|((.*\.)?sailing\.omegatiming\.com)(:[0-9]*)?$"
|
||||
# For the security-service master instance, don't activate replication from security-service
|
||||
#REPLICATE_ON_START=com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sailing.shared.server.impl.SharedSailingDataImpl,com.sap.sse.landscape.aws.impl.AwsLandscapeStateImpl
|
||||
#REPLICATE_MASTER_SERVLET_HOST=security-service.sapsailing.com
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
The environments_scripts directory contains more directories, which map to environment types, each holding scripts and files useful to that environment. Each environment type also contains a "users" folder, which contains subfolders for each user on the system.
|
||||
The build-crontab-and-cp-files script uses the contents of these subfolders to create and install a customised crontab for each user in the folder. It does this by concatenating one liner crontabs into an uber crontab.
|
||||
Any time the crontab should contain a user's home directory, instead write PATH_OF_HOME_DIR_TO_REPLACE; if the crontab should
|
||||
contain the path to the git directory, instead write PATH_OF_GIT_HOME_DIR_TO_REPLACE.
|
||||
These are replaced by the build-crontab-and-cp-files script with the correct paths
|
||||
The environments_scripts directory contains more directories, which map to environment
|
||||
types, each holding scripts and files useful to that environment.
|
||||
Each environment type also contains a "users" folder, which contains
|
||||
subfolders for each user on the system.
|
||||
The build-crontab-and-cp-files script uses the contents of these subfolders to
|
||||
create and install a customised crontab for each user in the folder.
|
||||
It does this by concatenating one liner crontab files/links following the naming
|
||||
pattern "crontab*" into an uber crontab.
|
||||
|
||||
For crontab snippet placeholder substitutions, please see
|
||||
${GIT_ROOT}/configuration/crontabs/README.
|
||||
|
||||
environment_scripts (directory)
|
||||
|
|
||||
|_environement_type (directory)
|
||||
|_{environment_type} (directory)
|
||||
|
|
||||
|_usefulScripts
|
||||
|_files (directory)
|
||||
| |
|
||||
| |_{contents to copy to environment, starting from / folder}
|
||||
|
|
||||
|_users (directory)
|
||||
|
|
||||
|_user1 (directory)
|
||||
|
|
||||
|_symbolicLinks (to configuration/crontabs)
|
||||
|
||||
|
||||
The build-crontab-and-cp-files script is not installed to /usr/local/bin,
|
||||
so in order to actually perform this crontab setup and file copying from
|
||||
on an instance, you will need to use the build_crontab_and_setup-files function
|
||||
from imageupgrade_functions.sh, which copies the latest environment_scripts
|
||||
folder onto the local instance and then executes the build-crontab-and-cp-files
|
||||
script, within the directory. This allows for a single dependency and calling method.
|
||||
Furthermore, it means the latest version of the build-crontab-and-cp-files script
|
||||
is always used.
|
||||
@@ -3,66 +3,142 @@
|
||||
# Purpose: The first parameter is an image type. This script iterates over the image types' USER folders,
|
||||
# concatenating all the symbolic links (referencing locations within configuration/crontabs) into one crontab
|
||||
# file for each user. It also takes the name of the user containing a copy of the git repo as well as the name of the
|
||||
# dir within that user to go to. The created files for each user go into that user's home dir and are installed for
|
||||
# that user too.
|
||||
# Within these crontab stubs, are certain string literals, which are replaced: PATH_OF_GIT_HOME_DIR_TO_REPLACE becomes
|
||||
# the absolute path to the git home dir, and PATH_OF_HOME_DIR_TO_REPLACE is changed to the path of the home directory
|
||||
# in which the crontab will be installed.
|
||||
# dir within that user to go to. The created crontab for each user go into that user's home dir and are installed for
|
||||
# that user too.
|
||||
# Within these crontab stubs, are certain string literals, which are replaced: PATH_OF_HOME_DIR_TO_REPLACE is changed
|
||||
# to the path of the home directory in which the crontab will be installed (ie. that user's home).
|
||||
# Furthermore, within the users folder optional uid, gid and groups files an exist. uid should store the user's uid,
|
||||
# gid the group id and groups should have secondary groups (one per line). The user is added to the secondary groups
|
||||
# after all users are created.
|
||||
# Useful files are also copied across from the "files" dir within each image type.
|
||||
# Finally, the script ends by performing a deamon reload and reenabling all the systemd units in the files directory,
|
||||
# so that the correct wants, requires, etc. are installed/linked. Any systemd units, within the mimicked filesystem,
|
||||
# will be automatically enabled.
|
||||
|
||||
if [[ $# -lt 3 || $# -gt 5 ]]; then
|
||||
echo "$0 <ENVIRONMENT_TYPE> <USER_WITH_COPY_OF_REPO> <RELATIVE_PATH_OF_GIT_DIR_WITHIN_USER> "
|
||||
echo ""
|
||||
echo "Where USER_WITH_COPY_OF_REPO is a user that contains a checked out copy of the main git."
|
||||
echo "And where RELATIVE_PATH_OF_GIT_DIR_WITHIN_USER is the path to the git repo from the USER_WITH_COPY_OF_REPO's home directory."
|
||||
echo "Use the s(imple) flag to only do the crontab and not copy any files across. The n(o install) flag can be used to setup the crontabs but not install them."
|
||||
exit 2
|
||||
fi
|
||||
# will be automatically enabled.
|
||||
# For options, see the help below.
|
||||
# This script should NOT be installed into /usr/local/bin. See the README for more.
|
||||
. repo/usr/local/bin/imageupgrade_functions.sh
|
||||
INSTALL_CRONTAB="true"
|
||||
options='sn'
|
||||
COPY_FILES="true"
|
||||
CREATE_CRONTABS="true"
|
||||
options='fnc'
|
||||
while getopts $options option
|
||||
do
|
||||
case $option in
|
||||
c) CREATE_CRONTABS="false";;
|
||||
f) COPY_FILES="false";;
|
||||
n) INSTALL_CRONTAB="false";;
|
||||
s) ONLY_CRONTAB="true";;
|
||||
\?) echo "Invalid option"
|
||||
\?) echo "Invalid option" # getops replaces unknown options with a question mark, so we have to escape the question mark.
|
||||
exit 4;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1)) # shift the arguments along so -s is no longer $1
|
||||
shift $((OPTIND-1)) # shift the arguments along so there are no options in the arguments anymore.
|
||||
if [[ "$#" -ne 1 ]]; then
|
||||
echo "$0 [ -f ] [ -n ] [ -c ] <ENVIRONMENT_TYPE>"
|
||||
echo ""
|
||||
echo "Use the f(iles) flag to disable file copying. Use the c(rontab) flag to disable the creation of users and the creation of crontab files for those users."
|
||||
echo "If the c flag is not used then the n(o install) flag can be used to setup the crontabs but not install them."
|
||||
exit 2
|
||||
fi
|
||||
ENV_TYPE="$1"
|
||||
GIT_USER="$2"
|
||||
RELATIVE_GIT_DIR_NAME="$3"
|
||||
cd "$(dirname "$0")/${ENV_TYPE}"
|
||||
if [[ -d "groups" ]]; then
|
||||
cd "groups"
|
||||
for group in * ; do
|
||||
[[ -e "$group" ]] || continue
|
||||
echo "CREATING GROUP $group"
|
||||
if [[ -e "$group"/gid ]]; then
|
||||
groupadd --gid $(cat "$group"/gid) "$group"
|
||||
else
|
||||
groupadd "$group"
|
||||
fi
|
||||
done
|
||||
cd ..
|
||||
fi
|
||||
if [[ -d "users" ]]; then
|
||||
cd "users"
|
||||
GIT_PATH="$(eval echo $(printf "~%q" "$GIT_USER"))/${RELATIVE_GIT_DIR_NAME}" # The path to the git repo that contains the files needed.
|
||||
for dir in $(ls -d */ ); do
|
||||
USERNAME=$(echo $dir | sed "s/\/$//") # Dirname is the username. The trailing slash is removed.
|
||||
HOME_DIR=$(eval echo $(printf "~%q" "$USERNAME")) # The path to the home dir of the user whose cronjob will be installed.
|
||||
# Clear the crontab file before assembling it from the snippets:
|
||||
> $HOME_DIR/crontab
|
||||
for crontab in $(ls ${USERNAME}/crontab*); do
|
||||
cat "${crontab}">> $HOME_DIR/crontab
|
||||
done
|
||||
sed -i "s|PATH_OF_GIT_HOME_DIR_TO_REPLACE|${GIT_PATH}|g" $HOME_DIR/crontab # Sets correct path to the git repo within the crontab.
|
||||
sed -i "s|PATH_OF_HOME_DIR_TO_REPLACE|${HOME_DIR}|g" $HOME_DIR/crontab # Sets the correct path to the home dir of the user whose crontab will be installed.
|
||||
echo "">>$HOME_DIR/crontab # Adds a newline
|
||||
if [[ "$INSTALL_CRONTAB" == "true" ]]; then
|
||||
crontab -u ${USERNAME} $HOME_DIR/crontab # Install the crontab in the given user's home dir.
|
||||
for dir in *; do
|
||||
[[ -d "$dir" ]] || continue
|
||||
USERNAME="$dir"
|
||||
user_UID=""
|
||||
user_GID=""
|
||||
echo "STARTING WORK ON USER $USERNAME"
|
||||
if [[ -f "$USERNAME"/uid ]]; then
|
||||
user_UID=$(cat "$USERNAME"/uid)
|
||||
echo "UID => $user_UID"
|
||||
fi
|
||||
if [[ -f "$USERNAME"/gid ]]; then
|
||||
user_GID=$(cat "$USERNAME"/gid)
|
||||
echo "GID => $user_GID"
|
||||
groupadd --gid "$user_GID" "$USERNAME"
|
||||
[[ "$?" -eq 0 ]] || echo "Group id or name already exists." >&2
|
||||
fi
|
||||
if [[ -n "$user_UID" && -n "$user_GID" ]]; then
|
||||
adduser --uid "$user_UID" --gid "$user_GID" "$USERNAME"
|
||||
elif [[ -n "$user_UID" ]]; then
|
||||
adduser --uid "$user_UID" "$USERNAME"
|
||||
elif [[ -n "$user_GID" ]]; then
|
||||
adduser --gid "$user_GID" "$USERNAME"
|
||||
else
|
||||
adduser "$USERNAME"
|
||||
fi
|
||||
id "$USERNAME"
|
||||
if [[ "$?" -eq 0 ]]; then
|
||||
HOME_DIR=$(eval echo $(printf "~%q" "$USERNAME")) # The path to the home dir of the user whose cronjob will be installed.
|
||||
# Sets permissions of home dir.
|
||||
[[ -e "$USERNAME"/permissions ]] && chmod "$(cat "$USERNAME"/permissions)" "$HOME_DIR"
|
||||
if [[ "$CREATE_CRONTABS" == "true" ]]; then # 9 is the exit code indicating the username already exists.
|
||||
# Clear the crontab file before assembling it from the snippets:
|
||||
> $HOME_DIR/crontab
|
||||
echo "# Note that this file should not be edited manually. Please instead make use of the build_crontab_and_setup_files command in imageupgrade_functions.sh">>"$HOME_DIR"/crontab
|
||||
echo "# which concatenates the crontabs found at users/*/* into this file. Please edit these crontab stubs in the git repo to make permanent changes.">>"$HOME_DIR"/crontab
|
||||
echo "">>"$HOME_DIR"/crontab
|
||||
for crontab in ${USERNAME}/crontab*; do
|
||||
[[ -e $crontab ]] || continue
|
||||
cat "${crontab}" | eval $( get_replacements_from_crontab_filename_as_sed_command "${crontab}" ) >> $HOME_DIR/crontab
|
||||
echo "">> $HOME_DIR/crontab
|
||||
done
|
||||
chown "$USERNAME":"$USERNAME" $HOME_DIR/crontab
|
||||
sed -i "s|PATH_OF_HOME_DIR_TO_REPLACE|${HOME_DIR}|g" "$HOME_DIR"/crontab # Sets the correct path to the home dir of the user whose crontab will be installed.
|
||||
sed -i '/^$/d' $HOME_DIR/crontab # purges random empty lines.
|
||||
echo "">>$HOME_DIR/crontab # Adds a newline
|
||||
if [[ "$INSTALL_CRONTAB" == "true" ]]; then
|
||||
crontab -u ${USERNAME} $HOME_DIR/crontab # Install the crontab in the given user's home dir.
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "****** finished user ******"
|
||||
done
|
||||
# Add to groups after all the groups exist.
|
||||
for dir in *; do
|
||||
[[ -d "$dir" ]] || continue
|
||||
USERNAME="$dir"
|
||||
[[ -e "$USERNAME"/groups ]] || continue
|
||||
echo "ADDING $USERNAME TO THE GROUPS SPECIFIED IN THEIR 'groups' FILE"
|
||||
for group in $(cat "$USERNAME"/groups); do
|
||||
gpasswd --add "$USERNAME" "$group"
|
||||
done
|
||||
done
|
||||
cd .. # exits users folder, which is essential for the next commands
|
||||
fi
|
||||
if [[ "$ONLY_CRONTAB" != "true" && -d "files" ]]; then
|
||||
# Add users to groups, specified in ENVIRONMENT_TYPE/groups/GROUP/users. Used if groups exist which aren't directly related to a user.
|
||||
if [[ -d "groups" ]]; then
|
||||
cd "groups"
|
||||
for group in * ; do
|
||||
[[ -e "$group"/users ]] || continue
|
||||
echo "ADDING USERS IN 'users' FILE TO GROUP $group"
|
||||
for user in $(cat "$group"/users); do
|
||||
gpasswd -a "$user" "$group"
|
||||
done
|
||||
done
|
||||
cd ..
|
||||
fi
|
||||
if [[ "$COPY_FILES" == "true" && -d "files" ]]; then
|
||||
cd "files"
|
||||
\cp -rL * / # copies all files accross, realising any symbolic links. The backslash escapes the alias cp -i.
|
||||
\cp --remove-destination -rL * / # copies all files accross, realising any symbolic links. The backslash escapes the alias cp -i.
|
||||
systemctl daemon-reload
|
||||
for unit in $(find etc/systemd/system -type f); do
|
||||
for unit in etc/systemd/system/*; do
|
||||
[[ -f "$unit" ]] || continue
|
||||
systemctl reenable /"${unit}" # to recreate all the dependency links.
|
||||
done
|
||||
cd ..
|
||||
fi
|
||||
fi
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
+2
-2
@@ -9,5 +9,5 @@ RequiredBy=multi-user.target
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=/etc/init.d/hudson start
|
||||
ExecStop=/etc/init.d/hudson stop
|
||||
ExecStart=/usr/local/bin/hudson start
|
||||
ExecStop=/usr/local/bin/hudson stop
|
||||
@@ -60,13 +60,14 @@ RETVAL=0
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting Hudson "
|
||||
# Note, the pidfile isn't written to below but it is checked to see if the program is already running.
|
||||
daemon --user "$HUDSON_USER" --pidfile "$HUDSON_PID_FILE" "$JAVA_CMD" "$PARAMS" &> /var/tmp/hudson.log &
|
||||
RETVAL=$?
|
||||
if [ $RETVAL = 0 ]; then
|
||||
success
|
||||
echo > "$HUDSON_PID_FILE" # just in case we fail to find it
|
||||
MY_SESSION_ID=`/bin/ps h -o sess -p $$`
|
||||
# get PID
|
||||
# get PID. Note the ww means unlimited width.
|
||||
/bin/ps hww -u "$HUDSON_USER" -o sess,ppid,pid,cmd | \
|
||||
while read sess ppid pid cmd; do
|
||||
[ "$ppid" = 1 ] || continue
|
||||
|
||||
+17
-32
@@ -7,14 +7,11 @@
|
||||
# of the instance you just launched in AWS as only argument. This will then
|
||||
# turn the instance into an application server for the SAP Sailing Analytics
|
||||
# application. When the script is done you may log in to look around and check
|
||||
# things. When done, shut down the instance (Stop, not Terminate) and create
|
||||
# an image off of it, naming it, e.g., "SAP Sailing Analytics 2.0" and
|
||||
# also tagging its root volume snapshot as, e.g., "SAP Sailing Analytics 2.0 (Root)".
|
||||
# If you want to use the resulting image in production, also tag it with
|
||||
# tag key "image-type" and tag value "sailing-analytics-server".
|
||||
# things, such as the landscape managers keys, aws credentials, and that
|
||||
# the necessary scripts are in /usr/local/bin.
|
||||
if [ $# != 0 ]; then
|
||||
SERVER=$1
|
||||
$(dirname $0)/../sailing_server_setup/setup-sailing-server.sh ${SERVER}
|
||||
$(dirname $0)/../sailing_server/setup-sailing-server.sh ${SERVER}
|
||||
scp "${0}" ec2-user@${SERVER}:
|
||||
ssh -A ec2-user@${SERVER} ./$( basename "${0}" )
|
||||
else
|
||||
@@ -22,16 +19,16 @@ else
|
||||
echo "Running on an AWS EC2 instance as user ${USER} / $(whoami), starting setup..."
|
||||
# Install secrets
|
||||
scp root@sapsailing.com:dev-secrets /tmp
|
||||
scp root@sapsailing.com:hudson-aws-credentials /tmp
|
||||
sudo mv /tmp/dev-secrets /root/secrets
|
||||
sudo mkdir /root/.aws
|
||||
sudo mv /tmp/hudson-aws-credentials /root/.aws/credentials
|
||||
sudo chown root:root /root/secrets /root/.aws/credentials
|
||||
sudo chmod 600 /root/secrets /root/.aws/credentials
|
||||
sudo chown root:root /root/secrets
|
||||
sudo chmod 600 /root/secrets
|
||||
. imageupgrade_functions.sh
|
||||
if ! build_crontab_and_setup_files build_server; then
|
||||
exit 1
|
||||
fi
|
||||
# Make eu-west-1 the default region for any aws CLI interaction:
|
||||
sudo su - -c "aws configure set default.region eu-west-1"
|
||||
# Create "hudson" user and clear its directory again which is to become a mount point
|
||||
sudo adduser hudson
|
||||
# Clear "hudson" user's directory again which is to become a mount point
|
||||
sudo su - hudson -c "rm -rf /home/hudson/* /home/hudson/.* 2>/dev/null"
|
||||
sudo mkdir /usr/lib/hudson
|
||||
sudo chown hudson /usr/lib/hudson
|
||||
@@ -39,19 +36,12 @@ else
|
||||
sudo chgrp hudson /var/log/hudson
|
||||
sudo chmod g+w /var/log/hudson
|
||||
sudo wget -O /usr/lib/hudson/hudson.war "https://static.sapsailing.com/hudson.war.patched-with-mail-1.6.2"
|
||||
# Link hudson file to /etc/init.d
|
||||
sudo ln -s /home/sailing/code/configuration/hudson_instance_setup/hudson /etc/init.d
|
||||
# Link hudson service to /etc/systemd/system
|
||||
sudo ln -s /home/sailing/code/configuration/hudson_instance_setup/hudson.service /etc/systemd/system
|
||||
# Link Hudson system-wide config file:
|
||||
sudo ln -s /home/sailing/code/configuration/hudson_instance_setup/sysconfig-hudson /etc/sysconfig/hudson
|
||||
# Link additional script files needed for Hudson build server control:
|
||||
sudo ln -s /home/sailing/code/configuration/launchhudsonslave /usr/local/bin
|
||||
sudo ln -s /home/sailing/code/configuration/launchhudsonslave-java11 /usr/local/bin
|
||||
sudo ln -s /home/sailing/code/configuration/aws-automation/getLatestImageOfType.sh /usr/local/bin
|
||||
# Enable NFS server
|
||||
sudo systemctl enable nfs-server.service
|
||||
sudo systemctl start nfs-server.service
|
||||
# Enable the mongod.service on which the sailing service depends:
|
||||
sudo systemctl enable mongod.service
|
||||
sudo systemctl start mongod.service
|
||||
# Enable the service:
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable hudson.service
|
||||
@@ -59,18 +49,11 @@ else
|
||||
sudo su - -c "cat <<EOF >>/etc/exports
|
||||
/home/hudson/android-sdk-linux 172.31.0.0/16(rw,nohide,no_root_squash)
|
||||
EOF
|
||||
"
|
||||
# Allow "hudson" user to launch EC2 instances:
|
||||
sudo su - -c "cat <<EOF >>/etc/sudoers.d/hudsoncanlaunchec2instances
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
EOF
|
||||
"
|
||||
# Install DEV server
|
||||
sudo su - sailing -c "mkdir /home/sailing/servers/DEV
|
||||
cd /home/sailing/servers/DEV
|
||||
cat <<EOF | /home/sailing/code/java/target/refreshInstance.sh auto-install-from-stdin
|
||||
cat <<EOF | /usr/local/bin/refreshInstance.sh auto-install-from-stdin
|
||||
USE_ENVIRONMENT=dev-server
|
||||
EOF
|
||||
"
|
||||
@@ -82,8 +65,10 @@ EOF
|
||||
sudo chgrp sailing /home/sailing/servers/DEV/configuration/mail.properties
|
||||
# Start the sailing.service with empty/no user data, so the next boot is recognized as a re-boot
|
||||
sudo systemctl start sailing.service
|
||||
sudo systemctl stop sailing.service
|
||||
sudo mount -a
|
||||
echo "Now follow the instructions on the wiki for creating-ec2-image-for-hudson-from-scratch.md. It explains how to mount"
|
||||
echo "the hudson volume and setup the aws + ssh keys."
|
||||
echo "See https://wiki.sapsailing.com/wiki/info/landscape/creating-ec2-image-for-hudson-from-scratch.md"
|
||||
else
|
||||
echo "Not running on an AWS instance; refusing to run setup!" >&2
|
||||
echo "To prepare an instance running in AWS, provide its external IP as argument to this script." >&2
|
||||
@@ -0,0 +1 @@
|
||||
1002
|
||||
-1
@@ -1 +0,0 @@
|
||||
../../../../crontabs/crontab-update-authorized-keys
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../crontabs/crontab-update-authorized-keys@USER_HOME_DIR
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../repo/etc/logrotate.d/mongodb
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
net:
|
||||
port: 10201
|
||||
bindIp: 0.0.0.0
|
||||
storage:
|
||||
dbPath: "/var/lib/mongodb/archive"
|
||||
directoryPerDB: true
|
||||
wiredTiger:
|
||||
engineConfig:
|
||||
cacheSizeGB: 2
|
||||
systemLog:
|
||||
destination: file
|
||||
path: "/var/log/mongodb/archive.log"
|
||||
replication:
|
||||
replSetName: "archive"
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
net:
|
||||
port: 10203
|
||||
bindIp: 0.0.0.0
|
||||
storage:
|
||||
dbPath: "/var/lib/mongodb/hidden-live-replica"
|
||||
directoryPerDB: true
|
||||
wiredTiger:
|
||||
engineConfig:
|
||||
cacheSizeGB: 2
|
||||
systemLog:
|
||||
destination: file
|
||||
path: "/var/log/mongodb/hidden-live-replica.log"
|
||||
replication:
|
||||
replSetName: "live"
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
net:
|
||||
port: 10202
|
||||
bindIp: 0.0.0.0
|
||||
storage:
|
||||
dbPath: "/var/lib/mongodb/slow"
|
||||
directoryPerDB: true
|
||||
wiredTiger:
|
||||
engineConfig:
|
||||
cacheSizeGB: 2
|
||||
systemLog:
|
||||
destination: file
|
||||
path: "/var/log/mongodb/slow.log"
|
||||
replication:
|
||||
replSetName: "slow"
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Ensures all files under /var/lib/mongo are owned by mongod user/group
|
||||
Requires=ephemeralvolume.service
|
||||
After=ephemeralvolume.service
|
||||
Before=mongod.service
|
||||
|
||||
[Install]
|
||||
RequiredBy=mongod.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=/bin/chown -R mongod:mongod /var/lib/mongodb/
|
||||
configuration/environments_scripts/central_mongo_setup/files/etc/systemd/system/imageupgrade.service
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/etc/systemd/system/imageupgrade.service
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
[Unit]
|
||||
Description=MongoDB Database Server
|
||||
Documentation=https://docs.mongodb.org/manual
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=mongod
|
||||
Group=mongod
|
||||
ExecStart=/bin/mongod --config /etc/mongodb/mongod-archive.conf
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=always
|
||||
PIDFile=/var/run/mongodb/mongod-archive.pid
|
||||
RuntimeDirectory=mongodb
|
||||
# file size
|
||||
LimitFSIZE=infinity
|
||||
# cpu time
|
||||
LimitCPU=infinity
|
||||
# virtual memory size
|
||||
LimitAS=infinity
|
||||
# open files
|
||||
LimitNOFILE=64000
|
||||
# processes/threads
|
||||
LimitNPROC=64000
|
||||
# locked memory
|
||||
LimitMEMLOCK=infinity
|
||||
# total threads (user+kernel)
|
||||
TasksMax=infinity
|
||||
TasksAccounting=false
|
||||
|
||||
# Recommended limits for mongod as specified in
|
||||
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
[Unit]
|
||||
Description=MongoDB Database Server
|
||||
Documentation=https://docs.mongodb.org/manual
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=mongod
|
||||
Group=mongod
|
||||
ExecStart=/bin/mongod --config /etc/mongodb/mongod-hidden-live-replica.conf
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=always
|
||||
PIDFile=/var/run/mongodb/mongod-hidden-live-replicaslow.pid
|
||||
RuntimeDirectory=mongodb
|
||||
# file size
|
||||
LimitFSIZE=infinity
|
||||
# cpu time
|
||||
LimitCPU=infinity
|
||||
# virtual memory size
|
||||
LimitAS=infinity
|
||||
# open files
|
||||
LimitNOFILE=64000
|
||||
# processes/threads
|
||||
LimitNPROC=64000
|
||||
# locked memory
|
||||
LimitMEMLOCK=infinity
|
||||
# total threads (user+kernel)
|
||||
TasksMax=infinity
|
||||
TasksAccounting=false
|
||||
|
||||
# Recommended limits for mongod as specified in
|
||||
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
[Unit]
|
||||
Description=MongoDB Database Server
|
||||
Documentation=https://docs.mongodb.org/manual
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=mongod
|
||||
Group=mongod
|
||||
ExecStart=/bin/mongod --config /etc/mongodb/mongod-slow.conf
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=always
|
||||
PIDFile=/var/run/mongodb/mongod-slow.pid
|
||||
RuntimeDirectory=mongodb
|
||||
# file size
|
||||
LimitFSIZE=infinity
|
||||
# cpu time
|
||||
LimitCPU=infinity
|
||||
# virtual memory size
|
||||
LimitAS=infinity
|
||||
# open files
|
||||
LimitNOFILE=64000
|
||||
# processes/threads
|
||||
LimitNPROC=64000
|
||||
# locked memory
|
||||
LimitMEMLOCK=infinity
|
||||
# total threads (user+kernel)
|
||||
TasksMax=infinity
|
||||
TasksAccounting=false
|
||||
|
||||
# Recommended limits for mongod as specified in
|
||||
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+3
-2
@@ -12,7 +12,8 @@ else
|
||||
fi
|
||||
|
||||
DB=$1
|
||||
DUMPBASEDIR=/mnt/mongodb-slow
|
||||
DUMPBASEDIR=/var/lib/mongodb/slow/.dump
|
||||
mkdir -p "${DUMPBASEDIR}"
|
||||
|
||||
if [ "$CONFIRMATION" = "" ]; then
|
||||
echo -n "This will drop the database $DB in the archive DB before importing. Are you sure (y/n)? "
|
||||
@@ -44,4 +45,4 @@ else
|
||||
echo "Hashes of old and new are empty of differ: ${ORIGINAL_HASH} and ${ARCHIVE_HASH}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ${DUMPBASEDIR}"
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
useremail=$1
|
||||
for port in 10201 10202 10203; do
|
||||
for db in `echo "rs.secondaryOk()
|
||||
show dbs
|
||||
quit()" | mongo --port $port | tail -n +3 | grep -v "^bye$" | awk '{print $1;}'`; do
|
||||
match_1=`echo "rs.secondaryOk()
|
||||
db.USERS.find({EMAIL: \"$useremail\"})" | mongo --quiet --port $port $db`
|
||||
match_2=`echo "rs.secondaryOk()
|
||||
db.COMPETITORS.find({email: \"$useremail\"})" | mongo --quiet --port $port $db`
|
||||
if [ "$match_1" != "" -o "$match_2" != "" ]; then
|
||||
echo ${db} on port $port: $match_1 $match_2
|
||||
fi
|
||||
done
|
||||
done
|
||||
# Run this from a device with access to root@sapsailing.com to easily find a user by their email, where $1 is the user:
|
||||
# ssh -A root@sapsailing.com ssh -A ec2-user@dbserver.internal.sapsailing.com finduserbyemail $1
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Upgrades the AWS EC2 MongoDB instance that this script is assumed to be executed on.
|
||||
# The steps are as follows:
|
||||
|
||||
. imageupgrade_functions.sh
|
||||
|
||||
clean_mongo_pid() {
|
||||
rm -f /var/run/mongodb/mongod.pid
|
||||
}
|
||||
|
||||
LOGON_USER_HOME=/home/ec2-user
|
||||
METADATA=$( get_ec2_user_data )
|
||||
echo "Metadata: ${METADATA}"
|
||||
if echo "${METADATA}" | grep -q "^image-upgrade$"; then
|
||||
echo "Image upgrade..."
|
||||
run_yum_update
|
||||
build_crontab_and_setup_files central_mongo_setup
|
||||
clean_startup_logs
|
||||
clean_mongo_pid
|
||||
finalize
|
||||
fi
|
||||
configuration/environments_scripts/central_mongo_setup/files/usr/local/bin/imageupgrade_functions.sh
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/imageupgrade_functions.sh
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/notify-operators
|
||||
+2
-1
@@ -9,10 +9,11 @@ for db in $MONGODBS; do
|
||||
read health
|
||||
read state
|
||||
if [ "$health" != "1" ]; then
|
||||
echo "MongoDB replica set $replicaset unhealthy, node $server is in state $state\
|
||||
echo "MongoDB replica set $replicaset unhealthy, node $server is in state $state\
|
||||
|
||||
Check status of $db urgently. To unsubscribe, change $MAILINGLIST on `hostname`." | mail -s "MongoDB Replica Set \"$replicaset\" Unhealthy" `cat "$MAILINGLIST"`
|
||||
fi
|
||||
done
|
||||
)
|
||||
done
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# Fetches the latest trac trac urls from the Mongo archive replica set, currently residing on the central mongo instance,
|
||||
# and commits the changes to the master branch of the main Git. Note that local state is prioritised if there is a conflict.
|
||||
# Parameter 1 is an optional absolute path to the Git root. If unspecified, then the default is /home/wiki/gitwiki.
|
||||
if [[ $# -eq 0 ]]; then
|
||||
GIT_ROOT=/home/wiki/gitwiki
|
||||
else
|
||||
GIT_ROOT=$1
|
||||
fi
|
||||
PATH_TO_TRAC_TRAC_URLS="configuration/tractrac-json-urls"
|
||||
urls=$(mongo --quiet "mongodb://dbserver.internal.sapsailing.com:10201/winddb?replicaSet=archive" --eval 'db.TRACTRAC_CONFIGURATIONS.find({}, {TT_CONFIG_JSON_URL : 1}).toArray()' | grep -v ObjectId | jq -r '.[].TT_CONFIG_JSON_URL' )
|
||||
if [[ "$?" -ne 0 || "$urls" == "null" ]]; then
|
||||
echo "Mongo db returns null for tractrac url discovery" | notify-operators "MongoDB/tractrac urls issue"
|
||||
exit 1
|
||||
else
|
||||
echo "${urls}" | sort -u >"${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
|
||||
cd "${GIT_ROOT}"
|
||||
git config pull.rebase false # ensure that diverging branches merge.
|
||||
branch_head=$(git rev-parse HEAD)
|
||||
stash_stack_size=$(git stash list | wc -l)
|
||||
git stash
|
||||
new_stash_stack_size=$(git stash list | wc -l)
|
||||
git pull
|
||||
if [[ "$stash_stack_size" -eq "$new_stash_stack_size" ]]; then
|
||||
echo "NO CHANGES STASHED" # This implies there were no changes to the tractrac urls or other changes in the workspace.
|
||||
else
|
||||
if git stash apply; then
|
||||
echo "STASH APPLIED CLEANLY"
|
||||
git stash drop
|
||||
git add "${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
|
||||
git commit -m "Updated tractrac-json-urls"
|
||||
git push
|
||||
else
|
||||
# prioritise existing state and local changes.
|
||||
echo "PRIORITISING LOCAL STATE, RESETTING HEAD AND APPLYING STASH."
|
||||
git reset --hard "$branch_head"
|
||||
git stash apply
|
||||
echo "The stash is still stored in the stack."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/update_authorized_keys_for_landscape_managers
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/update_authorized_keys_for_landscape_managers_if_changed
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/update_landscape_managers_mailing_list.sh
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
# Usage: Launch an Amazon EC2 instance from an Amazon Linux 2 AMI with
|
||||
# 16GB of root partition size and the "Database and Messaging" security group
|
||||
# using an SSH key for which you have a working private key available.
|
||||
# Make sure to launch it in the same AZ as your current "MongoDB Central"
|
||||
# instance, or you won't be able to attach the existing data volumes!
|
||||
# Then, run this script on your local computer, using the external IP address
|
||||
# of the instance you just launched in AWS as only argument. This will then
|
||||
# prepare the instance as a central MongoDB instance.
|
||||
# When the script is done you may log in to look around and check
|
||||
# things. When done, stop the running "MongoDB Central" instance and detach
|
||||
# its MongoDB data volumes as instructed below; attach them to the new instance,
|
||||
# then run "mount -a" and start the MongoDB processes using the service units:
|
||||
# - mongod-archive.service
|
||||
# - mongod-hidden-live-replica.service
|
||||
# - mongod-slow.service
|
||||
# as per the instructions printed to the console at the end of this script.
|
||||
# Name your instance "MongoDB Central" and assign the Route53 entry for
|
||||
# dbserver.internal.sapsailing.com to its internal IP address.
|
||||
if [ $# != 0 ]; then
|
||||
SERVER=$1
|
||||
scp "${0}" ec2-user@${SERVER}:
|
||||
ssh -A ec2-user@${SERVER} ./$( basename "${0}" )
|
||||
else
|
||||
if ec2-metadata | grep -q instance-id; then
|
||||
echo "Running on an AWS EC2 instance as user ${USER} / $(whoami), starting setup..."
|
||||
# Install standard packages:
|
||||
sudo yum -y update
|
||||
sudo yum -y install nvme-cli chrony cronie cronie-anacron jq mailx
|
||||
# Copy imageupgrade_function.sh
|
||||
scp -o StrictHostKeyChecking=no -p root@sapsailing.com:/home/wiki/gitwiki/configuration/environments_scripts/repo/usr/local/bin/imageupgrade_functions.sh .
|
||||
sudo mv imageupgrade_functions.sh /usr/local/bin
|
||||
# build-crontab
|
||||
. imageupgrade_functions.sh
|
||||
build_crontab_and_setup_files central_mongo_setup
|
||||
# obtain root SSH key from key vault:
|
||||
setup_keys "central_mongo_setup"
|
||||
# Create some swap space for the case mountnvmeswap hasn't created any
|
||||
setup_swap 6000
|
||||
# Install MongoDB 4.4 and configure as replica set "live"
|
||||
setup_mongo_4_4
|
||||
# Disable default mongod service unit derived from /etc/init.d/mongod:
|
||||
sudo systemctl disable mongod.service
|
||||
# Prepare for the MongoDB volume mounts:
|
||||
sudo mkdir -p /var/lib/mongodb/hidden-live-replica
|
||||
sudo mkdir -p /var/lib/mongodb/slow
|
||||
sudo mkdir -p /var/lib/mongodb/archive
|
||||
sudo chown -R mongod:mongod /var/lib/mongodb
|
||||
sudo su - -c "cat << EOF >>/etc/fstab
|
||||
UUID=d59156c5-7833-425a-9143-3a83b01f32b9 /var/lib/mongodb/hidden-live-replica xfs defaults,relatime 1 1
|
||||
UUID=5586bc6e-d399-42e8-a0a0-bf2d65f8c703 /var/lib/mongodb/archive xfs defaults,relatime 1 1
|
||||
UUID=0c73fde1-4719-405a-ab0e-bffd0aaf8d84 /var/lib/mongodb/slow xfs defaults,relatime 1 1
|
||||
EOF
|
||||
"
|
||||
scp root@sapsailing.com:ssh-key-reader.token /tmp
|
||||
sudo mv /tmp/ssh-key-reader.token /root
|
||||
sudo chown root:root /root/ssh-key-reader.token
|
||||
sudo chmod 600 /root/ssh-key-reader.token
|
||||
setup_sshd_resilience
|
||||
echo "Part 1 has completed. Now carry out the following steps in the AWS Console:"
|
||||
echo " - stop the \"MongoDB Central\" instance"
|
||||
echo " - detach the following volumes from it:"
|
||||
echo " * Hidden MongoDB Live Replica encrypted"
|
||||
echo " * MongoDB Archive winddb encrypted"
|
||||
echo " * MongoDB Archive slow encrypted"
|
||||
echo " - attach these volumes to the new instance"
|
||||
echo " - issue the following commands on the new instance:"
|
||||
echo " mount -a"
|
||||
echo " chmod -R mongod:mongod /var/lib/mongodb"
|
||||
echo " systemctl start mongod-archive.service"
|
||||
echo " systemctl start mongod-hidden-live-replica.service"
|
||||
echo " systemctl start mongod-slow.service"
|
||||
echo " - assign the Route53 DNS record \"dbserver.internal.sapsailing.com\" to this"
|
||||
echo " instance's internal IP address $( ec2-metadata --local-ipv4 | sed -e 's/^local-ipv4: //' )"
|
||||
echo " - name the new instance \"MongoDB Central\" and terminate the old instance"
|
||||
echo " - tag the instance with mongo-replica-sets = live:10203,archive:10201,slow:10202"
|
||||
else
|
||||
echo "Not running on an AWS instance; refusing to run setup!" >&2
|
||||
echo "To prepare an instance running in AWS, provide its external IP as argument to this script." >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
File renamed without changes.
+1
@@ -0,0 +1 @@
|
||||
../../../../crontabs/crontab-update-authorized-keys@USER_HOME_DIR
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../crontabs/crontab-update-landscape-managers-mailing-list
|
||||
File renamed without changes.
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"Comment": "Alter logfiles record ",
|
||||
"Changes": [
|
||||
{
|
||||
"Action": "UPSERT",
|
||||
"ResourceRecordSet": {
|
||||
"Name": "logfiles.internal.sapsailing.com",
|
||||
"Type": "A",
|
||||
"TTL": 60,
|
||||
"ResourceRecords": [
|
||||
{
|
||||
"Value": "LOGFILES_INTERNAL_IP"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Action": "UPSERT",
|
||||
"ResourceRecordSet": {
|
||||
"Name": "smtp.internal.sapsailing.com",
|
||||
"Type": "A",
|
||||
"TTL": 60,
|
||||
"ResourceRecords": [
|
||||
{
|
||||
"Value": "SMTP_INTERNAL_IP"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+1550
File diff suppressed because it is too large.
Load diff
+1572
File diff suppressed because it is too large.
Load diff
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/logrotate /etc/logrotate.conf
|
||||
EXITVALUE=$?
|
||||
if [ $EXITVALUE != 0 ]; then
|
||||
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
|
||||
fi
|
||||
exit 0
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
su -l -c '/usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" >>/var/log/awstats-cron.out 2>>/var/log/awstats-cron.err'
|
||||
#exec /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" >>/var/log/awstats-cron.out 2>>/var/log/awstats-cron.err
|
||||
exit 0
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Check if sail-insight.com cert needs renewing
|
||||
/usr/bin/sudo -u certbot docker run --rm --name certbot -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" -v "/home/trac/sail-insight-website/:/home/trac/sail-insight-website" certbot/certbot renew && service httpd reload
|
||||
exit 0
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
cd /var/log/old
|
||||
unique_ips_per_referrer_fast `find . -name 'access_log*'` bundesliga2015_elb_access_log.gz tw2015_elb_access_log.gz >/dev/null 2>/dev/null
|
||||
exit 0
|
||||
@@ -0,0 +1 @@
|
||||
latest
|
||||
@@ -0,0 +1,720 @@
|
||||
######################################
|
||||
# Time Format Options (required)
|
||||
######################################
|
||||
#
|
||||
# The hour (24-hour clock) [00,23]; leading zeros are permitted but not required.
|
||||
# The minute [00,59]; leading zeros are permitted but not required.
|
||||
# The seconds [00,60]; leading zeros are permitted but not required.
|
||||
# See `man strftime` for more details
|
||||
#
|
||||
# The following time format works with any of the
|
||||
# Apache/NGINX's log formats below.
|
||||
#
|
||||
time-format %H:%M:%S
|
||||
#
|
||||
# Google Cloud Storage or
|
||||
# The time in microseconds since the Unix epoch.
|
||||
#
|
||||
#time-format %f
|
||||
|
||||
# Squid native log format
|
||||
#
|
||||
#time-format %s
|
||||
|
||||
######################################
|
||||
# Date Format Options (required)
|
||||
######################################
|
||||
#
|
||||
# The date-format variable followed by a space, specifies
|
||||
# the log format date containing any combination of regular
|
||||
# characters and special format specifiers. They all begin with a
|
||||
# percentage (%) sign. See `man strftime`
|
||||
#
|
||||
# The following date format works with any of the
|
||||
# Apache/NGINX's log formats below.
|
||||
#
|
||||
date-format %d/%b/%Y
|
||||
#
|
||||
# AWS | Amazon CloudFront (Download Distribution)
|
||||
# AWS | Elastic Load Balancing
|
||||
# W3C (IIS)
|
||||
#
|
||||
#date-format %Y-%m-%d
|
||||
#
|
||||
# Google Cloud Storage or
|
||||
# The time in microseconds since the Unix epoch.
|
||||
#
|
||||
#date-format %f
|
||||
|
||||
# Squid native log format
|
||||
#
|
||||
#date-format %s
|
||||
|
||||
######################################
|
||||
# Log Format Options (required)
|
||||
######################################
|
||||
#
|
||||
# The log-format variable followed by a space or \t for
|
||||
# tab-delimited, specifies the log format string.
|
||||
#
|
||||
# NOTE: If the time/date is a timestamp in seconds or microseconds
|
||||
# %x must be used instead of %d & %t to represent the date & time.
|
||||
|
||||
# NCSA Combined Log Format
|
||||
#log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
|
||||
# NCSA Combined with virtual host name as prefix:
|
||||
log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
|
||||
|
||||
# NCSA Combined Log Format with Virtual Host
|
||||
#log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
|
||||
|
||||
# Common Log Format (CLF)
|
||||
#log-format %h %^[%d:%t %^] "%r" %s %b
|
||||
|
||||
# Common Log Format (CLF) with Virtual Host
|
||||
#log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b
|
||||
|
||||
# W3C
|
||||
#log-format %d %t %h %^ %^ %^ %^ %r %^ %s %b %^ %^ %u %R
|
||||
|
||||
# Squid native log format
|
||||
#log-format %^ %^ %^ %v %^: %x.%^ %~%L %h %^/%s %b %m %U
|
||||
|
||||
# AWS | Amazon CloudFront (Download Distribution)
|
||||
#log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^
|
||||
|
||||
# Google Cloud Storage
|
||||
#log-format "%x","%h",%^,%^,"%m","%U","%s",%^,"%b","%D",%^,"%R","%u"
|
||||
|
||||
# AWS | Elastic Load Balancing
|
||||
#log-format %dT%t.%^ %^ %h:%^ %^ %T %^ %^ %^ %s %^ %b "%r" "%u"
|
||||
|
||||
# AWSS3 | Amazon Simple Storage Service (S3)
|
||||
#log-format %^[%d:%t %^] %h %^"%r" %s %^ %b %^ %L %^ "%R" "%u"
|
||||
|
||||
# Virtualmin Log Format with Virtual Host
|
||||
#log-format %h %^ %v %^[%d:%t %^] "%r" %s %b "%R" "%u"
|
||||
|
||||
# In addition to specifying the raw log/date/time formats, for
|
||||
# simplicity, any of the following predefined log format names can be
|
||||
# supplied to the log/date/time-format variables. GoAccess can also
|
||||
# handle one predefined name in one variable and another predefined
|
||||
# name in another variable.
|
||||
#
|
||||
#log-format COMBINED
|
||||
#log-format VCOMBINED
|
||||
#log-format COMMON
|
||||
#log-format VCOMMON
|
||||
#log-format W3C
|
||||
#log-format SQUID
|
||||
#log-format CLOUDFRONT
|
||||
#log-format CLOUDSTORAGE
|
||||
#log-format AWSELB
|
||||
#log-format AWSS3
|
||||
|
||||
######################################
|
||||
# UI Options
|
||||
######################################
|
||||
|
||||
# Choose among color schemes
|
||||
# 1 : Monochrome
|
||||
# 2 : Green
|
||||
# 3 : Monokai (if 256-colors supported)
|
||||
#
|
||||
#color-scheme 3
|
||||
|
||||
# Prompt log/date configuration window on program start.
|
||||
#
|
||||
config-dialog false
|
||||
|
||||
# Color highlight active panel.
|
||||
#
|
||||
hl-header true
|
||||
|
||||
# Specify a custom CSS file in the HTML report.
|
||||
#
|
||||
#html-custom-css /path/file.css
|
||||
|
||||
# Specify a custom JS file in the HTML report.
|
||||
#
|
||||
#html-custom-js /path/file.js
|
||||
|
||||
# Set default HTML preferences.
|
||||
#
|
||||
# NOTE: A valid JSON object is required.
|
||||
# DO NOT USE A MULTILINE JSON OBJECT.
|
||||
# The parser will only parse the value next to `html-prefs` (single line)
|
||||
# It allows the ability to customize each panel plot. See example below.
|
||||
#
|
||||
#html-prefs {"theme":"bright","perPage":5,"layout":"horizontal","showTables":true,"visitors":{"plot":{"chartType":"bar"}}}
|
||||
|
||||
# Set HTML report page title and header.
|
||||
#
|
||||
#html-report-title My Awesome Web Stats
|
||||
|
||||
# Format JSON output using tabs and newlines.
|
||||
#
|
||||
json-pretty-print false
|
||||
|
||||
# Turn off colored output. This is the default output on
|
||||
# terminals that do not support colors.
|
||||
# true : for no color output
|
||||
# false : use color-scheme
|
||||
#
|
||||
no-color false
|
||||
|
||||
# Don't write column names in the terminal output. By default, it displays
|
||||
# column names for each available metric in every panel.
|
||||
#
|
||||
no-column-names false
|
||||
|
||||
# Disable summary metrics on the CSV output.
|
||||
#
|
||||
no-csv-summary false
|
||||
|
||||
# Disable progress metrics.
|
||||
#
|
||||
no-progress false
|
||||
|
||||
# Disable scrolling through panels on TAB.
|
||||
#
|
||||
no-tab-scroll false
|
||||
|
||||
# Do not show the last updated field displayed in the HTML generated report.
|
||||
#
|
||||
#no-html-last-updated true
|
||||
|
||||
# Enable mouse support on main dashboard.
|
||||
#
|
||||
with-mouse false
|
||||
|
||||
# Maximum number of items to show per panel.
|
||||
# Note: Only the CSV and JSON outputs allow a maximum greater than the
|
||||
# default value of 366.
|
||||
#
|
||||
#max-items 366
|
||||
|
||||
# Custom colors for the terminal output
|
||||
# Tailor GoAccess to suit your own tastes.
|
||||
#
|
||||
# Color Syntax:
|
||||
# DEFINITION space/tab colorFG#:colorBG# [[attributes,] PANEL]
|
||||
#
|
||||
# FG# = foreground color number [-1...255] (-1 = default terminal color)
|
||||
# BG# = background color number [-1...255] (-1 = default terminal color)
|
||||
#
|
||||
# Optionally:
|
||||
#
|
||||
# It is possible to apply color attributes, such as:
|
||||
# bold,underline,normal,reverse,blink.
|
||||
# Multiple attributes are comma separated
|
||||
#
|
||||
# If desired, it is possible to apply custom colors per panel, that is, a
|
||||
# metric in the REQUESTS panel can be of color A, while the same metric in the
|
||||
# BROWSERS panel can be of color B.
|
||||
#
|
||||
# The following is a 256 color scheme (hybrid palette)
|
||||
#
|
||||
#color COLOR_MTRC_HITS color110:color-1
|
||||
#color COLOR_MTRC_VISITORS color173:color-1
|
||||
#color COLOR_MTRC_DATA color221:color-1
|
||||
#color COLOR_MTRC_BW color167:color-1
|
||||
#color COLOR_MTRC_AVGTS color143:color-1
|
||||
#color COLOR_MTRC_CUMTS color247:color-1
|
||||
#color COLOR_MTRC_MAXTS color186:color-1
|
||||
#color COLOR_MTRC_PROT color109:color-1
|
||||
#color COLOR_MTRC_MTHD color139:color-1
|
||||
#color COLOR_MTRC_HITS_PERC color186:color-1
|
||||
#color COLOR_MTRC_HITS_PERC_MAX color139:color-1
|
||||
#color COLOR_MTRC_HITS_PERC_MAX color139:color-1 VISITORS
|
||||
#color COLOR_MTRC_HITS_PERC_MAX color139:color-1 OS
|
||||
#color COLOR_MTRC_HITS_PERC_MAX color139:color-1 BROWSERS
|
||||
#color COLOR_MTRC_HITS_PERC_MAX color139:color-1 VISIT_TIMES
|
||||
#color COLOR_MTRC_VISITORS_PERC color186:color-1
|
||||
#color COLOR_MTRC_VISITORS_PERC_MAX color139:color-1
|
||||
#color COLOR_PANEL_COLS color243:color-1
|
||||
#color COLOR_BARS color250:color-1
|
||||
#color COLOR_ERROR color231:color167
|
||||
#color COLOR_SELECTED color7:color167
|
||||
#color COLOR_PANEL_ACTIVE color7:color237
|
||||
#color COLOR_PANEL_HEADER color250:color235
|
||||
#color COLOR_PANEL_DESC color242:color-1
|
||||
#color COLOR_OVERALL_LBLS color243:color-1
|
||||
#color COLOR_OVERALL_VALS color167:color-1
|
||||
#color COLOR_OVERALL_PATH color186:color-1
|
||||
#color COLOR_ACTIVE_LABEL color139:color235 bold underline
|
||||
#color COLOR_BG color250:color-1
|
||||
#color COLOR_DEFAULT color243:color-1
|
||||
#color COLOR_PROGRESS color7:color110
|
||||
|
||||
######################################
|
||||
# Server Options
|
||||
######################################
|
||||
|
||||
# Specify IP address to bind server to.
|
||||
#
|
||||
#addr 0.0.0.0
|
||||
|
||||
# Run GoAccess as daemon (if --real-time-html enabled).
|
||||
#
|
||||
#daemonize false
|
||||
|
||||
# Ensure clients send the specified origin header upon the WebSocket
|
||||
# handshake.
|
||||
#
|
||||
#origin http://example.org
|
||||
|
||||
# The port to which the connection is being attempted to connect.
|
||||
# By default GoAccess' WebSocket server listens on port 7890
|
||||
# See man page or http://gwsocket.io for details.
|
||||
#
|
||||
#port 7890
|
||||
|
||||
# Enable real-time HTML output.
|
||||
#
|
||||
#real-time-html true
|
||||
|
||||
# Path to TLS/SSL certificate.
|
||||
# Note that ssl-cert and ssl-key need to be used to enable TLS/SSL.
|
||||
#
|
||||
#ssl-cert /path/ssl/domain.crt
|
||||
|
||||
# Path to TLS/SSL private key.
|
||||
# Note that ssl-cert and ssl-key need to be used to enable TLS/SSL.
|
||||
#
|
||||
#ssl-key /path/ssl/domain.key
|
||||
|
||||
# URL to which the WebSocket server responds. This is the URL supplied
|
||||
# to the WebSocket constructor on the client side.
|
||||
#
|
||||
# Optionally, it is possible to specify the WebSocket URI scheme, such as ws://
|
||||
# or wss:// for unencrypted and encrypted connections.
|
||||
# e.g., ws-url wss://goaccess.io
|
||||
#
|
||||
# If GoAccess is running behind a proxy, you could set the client side
|
||||
# to connect to a different port by specifying the host followed by a
|
||||
# colon and the port.
|
||||
# e.g., ws-url goaccess.io:9999
|
||||
#
|
||||
# By default, it will attempt to connect to localhost. If GoAccess is
|
||||
# running on a remote server, the host of the remote server should be
|
||||
# specified here. Also, make sure it is a valid host and NOT an http
|
||||
# address.
|
||||
#
|
||||
#ws-url goaccess.io
|
||||
|
||||
# Path to read named pipe (FIFO).
|
||||
#
|
||||
#fifo-in /tmp/wspipein.fifo
|
||||
|
||||
# Path to write named pipe (FIFO).
|
||||
#
|
||||
#fifo-in /tmp/wspipeout.fifo
|
||||
|
||||
######################################
|
||||
# File Options
|
||||
######################################
|
||||
|
||||
# Specify the path to the input log file. If set, it will take
|
||||
# priority over -f from the command line.
|
||||
#
|
||||
#log-file /var/log/apache2/access.log
|
||||
|
||||
# Send all debug messages to the specified file.
|
||||
#
|
||||
#debug-file debug.log
|
||||
|
||||
# Specify a custom configuration file to use. If set, it will take
|
||||
# priority over the global configuration file (if any).
|
||||
#
|
||||
#config-file <filename>
|
||||
|
||||
# Log invalid requests to the specified file.
|
||||
#
|
||||
#invalid-requests <filename>
|
||||
|
||||
# Do not load the global configuration file.
|
||||
#
|
||||
#no-global-config false
|
||||
|
||||
######################################
|
||||
# Parse Options
|
||||
######################################
|
||||
|
||||
# Enable a list of user-agents by host. For faster parsing, do not
|
||||
# enable this flag.
|
||||
#
|
||||
agent-list false
|
||||
|
||||
# Enable IP resolver on HTML|JSON|CSV output.
|
||||
#
|
||||
with-output-resolver false
|
||||
|
||||
# Exclude an IPv4 or IPv6 from being counted.
|
||||
# Ranges can be included as well using a dash in between
|
||||
# the IPs (start-end).
|
||||
#
|
||||
#exclude-ip 127.0.0.1
|
||||
#exclude-ip 192.168.0.1-192.168.0.100
|
||||
#exclude-ip ::1
|
||||
#exclude-ip 0:0:0:0:0:ffff:808:804-0:0:0:0:0:ffff:808:808
|
||||
|
||||
# Include HTTP request method if found. This will create a
|
||||
# request key containing the request method + the actual request.
|
||||
#
|
||||
# <yes|no> [default: yes]
|
||||
#
|
||||
http-method yes
|
||||
|
||||
# Include HTTP request protocol if found. This will create a
|
||||
# request key containing the request protocol + the actual request.
|
||||
#
|
||||
# <yes|no> [default: yes]
|
||||
#
|
||||
http-protocol yes
|
||||
|
||||
# Write output to stdout given one of the following files and the
|
||||
# corresponding extension for the output format:
|
||||
#
|
||||
# /path/file.csv - Comma-separated values (CSV)
|
||||
# /path/file.json - JSON (JavaScript Object Notation)
|
||||
# /path/file.html - HTML
|
||||
#
|
||||
#output-format /path/file.html
|
||||
|
||||
# Ignore request's query string.
|
||||
# i.e., www.google.com/page.htm?query => www.google.com/page.htm
|
||||
#
|
||||
# Note: Removing the query string can greatly decrease memory
|
||||
# consumption, especially on timestamped requests.
|
||||
#
|
||||
no-query-string false
|
||||
|
||||
# Disable IP resolver on terminal output.
|
||||
#
|
||||
no-term-resolver false
|
||||
|
||||
# Treat non-standard status code 444 as 404.
|
||||
#
|
||||
444-as-404 false
|
||||
|
||||
# Add 4xx client errors to the unique visitors count.
|
||||
#
|
||||
4xx-to-unique-count false
|
||||
|
||||
# Include static files that contain a query string in the static files
|
||||
# panel.
|
||||
# e.g., /fonts/fontawesome-webfont.woff?v=4.0.3
|
||||
#
|
||||
all-static-files false
|
||||
|
||||
# Date specificity. Possible values: `date` (default), or `hr`.
|
||||
#
|
||||
#date-spec hr
|
||||
|
||||
# Decode double-encoded values.
|
||||
#
|
||||
double-decode false
|
||||
|
||||
# Enable parsing/displaying the given panel.
|
||||
#
|
||||
#enable-panel VISITORS
|
||||
#enable-panel REQUESTS
|
||||
#enable-panel REQUESTS_STATIC
|
||||
#enable-panel NOT_FOUND
|
||||
#enable-panel HOSTS
|
||||
#enable-panel OS
|
||||
#enable-panel BROWSERS
|
||||
#enable-panel VISIT_TIMES
|
||||
#enable-panel VIRTUAL_HOSTS
|
||||
#enable-panel REFERRERS
|
||||
#enable-panel REFERRING_SITES
|
||||
#enable-panel KEYPHRASES
|
||||
#enable-panel STATUS_CODES
|
||||
#enable-panel REMOTE_USER
|
||||
#enable-panel GEO_LOCATION
|
||||
|
||||
# Hour specificity. Possible values: `hr` (default), or `min` (tenth
|
||||
# of a minute).
|
||||
#
|
||||
#hour-spec min
|
||||
|
||||
# Ignore crawlers from being counted.
|
||||
# This will ignore robots listed under browsers.c
|
||||
# Note that it will count them towards the total
|
||||
# number of requests, but excluded from any of the panels.
|
||||
#
|
||||
ignore-crawlers false
|
||||
|
||||
# Parse and display crawlers only.
|
||||
# This will ignore robots listed under browsers.c
|
||||
# Note that it will count them towards the total
|
||||
# number of requests, but excluded from any of the panels.
|
||||
#
|
||||
crawlers-only false
|
||||
|
||||
# Ignore parsing and displaying the given panel.
|
||||
#
|
||||
#ignore-panel VISITORS
|
||||
#ignore-panel REQUESTS
|
||||
#ignore-panel REQUESTS_STATIC
|
||||
#ignore-panel NOT_FOUND
|
||||
#ignore-panel HOSTS
|
||||
#ignore-panel OS
|
||||
#ignore-panel BROWSERS
|
||||
#ignore-panel VISIT_TIMES
|
||||
#ignore-panel VIRTUAL_HOSTS
|
||||
ignore-panel REFERRERS
|
||||
#ignore-panel REFERRING_SITES
|
||||
ignore-panel KEYPHRASES
|
||||
#ignore-panel STATUS_CODES
|
||||
#ignore-panel REMOTE_USER
|
||||
#ignore-panel GEO_LOCATION
|
||||
|
||||
# Ignore referers from being counted.
|
||||
# This supports wild cards. For instance,
|
||||
# '*' matches 0 or more characters (including spaces)
|
||||
# '?' matches exactly one character
|
||||
#
|
||||
#ignore-referer *.domain.com
|
||||
#ignore-referer ww?.domain.*
|
||||
|
||||
# Ignore parsing and displaying one or multiple status code(s)
|
||||
#
|
||||
#ignore-status 400
|
||||
#ignore-status 502
|
||||
|
||||
# Number of lines from the access log to test against the provided
|
||||
# log/date/time format. By default, the parser is set to test 10
|
||||
# lines. If set to 0, the parser won't test any lines and will parse
|
||||
# the whole access log.
|
||||
#
|
||||
#num-tests 10
|
||||
|
||||
# Parse log and exit without outputting data.
|
||||
#
|
||||
#process-and-exit false
|
||||
|
||||
# Display real OS names. e.g, Windows XP, Snow Leopard.
|
||||
#
|
||||
real-os true
|
||||
|
||||
# Sort panel on initial load.
|
||||
# Sort options are separated by comma.
|
||||
# Options are in the form: PANEL,METRIC,ORDER
|
||||
#
|
||||
# Available metrics:
|
||||
# BY_HITS - Sort by hits
|
||||
# BY_VISITORS - Sort by unique visitors
|
||||
# BY_DATA - Sort by data
|
||||
# BY_BW - Sort by bandwidth
|
||||
# BY_AVGTS - Sort by average time served
|
||||
# BY_CUMTS - Sort by cumulative time served
|
||||
# BY_MAXTS - Sort by maximum time served
|
||||
# BY_PROT - Sort by http protocol
|
||||
# BY_MTHD - Sort by http method
|
||||
# Available orders:
|
||||
# ASC
|
||||
# DESC
|
||||
#
|
||||
#sort-panel VISITORS,BY_DATA,ASC
|
||||
#sort-panel REQUESTS,BY_HITS,ASC
|
||||
#sort-panel REQUESTS_STATIC,BY_HITS,ASC
|
||||
#sort-panel NOT_FOUND,BY_HITS,ASC
|
||||
#sort-panel HOSTS,BY_HITS,ASC
|
||||
#sort-panel OS,BY_HITS,ASC
|
||||
#sort-panel BROWSERS,BY_HITS,ASC
|
||||
#sort-panel VISIT_TIMES,BY_DATA,DESC
|
||||
#sort-panel VIRTUAL_HOSTS,BY_HITS,ASC
|
||||
#sort-panel REFERRERS,BY_HITS,ASC
|
||||
#sort-panel REFERRING_SITES,BY_HITS,ASC
|
||||
#sort-panel KEYPHRASES,BY_HITS,ASC
|
||||
#sort-panel STATUS_CODES,BY_HITS,ASC
|
||||
#sort-panel REMOTE_USER,BY_HITS,ASC
|
||||
#sort-panel GEO_LOCATION,BY_HITS,ASC
|
||||
|
||||
# Consider the following extensions as static files
|
||||
# The actual '.' is required and extensions are case sensitive
|
||||
# For a full list, uncomment the less common static extensions below.
|
||||
#
|
||||
static-file .css
|
||||
static-file .js
|
||||
static-file .jpg
|
||||
static-file .png
|
||||
static-file .gif
|
||||
static-file .ico
|
||||
static-file .jpeg
|
||||
static-file .pdf
|
||||
static-file .txt
|
||||
static-file .csv
|
||||
static-file .zip
|
||||
static-file .mp3
|
||||
static-file .mp4
|
||||
static-file .mpeg
|
||||
static-file .mpg
|
||||
static-file .exe
|
||||
static-file .swf
|
||||
static-file .woff
|
||||
static-file .woff2
|
||||
static-file .xls
|
||||
static-file .xlsx
|
||||
static-file .doc
|
||||
static-file .docx
|
||||
static-file .ppt
|
||||
static-file .pptx
|
||||
static-file .iso
|
||||
static-file .gz
|
||||
static-file .rar
|
||||
static-file .svg
|
||||
static-file .bmp
|
||||
static-file .tar
|
||||
static-file .tgz
|
||||
static-file .tiff
|
||||
static-file .tif
|
||||
static-file .ttf
|
||||
static-file .flv
|
||||
#static-file .less
|
||||
#static-file .ac3
|
||||
#static-file .avi
|
||||
#static-file .bz2
|
||||
#static-file .class
|
||||
#static-file .cue
|
||||
#static-file .dae
|
||||
#static-file .dat
|
||||
#static-file .dts
|
||||
#static-file .ejs
|
||||
#static-file .eot
|
||||
#static-file .eps
|
||||
#static-file .img
|
||||
#static-file .jar
|
||||
#static-file .map
|
||||
#static-file .mid
|
||||
#static-file .midi
|
||||
#static-file .mkv
|
||||
#static-file .odp
|
||||
#static-file .ods
|
||||
#static-file .odt
|
||||
#static-file .ogg
|
||||
#static-file .otf
|
||||
#static-file .pict
|
||||
#static-file .pls
|
||||
#static-file .ps
|
||||
#static-file .qt
|
||||
#static-file .rm
|
||||
#static-file .svgz
|
||||
#static-file .wav
|
||||
#static-file .webp
|
||||
|
||||
######################################
|
||||
# GeoIP Options
|
||||
# Only if configured with --enable-geoip
|
||||
######################################
|
||||
|
||||
# Standard GeoIP database for less memory usage.
|
||||
#
|
||||
#std-geoip false
|
||||
|
||||
# Specify path to GeoIP database file. i.e., GeoLiteCity.dat
|
||||
# .dat file needs to be downloaded from maxmind.com.
|
||||
#
|
||||
# For IPv4 City database:
|
||||
# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
|
||||
# gunzip GeoLiteCity.dat.gz
|
||||
#
|
||||
# For IPv6 City database:
|
||||
# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz
|
||||
# gunzip GeoLiteCityv6.dat.gz
|
||||
#
|
||||
# For IPv6 Country database:
|
||||
# wget -N http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
|
||||
# gunzip GeoIPv6.dat.gz
|
||||
#
|
||||
# Note: `geoip-city-data` is an alias of `geoip-database`
|
||||
#
|
||||
#geoip-database /usr/local/share/GeoIP/GeoLiteCity.dat
|
||||
|
||||
######################################
|
||||
# Tokyo Cabinet Options
|
||||
# Only if configured with --enable-tcb=btree
|
||||
######################################
|
||||
|
||||
# GoAccess has the ability to process logs incrementally through the on-disk
|
||||
# B+Tree database.
|
||||
#
|
||||
# It works in the following way:
|
||||
# - A data set must be persisted first with --keep-db-files, then the same data
|
||||
# set can be loaded with --load-from-disk.
|
||||
# - If new data is passed (piped or through a log file), it will append it to
|
||||
# the original data set.
|
||||
# - To preserve the data at all times, --keep-db-files must be used.
|
||||
# - If --load-from-disk is used without --keep-db-files, database files will be
|
||||
# deleted upon closing the program.
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Persist parsed data into disk. This should be set to
|
||||
# the first dataset prior to use `load-from-disk`.
|
||||
# Setting it to false will delete all database files
|
||||
# when exiting the program.
|
||||
#keep-db-files true
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Load previously stored data from disk.
|
||||
# Database files need to exist. See `keep-db-files`.
|
||||
#load-from-disk false
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Path where the on-disk database files are stored.
|
||||
# The default value is the /tmp/ directory
|
||||
# Note the trailing forward-slash.
|
||||
#
|
||||
#db-path /tmp/
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Set the size in bytes of the extra mapped memory.
|
||||
# The default value is 0.
|
||||
#
|
||||
#xmmap 0
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Max number of leaf nodes to be cached.
|
||||
# Specifies the maximum number of leaf nodes to be cached.
|
||||
# If it is not more than 0, the default value is specified.
|
||||
# The default value is 1024.
|
||||
#
|
||||
#cache-lcnum 1024
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Specifies the maximum number of non-leaf nodes to be cached.
|
||||
# If it is not more than 0, the default value is specified.
|
||||
# The default value is 512.
|
||||
#
|
||||
#cache-ncnum 512
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Specifies the number of members in each leaf page.
|
||||
# If it is not more than 0, the default value is specified.
|
||||
# The default value is 128.
|
||||
#
|
||||
#tune-lmemb 128
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Specifies the number of members in each non-leaf page.
|
||||
# If it is not more than 0, the default value is specified.
|
||||
# The default value is 256.
|
||||
#
|
||||
#tune-nmemb 256
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Specifies the number of elements of the bucket array.
|
||||
# If it is not more than 0, the default value is specified.
|
||||
# The default value is 32749.
|
||||
# Suggested size of the bucket array is about from 1 to 4
|
||||
# times of the number of all pages to be stored.
|
||||
#
|
||||
#tune-bnum 32749
|
||||
|
||||
# On-disk B+ Tree
|
||||
# Specifies that each page is compressed with ZLIB|BZ2 encoding.
|
||||
# Disabled by default.
|
||||
#
|
||||
#compression zlib
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../repo/etc/logrotate.d/httpd
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
ulimit -n 30000
|
||||
ulimit -u 40000
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# Enables the trac user, on all hosts, to execute commands as the root user. It can do this without a password but only to run the given command.
|
||||
# Enables the trac user, on all hosts, to execute commands as the root user. It can do this without a password but only to run the given command.
|
||||
trac ALL = (root) NOPASSWD: /usr/local/bin/push_hyperspace_to_github_tools_sap
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
# Enables the apache user, on all hosts, to execute commands as the wiki user. This can be done without a password for
|
||||
# running git, and all of its commands.
|
||||
# Enables the apache user, on all hosts, to execute commands as the wiki user. This can be done without a password for
|
||||
# running git, and all of its commands. This is used for the cgi-bin script on the central.
|
||||
apache ALL = (wiki) NOPASSWD: /usr/bin/git
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/etc/systemd/system/create-internal-status-file.service
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/etc/systemd/system/logrotate-and-general-clean-upon-shutdown.service
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Removes welcome.conf.
|
||||
Requires=-.mount network-online.target
|
||||
After=-.mount network-online.target
|
||||
Before=httpd.service get-latest-httpd-conf.service
|
||||
[Install]
|
||||
RequiredBy=multi-user.target
|
||||
WantedBy=httpd.service
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=/bin/bash -c "cd /etc/httpd; [[ -e conf.d/welcome.conf ]] && rm -f conf.d/welcome.conf"
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Starts up the tmux management panel
|
||||
Requires=-.mount
|
||||
After=-.mount
|
||||
|
||||
[Install]
|
||||
RequiredBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=oenshot
|
||||
RemainAfterExit=true
|
||||
ExecStart=/usr/local/bin/tmuxManagementConsole.sh
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Starts up the wiki
|
||||
Requires=-.mount
|
||||
After=-.mount
|
||||
|
||||
[Install]
|
||||
RequiredBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
RemainAfterExit=true
|
||||
ExecStart=su - wiki -c "cd /home/wiki && rackup -p 4567 /home/wiki/config.ru"
|
||||
ExecStop=/bin/kill -SIGTERM "$MAINPID"
|
||||
@@ -0,0 +1,36 @@
|
||||
set-option -g prefix C-b
|
||||
|
||||
# Start numbering at 0
|
||||
set -g base-index 0
|
||||
|
||||
# Allows for faster key repetition
|
||||
set -s escape-time 0
|
||||
|
||||
# Set status bar
|
||||
set -g status-bg black
|
||||
set -g status-fg white
|
||||
set -g status-left ""
|
||||
set -g status-right "#[fg=green]#H"
|
||||
|
||||
# set a short history limit to avoid using too much memory
|
||||
set -g history-limit 1000
|
||||
|
||||
# Rather than constraining window size to the maximum size of any client
|
||||
# connected to the *session*, constrain window size to the maximum size of any
|
||||
# client connected to *that window*. Much more reasonable.
|
||||
setw -g aggressive-resize on
|
||||
|
||||
# Allows us to use C-b a <command> to send commands to a TMUX session inside
|
||||
# another TMUX session
|
||||
bind-key a send-prefix
|
||||
|
||||
# Activity monitoring
|
||||
setw -g monitor-activity off
|
||||
#set -g visual-activity on
|
||||
|
||||
# Example of using a shell command in the status line
|
||||
#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
|
||||
|
||||
# Highlight active window
|
||||
set-window-option -g window-status-current-style bg=red
|
||||
set-window-option -g default-shell /bin/bash
|
||||
+9
-8
@@ -19,7 +19,7 @@ sync_repo() {
|
||||
# Gets all public ips for the instances with the chosen tag and iterates over the IPs.
|
||||
for IP in $(aws ec2 describe-instances --filters Name=tag-key,Values="${1}" | jq -r '.Reservations[].Instances[].PublicIpAddress'); do
|
||||
# strictHostKey... means no authenticity check. The sync-repo... script must be installed in the root user's home.
|
||||
echo $IP
|
||||
echo "Getting the latest changes on branch $2 for $IP ($1)"
|
||||
ssh -o "StrictHostKeyChecking=no" -o "ConnectTimeout=10" root@${IP} "cd ~ && sync-repo-and-execute-cmd.sh '${DIR}' '${COMMAND}' '${2}'";
|
||||
done;
|
||||
}
|
||||
@@ -35,12 +35,12 @@ check_conflict() {
|
||||
merge_main_into_branch() {
|
||||
#$1 Branch name. Assumes you are in the git repo.
|
||||
git checkout "${1}"
|
||||
check_conflict "$?" "Conflict checking out ${1}"
|
||||
check_conflict "$?" "Conflict checking out ${1}, in the checked-out workspace."
|
||||
git pull
|
||||
check_conflict "$?" "Conflict pulling ${1}"
|
||||
echo "Merging ${MAIN_BRANCH_NAME} into ${1}"
|
||||
check_conflict "$?" "Conflict pulling ${1}, in the checked-out workspace."
|
||||
echo "Merging ${MAIN_BRANCH_NAME} into ${1}, in the checked-out workspace."
|
||||
git merge ${MAIN_BRANCH_NAME}
|
||||
check_conflict "$?" "Conflict merging ${MAIN_BRANCH_NAME} into ${1}"
|
||||
check_conflict "$?" "Conflict merging ${MAIN_BRANCH_NAME} into ${1}, in the checked-out workspace."
|
||||
git push
|
||||
}
|
||||
while read oldrev newrev refname; do # These vars are passed on stdin to this hook.
|
||||
@@ -55,14 +55,15 @@ while read oldrev newrev refname; do # These vars are passed on stdin to this
|
||||
echo "The central pulls the central branch"
|
||||
sync_repo "${CENTRAL_TAG}" "${CENTRAL_BRANCH_NAME}"
|
||||
elif [[ "$branch_name" == "$MAIN_BRANCH_NAME" ]]; then
|
||||
echo "Performing manipulation in the checked-out workspace on the central, used for merges and manipulation."
|
||||
cd ~
|
||||
unset GIT_DIR
|
||||
cd ${CHECKED_OUT_WORKSPACE_NAME}
|
||||
# Get the latest main
|
||||
git checkout ${MAIN_BRANCH_NAME}
|
||||
check_conflict "$?" "Uncommitted files in the working directory"
|
||||
check_conflict "$?" "Uncommitted files in the working directory, in the checked-out workspace."
|
||||
git pull
|
||||
check_conflict "$?" "Merge conflict in main branch"
|
||||
check_conflict "$?" "Merge conflict in main branch from the checked-out workspace."
|
||||
if [[ "$(git rev-parse ${MAIN_BRANCH_NAME})" != "$(git rev-parse origin/${MAIN_BRANCH_NAME})" ]]; then
|
||||
echo "Merge induced by pull. Pushing latest changes in ${MAIN_BRANCH_NAME} to origin" # In case of a merge from diverging branches. This seems cyclic as we are pushing to the same branch, but should resolve, when "Everything up-to-date".
|
||||
git push
|
||||
@@ -75,4 +76,4 @@ while read oldrev newrev refname; do # These vars are passed on stdin to this
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
+11
-11
@@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
# This hook executes once for the receive operation. It takes no arguments, but for each ref to be updated it receives on
|
||||
# standard input a line of the format:
|
||||
#
|
||||
# <old-value> SP <new-value> SP <ref-name> LF
|
||||
#
|
||||
REFS=$( cat )
|
||||
curl https://postreceive:ohfa7083.98@hudson.sapsailing.com/git/notifyCommit?url=ssh://trac@sapsailing.com/home/trac/git
|
||||
if echo "$REFS" | awk '{ print $3; }' | grep "\<hyperspace\>"; then
|
||||
sudo /usr/local/bin/push_hyperspace_to_github_tools_sap
|
||||
fi
|
||||
#!/bin/bash
|
||||
# This hook executes once for the receive operation. It takes no arguments, but for each ref to be updated it receives on
|
||||
# standard input a line of the format:
|
||||
#
|
||||
# <old-value> SP <new-value> SP <ref-name> LF
|
||||
#
|
||||
REFS=$( cat )
|
||||
curl https://postreceive:ohfa7083.98@hudson.sapsailing.com/git/notifyCommit?url=ssh://trac@sapsailing.com/home/trac/git
|
||||
if echo "$REFS" | awk '{ print $3; }' | grep "\<hyperspace\>"; then
|
||||
sudo /usr/local/bin/push_hyperspace_to_github_tools_sap
|
||||
fi
|
||||
@@ -0,0 +1,98 @@
|
||||
require 'gollum/app'
|
||||
require 'digest/sha1'
|
||||
|
||||
|
||||
#__DIR__ = File.expand_path(File.dirname(__FILE__))
|
||||
#$: << __DIR__
|
||||
class App < Precious::App
|
||||
User = Struct.new(:name, :email, :password_hash, :can_write)
|
||||
before { authenticate! }
|
||||
before /edit/ do authorize_write! ; end
|
||||
before do
|
||||
session['gollum.author'] = {
|
||||
:name => "%s" % settings.loggedInUser,
|
||||
:email => "%s@example.com" % settings.loggedInUser,
|
||||
}
|
||||
end
|
||||
|
||||
helpers do
|
||||
def authenticate!
|
||||
public_urls=IO.readlines 'public.txt'
|
||||
public_urls.each {|url|
|
||||
if self.env['PATH_INFO'] == url.slice(0, url.length-1)
|
||||
puts "Allowing " + url
|
||||
return
|
||||
end
|
||||
|
||||
if self.env['PATH_INFO'].start_with?('/wiki/images') ||
|
||||
self.env['PATH_INFO'].start_with?('/favicon.ico')
|
||||
return
|
||||
end
|
||||
}
|
||||
if self.env['PATH_INFO'].split('/')[1] == 'gollum' && self.env['PATH_INFO'].split('/')[2] == 'assets'
|
||||
return
|
||||
end
|
||||
@_auth = Rack::Auth::Basic::Request.new(request.env)
|
||||
if self.env['PATH_INFO'].split('/').length >=2 &&
|
||||
(self.env['PATH_INFO'].split('/')[1] != 'wiki' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'wiki' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'home' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'home' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'Home' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'Home' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'Home.md' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'search' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'search' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'edit' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'edit' &&
|
||||
self.env['PATH_INFO'].split('/')[1] != 'preview' &&
|
||||
self.env['PATH_INFO'].split('/')[2] != 'preview' &&
|
||||
(self.env['PATH_INFO'].split('/')[1] != 'gollum' ||
|
||||
(self.env['PATH_INFO'].split('/')[2] != 'create' &&
|
||||
(self.env['PATH_INFO'].split('/')[2] != 'overview' || self.env['PATH_INFO'].split('/')[3] != 'wiki'))))
|
||||
throw(:halt, [403, 'Forbidden - You can not access anything outside wiki/ path.'])
|
||||
end
|
||||
if @_auth.provided?
|
||||
end
|
||||
if @_auth.provided? && @_auth.basic? && @_auth.credentials && @user = detected_user(@_auth.credentials)
|
||||
Precious::App.set(:loggedInUser, @user.name)
|
||||
return @user
|
||||
else
|
||||
response['WWW-Authenticate'] = %(Basic realm="Gollum Wiki")
|
||||
throw(:halt, [401, "Not authorized\n"])
|
||||
end
|
||||
end
|
||||
|
||||
def authorize_write!
|
||||
throw(:halt, [403, "Forbidden\n"]) unless @user.can_write
|
||||
end
|
||||
|
||||
def users
|
||||
@_users ||= settings.authorized_users.map {|u| User.new(*u) }
|
||||
end
|
||||
|
||||
def detected_user(credentials)
|
||||
users.detect do |u|
|
||||
[u.email, u.password_hash] ==
|
||||
[credentials[0], Digest::SHA1.hexdigest(credentials[1])]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def commit_
|
||||
{
|
||||
:message => params[:message],
|
||||
# :name => @user.name,
|
||||
:email => @user.email
|
||||
}
|
||||
end
|
||||
end
|
||||
##set author
|
||||
#class Precious::App
|
||||
# before do
|
||||
# session['gollum.author'] = {
|
||||
# :name => "%s" % settings.loggedInUser,
|
||||
# :email => "%s@example.com" % settings.loggedInUser,
|
||||
# }
|
||||
# end
|
||||
#End
|
||||
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env ruby
|
||||
#require 'rubygems'
|
||||
#require 'gollum/app'
|
||||
## Define list of authorized users.
|
||||
## Each user must have a username, password, name and email.
|
||||
##
|
||||
## Instead of a password you can also define a password_digest, which is the
|
||||
## SHA-256 hash of a password.
|
||||
##
|
||||
## Example:
|
||||
#users = YAML.load %q{
|
||||
#---
|
||||
#- username: rick
|
||||
# password: asdf754&1129-@lUZw
|
||||
# name: Rick Sanchez
|
||||
# email: rick@example.com
|
||||
#- username: morty
|
||||
# password_digest: 5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5
|
||||
# name: Morty Smith
|
||||
# email: morty@example.com
|
||||
#}
|
||||
#
|
||||
## Allow unauthenticated users to read the wiki (disabled by default).
|
||||
#options = { allow_unauthenticated_readonly: true }
|
||||
#
|
||||
## Allow only authenticated users to change the wiki.
|
||||
## (NOTE: This must be loaded *before* Precious::App!)
|
||||
#use Gollum::Auth, users, options
|
||||
#
|
||||
## That's it. The rest is for gollum only.
|
||||
#gollum_path = "/home/wiki/gitwiki"
|
||||
#wiki_options = {:universal_toc => false}
|
||||
#Precious::App.set(:gollum_path, gollum_path)
|
||||
#Precious::App.set(:wiki_options, wiki_options)
|
||||
#run Precious::App
|
||||
|
||||
require 'rubygems'
|
||||
require 'gollum/app'
|
||||
require_relative 'app'
|
||||
#require 'ruby-prof'
|
||||
#require 'gollum/auth' # Don't forget to load the gem!
|
||||
Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
|
||||
#Gollum::Markup.formats.clear
|
||||
#Gollum::Markup.formats[:markdown] = {
|
||||
# :name => "MarkDown",
|
||||
# :extensions => "md",
|
||||
# :regexp => /md|mkdn?|mdown|markdown/
|
||||
#}
|
||||
|
||||
gollum_path = "/home/wiki/gitwiki"
|
||||
wiki_options = {:universal_toc => false}
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:wiki_options, wiki_options)
|
||||
Precious::App.set(:authorized_users, YAML.load_file(File.expand_path('users.yml', File.expand_path(File.dirname(__FILE__)))))
|
||||
Precious::App.set(:loggedInUser, "anonymous");
|
||||
App.set(:default_markup, :markdown) # set your favorite markup language
|
||||
run App
|
||||
|
||||
#require 'rubygems'
|
||||
#require 'gollum/app'
|
||||
#
|
||||
#gollum_path = "/home/wiki/gitwiki"
|
||||
#wiki_options = {:universal_toc => false}
|
||||
#Precious::App.set(:gollum_path, gollum_path)
|
||||
#Precious::App.set(:default_markup, :markdown) # set your favorite markup language
|
||||
#Precious::App.set(:wiki_options, wiki_options)
|
||||
#run Precious::App
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/awsmfalogon.sh
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/usr/local/bin/setupHttpdGitLocal.sh
|
||||
+2
-17
@@ -14,17 +14,8 @@ else
|
||||
cd /home/trac/git
|
||||
tmux new-session -s "$sn" -n "BUILD" -d
|
||||
|
||||
counter=1
|
||||
for dir in dev test prod1 prod2; do
|
||||
cd $SERVERS_DIR/$dir
|
||||
tmux new-window -t "$sn:$counter" -n `basename $dir` "bash -c './start'; bash"
|
||||
counter=$[counter + 1]
|
||||
done
|
||||
counter=0
|
||||
|
||||
cd /home/trac/servers/prod1
|
||||
tmux new-window -t "$sn:$counter" -n "UDP" "bash -c './udpmirror -v 2012 localhost 2010 localhost 2011 localhost 2013 localhost 2014'; bash"
|
||||
|
||||
cd /opt/mongodb/bin
|
||||
tmux new-window -t "$sn:$[counter+1]" -n "GOAccess" "bash -c 'goaccess -f /var/log/httpd/access_log'; bash"
|
||||
|
||||
cd /opt/
|
||||
@@ -33,12 +24,6 @@ else
|
||||
cd /home/trac/servers
|
||||
tmux new-window -t "$sn:$[counter+3]" -n "Logs" "bash -c 'ls -lah'; bash"
|
||||
|
||||
cd /home/trac/servers/prod1
|
||||
tmux new-window -t "$sn:$[counter+4]" -n "STListener" "bash -c './swisstiminglistener 3500 3501'; bash"
|
||||
|
||||
tmux select-window -t "$sn:0"
|
||||
fi
|
||||
|
||||
if [[ "$1" != "unattended" ]]; then
|
||||
tmux -2 attach-session -t "$sn"
|
||||
fi
|
||||
fi
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
-19
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
GIT_ROOT=/home/wiki/gitwiki
|
||||
else
|
||||
GIT_ROOT=$1
|
||||
fi
|
||||
PATH_TO_TRAC_TRAC_URLS="configuration/tractrac-json-urls"
|
||||
urls=$(mongo --quiet "mongodb://dbserver.internal.sapsailing.com:10201/winddb?replicaSet=archive" --eval 'db.TRACTRAC_CONFIGURATIONS.find({}, {TT_CONFIG_JSON_URL : 1}).toArray()' | grep -v ObjectId | jq -r '.[].TT_CONFIG_JSON_URL' )
|
||||
if [[ $urls == "null" || $? -ne 0 ]]; then
|
||||
echo "Mongo db returns null for tractrac url discovery" | notify-operators "MongoDB/tractrac urls issue"
|
||||
exit 1
|
||||
else
|
||||
echo "${urls}" | sort -u >"${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
|
||||
cd "${GIT_ROOT}"
|
||||
git add "${GIT_ROOT}/${PATH_TO_TRAC_TRAC_URLS}"
|
||||
git commit -m "Updated tractrac-json-urls"
|
||||
git push
|
||||
fi
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"LDAPBaseDN" : "",
|
||||
"LDAPbinddn" : "",
|
||||
"LDAPfilter" : "",
|
||||
"LDAPmailattribute" : "mail",
|
||||
"LDAPserver" : "",
|
||||
"LDAPstarttls" : "0",
|
||||
"LDAPuidattribute" : "uid",
|
||||
"RADIUS_NAS_IP" : "",
|
||||
"RADIUS_email_suffix" : "",
|
||||
"RADIUS_secret" : "",
|
||||
"RADIUS_server" : "",
|
||||
"ajax_user_autocompletion" : "1",
|
||||
"allow_attachment_deletion" : "0",
|
||||
"allow_attachment_display" : "0",
|
||||
"allowbugdeletion" : "0",
|
||||
"allowemailchange" : "1",
|
||||
"allowuserdeletion" : "0",
|
||||
"announcehtml" : "",
|
||||
"attachment_base" : "",
|
||||
"auth_env_email" : "",
|
||||
"auth_env_id" : "",
|
||||
"auth_env_realname" : "",
|
||||
"chartgroup" : "editbugs",
|
||||
"collapsed_comment_tags" : "obsolete, spam",
|
||||
"comment_taggers_group" : "editbugs",
|
||||
"commentonchange_resolution" : "0",
|
||||
"commentonduplicate" : "0",
|
||||
"confirmuniqueusermatch" : "1",
|
||||
"cookiedomain" : "",
|
||||
"cookiepath" : "/",
|
||||
"createemailregexp" : ".*",
|
||||
"debug_group" : "admin",
|
||||
"default_search_limit" : "500",
|
||||
"defaultopsys" : "",
|
||||
"defaultplatform" : "",
|
||||
"defaultpriority" : "P5",
|
||||
"defaultquery" : "resolution=---&emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailqa_contact2=1&emaillongdesc3=1&order=Importance&long_desc_type=substring",
|
||||
"defaultseverity" : "enhancement",
|
||||
"duplicate_or_move_bug_status" : "RESOLVED",
|
||||
"emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$",
|
||||
"emailregexpdesc" : "A legal address must contain exactly one '@', and at least one '.' after the @.",
|
||||
"emailsuffix" : "",
|
||||
"font_file" : "",
|
||||
"globalwatchers" : "",
|
||||
"inbound_proxies" : "",
|
||||
"insidergroup" : "",
|
||||
"last_visit_keep_days" : "10",
|
||||
"letsubmitterchoosemilestone" : "1",
|
||||
"letsubmitterchoosepriority" : "1",
|
||||
"mail_delivery_method" : "SMTP",
|
||||
"mailfrom" : "bugzilla-daemon@sapsailing.com",
|
||||
"maintainer" : "",
|
||||
"makeproductgroups" : "0",
|
||||
"max_search_results" : "10000",
|
||||
"maxattachmentsize" : "1024",
|
||||
"maxlocalattachment" : "0",
|
||||
"maxusermatches" : "1000",
|
||||
"memcached_namespace" : "bugzilla:",
|
||||
"memcached_servers" : "",
|
||||
"musthavemilestoneonaccept" : "0",
|
||||
"mybugstemplate" : "buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=%userid%",
|
||||
"noresolveonopenblockers" : "0",
|
||||
"or_groups" : "1",
|
||||
"password_check_on_login" : "1",
|
||||
"password_complexity" : "no_constraints",
|
||||
"proxy_url" : "",
|
||||
"querysharegroup" : "editbugs",
|
||||
"quip_list_entry_control" : "open",
|
||||
"rememberlogin" : "on",
|
||||
"requirelogin" : "1",
|
||||
"search_allow_no_criteria" : "1",
|
||||
"shadowdb" : "",
|
||||
"shadowdbhost" : "",
|
||||
"shadowdbport" : "3306",
|
||||
"shadowdbsock" : "",
|
||||
"shutdownhtml" : "",
|
||||
"smtp_debug" : "1",
|
||||
"smtp_password" : "AkoTN6Upot/Sgc/JJD1VRUbqsM15eQ/5paY4FB/YkEkU",
|
||||
"smtp_ssl" : "1",
|
||||
"smtp_username" : "AKIAIHCQEFAZDLIK7SUQ",
|
||||
"smtpserver" : "email-smtp.eu-west-1.amazonaws.com",
|
||||
"ssl_redirect" : "0",
|
||||
"sslbase" : "https://bugzilla.sapsailing.com/bugzilla/",
|
||||
"strict_isolation" : "0",
|
||||
"strict_transport_security" : "off",
|
||||
"timetrackinggroup" : "editbugs",
|
||||
"upgrade_notification" : "latest_stable_release",
|
||||
"urlbase" : "https://bugzilla.sapsailing.com/bugzilla/",
|
||||
"use_mailer_queue" : "0",
|
||||
"use_see_also" : "1",
|
||||
"useclassification" : "0",
|
||||
"usemenuforusers" : "0",
|
||||
"useqacontact" : "0",
|
||||
"user_info_class" : "CGI",
|
||||
"user_verify_class" : "DB",
|
||||
"usestatuswhiteboard" : "0",
|
||||
"usetargetmilestone" : "0",
|
||||
"usevisibilitygroups" : "0",
|
||||
"utf8" : "1",
|
||||
"webdotbase" : "",
|
||||
"webservice_email_filter" : "0",
|
||||
"whinedays" : "7"
|
||||
}
|
||||
+7
-3
@@ -5,15 +5,19 @@ BODY=$( cat )
|
||||
echo "${BODY}" >/tmp/github-hook-body
|
||||
REF=$( echo "${BODY}" | jq -r '.ref' )
|
||||
PUSHER=$( echo "${BODY}" | jq -r '.pusher.email' )
|
||||
logger -t github-cgi "ref ia $REF, pusher was $PUSHER"
|
||||
logger -t github-cgi "ref is $REF, pusher was $PUSHER"
|
||||
# For testing:
|
||||
#if [ "${PUSHER}" = "axel.uhl@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
|
||||
if [ "${PUSHER}" = "tmsatsls+github.tools.sap_service-tip-git@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
|
||||
tmsatsls+github.com_service-tip-git@sap.com
|
||||
# The filter in case this is to be used for github.tools.sap:
|
||||
#if [ "${PUSHER}" = "tmsatsls+github.tools.sap_service-tip-git@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
|
||||
# The filter for github.com:
|
||||
if [ "${PUSHER}" = "tmsatsls+github.com_service-tip-git@sap.com" -a "${REF}" = "refs/heads/translation" ]; then
|
||||
echo "Identified a push to refs/heads/translation by ${PUSHER}."
|
||||
echo "Fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
|
||||
logger -t github-cgi "fetching translation branch from github.tools.sap and pushing it to ssh://trac@sapsailing.com/home/trac/git"
|
||||
cd /home/wiki/gitwiki
|
||||
sudo -u wiki git fetch sapsailing translation:translation 2>&1
|
||||
sudo -u wiki git fetch github translation:translation 2>&1
|
||||
sudo -u wiki git push origin translation:translation 2>&1
|
||||
else
|
||||
echo "Either pusher was not tmsatsls+github.tools.sap_service-tip-git@sap.com or ref was not refs/heads/translation. Not triggering."
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../../repo/var/www/cgi-bin/reverseProxyHealthcheck.sh
|
||||
Loaded 100 of 719 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user