Skip to content

Commit

Permalink
Merge branch 'deployment'
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiner Wolf committed Feb 4, 2024
2 parents 7b5970e + b9eddf7 commit 1439754
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
7 changes: 4 additions & 3 deletions code/galdevweb/GaldevWeb/Pages/Assumptions.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

var title = "Annahmen für das Szenario von Galactic Developments";
var description = "Annahmen für das Szenario von Galactic Developments: Es gibt fremde Völker (aka. Aliens). Die haben nicht nur Noppen auf der Nase, sondern sind anders anders. Menschen sind nicht besser oder schlechter als andere Völker. Die meisten raumfahrenden Völker sind schon länger dabei als die Menschen. Technologisch sind die Menschen anfangs eher rückständig. Technik ist kompliziert, vor allem in der Zukunft. Menschen und andere Völker sind nicht homogen. Auch Alien-Völker sind so vielfältig wie die Menschheit. Nur ein Teil der Milchstraße ist bekannt, aber immerhin ein Teil. Hard Science Fiction: nur mögliche (oder nicht unmögliche) Wissenschaft. Ausnahme: Reisen (scheinbar) schneller als das Licht, erklärt mit einer - nicht auf den ersten Blick unwissenschaftlichen - Idee. Ansonsten gibt es: bewusste und unbewusste KI, Nano, Genmods, Cyborgs, Mechs, Implantate, IQ-Upgrades, Assoziationsbooster, VR, Metamaterialien, Autofabs, Mikrobots-Schwärme, Upload, pB11-Fusion, Antimaterie, Railguns, metallischen Wasserstoff, Zylinderhabitate... Und einiges, was man noch nicht so oft woanders gesehen hat, z.B.: Pelletsturm-Schilde, Gluonen-Kapazitoren, Materieströme, Ultrametalle, Molekularstrahldrucker, Feldanzüge, offene Bereiche, Fraktal-Fusion, anorganische Viren...";
var imageBaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}/images/Assumptions/";

var BaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Headers["X-Forwarded-Proto"].FirstOrDefault() ?? UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}";

ViewData["Title"] = title;
ViewData["MetaDescription"] = description;
ViewData["MetaFacebookTitle"] = title;
ViewData["MetaFacebookDescription"] = description;
ViewData["MetaFacebookImage"] = imageBaseUrl + "old-ship.jpg";
ViewData["MetaFacebookImage"] = BaseUrl + "/images/Assumptions/old-ship.jpg";
ViewData["MetaFacebookImageAlt"] = "Old Ship in Hangar";
ViewData["MetaTwitterTitle"] = title;
ViewData["MetaTwitterDescription"] = description;
ViewData["MetaTwitterImage"] = imageBaseUrl + "old-ship.jpg";
ViewData["MetaTwitterImage"] = BaseUrl + "/images/Assumptions/old-ship.jpg";
}

<div class="row mt-3">
Expand Down
11 changes: 6 additions & 5 deletions code/galdevweb/GaldevWeb/Pages/Blog.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
@{
ViewData["Active"] = "Blog";

var ImageBaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}/blog/";
var BaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Headers["X-Forwarded-Proto"].FirstOrDefault() ?? UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}";

if (Model.Post != null) {
ViewData["Title"] = Model.Post.Title;
ViewData["MetaDescription"] = Model.Post.Summary;
ViewData["MetaFacebookTitle"] = Model.Post.Title;
ViewData["MetaFacebookDescription"] = Model.Post.Summary;
ViewData["MetaFacebookImage"] = ImageBaseUrl + Model.Post.Image;
ViewData["MetaFacebookImage"] = BaseUrl + "/blog/" + Model.Post.Image;
ViewData["MetaFacebookImageAlt"] = Model.Post.Title;
ViewData["MetaTwitterTitle"] = Model.Post.Title;
ViewData["MetaTwitterDescription"] = Model.Post.Summary;
ViewData["MetaTwitterImage"] = ImageBaseUrl + Model.Post.Image;
ViewData["MetaTwitterImage"] = BaseUrl + "/blog/" + Model.Post.Image;
}
}

Expand All @@ -43,7 +43,7 @@

<p class="mt-4 mb-4">
@if (string.IsNullOrEmpty(Model.Post.Html)) {
<img src="@ImageBaseUrl@Model.Post.Image" class="img-fluid gd-blog-post-image" alt="@Model.Post.Title" />
<img src="@BaseUrl/blog/@Model.Post.Image" class="img-fluid gd-blog-post-image" alt="@Model.Post.Title" />
} else {
<text>
@Html.Raw(Model.Post.Html)
Expand Down Expand Up @@ -104,7 +104,7 @@

foreach (var post in Model.Index.Where(p => p.Language == Model.Lang)) {
cards.Add(Node.From(new Dictionary<string, string> {
["ImgSrc"] = $"{ImageBaseUrl}{post.Image}",
["ImgSrc"] = $"{BaseUrl}/blog/{post.Image}",
["ImgAlt"] = post.Title,
["Link"] = Links.GetPathByPage("/Blog", null, new { name = post.SeoTitle }) ?? "",
["Title"] = post.Title,
Expand All @@ -125,3 +125,4 @@
}

@await Html.PartialAsync("_MarkdownConverterPartial")

2 changes: 1 addition & 1 deletion code/galdevweb/GaldevWeb/Pages/Timeline.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@{
ViewData["Active"] = "Timeline";

var BaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}";
var BaseUrl = $"{UrlHelper.ActionContext.HttpContext.Request.Headers["X-Forwarded-Proto"].FirstOrDefault() ?? UrlHelper.ActionContext.HttpContext.Request.Scheme}://{UrlHelper.ActionContext.HttpContext.Request.Host}";

if (Model.NotAvailable) {
//
Expand Down
10 changes: 6 additions & 4 deletions code/galdevweb/GaldevWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public static void Main(string[] args)

var app = builder.Build();

app.UseForwardedHeaders(new ForwardedHeadersOptions {
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto,
KnownNetworks = { },
KnownProxies = { },
});

//if (!app.Environment.IsDevelopment()) {
// app.UseExceptionHandler("/Error");
//}
Expand Down Expand Up @@ -90,10 +96,6 @@ public static void Main(string[] args)
endpoints.MapControllers();
});

app.UseForwardedHeaders(new ForwardedHeadersOptions {
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});

app.Run();
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1439754

Please sign in to comment.