This commit is contained in:
2021-04-26 22:40:24 +00:00
parent dc86ec087d
commit c0f91d95a6
4 changed files with 18 additions and 22 deletions

View File

@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore;
using rockfishCore.Models;
using rockfishCore.Util;

View File

@@ -23,7 +23,7 @@ dotnet publish -o ./../publish/
3) COPY
Copy over to production server,
.NET Core apps: /var/aspnetcore
.NET Core apps: /srv/coreapps
only need the .dll and the wwwroot folder contents,
remember not to delete the folders on the server only replace their contents because there are file permissions set
Backup the database

View File

@@ -12,10 +12,6 @@ namespace rockfishCore.Util
{
public static class OpsDiagnostics
{
private const int S3_EXPECTED_FILE_COUNT = 24;
public static readonly string[] S3_EXPECTED_BACKUP_FILE_PREFIXES =
{ "biz-docker-website-backup-", "biz-letsencryptbackup-", "biz-pecklist-db-backup-", "biz-rockfish-db-backup-",
"devops-docker-le-config-backup-","forum-backup-", "mail-svn-repo-backup-" };
private const string S3_SECRET_KEY = "iNwbHr+sK+9is2wmRjIax+rdyEjLNvWKJBYr7w4txkY";
private const string S3_ACCESS_KEY = "CMPAFDNX53OWPC55HBJ4";
private const string S3_HOST_ENDPOINT = "https://nyc3.digitaloceanspaces.com";
@@ -103,31 +99,36 @@ namespace rockfishCore.Util
public static bool VerifyBackups()
{
bool ret = false;
string[] CriticalDailyBackupFilePrefixes = { "ayanova21-pecklist-db-backup-", "ayanova21-rockfish-db-backup-", "mail21-svn-backup-" };
string[] Level2ManualBackupFilePrefixes = { "forum21-backup-", "ayanova21-website-backup-" };
var SpacesFileNames = GetFileListFromSpacesBackupStorage();
if (SpacesFileNames.Count != S3_EXPECTED_FILE_COUNT) return ret;
//Daily critical files
//get yesterday's date in the same format as the backup creates
var ExpectedBackupDateString = DateTime.Today.AddDays(-1).ToString("yyMMdd");
int foundMatches = 0;
foreach (string ExpectedFileName in S3_EXPECTED_BACKUP_FILE_PREFIXES)
int FoundCriticalMatches = 0;
foreach (string ExpectedFileName in CriticalDailyBackupFilePrefixes)
{
foreach (string FileName in SpacesFileNames)
{
if (FileName.StartsWith(ExpectedFileName + ExpectedBackupDateString))
{
foundMatches++;
FoundCriticalMatches++;
break;
}
}
}
if (foundMatches == S3_EXPECTED_BACKUP_FILE_PREFIXES.Length)
{
ret = true;
}
return ret;
//Website and Forum sb at least three of each, so just ensure there are three matches
//we dont' care about date for these ones, just prescence
int FoundLevel2Matches = 0;
foreach (string ExpectedFileName in Level2ManualBackupFilePrefixes)
foreach (string FileName in SpacesFileNames)
if (FileName.StartsWith(ExpectedFileName))
FoundLevel2Matches++;
//should be one each of the critical and 3 each of the level2
return (FoundCriticalMatches == CriticalDailyBackupFilePrefixes.Length && FoundLevel2Matches == (Level2ManualBackupFilePrefixes.Length * 3));
}

View File

@@ -2,7 +2,7 @@ namespace rockfishCore.Util
{
public static class RfVersion
{
public const string NumberOnly="6.10";
public const string NumberOnly="6.11";
public const string Full = "Rockfish server " + NumberOnly;
}
}