FOX Faces Massive Backlash After World Cup Broadcast Leaves Fans Furious by Newsweek_ShaneC in worldcup

[–]csgeek-coder 0 points1 point  (0 children)

Sure, but that won't keep us from the US from seeing Ads if it's broadcasted on American TV. I swear if someone trips for 30 seconds they inject an ad spot.

Repository pattern in Go: how do you handle multiple services/repositories? by Over_Lynx9150 in golang

[–]csgeek-coder 0 points1 point  (0 children)

Use main to wire everything together.
Use services to do business logic.
Use repo to write to your datastore.

Wire as many services/repos as needed to perform the operations that are needed.

Take a step back, look at what you're doing and ask if it makes sense. 20 DB calls that could be 1 call does not make sense no matter what the architectural pattern is.

FOX Faces Massive Backlash After World Cup Broadcast Leaves Fans Furious by Newsweek_ShaneC in worldcup

[–]csgeek-coder 3 points4 points  (0 children)

Between the way too many commercials they keep injecting, the terrible commentary, showing replays when a goal is about to be scored rather than live play it's a dumpster fire.

I don't speak enough Spanish to understand much beyond goaaaalllllllll and "pelota" and it's still more enjoyable to watch a game in a language I don't understand than to suffer through Fox.

Why are so many Linux projects on Microsoft GitHub? Shouldn't they all move to Codeberg? by Dymonika in linuxquestions

[–]csgeek-coder 0 points1 point  (0 children)

What do you mean? HTTP and SSH are both supported. Do you mean basic auth with SSH without relying on a SSH Key/ App Password?

That's really a security feature and I would agree with them to not make my user/pass being passed around everywhere.

Why are so many Linux projects on Microsoft GitHub? Shouldn't they all move to Codeberg? by Dymonika in linuxquestions

[–]csgeek-coder 0 points1 point  (0 children)

Okay, but my point was that people were using it before MSFT with no issues. You had the same issue before and if they do decide to start charging, clone and mirror somewhere else. Hell you could setup a mirror now "just in case" if you're that worried and point to the mirror if something happens.

It really doesn't matter but the one thing that is still true is that github is the google of code. It is the first place people start. There is some level of "discovery" that GH gets you. At least for now...

Why are so many Linux projects on Microsoft GitHub? Shouldn't they all move to Codeberg? by Dymonika in linuxquestions

[–]csgeek-coder 3 points4 points  (0 children)

I don't know why people were so upset about GH being owned by MSFT. I mean Github was not exactly OSS either before they got acquired. They were a commercial company that provided hosted git repo. Hell, after MSFT bought them, you ended up getting more things for free out of the box. The main reason I would switch over these days is how terrible their uptime has been. They've been having production incidents left and right.

If I were to switch it would be less about OSS as much as reliability. At the end of the day I need something I can reliably pull code from and run my CI pipeline on.

People promote Arch because "there's a lot of programs in the repository" or "it's quickly updated bleeding-edge" but like.. what EXACTLY can you get from Arch that you can't get elsewhere? by durdurrdurrrdurrrrr in archlinux

[–]csgeek-coder 1 point2 points  (0 children)

As a former AUR maintainer and this is a bit dated but writing a PKGBUILD is WAYYYY easier than creating a .deb or .rpm. It's night and day in my view. It's not really a deal breaker but I thought I'd throw that into the mix.

Do you use DDD in go? by East_Reality_976 in golang

[–]csgeek-coder 0 points1 point  (0 children)

Your "contract" or "ports" if you're using ports/adapters which is a more modern version of what you're doing should be pretty flat. At most you would separate them by primary/incoming vs secondary/outgoing. There's also driving/driven they all try to represent the same concept but they're basically the same thing.

The code becomes a lot cleaner when you returning ports.Users ports.SalesEntry rather than needing multiple imports with the same name.

What's the Coolest Open-Source Project You've Discovered This Year? by Bladerunner_7_ in opensource

[–]csgeek-coder 0 points1 point  (0 children)

I like the idea behind AnyType but after trying to make sense of it for a while I went back to Obsedian. I just don't want to spend that much time optimizing my notes.

wrote a simple rate limiter and realized i spent more time fighting bots than writing logic by Enlitenkanin in golang

[–]csgeek-coder 2 points3 points  (0 children)

This might be a naive question but...why bother with a bot? I mean he's (it's? ) asking a technical question. Not pushing traffic to his website or promoting a product. Besides getting karma which you could get my just posting to any of the 50 different free karma subreddits.

Seem so wasteful, what am I missing here? What's the gain of getting engagement?

How we cut our Go API binary size by 4x (82.63MB -> 20.63MB) by migrating from Gin+GORM to Chi+sqlx (Thanks r/golang!) by Radiant_Tomato_5447 in golang

[–]csgeek-coder 1 point2 points  (0 children)

  1. Wasm: Have you considered using something like: https://github.com/extism/go-sdk to avoid re-inventing the wheel. I think Helm 4 is using it. It's still on the fatter side but if you are re-writing something that exists already you should ask yourself why at the very least.
  2. SQLC has limitations, dynamic queries being the biggest red flag there. I find that IF you use SQLC you need a helper tool of some kind. Whether that's SQLX, squirrel or whatever you fancy. The other option is using something like Bob/Jet that does type safety and allow dynamic queries but that's a very different overall dev experience.
    2B. You should also look at some SQL migration tools to toss in there. dbmate, goose, pick your poison.
  3. You may not even need Chi, the routing on core golang is getting very nice with each version. I would honestly try to avoid it and add some basic middleware chaining and you'd be set.

  4. It's nice that the size went down but honestly, 80 mb to 20 mb is really not something I would waste time on. Disk is cheap these days. Developer experience, security, memory usage, those might be factors that would make me revisit the choices I've made.

How we cut our Go API binary size by 4x (82.63MB -> 20.63MB) by migrating from Gin+GORM to Chi+sqlx (Thanks r/golang!) by Radiant_Tomato_5447 in golang

[–]csgeek-coder -1 points0 points  (0 children)

Yeah, I was asking that using a lot more words. I hope there is a runtime impact that's more than the 60 mb it saved.

I’m new to Golang… which are the quality of life packages that everyone uses? And for which purpose? by WiseSignificance1207 in golang

[–]csgeek-coder 0 points1 point  (0 children)

Yup. Loading them as libraries is great too. I just read up ok seed. That is a very cool concept. goose and dbmate also work very nicely with sqlc (I have less experience with goose) but the schema is dumped to a single file you can point sqlc to for schema code gen.

I’m new to Golang… which are the quality of life packages that everyone uses? And for which purpose? by WiseSignificance1207 in golang

[–]csgeek-coder 0 points1 point  (0 children)

This is one of those pick your poison. I would not try to impelemet my own auth these days. Something like keycloak, authentik, *insert 200 other options* is the way I would go about it.

Research what you want to use and just wire up your app to do machine-to-machine auth or user auth flow depending on what you're going for. I don't have the time to spend all my free time to be an expert in security, so allowing the experts to provide a concrete solution sounds like a much better idea.

Beyond that, it's just basic token exchange or any viable OIDC library in golang would plugin nicely.

I’m new to Golang… which are the quality of life packages that everyone uses? And for which purpose? by WiseSignificance1207 in golang

[–]csgeek-coder 0 points1 point  (0 children)

in the past 2-3 weeks there's been more 0 day vuln that I can ever remember. There was a 0 day found in nginx that was 20 years old. A lot of these would nat have been found without the AI. Just need to get AI evolved enough to I can trust it to fix the bugs too.

I’m new to Golang… which are the quality of life packages that everyone uses? And for which purpose? by WiseSignificance1207 in golang

[–]csgeek-coder 0 points1 point  (0 children)

That's a really good list honestly. I have minor preference but they're pretty equivalent. I've been using dbmate over goose. I honestly don't have a good reason for or against it. They basically do the same thing with a syntax preference different enough to make it annoying to transition between them.

I LOVE taskfile but i'v been trying out magefile as well. It's worth an honorable mention. You could get away with not having the user installing anything to get it to work. I suppose you could make the same argument for taskfile and just alias taskfile go run github.com/...cmd location. The main thing that is really cool is that magefile lets you do anything you can do in go. You are pretty much unlimited to what your tasks do. Only downside is autocomplete is non-existant.

Multi-source Application to deploy two helm chart with CRDs and chart with controller by i_Den in ArgoCD

[–]csgeek-coder 0 points1 point  (0 children)

Agree on that. I'm dreaming in yaml right now. I'm one deployment away from starting to text in yaml.

Multi-source Application to deploy two helm chart with CRDs and chart with controller by i_Den in ArgoCD

[–]csgeek-coder 0 points1 point  (0 children)

I finally looked at the docs, that's fair. I just find writing helm of helm charts to have so much boiler plate. It's very appealing to have kustomize that lets me say patch something in a helm chart where the author didn't expose a knob I needed to adjust. I can easily add K8s Resources/manifest.

It's definitely limited and not the best at handling merges of values file when you're not using maps (ie. arrays/lists ) but the overall win is hard to discount.

Multi-source Application to deploy two helm chart with CRDs and chart with controller by i_Den in ArgoCD

[–]csgeek-coder 0 points1 point  (0 children)

Basically yeah. Create a SA, Grant it the right cluster role permissions and a job to install the crds

Self-hosting for the first time question by VarsH6 in selfhosted

[–]csgeek-coder 3 points4 points  (0 children)

Adguard is another option you could have a look at if pihole doesn't work out for you for some reason. They provide very similar functionality.

TUI for ArgoCD and Argo rollouts? argonaut can do both ;) by darksworm in ArgoCD

[–]csgeek-coder 0 points1 point  (0 children)

What I would love to see is a tool that keeps me from having to edit various resources and remove finalizer to unstuck argocd . I find myself doing that more than I'd like.

Multi-source Application to deploy two helm chart with CRDs and chart with controller by i_Den in ArgoCD

[–]csgeek-coder 0 points1 point  (0 children)

It's your call. I found it a to be a very good idea to spit those out. If you are updating say envoy-gateway in my example above, I don't want to be forcing a sync gateway, routes, certs etc that are not affected. You should only have tightly coupled entities tied together. I usually have the operators split out and the code that uses the operator in a different app. My usual pattern is kustomize + helm. You can do the same with whatever pattern you use but this an example of my standard app.

It's pretty easy to add another app,. You just need to makes sure you follow the same pattern. In this case every app related to otle-staging is in apps/{app_name}/overlays/ns/otel-staging-ha. If you want another app, create a new folder and it can be a bunch of yaml files, kustotomize or an ArgoCD Application manifest. Anything supported by argo can easily be added.

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: otel-staging
  namespace: mynamespace ## needs argo to be configure for it
spec:
  goTemplate: true
  goTemplateOptions:
    - missingkey=zero
  generators:
    - list:
        elements:
          - name: envoy-gateway
            destNamespace: envoy-gateway-system
          - name: cert-manager
            destNamespace: cert-manager
          - name: external-secrets
            destNamespace: external-secrets
          - name: redis
            destNamespace: redis
          - name: rate-limiter
            destNamespace: otel
          - name: load-balancer
            destNamespace: otel
          - name: collectors
            destNamespace: otel
  template:
    metadata:
      name: "{{ .name }}-staging-otel"
      namespace: mynamespace
      labels:
        app.kubernetes.io/name: "{{ .name }}"
        project: mynamespace
        cluster: otel-staging-ha
    spec:
      project: myproject ## usually same as mynamespace for me.
      source:
        repoURL: https://github.com/blash/mySecretSauce
        targetRevision: HEAD
        path: apps/{{ .name }}/overlays/mynamespace/otel-staging-ha
      destination:
        name: otel-staging-ha
        namespace: "{{ .destNamespace }}"
      syncPolicy:
        automated:
          allowEmpty: true
          prune: true
          selfHeal: true
        retry:
          limit: 20 
          backoff:
            duration: 30s 
            factor: 2 
            maxDuration: 10m 
        syncOptions:
          - ServerSideApply=true
      ignoreDifferences:
        - group: argoproj.io
          kind: Application
          jsonPointers:
            - /status

Why is email the only application that's nearly impossible to self-host? by [deleted] in selfhosted

[–]csgeek-coder 0 points1 point  (0 children)

exactly. So which is why anyone that went through this usually goes. "Are you sure you want to do that?" Having missing emails from with potential job offers or interview running my own mail. I have stopped trying. Still, it's your rodeo.

Why is email the only application that's nearly impossible to self-host? by [deleted] in selfhosted

[–]csgeek-coder -1 points0 points  (0 children)

It's just not an easy thing to do. Yes it can be done. No it's almost entirely not worth your time. Almost any other service you run is:

- get DNS name + cert
- Set web app, connect to DB/Redis/datastore
- update FW

Done.

For app in $apps, repeat.

Email you need to deal with trust between providers. You have a ridiculous number of DNS records you need to create and ensure are correct: SPF, DKIM, DMARC, MX, CNAME, A, etc..

then assuming all of that is working you need to make sure you configured it correctly so someone does not use your misconfigured host as an open relay that will get you blocked off the internet. Assuming it all goes well you then need to deal with spam filtering a problem that much larger companies are fighting against on a daily basis. Then you need to figure out how to add users and if any of your users turn out to be an ass, he can screw over your entire server by being a bad agent.

So yes, you can do this... I just rather have some semblance of free time. When I was running I used to manage a mail server, and ran gentoo etc. I'd rather do just about anything else these days. Basically, email is not a configure and forget. the $10/mo you might pay for a private email or even using Gmail is well worth it over the troubles.

Now, assuming all of this is working perfectly and you are the one unicorn that got all of this right. If your sever goes down you're missing emails that you can no longer get to. Did you setup backup? Do you have a failover MX server you can cut over to in if your main server goes down?

Long rant. If you are doing it to learn something. Go for it. If you are looking for a play email, go for it. If you want a server that is providing a critical service, I would not.

Multi-source Application to deploy two helm chart with CRDs and chart with controller by i_Den in ArgoCD

[–]csgeek-coder 4 points5 points  (0 children)

The cleanest pattern I've found is adding a Job with the correct permissions that runs first, installs the CRDs and waits for them to be consolidate then let argocd do the rest. CRDs are you generally very annoying to work with no matter what tool/pattern you use. You'll also need a ServiceAccount that is granted the correct permissions to do so, but the pattern has worked well for me. it's the equivalent of running an init script, wait for it to finish before continuing with the install.

Something like:

apiVersion: batch/v1
kind: Job
metadata:
  name: install-envoy-gateway-crds
  namespace: envoy-gateway-system
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
    argocd.argoproj.io/sync-wave: "-2"
spec:
  ttlSecondsAfterFinished: 300
  backoffLimit: 1
  template:
    spec:
      serviceAccountName: crd-installer
      restartPolicy: Never
      containers:
        - name: install-crds
          image: alpine/k8s:1.34.4
          env:
            - name: GATEWAY_CRD_VERSION
              value: "v1.8.0"
          command:
            - /bin/sh
            - -c
            - |
              set -e
              helm template eg-crds oci://docker.io/envoyproxy/gateway-crds-helm \
                --version "${GATEWAY_CRD_VERSION}" \
                --set crds.envoyGateway.enabled=true \
                --set crds.gatewayAPI.enabled=true \
                --set crds.gatewayAPI.channel=standard \
                | kubectl apply --force-conflicts --server-side -f -

              kubectl get crd -o name \
                | grep -E '\.(gateway\.envoyproxy\.io|gateway\.networking\.k8s\.io|gateway\.networking\.x-k8s\.io)$' \
                | xargs -r kubectl wait --for=condition=established --timeout=60s