Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
958b203
fix typo in path name
proditis Jan 12, 2026
e22be84
allow us to perform acme requests even when in DT mode
proditis Jan 12, 2026
e1461fd
a simple playbook to add new ssh keys to a host/user
proditis Jan 12, 2026
fd4fd17
sync composer lock with json
proditis Jan 12, 2026
5164b74
add auto-assign pr
proditis Jan 14, 2026
0151a10
create docker-servers bootstrap and normal ops
proditis Jan 14, 2026
a2b7d74
dont show personal stats on team events
proditis Jan 14, 2026
426c95d
dont show leaderboards on guest view profile on team only events
proditis Jan 14, 2026
201a4f7
team module required for badge generation on team events
proditis Jan 14, 2026
2338b8b
add missing pass from admins
proditis Jan 14, 2026
ce1ed68
fix the typo in targets_cidr
proditis Jan 14, 2026
5b0400a
disable dynamic treasures for sanitycheck
proditis Jan 15, 2026
e5f6941
support expire, typecast params, catch Throwable instead of exceptions
proditis Jan 18, 2026
71e42f2
avoid filtering on 0 minutes_ago
proditis Jan 18, 2026
264df81
only allow mui to fetch identificationFiles
proditis Jan 18, 2026
904841d
fix permissions and allow run from outside PR
proditis Jan 23, 2026
10dc3a1
no need for everyone to have access to the WS
proditis Jan 23, 2026
924e911
sync with github repo playbook
proditis Jan 23, 2026
4216758
use install -d instead to limit the number of command from mkdir/chown
proditis Jan 23, 2026
22c4408
use the proper ws socket for live installs and use the same user for …
proditis Jan 23, 2026
fc8f59d
add php ini that is needed for our service publisher
proditis Jan 23, 2026
7de4ed6
make sure we only allow mui to acceess identificationFiles
proditis Jan 23, 2026
58a3e77
simplify actionInstances() and document action
proditis Jan 23, 2026
9040674
make sure player register respect status and active
proditis Jan 23, 2026
b8a9532
Introduce ArrayHelperExtended
proditis Jan 23, 2026
024d3fe
Add TeamInvite and log errorSummary on errors
proditis Jan 23, 2026
978d0f7
re-generate serial until unique
proditis Jan 23, 2026
aea78c3
add approvedMemberIP's method to team
proditis Jan 23, 2026
f30dd64
fix targetInstanceQuery withApprovedMemberHeartbeat
proditis Jan 23, 2026
abe52d6
dont apply timezone twice
proditis Jan 23, 2026
0c552eb
update some default migration settings
proditis Jan 23, 2026
d659c79
private_network and private_network_targets is needed
proditis Jan 23, 2026
6161138
update triggers to match
proditis Jan 23, 2026
98da78b
update routines to match
proditis Jan 23, 2026
fca1e51
if team_visible_instances or team_subscription show only spawn team i…
proditis Jan 23, 2026
2c85024
use inviteOrCreate instead
proditis Jan 23, 2026
eb0930e
Add getInviteOrCreate
proditis Jan 23, 2026
c37d80d
simplify team instances
proditis Jan 23, 2026
609066d
fix verification token logic bug
proditis Jan 24, 2026
d8f6be0
fix perms for mods
proditis Jan 24, 2026
e361b8b
fix teaminvite record and log errors
proditis Jan 24, 2026
984a0b5
make a distinction when actions i needed and not
proditis Jan 24, 2026
6941afb
throw error when we try to mail a user without token
proditis Jan 25, 2026
af2997d
drop tad_player_token
proditis Jan 25, 2026
e1b223b
disable pagination for mass mails and include filter of emailToken
proditis Jan 25, 2026
1a14e1f
give alias to the relations
proditis Jan 25, 2026
81280b1
dont show mail action if the user has no tokens
proditis Jan 25, 2026
ffed90e
only admins should see metadata
proditis Jan 25, 2026
6dc0694
touch /tmp/event_finished at the end
proditis Jan 25, 2026
2b7edbf
missing teamNetworks
proditis Jan 25, 2026
0620dac
use our own formatter for this
proditis Jan 25, 2026
1d68c64
add event shudown script for vpn
proditis Jan 25, 2026
573920a
add shutdown event for vpn
proditis Jan 25, 2026
03e5059
perform action on watchdog event
proditis Jan 25, 2026
7979e70
on db broadcast notification on event finish
proditis Jan 25, 2026
0910421
add a service for watchdoger on db
proditis Jan 25, 2026
005bded
start watchdog-action on startup
proditis Jan 25, 2026
38a9e12
remove the trigger from our schema
proditis Jan 25, 2026
a1c5002
update pending notifications status on render
proditis Jan 25, 2026
5cc30f8
dont use location we use it internally
proditis Jan 25, 2026
f89d975
fix some more markdown warnings
proditis Jan 25, 2026
ae4d31e
tester and here
proditis Jan 25, 2026
28b6b86
add publish of target update
proditis Jan 26, 2026
ea8dc6f
dont force default value on target_days_updated
proditis Jan 26, 2026
18d7f38
on notification error send to logs
proditis Jan 26, 2026
7f90642
sync mine and view stream queries
proditis Jan 26, 2026
d59b2a0
use the target_id for updates
proditis Jan 26, 2026
5ffe094
add the target->id to the css ID
proditis Jan 26, 2026
119ecbe
use unique div id for each markdown div
proditis Jan 26, 2026
45f8219
register the js/css files to make the markdown good-looking
proditis Jan 26, 2026
fe45c55
document websockets a bit
proditis Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .github/update-composer-json.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?php

// Load the composer.json and composer.lock files
$composerJsonPath = 'composer.json';
$composerLockPath = 'composer.lock';

// Check if the files exist
if (!file_exists($composerJsonPath) || !file_exists($composerLockPath)) {
echo "composer.json or composer.lock file is missing!";
exit(1);
}

// Read and decode the composer.json file
$composerJson = json_decode(file_get_contents($composerJsonPath), true);
if ($composerJson === null) {
echo "Error reading composer.json!";
exit(1);
}

// Read and decode the composer.lock file
$composerLock = json_decode(file_get_contents($composerLockPath), true);
if ($composerLock === null) {
echo "Error reading composer.lock!";
exit(1);
}

// Check if "repositories" exists in composer.json; if not, create it
if (!isset($composerJson['repositories'])) {
$composerJson['repositories'] = [];
}

// Prepare to track any newly pinned packages
$pinnedPackages = [];

// Function to convert exact version to a range (caret operator with full version)
function convertToVersionRange($version) {
// If version looks like an exact version (e.g., "2.0.53"), convert it to a range with caret
if (preg_match('/^(\d+)\.(\d+)\.(\d+)$/', $version, $matches)) {
return "^" . $matches[1] . "." . $matches[2] . "." . $matches[3]; // Convert to ^X.Y.Z (e.g., ^2.0.53)
}
// If already a version range (like "^2.0" or "~2.0"), just return it
return $version;
}

// Iterate through the packages in composer.lock
foreach ($composerLock['packages'] as $package) {
$packageName = $package['name'];
$packageVersion = $package['version'];

// Convert exact version to a range using the convertToVersionRange function
$packageVersionRange = convertToVersionRange($packageVersion);

// Update the versions in the "require" section if the package exists
if (isset($composerJson['require'][$packageName])) {
$composerJson['require'][$packageName] = $packageVersionRange;
}

// If the package exists in "require-dev", update that as well
if (isset($composerJson['require-dev'][$packageName])) {
$composerJson['require-dev'][$packageName] = $packageVersionRange;
}

// Get the repository URL and dist type from composer.lock (either from 'dist' or 'source')
$repositoryUrl = null;
$packageHash = null;
$distType = 'tar'; // Default to 'tar' if no type is specified

if (isset($package['dist']['url'])) {
$repositoryUrl = $package['dist']['url'];
$packageHash = isset($package['dist']['reference']) ? $package['dist']['reference'] : null;
// Set the dist type based on the 'dist' section in composer.lock
if (isset($package['dist']['type'])) {
$distType = $package['dist']['type']; // Use the dist type from composer.lock
}
} elseif (isset($package['source']['url'])) {
$repositoryUrl = $package['source']['url'];
$packageHash = isset($package['source']['reference']) ? $package['source']['reference'] : null;
// If the package comes from a VCS, we can set type as 'vcs'
$distType = 'vcs';
}

// If no URL found, skip this package (you can handle this case as needed)
if (!$repositoryUrl) {
echo "No repository URL found for package: $packageName\n";
continue;
}

// Pin the package in the "repositories" section if it's not already pinned
$repositoryExists = false;

foreach ($composerJson['repositories'] as &$repo) {
if (isset($repo['package']) && $repo['package']['name'] === $packageName) {
// Update existing repository entry with the new version, URL, hash, and dist type
$repo['package']['version'] = $packageVersionRange;
$repo['package']['dist']['url'] = $repositoryUrl;
if ($packageHash) {
$repo['package']['dist']['reference'] = $packageHash;
}
$repo['package']['dist']['type'] = $distType;
$repositoryExists = true;
break;
}
}

// If repository entry does not exist, add a new one
if (!$repositoryExists) {
$composerJson['repositories'][] = [
'type' => 'package', // The type is at the root level of the repository entry
'package' => [
'name' => $packageName,
'version' => $packageVersionRange,
'type' => 'library', // Default type, you can adjust this if needed
'dist' => [
'url' => $repositoryUrl,
'type' => $distType, // Use the dynamically derived dist type
'reference' => $packageHash // Adding the hash (reference) if available
]
]
];
// Track pinned package
$pinnedPackages[] = $packageName;
}
}

// Write the updated composer.json back to the file
if (file_put_contents($composerJsonPath, json_encode($composerJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL)) {
echo "composer.json has been updated with the versions from composer.lock.\n";
if (count($pinnedPackages) > 0) {
echo "The following packages were pinned to repositories:\n";
foreach ($pinnedPackages as $packageName) {
echo " - $packageName\n";
}
}
} else {
echo "Failed to update composer.json.\n";
exit(1);
}
24 changes: 24 additions & 0 deletions .github/workflows/auto-assign-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Auto-Assign PR

on:
pull_request_target:
types: [opened]

permissions:
issues: write

jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Assign PR to repo owner
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GH_ADMIN_TOKEN }}
script: |
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: ["proditis"]
});
4 changes: 3 additions & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ MD012: false
MD013: false
# Disable required empty line after heading
MD022: false
MD033: false
MD033: false
MD040: false
MD043: false
1 change: 1 addition & 0 deletions ansible/Dockerfiles/sanitycheck/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ writeup_allowed: 0
headshot_spin: 0
instance_allowed: 0
TargetOndemand: false
dynamic_treasures: 0
container:
name: "{{hostname}}"
hostname: "{{fqdn}}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/files/pui.service.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

# Allow users to connect to port 80/443
pass in quick on egress inet proto tcp from {<moderators>, <administrators>} to (egress:0) port 8888 rdr-to 127.0.0.1
pass in quick on interconnect inet proto tcp from (interconnect:network) to (interconnect:0) port 8888 rdr-to 127.0.0.1

pass quick from <administrators> label "administrators"

pass quick inet proto tcp from <moderators> to (egress:0) port { 80 , 443 } label "www-moderators"

# FOR DT OPERATIONS
pass in quick inet proto tcp from <maintenance> to port 80 rdr-to 127.0.0.1 port 8080 label "maintenance"
pass in quick inet proto tcp from <maintenance> to port 443 rdr-to 127.0.0.1 port 8443 label "maintenance"
block in quick on egress inet proto tcp from <maintenance> to (egress:0) port 8888

pass in on egress inet proto tcp from <venue> to port { 80, 443 } label "www-normal"
pass in on egress inet proto tcp to port { 80, 443 } label "www-normal"
pass in quick on egress inet proto tcp to (egress:0) port 8888 rdr-to 127.0.0.1

2 changes: 1 addition & 1 deletion ansible/inventories/servers/host_vars/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ registry_storage: "/storage"
registry_bind_ip: "0.0.0.0"
registry_bind_port: "5000"
registry_targets_if: if0
registry_targets_cidr: 10.0.100.0/24
registry_targets_cidr: 10.0.0.100/24
backups:
- { tgz: "/altroot/root.tgz", src: '/root' }
- { tgz: "/altroot/etc.tgz", src: '/etc' }
Expand Down
33 changes: 33 additions & 0 deletions ansible/maintenance/authorized_keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Update authorized SSH keys for a user
hosts: all
become: true

vars:
target_user: root

pre_tasks:
- name: Ensure ssh_keys_source is provided
ansible.builtin.fail:
msg: "You must provide ssh_keys_source (file path or URL)"
when: ssh_keys_source is not defined

- name: Load SSH public keys from file or URL
ansible.builtin.set_fact:
ssh_public_keys: >-
{{
lookup(
ssh_keys_source is match('^https?://')
| ternary('url', 'file'),
ssh_keys_source
)
}}

tasks:
- name: Update authorized_keys for user
ansible.posix.authorized_key:
user: "{{ target_user }}"
key: "{{ ssh_public_keys }}"
manage_dir: true
state: present
# exclusive: true # uncomment to replace all existing keys
32 changes: 32 additions & 0 deletions ansible/maintenance/sync-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env ansible-playbook
---
- name: Update deployed application from Git
hosts: all
tasks:
- name: Ensure repository is up to date
git:
repo: "{{ GITHUB_REPO }}"
dest: "{{ REPO }}"
version: "{{ GITHUB_REPO_BRANCH }}"
force: yes
accept_hostkey: yes
update: yes
notify: restart applications
register: git_result

- name: Clean untracked files (preserving paths)
shell: git clean -fd {{ '-n' if ansible_check_mode else '' }} {% for p in PRESERVE_PATHS %}-e {{ p }} {% endfor %}
args:
chdir: "{{ REPO }}"
register: clean_result
changed_when: clean_result.stdout != ""
when: git_result.changed and PRESERVE_PATHS is defined
notify: restart applications

handlers:
- name: restart applications
when: APP_SERVICES is defined
service:
name: "{{ item }}"
state: restarted
loop: "{{ APP_SERVICES }}"
21 changes: 21 additions & 0 deletions ansible/runonce/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,27 @@
group: wheel
mode: '0555'

- name: copy watchdoger script
copy:
src: ../../contrib/watchdoger.py
dest: /usr/local/bin/watchdoger
owner: root
group: wheel
mode: '0555'

- name: Install watchdoger.ini for supervisord
copy:
dest: /etc/supervisord.d/watchdoger.ini
content: |
[program:watchdoger]
user = root
command = /usr/local/bin/watchdoger --file_path /tmp/event_finished --url {{ wsserver.url | default("http://10.7.0.200:8888/broadcast") }} --token {{ wsserver.token | default("server123token") }}
autorestart = false
startretries = 0
stdout_logfile=/var/log/watchdoger.log
stdout_logfile_maxbytes=0
redirect_stderr=true

- name: Setting up sysctl.conf
sysctl:
name: "{{ item.key }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/runonce/docker-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
content: "{{item.content|default(omit)}}"
with_items:
- { dest: "/etc/pf.conf", src: "../files/pf.conf"}
- { dest: "/etc/service.pf.conf", content: "anchor \"dynamic\"\npass quick inet proto tcp from <service_clients> to port {{registry_bind_port}} label \"service_clients\"\n"}
- { dest: "/etc/service.pf.conf", content: "pass quick from <administrators> label \"administrators\"\nanchor \"dynamic\"\npass quick inet proto tcp from <service_clients> to port {{registry_bind_port}} label \"service_clients\"\n"}
- { dest: "/etc/service_clients.conf", content: "{{registry_targets_cidr}}\n"}

- name: Dump administrators PF table (if exists)
Expand Down
Loading