#tools-and-devops
1 messages · Page 18 of 1
Ok
Hi there. Currently researching Synology NAS. Does the DSM OS have any out-of-the-box automated image backup system?
I’d like to dedicate a partition in my drives for daily backups up to the last week or so.
any way to compare package versions across multiple distros? any website that does that or something
packages in general, not necessarily python
Compare for what?
Every distro has their own package format, so they’d all look completely different
But in general they’d still be pulling from the same Git repo for the source, so the actual code would be garunteed to be exactly the same
… unless they added their own patch I guess
fucking ads EVERYWHERE
Okay now that I clicked on your second link I’m not getting any
But after I clicked on the first one, every click I made, I had to close a full page add before I could continue
nice ty!
do anyone know about best online AI/ML master course in india ..... ple suggest me
Guys, how can I check if multiple packages (with the specified versions) are compatible? I have been trying to brute force it with just trying and see if they are, but I've been waiting for 3 hrs now for it to finish pip install -r requirements.txt.
So im trying to run this bit of powershell https://paste.pythondiscord.com/JERA in CIBW_BEFORE_BUILD_WINDOWS: in a ghactions script, but it just errors with { was unexpected at this time.
Running before_build...
+ PowerShell -Command "&{ if (![System.IO.File]::Exists('./run-check')) {
git clone https://github.com/microsoft/vcpkg.git;
cd vcpkg;
bootstrap-vcpkg.bat;
cd ..;
./vcpkg/vcpkg.exe install pkgconfig;
echo 'INSTALL ASSIMP';
./vcpkg/vcpkg.exe install assimp:x64-windows-static;
echo 'INSTALL GLM';
./vcpkg/vcpkg.exe install glm:x64-windows-static;
echo 'INSTALL SDL';
./vcpkg/vcpkg.exe install sdl2:x64-windows-static;
New-Item -Path './run-check' -ItemType 'File';
} }"
Missing closing '}' in statement block or type definition.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndCurlyBrace
``` I changed the command a little, but it still seems to be throwing errors
what could i use on linux to annotate my screen? am videoconferencing my code
I have two GH workflows: one runs on push to master, and the second is schedule for everyday
is there a way that I can trigger one to run from tihe other workflow?
and if so, can I trigger just a single job from the workflow?
well, yes.
https://github.com/darklab8/fl-darkstat/blob/master/.github/workflows/deploy.yml
name: CI
on:
push:
branches:
- "master"
- "dev"
jobs:
github-pages:
name: Github Pages
runs-on: ubuntu-22.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out source repository
uses: actions/checkout@v2
- uses: darklab8/fl-configs/.github/actions/checkout-freelancer@master
with:
freelancer-mod: "discovery"
freelancer-folder: ${{ github.workspace }}/fl-data
ssh-key-base64-discovery: ${{ secrets.ID_RSA_FILES_FREELANCER_DISCOVERY }}
# other CI code.
You have two choices.
You can retrigger only specific CI step. In this case u need to put your reusable code logic into "action"
Alternatively if it is entire CI job like
just put it into separate file executable onto Workflow Call
jobs:
ci-run:
name: Run the CI suite
uses: Organization/RepoName/.github/workflows/docker-pytest.yml@master
Workflow example with arguments
.github/workflows/docker-pytest.yml
name: Download the build image and run the tests against it
on:
workflow_call:
inputs:
docker-compose:
description: 'Path of the docker-compose.yml file'
default: 'docker-compose.yml'
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
unit-test:
name: Run pytest
runs-on: [self-hosted, linux, x64]
permissions:
id-token: write
checks: write
contents: write
issues: read
pull-requests: write
steps:
- uses: RepoName/actions/get-name@v5
id: name
if: ${{ !inputs.service }}
- name: Check out source repository
uses: actions/checkout@v3
with:
fetch-depth: 0
# the rest of CI code
you can reuse it then and call both as Job inside primary CI, and as everyday cron jobbed one
Both options can work. Having reusable Actions or reusable Workflow
aight thanks for the explanation
there is a Python script that is executed in the workflow that I want to keep its source private.
is there a way to do this? perhaps I can put it in a private repo along with the workflow that triggers it, and call that workflow from a public repository (of the same organizatio/user) ?
your Github Action or Workflow have to be public to work
But the code they call does not have to be not compiled code.
the regular means to obfuscate code essentially. utilize obfuscation/compilation/or write in language that is actually compilable
Ultimately a super private way for code to remain private =>
=> having workflow calling code logic at remote server 😄
at the cost of keeping your server power, it will remain 100% secret
is there some cheap cloud computing you recommend?
yeah I might actually do it in Rust and upload the binaries, but I will have to change some stuff to make it work
are you sure there is no other way to call a private workflow from a public repo of the same user?
Hetzner is ultra cheap quality i use for normal servers. Single server powers me everything, minecraft, bots, microk8s cluster.
Use it for reliable solution that will not go over limits of your payments. Regular hourly payment strategy.
https://www.hetzner.com/
Otherwise if you are feeling brave and wish it to be extra cheap, with thinking it will not be called more than free tier provides
https://aws.amazon.com/lambda/pricing/
The monthly request price is $0.20 per one million requests and the free tier provides 1 million requests per month.
you could make it running technically for free through AWS lambda calls.
But don't joke with not setting limits/alerts for pricing consumption 😄 otherwise u can receive payment charge more than your home costs.
Rate limiting is heavily encouraged for public services to set, in order to avoid surprises.
Your partner for system-wide hosting, from cloud to dedicated servers. We deploy the latest tech at the best price in minutes.
LOL
that already happened to me with AWS
I need to open a new account to try it again
I've been seeing hetzner ads all over YT lately...
They are great. I like them ^_^ German quality
Terraform compatibility, API access
Quick creation and destruction
Ultra cheap prices (especially for arm64)
other than AWS, what other cloud providers have a decent free tier? (I wont be using more than 20 mins of CPU time a month)
Check how cool their ARM64 prices
like, 4 times more hardware power than you could get from Digital Ocean for same price 😄
ergh, GCP
Digital Ocean too
probably Azure
than more complex provider => than longer their free tier as honey trap 🙂
DO is simple
but free tier for month or 2-3 months, not remembering exactly
Start your free trial with a $200 credit for 60 days
nvm
design solutions to run at client side => and run them for free as Github Pages or other static assets free service 😉
otherwise yeah... AWS lambdas or their equivalent in other providers is potential free power. free with great caution.
it is harder to implement such logic for backend devs though.. i managed to do it with building solution as static site generator
but otherwise it is more friendly to modern frontend js devs
some room is getting opening to us mortals (in other languages living) than more mature web wasm becomes though
what? can I run a GH workflow locally?
ergh... in specific of GH workflow...
u can run locally if u wish.
Self hosted runners use for yourself (we use them for organization to have Github for private repos for free ^_^)
optionally there is nektos/act program to debug locally
had a look at it, looks interesting
I will think about it, but so far the simplest and most free solution is save the code in a private repo, and then add a workflow that compiles and obfuscates it, and uploads the binaries to the public repo
I was thinking about it, how would you go about doing that?
was thinking of storing a "secret string" inside the code, and when the public repo calls the binary, it passes the token as an argument (which is stored a GH secret)
well, forget that i said that
it sounds like against TOS
and immoral, with against culture of FOSS
I highly doubt it is
ergh, immoral people never doubt their dishonest ways 😄 they think they do things right
its for an open source and its also generate the documentation
trust me, it is immoral.
u mentioned yourself that it will be closed source. Therefore it is not open source
why are you so quick to judge, you dont even know the details other that I want to make it private
I'll put it simply for you: close-source script that generates files for an open-source project (yeah, the output is public)
i don't like the direction of our conversation. in my opinon we go against TOS waters, so go on without me to that
well, literally closed source. Closed source can't be open source. You named it yourself.
so what if the script is closed source? it would be the same thing if I called a lambda function from a GH workflow
then it is your private service that remains private
abusing public free hardpower for that is kind of bad. potentially will lead to your account termination if that will be discovered in large amount
public free Github Runners were made free for open source
yours is not
therefore you will be abusing it
simple as that
🤨
what is your reason for the code to remain closed source? despite the project being open source?
wtf are you talking about
by your logic having a GH actions workflow in a private repo is against TOS, because "public free Github Runners were made free for open source" and nobody benefits from it
bruh you need to calm down with this mod-behaviour
that would be none of your business
let's not turn this into a useless argument
i think this is a misunderstanding, my understanding is that you are shipping some sort of proprietary application? regardless, it's not great to put binaries in git repos whatsoever assuming that "upload the binaries to a public repo" means pushing them into the Git object store, distribute your applications through some other website and sign them cryptographically to ensure security
could someone explain to me how am I supposed to handle users, connections, and elevated rights while automating stuff through ssh ?
I'm a bit lost: apparently I shouldn't run commands as root or sudoer (and most tools don't handle it anyway), but I feel like most tasks needs elevated rights
for example starting a container, or copying a config file or secrets
send me a site to do beginner programs and exercices
thanks
Hey guys!
I’d like to introduce you to my indie product Apitally (https://apitally.io), a simple API monitoring & analytics tool for Python projects.
Apitally provides insights into API traffic, errors, and performance, for the whole API, each endpoint and individual API consumers. It also monitors API uptime, alerting users when their API is down.
The big monitoring platforms (Datadog etc.) can be a bit overwhelming & expensive, particularly for simpler use cases. So Apitally’s key differentiators are simplicity & affordability, with the goal to make it as easy as possible for users to understand usage and performance of their APIs.
Apitally directly integrates with various web frameworks (FastAPI, Django, Flask, Litestar) through middleware, which captures request & response metadata (never anything sensitive!) and asynchronously ships it to Apitally’s servers in regular intervals.
Please let me know what you think!
!rule ad
Hi everyone.
About automating stuff through ssh and best practice in terms of security, here's where I am so far:
- have a dedicated user for automation, with no passwd (but with ssh pubkey check)
- give precises rights to that user using permissions and the sudoers file
- don't store anything secrets in the docker compose files. Secrets needs to be handle in another way (for example using docker secrets)
Here's my questions:
- how to deploy things that are inherently secrets ? For exemple, https certificates, or config files with secrets in it
- how can I allow a user to use docker container create or docker container stop, but not say docker secrets or docker exec ?
- related to the previous question: Do I need to create scripts with rx rights for the automation user to use
Fair warning. Using Docker Swarm is discrouraged and that's not the thing where main community support. Kubernetes is recommended default for container orchestration.
how to deploy things that are inherently secrets ? For exemple, https certificates, or config files with secrets in it
Okay, lets imagine it was me who was doing that.
- I would store your cert https_certificates, and secret values in AWS Secret Manager/SSM manager or for self hosted Hashicorp Vault is an option. For the purpose of not storing secrets in git repo, and having programmatic access to them. Configurational not secret fiiles will not be stored in it! They are fine to keep in git repository directly.
- i would connected my Docker access over SSH port forwarding
provider "docker" {
host = "ssh://user@remote-host:22"
ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null"]
}
- Applied necessary secrets/configs/services creations with terraform. It automatically would patch existing things or remove outdated no longer needed stuff
https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/secret
The end of story
how can I allow a user to use docker container create or docker container stop, but not say docker secrets or docker exec ?
https://docs.docker.com/engine/swarm/configs/ default docker secret feature. works only for swarm services
related to the previous question: Do I need to create scripts with rx rights for the automation user to use
API documentation does not hints it being needed
just to be clear (my english can be lacking at times) are you saying I should look into Kubernetes instead of deploying docker container directly ?
if u use Docker Swarm... then yeah.
You do. Docker Secrets/Config/Servces are Docker Swarm (Container orchestration) only things
that is already beyond regular docker
^_^
You are entering entire WORMHOLE of problems tbh
Container scheduling in self hosted way... urgh.
I'm seriously considering just using portainer to deploy stuff and forget about repeatability
I mean, not automating shit, and just do everything manually
next devs to support it will be screwed
it's personal it's not really an issue
ah, then do anything u wish 😅
also it's not a bug, it's a feature in job security
personally i use for personal usage just Docker Terraform and nothing else
no swarm
comfortable enough
still with AWS ?
so through ssh ?
Terraform docker over ssh daemon connection yeah
i run microk8s in addition, to experiment if it will be worth it, may be may be. its ecosystem offers really easy to configure monitoring. Somewhat hesitant but very tempting
and without docker compose
ugh.. one of my apps runs on just docker-compose. Minecraft server
https://github.com/darklab8/infra-game-servers/blob/master/server_modded_1710/docker-compose.debug.yml lazy to translate it to terraform yet
I will refactor it later.
in general it runs on terraform though without compose
i use docker hub public/private registry for free image storage https://hub.docker.com/
minecraft server is not yet refactored to this approach... but i will... because i am afraid i will not be able to relaunch it in a year if i will not do it (very fragile amount of dependencies inside this image, that are potentially not rebuildable in a year)
it's slowly starting to make sence
a whole repos with lots of infra project ?
don't mind if I do :3
... i am influenced in how we do stuff at work
https://github.com/darklab8/infra single repo to create cluster + i use it for reusable infra code
Dedicated projects like discord bot import my reusable code from the repo and apply their own specifics to run apps
https://github.com/darklab8/fl-darkbot/blob/master/tf/production/main.tf
Except at work we publish under git tag reusable modules and lock to specific version. for my pet projects i am lazy to do it and prefering using always latest code
module "ecr" {
source = "git@github.com:Company/tf.git//modules/ecr?ref=v0.102"
name = "prometheusian"
}
reusage at work properly.
me lazily at pet projects
module "server" {
source = "../../../infra/tf/modules/hetzner_server/data"
name = "node-arm"
}
so basically, from the ground up:
- I create my custom image, with the right config, the right everything
- I upload it
- I use terraform just to pull and deploy said image
- and voilà
🤔 almost correct
Secrets i inject via environment variables into the container for running
optionally i could be utilizing volumes to preserve state or inject file secrets (not needed that in projects file secrets)
yes I've seen that, but I still need to figure everything out about that
the docker I've seen example used redis to manage secrets, and I don't know redis
😅 my pet projects are written with a switching interchangability between Docker running and Kubernetes running
in case my kubernetes will fail again and i will be lazy to maintain it... i fallback to good old docker (because i have real users depending on them, i need somehow to run them)
Terraform code is flexible enough to allow me reusing infra code for both solutions
btw, I means your automation user has the right to run kubernetis/docker, right ?
yes. i just use root users at servers for connection over ssh. i am lazy person
provider "docker" {
host = "ssh://root@${module.server.ipv4_address}:22"
ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.ssh/id_rsa.darklab"]
}
if that user is hacked what prevents the hacker to simply connect to a container and steal the secrets from the env ?
it will be possible to hack only if hacker will obtain id_rsa ssh file
true
kind of tough to do.
I guess it leaves only the physicial attack, but yes
also Docker/Kubernetes secrets aren't really secrets anyway. just base64 encryption
To protect such stuff in reliable way from host itself is veeeeeery bothersome
I see
modern approach to security for such usage cases usually running at most Docker containers in locked file system with non root users
mitigating damage to single container only compromised
Tbh i learned my lesson i think how to make minecraft docker-compose running easily via terraform
i never should have written docker-compose in the first place
i should have written terraform from the start
and added easy approach to debug it locally (simple enough to do)
that would be a good way to keep everything terraformed in a simpliest way with no code duplications or translating effort
@placid glen sorry if I'm late to the party and not addressing all of your question, but the gist I'm getting is that you want to deploy a container with some secrets and maybe some scaling. IMHO Google Cloud Run is pretty easy and reliable and even "free" most likely if it is an app "just for you."
no swarm or compose or anything. just whatever container you have working, push it up there, and it works. secret management would be like using env variables which are set one way on your computer but then in Cloud Run defined separately (so to use one database locally but another when on Cloud Run as an example)
I have a bunch a dedicated servers running on debian
ahh, outside my wheelhouse, then. sorry. good luck!
# Set commit status using GitHub API
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository_owner}}/${{ github.repository }}/statuses/${{github.sha}} \
-d "{\"state\": \"${state}\", \"description\": \"${description}\", \"context\": \"Testing the API\"}"
why this keep failing
Run state="success"
state="success"
description=$(if [ "success" == "success" ]; then echo "All tests passed successfully!"; else echo "Tests failed. Check logs for details."; fi)
# Set commit status using GitHub API
curl -X POST \
-H "Authorization: ***" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Anubhav1603/Anubhav1603/Alpha-Demons-API/statuses/158834f6b6fb2d9d24f512b8178b426b349acc7c \
-d "{\"state\": \"${state}\", \"description\": \"${description}\", \"context\": \"Testing the API\"}"
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 202 100 103 100 99 501 481 --:--:-- --:--:-- --:--:-- 985
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest",
"status": "404"
}
make sure that the -d flag to curl means what you think it means -- it might expect data to be in key-value format
url -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"content\": \"Tests failed on branch '${{ github.ref_name }}'.\\n\\n$(grep -E 'FAILED' pytest_output.log | sed -E 's/FAILED ([^ ]+)::([^ ]+).*/\1\\\n\2/')\"}" "${{ secrets.DISCORD_WEB_HOOK }}"
It's so annoying the tests which fails get printed in terminal well of GitHub actions but I am getting constant error in above command from discord for format of json isn't correct ,don't know why
You're thinking of -F
I'm not really thinking at all; I'm more vibing 🙂
Does anyone know how to have two separate sets of ruff linting rules in the same pyproject.toml? I'd like to have one light check for the CI and one comprehensive ruleset for local linting
off the top of my head, that sounds like something you should control via the command line, not the toml file
yea you're right, I just realized I can do --select ALL or any specific rule
it overrides the toml config
I want to do the following:
get the server running while I am offline
get the server better security
change the http/url to be more user friendly
whichever one you feel comfortable helping with is ok : ]
Your Django app can only be reachable when it's running and connected. You probably want it on the cloud
Look up guides to Django security like the one in the official documentation and the one from OWASP
You probably want to buy a domain name
any suggestions on doing any of this?
organized_failed_tests=$(echo "${failed_tests}" | awk '
{
if ($1 ~ /\.py$/) {
if (file != $1) {
if (file != "") printf "\n"
file = $1
printf "%s\r\n", file
if ($2 != "") printf "%s\n", $2
}
} else {
if ($1 != "") printf "%s\n", $1
}
}
' | sed '/^\s*$/d')
this is what i am getting
tests/test_example.py
test_read_example
tests/test_root.py
test_read_main
test_read_mains
this is what i want
tests/test_example.py
test_read_example
tests/test_root.py
test_read_main
test_read_mains
for some reason new line isnt getting added
What's the input?
my rule about shell scripts is: if they grow to more than (say) three lines, I replace them with a python program 🙂
Hello I want to create a tool to convert PDF files with tables with no borders to excel using python how can I do that?
Do yourself a favor and don't look at this.
https://github.com/killjoy1221/dlvsix
Maybe I should get this built into the code-cli
Hi guys, I've been trying to make a pyhton tool with which i can save all currently opened opera-gx tabs as shortcuts on my pc. i tried asking chatgpt but the code doesn't work (even after a lot of back-and-forth and changing the code) can someone help me? This is the code i am currently trying to run:
from selenium.webdriver.chrome.service import Service
opera_driver_path = 'C:\\cool pictures\\python programs\\operadriver_win64\\operadriver.exe'
opera_path = 'C:\\Users\\tobia\\AppData\\Local\\Programs\\Opera GX\\launcher.exe'
options = webdriver.ChromeOptions()
options.binary_location = opera_path
service = Service(opera_driver_path)
driver = webdriver.Chrome(service=service, options=options)
urls = []
for handle in driver.window_handles:
driver.switch_to.window(handle)
urls.append(driver.current_url)
for url in urls:
print(url)```
However if i run this code i get the following error:
```PS C:\Users\tobia> & C:/Users/tobia/AppData/Local/Programs/Python/Python311/python.exe "c:/cool pictures/python programs/tab-saving-automation.py"
Traceback (most recent call last):
File "C:\Users\tobia\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 64, in _binary_paths
raise ValueError(f"The path is not a valid file: {path}")
ValueError: The path is not a valid file: C:\cool pictures\python programs\operadriver_win64\operadriver.exe```
Does anyone know any ai tools to edit videos and text to speech
anyone has Linux resources
Moving from the wrong channel (sorry!) so here's the link where I started from.
#packaging-and-distribution message
So google was very dissapointing in this case because it always talks about development, but not what comes after. Our setup probably isn't conventional which complicates things.
So right now, we have a linux machine we call the "Business Box" where all of the COBOL and Python programs reside. All of the Pythons are written in 3.9, and we can't upgrade because one of the modules breaks at 3.10 due to the connector or something. It came up that people use virtual environments (my school skipped over these) for developing programs, but it was my understanding that once a project is finished, we're supposed to move it from dev to the overall production environment.
The question I asked in the wrong channel was about getting clarification on the use of virtual environments in production rather than a single production environment.
Forgot to mention that users access these programs through a separate menu system (COBOL) through Putty sessions.
somewhat vague description but let me describe you common minimap setup to utilize venvs
you created your dev venv and have it activated
stuff is installed to develop. You write manually primary dependencies into requirements.txt. Optionally they can be having specified minimal necessary version or required one
you do pip freeze > constraints.txt to lock all installed libraries to exact versions
when other devs develop from other machine (or u deploy to prod) => you are supposed to install dependencies as pip install -r requirements -c constraints.txt (for activated venv lets say)
this makes dependencies reproducable
because u will have installed exact dependencies as your dev environment
we at work utilize pipenv that handles this manual dependency management for us into automatic
other people utilize poetry commonly today
those utilities manage Dependency file and its Lock file for you
you will be required just to point what to install and what to upgrade
in my minimalistic projects i am lazy and just use pip install -r requirements.txt -c constraints.txt, because it can work without any extra stuff installed for that
Exact instruction to create and active venv depends on your used OS
for Linux there is one instruction, for Windows another one
for linux i just use
python3 -m venv .venv(optionally i usepython3.10or some other exact python version to create specific venv version) (it works as long as i have installedapt install -y python3-venvor some other python specific version venv, likepython3.10-venvsource .venv/bin/activateactivates it for current shell. You can use it without activation for programmatic purposes..venv/bin/python3 your_program.pywill make venv used without activation
windows has 2 depending on your shell
@sturdy seal for windows my instruction if you plan running it at Linux servers
will be: Use WSL2, and have more or less similar linux env 😊
f*** windows. https://www.youtube.com/watch?v=2zpCOYkdvTQ
😂
Thank you for the pointer. I'm confused about constraints.txt, though. Doesn't requirements.txt set the version?
Because when I use them, with the exception of the trouble module, I edit it from == to >= so I get the newest ones.
Otherwise I'm unable to upgrade the individual packages. (Packages? Modules? Libraries?)
constraints.txt dependencies aren't installed, constraints.txt is just used to lock all dependencies (including secondary ones) to specific versions
that allows keeping dependencies in rqeuirements.txt only main ones, without specific version or only with more than specific version and etc. helping easier keep track what are main deps and removing them when necessary
in this strategy requirements.txt is human written. constraints.txt is autogenerated with pip freeze or other tool (preferably your CI validates that u keep it up to date)
I see, so the requirements would only name the library, but wouldn't have the == version?
yeah. point exact version in requirements.txt or >= minimum version only if it is trully necessary for not breaking stuff
I gotcha. The next step then is to learn poetry (we were already looking at this). Thank you 😄
@rapid sparrow Do you ever run into size issues when having several venvs?
Not really. Although it is slightly sad that my repos folder at dev machine has weight 114 GBs currently. I blame python module packages as main source
And then that same size in production?
Or do you move from the dev machine to production machine
size in production can varry from hundreds of megobytes to 2 GBs i think (2-4 gbs is probably fatest service we have)
but that's Docker image packaged with all dependencies for its running (OS level included, compilers and etc), and we never used technics to downsize final layer
There was never need for that. It is very small size to care for us
I see. We don't use docker here. The plan is to develop the stuff and then reclone it to the production server and build the venv there, then remove it from the dev server until we need to edit or test or whatever.
We build in CI, that autouploads Docker artefact with all dependencies frozen to docke registry
The same image with exactly all things frozen/installed is unit tested before being saved as valid for deployment
Container scheduling clusters pull Docker image for its running in AWS ECS and Kubernetes clusters
Ah. Our stuff all runs on a linux machine with putty sessions for each user.
Sounds very weird stuff 😅
Probably is. But it's my first job after college, so I don't really have anything to compare to, experience wise.
can someone help me
With?
i dont now how i can use and install colorama
pip install colorama
if I have two GH actions workflows: test_and_update_examples.yml and publish_pypi.yml, how do I make it so it publishes only if the tests don't fail?
make Test workflow with Workflow Call parameter
and call from publish before it publishes
things like that to test workflow
on:
pull_request: {}
workflow_call:
and to publish beginning:
jobs:
ci-run:
name: Run the CI suite
uses: Company/RepoName/.github/workflows/ci.yml@master
secrets: inherit
FROM python:3.11.4-bookworm
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD [ "python3", "manage.py", "runserver", "0.0.0.0:8000"]
``` I keep getting this error ``` ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
I created multiple images and deployed to productions before. Just forgot what is is all about.
You need to check the logs for more info but it looks like a dependency failing to install
Yeah. just wondering which dependency that is 'cause I did pip freeze > requirments.txt to get the same depednecies that I used in the app.
FROM python:3.11.4-bookworm
WORKDIR /app
COPY requirements.txt requirements.txt
Comment out everything but this and run
docker build --tag -test .docker run --it --rm test bash// entering shellpip install -r requirements.txt
and debug from console
And does docker logs [container id goes here] not tell you that?
Do you guys run docker on wsl on windows 11
I run podman on wsl
You bet
Thanks
once in a year when i have to work from windows 😅
otherwise straight using from Linux
anyone know if there's a github action to do:
poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';' > requirements.txt
on poetry.lock updates?
I don't know how to write github actions this is why i Make this thread today.
jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: pip install poetry
- run: poetry export --without-hashes --without-urls -o requirements.txt
- uses: EndBug/add-and-commit@v9
with:
message: Export requirements.txt
name: Update requirements.txt
on:
push:
paths:
- poetry.lock
jobs:
update-requirements:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Specify the Python version you need
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "::add-path::$HOME/.local/bin"
- name: Install dependencies
run: poetry install
- name: Export dependencies to requirements.txt
run: poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';' > requirements.txt
- name: Show generated requirements.txt
run: cat requirements.txt
someone sent me this
Why do you need the awk?
I found the output before
aiodns==3.2.0
aiofiles==0.8.0
aiogifs @ git+https://github.com/moanie/aiogifs.git@730fdb7bca18842db93b71cf0c50b93f9cc3c31a
aiohttp==3.9.5
aiosignal==1.3.1
aiosqlite==0.17.0
discord-games @ git+https://github.com/Tom-the-Bomb/Discord-Games@585e0dddb24aefbcc16569a2f7db44d1d194107a
discord-py @ git+https://github.com/Rapptz/discord.py.git@3a8063602919813e91d19101f9b5a0e9e7438d4b
discord-py-paginators @ git+https://github.com/Soheab/discord-py-paginators@3ed81f3bbd6637c91625cddb9568b5f4d21f832a
discord-py[speed,voice] @ git+https://github.com/Rapptz/discord.py.git@3a8063602919813e91d19101f9b5a0e9e7438d4b
it outputs nicely like this
my deps are somewhat from github
but mostly static from pypi
anyway awk is needed to do the formatting
It shouldn't. poetry export should create a file that can be consumed by pip
the format I received stops hashes and funky other junky
That's what --without-hashes is for
to create something like that
I am also trying to avoid python_version junk too
the ; in the requirements creates constraints for each dependency, like platform support.
Then just target a single version in tool.poetry.dependencies.python
or target latest
I am currently just trying to modify the script to actually push out the commit
Add this to the end of your steps ```yml
- uses: EndBug/add-and-commit@v9
with:
message: Export requirements.txt
name: Update requirements.txt
on:
push:
paths:
- poetry.lock
jobs:
update-requirements:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Specify the Python version you need
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "::add-path::$HOME/.local/bin"
- name: Install dependencies
run: poetry install
- name: Export dependencies to requirements.txt
run: poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';' > requirements.txt
- name: Show generated requirements.txt
run: cat requirements.txt
- uses: EndBug/add-and-commit@v9
with:
message: Export requirements.txt
Like that?
yes. Add a name if you like
I think it is fine as is
I just named the actual file
auto-poetry
Time to test it with an updated poetry.lock
yeah, this didn't work
it failed to install poetry
because of some env thing right?
Replace this ```yml
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "::add-path::$HOME/.local/bin"
With this ```yml
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1 # insert your poetry version here
What's the action do?
You can probably skip installing the package
So you don't need to do poetry install
You sent an empty commit
an empty commit does not include poetry.lock
@dim eagle
Do git refactor and a force push
What's a git refactor?
rebase I mean
Idk really know what a rebase is
you can use git rebase -i HEAD^^^ to rewrite the history.
it will generate a new commit, which you'll have to git push -f
You should do it in a new branch btw
?
looks like it works
I do worry about:
Warning: poetry-plugin-export will not be installed by default in a future version of Poetry.
In order to avoid a breaking change and make your automation forward-compatible, please install poetry-plugin-export explicitly. See https://python-poetry.org/docs/plugins/#using-plugins for details on how to install a plugin.
To disable this warning run 'poetry config warnings.export false'.
Plugins Poetry supports using and building plugins if you wish to alter or expand Poetry’s functionality with your own.
For example if your environment poses special requirements on the behaviour of Poetry which do not apply to the majority of its users or if you wish to accomplish something with Poetry in a way that is not desired by most users...
snok/install-poetry#53
poetry self add export [11:32:51]
Using version ^0.2.1 for export
Updating dependencies
Resolving dependencies... (1.7s)
Resolving dependencies... (1.9s)
list index out of range

It may be poetry-plugin-export
poetry self update [11:33:03]
Updating Poetry version ...
Using version ^1.8.3 for poetry
Updating dependencies
Resolving dependencies... (1.5s)
list index out of range
huh
poetry plugin add export [11:34:28]
The command "plugin" does not exist.
Did you mean this?
self show plugins
poetry self add poetry-plugin-export [11:35:02]
Using version ^1.8.0 for poetry-plugin-export
Updating dependencies
Resolving dependencies... (1.7s)
list index out of range
I am so confused
Click the link?
I commented out everything and still getting this error ```py
ERROR: failed to solve: process "/bin/sh -c pip3 install -r requirements.txt" did not complete successfully: exit code: 1
...
The docker build test command isn't recognize for some reason.
Sorry But I'm not sure which dependecy is causeing this error
I haven't created the image yet. I'm not sure if the docker logs is going to give me details about the image.
I think I found the issue ... it is the " RUN pip3 install -r requirements.txt" line
@rapid sparrow I fixed the issue 🙂 . I simply restarted my computer removed the "requirments.txt" and re-run pip freeze > requirements.txt` Again. I think I fogot to active my virtual enviroment that I created using poetry and created the first requirments.txt file without activing it .... this created a requirments.txt file using the libraries and things i installed on my base OS.
party hard 🎉
https://github.com/JDsProjects/asuna_api/actions/runs/9763733906
hi I have a failed runner
Python wrapper for asuna.ga. Contribute to JDsProjects/asuna_api development by creating an account on GitHub.
How would I Fix this?
it's supposed to update the pypi package whenever I make a new release
but it failed
Seems like you need to retry the build
it also told me no run could get it
and that the ubuntu version was outdated
do you see anything wrong with the config rn?
Oh right https://github.com/JDsProjects/asuna_api/blob/50f27c8d71d47583a5b2a918f8621915ec84e8e4/.github/workflows/publish-to-test-pypi.yml#L9 this Ubuntu version is too old
.github/workflows/publish-to-test-pypi.yml line 9
runs-on: ubuntu-18.04```
oh
What version should I update it too?
Latest
alr
Let's see if this works
Python wrapper for asuna.ga. Contribute to JDsProjects/asuna_api development by creating an account on GitHub.
emojis in a workflow name 👀
hm?
https://github.com/JDsProjects/asuna_api/blob/main/.github/workflows/publish-to-test-pypi.yml
Idk what's up now.
Python wrapper for asuna.ga. Contribute to JDsProjects/asuna_api development by creating an account on GitHub.
Latest doesn't exist
GitHub is waiting for you to create it
swap to ubuntu-latest
They did, they just haven't released it yet
https://github.com/JDsProjects/asuna_api/blob/main/.github/workflows/publish-to-test-pypi.yml#L9
.github/workflows/publish-to-test-pypi.yml line 9
runs-on: ubuntu-latest```
ah
Idk why it can't run
Because you tried to run it on Latest
If you look at the workflow file the job ran with, it says Latest
You've changed it in the default branch
Now you just need to make a new release
oh I see
Because it's 0.15
You only run your workflow if there's three dots
You can see that it didn't run for that tag
Oh
Oops
Let me do 0.1.5
Is there a remind me bot?
About to eat my birthday dinner on my bday
Pytest for testing ci/cd scripts?
Sooo, I have a few Dockerfiles
https://gitlab.com/highly-unlikely/tahoe-dx-primer/-/tree/main/Docker?ref_type=heads
and eventually might string some of them together with docker-compose.
I'm thinking that it would be nice to have some tests, for example, did the images build? Are they they recent?
Is there a method for testing CI/CD?
Do I just run tests against the resulting artifacts?
!help remind
!remind [mentions]... <expiration> [content]
Can also use: reminder, reminders, remindme
Commands for managing your reminders.
The expiration duration of !remind new supports the following symbols for each unit of time: - years: Y, y, year, years - months: m, month, months - weeks: w, W, week, weeks - days: d, D, day, days - hours: H, h, hour, hours - minutes: M, minute, minutes - seconds: S, s, second, seconds
For example, to set a reminder that expires in 3 days and 1 minute, you can do !remind new 3d1M Do something.
Subcommands:
!remind delete [ids]...
Delete up to (and including) 5 of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> [content]
Set yourself a simple reminder.
404, either a typo or a private repo
🎂
Oh, sorry, I forgot the repo is private. I can make it public

It seems to be working rn
Python wrapper for asuna.ga. Contribute to JDsProjects/asuna_api development by creating an account on GitHub.
I do have a few warnings
!warn 274879044577918976 do not post crackware
:incoming_envelope: :ok_hand: applied warning to @candid scaffold.
This should fix those warnings: JDsProjects/asuna_api#4
Though before you merge it -- do you actually support Python 3.4? If you do, I would double check it actually works on that first. IIRC some of this was only added in like 3.7.
I think I can drop 3.4
Most people would be 3.8 and up
Would mind adding that to the pr?
yea, setuptools 61.0.0 (when pyproject.toml was introduced) only supports 3.7+, and i believe that got raised to 3.8+ in 68.1.0
So if you put this in your pyproject.toml, will it imply >=61.0?
[build-system]
requires = ["setuptools"]
build_backend = "setuptools.build_meta"
I have to go now
I can do it, but it will be much later today
Hmm
question before: is it allowed here to ask about non pep-compliant things here? having problems with installing some hellish "addon" …
(like i installed and doesn't work and/or i don't know something…)
What is it?
thought of boosting a little calculations so decided to install… just that doesn't work…
Show the code you're using?
# coding: cursed-for
for (i=0; i<512; i=+16):
print(i)
top line literally copied from readme
# coding: cursed_for
ye
Underscore, not dash
You used a dash
Just tried myself. It works.
% cat main.py && .venv/bin/python main.py
# coding: cursed_for
for(i = 0; i < 10; i+=2):
print(i)
0
2
4
6
8
i do just ./file.py …
Do you have a shebang?
no shebang means it runs in bash
forgot, yep 🤦♀️
(now dealing with non-incremented values but sort-of works i think…)
fixed even that. lots of LOC saved :D
alr I'll check
merged
🎉
Pushing a new release
Trusted Publishers allows publishing packages to PyPI from automated environments like GitHub Actions without needing to use username/password combinations or API tokens to authenticate with PyPI. Read more: https://docs.pypi.org/trusted-publishers
hm?
One thing that's confusing me -- What exactly are you trying to do with your version?
You bumped your project to 0.3.2 but then created a release called 0.1.6.
Problematic old method to handle it
I see

Go to https://pypi.org/manage/project/asuna-api/settings/publishing/ and set it up like this --
Then you can delete this line: https://github.com/JDsProjects/asuna_api/blob/main/.github/workflows/python-pypi-publish.yaml#L62
.github/workflows/python-pypi-publish.yaml line 62
password: ${{ secrets.PYPI_API_TOKEN }}```
is it fine if i get rid of the api token already there in the github settings too?
TL;DR: filling out the form allows GitHub to request a temporary password when your Workflow runs, so you don't need to add one
Yeah, you should delete it from PyPI too, since you're not using it anymore
Yeah, see my picture
First is your username
Second is the repo name
Third is the workflow file name
Fourth is https://github.com/JDsProjects/asuna_api/blob/main/.github/workflows/python-pypi-publish.yaml#L46-L47
.github/workflows/python-pypi-publish.yaml lines 46 to 47
environment:
name: pypi```
You need the fourth one
It's pypi
That good?
Looks good
👍
(node:1932) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Usenode --trace-deprecation ...to show where the warning was created) ???
Python wrapper for asuna.ga. Contribute to JDsProjects/asuna_api development by creating an account on GitHub.
builds that it seems fine
That's part of the download-artifact step, not part of your project, so you can just wait for them to update their code
Looks like 4.1.7 is still their latest release, so no new updates yet: https://github.com/actions/download-artifact/releases/tag/v4.1.7
oh.
You can have Dependabot check for new updates for you
Here's a PR showing an example with it set to check once a month: https://github.com/JDsProjects/asuna_api/pull/5
Oh look at that it already found a couple things to update
Anyways... I know I kinda dumped a lot on you.
Does all that get you what you needed?
Ok, it should be public now.
I think that'll be fine
to be bad I cannot check for json updates on another repo and prettify them
with indent=4
will git cherrypick create a new commit hash or will it use the same hash?
A question that u could check just by running and seeing the resulting hash.
Anyway, they should be having new commit hashes
i have:
0: initial commit
1(HEAD): #1
2: #b
3: #c
i want to skip #b and merge/cherrypick #c
if i'm asking here it means i want to avoid "running and seeing ..." on the off chance i create an irreversible mistake.
if you don't know then no need to answer. it would be more efficient to keep quiet
Cherry-picking creates a new commit, usually (?).
I think the only time it wouldn't is if the commit already has the current HEAD as a parent.
https://learngitbranching.js.org/
there is a cool visual tutorial to learn and to try different commands in its sandbox also
it visualizes result in real time, showing how commits will be
so what do i do in this situation? i want to skip #b and only merge #c
It's not clear to me how the ancestry relations are there. 0 is parent of 1 is parent of 2 is parent of 3?
🚫 no thanks. 🚫 . i already have something much better than this. i have the atlassian git docs open. the reason i am asking here is becoz i can't find the answer on the docs/SO/blogs.
i wrote that in reverse. 0 is the base. that's why it is 0
Can you answer my question?
Like is it a linear history?
i think i just did
yes ..
i have simplified the scenario. if you can answer this i can figure out what to do
In that case, you can indeed cherry-pick commit 3. It will create a new commit, but that's unavoidable if 3's parent is 2, since a commit's identity includes the parent.
maybe i should rebase -i and drop the #2 commit 
That's the other option, yeah, but then you first have to go to commit 3. The result will be the same.
i just don't want create a new commit as it will mess up my commit history
That is impossible, sorry. Changing a commit's parents will always create a new commit.
remote / origin has:
0: initial commit
1: #a
2: #b
3: #c (HEAD)
i have on my local repo:
0: initial commit
1: #a (HEAD)
i just want #c without #b on my local repo
yeah i've done git fetch.. cherry-pick i was going to.. but just wanted to make sure it will keep the same commit hash or will it create a new hash 3: #d?
As I said, it will create a new commit hash and there's no way around that.
so if it creates a new hash.. and next time i push to remote.. it will mess up remote's history

Correct. You can of course also remove that commit from the remote, if you're working on it alone, by doing git push --force-with-lease.
But if you don't want to mess with the remote: Yes, then you can't push to it anymore.
I created a React app with vite. I am trying to to decroize the app using a Dockerfile. But I keep getting this error js ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 127
Here is my instructions
FROM node:22.4.0-alpine
WORKDIR /app
ENV PATH="./node_modules/.bin:$PATH"
COPY . .
RUN npm run build
CMD ["npm", "run", "dev"]
I tried that and saw 0.257 npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/app/package.json' which is likely relevant 🙂
ENV PATH="./node_modules/.bin:$PATH"
looks like incorrect line to me 🤔 u are supposed to create.dockerignorefile and inputting node_modules/ folder into ignored, not copied folder/files
as well as adding... at this step copying only package.json + lock file and running npm i command to install stuff
and only after that copying the rest of files
that will ensure correct caching + a way docker is intended being used
Is there a way you can install dependencies in heroku?
If all u need extra python dependencies, then Heroku installs them if u define them in any way https://devcenter.heroku.com/articles/deploying-python
if u need system/OS level extra dependencies... u a probably looking at deployment with docker containers
It supports requirements.txt or Pipfile
why hello there
def main():
message()
response()
def message():
input("Message: ")
def response():
you_say_something = input("Response: ")
if you_say_something == (""):
print("womp womp")
else: print("Yay!")
main()
memes!
...
?
!
!=
Thanks @rapid sparrow ! What I really want to do is deplyoy a React + Django + PostgreSQL app to EC2 using Gunicorn and Nignx. I did this a while ago and now I feel like I have to go back and re-learn Docker / docker-compose again 😥
Hi guys, I'm studying webscraping and trying to webscrap a pokedex website:
If I write code like this:
print(pokename)```
This is the output:
<div class="pokedex-pokemon-pagination-title">
<div>
Bulbasaur
<span class="pokemon-number">Nº 0001</span>
</div>
</div>
If I write code like this
pokename = soup.find('div', class_='pokedex-pokemon-pagination-title')
for pokenames in pokename:
print(pokenames.text)
This is the output:
How can I remove this spaces?
So this is general python and not really soup or tools/devops. But:
Just do .strip() on a string to remove leading or trailing whitespace.
can I ask about ruff here?
Hello I am a starter, and have learned Python a bit, can anyone help me guide a bit please? seriously passionate guy here seeking guidance! Thanks in advance
Just ask away 👍
Thanks @sonic moss . But I prefer to have Nginx, Gunicorn as part of my stack.
nginx my beloved
I tried it
It’s DSL was confusing
It kept throwing errors in my face
NGINX just works
NGINX is great
It’s always just done exactly what I needed it to
what do you guys recommend me to convert a pdf to text using python?
i guess checking this https://github.com/vinta/awesome-python
the thing u wish is basically quite complex one
as PDF can contain text
and can be image
if it is image=> then u need Computer Vision OCR like pytesseract
whole lot of shit id understand but soon I will
at this point can be simpler seeking third party service
than reinveinting your own solution
if the volumes are small enough for stuff u process and it can fit your usage case
i'm using pdftotext
but this error occur in the server: poppler/error: Failed to parse XRef entry [11].poppler/error: Top-level pages object is wrong type (null)
and my program stops without raising any exception
how can I prevent it to stop?
How are you calling it, with subprocess?
In any case, probably better to use either of these: https://www.reddit.com/r/learnpython/comments/1796l3g/pypdf_or_pymupdf/
with this pdf = pdftotext.PDF(content_bytes_io)
You could do a standard try/except if you don't want to try one of those other libraries instead
i think i cannot do a try/except because its not a python exception its a poppler exception
Sounds like this library is crap then
yes haha
and as im using a centos server upgrading poppler may be a pain in the ass
Either of the other two libraries I mentioned should work fine
They need More lines to achieve the same result than pdftotext.
with only this pdf = pdftotext.PDF(content_bytes_io)
I have all the content in string format
what could explain the load average on my server going through the roof when I'm not looking and stops when I connect to the server through ssh ?
Small price to pay for proper error handling 🤷
You need to monitor and find out what process it is: https://askubuntu.com/questions/1225073/how-can-i-see-what-process-spiked-cpu-usage-and-froze-the-system-a-few-seconds-a
I think I'm on something...
😢
perfctl
got p0wned most likely, idk what to do
I'm going to see what happen, thanks
Hi, i think this is where i should be asking. Trying to install pyaudio but getting this message
I have no experience with conda but try conda install anaconda::pyaudio
ah, seems like pyaudio isnt really up to date
https://pypi.org/project/PyAudio/#files shows they last built a binary wheel in November 2023, that's not that long ago.
Help pls
try again, but this time use py -3 -m pip install pyinstaller
microsoft store python doesnt add scripts to PATH, right? you probably have to run it using python3 -m PyInstaller ... instead
Hello guys I wanna make theorem prover language can some one help me in developing that ?
Sure, what's the hold up?
hello, this is my code : https://paste.pythondiscord.com/XVPQ can you help me to find new ideas and make it better and collab with me to make this popular ?
We don't do recruitment, including for collaboration on this server.
That said, if you have ideas you want to bounce or brainstorm, folks will be more than happy to chat
so still there is problem in my code I can't solve if this gonna be the input file : define a bool = false
define b bool = true
theorem th1_theorem = a
proof th1_theorem : not b
prove th1_theorem
theory th1 :: th1_theorem - end;
provet th1
structure s1 : and a b, a, b
theorem t2 = s1 = false
proof t2 : s1
prove t2 well this error I got from my code : Error: Proof step 's1' is not valid.
well, you got 5 different return in https://paste.pythondiscord.com/XVPQ#1L112-L112. Gotta figure out which one.
fyi, in general avoid having many return in your code. It makes the logic more difficult to follow
Much easier way to test your program for efficiency.
py -m profile -s time program_tester.py > "Efficiency Results.txt"
Not sure why others keep saying to use the timeit package.
Huh doesn't seem to want to print it all to file.
Oh, forgot to take care of my last input, nevermind.
does anyone know how to use multiple commands with git bisect properly on windows? like with sh -c
i tried:
git bisect run cmd /c "command_1 && command_2"
but this doesnt run the commands, it just starts another empty command prompt and sits there
also is there a way to test how git bisect run will run the command, i.e. just running one iteration then stopping?
petition for rust pylsp
I'm building my Django app in docker-compose but it needs the VPN network connection I have running on the host. How do I share this VPN connection to the docker-compose.yml file?
not sure this is the right channel to ask:
I'm wondering if there exists a documentation tool (like sphinx or docusaurus) that would allow hyperlinking the document with source files or even if possible, class/method declarations, and up to a pycharm plugin, those pages would be rendered in pycharm and I could click on hyperlink to rapidly go to parts of the code.
not sure the explanation is clear nor if someone made that kind of things already, but I'd be interested if ever one knows a bit
It should work natively. What VPN are you using?
Openfortivpn/ forticlient
Here's a shell script that might help. Run it on a crontab for @hourly and */10 * * * *
https://paste.pythondiscord.com/BDMQ
Are you on windows with docker via wsl2?
Don't forget to add this to /etc/wsl.conf
[network]
generateResolveConf = false
The package appears to not be named intuitively, what version do I use?
are you looking for https://pypi.org/project/django-cors-headers/ ?
that worked, however new problem? I am porting 8000 so how is the user disallowed?
did you try what the error suggests?
I am trying a lot of things one sec
got it!
Now I want my elastic IP to be set up with the server now that I can get it to work with the project
can elastic IP be used for domains that can be propogated? Is that even a thing?
new problem, I am trying to get two servers to run by using redus and daphne but I can not find the proper packages
why don't these work?:
redis-server
daphne -p 8001 thought_sync.asgi:application
Try using valkey instead.
for redis, you'd need a third party repo.
Though I believe the suggested approach is to use a managed server.
Does Kubernetes on Windows run on a Linux VM like how Docker on Windows runs on WSL?
Kubernetes on Linux runs natively by default with reusing linux kernel for efficient running. 0 VM usage.
for dev env people are commonly prefering using Kind today https://kind.sigs.k8s.io/ for quickly creatable and desstructable envs. it operates by running kubernetes in a docker container. 0 VM usage
if u will use Kubernetes in WSL2, it will run in same way pretty much for you, whatever u install, microk8s/k8s and etc. Except u will have overhead of WSL2 having running Linux, thus 1 VM usage.
if u will use Kubernetes through Desktop program created for Windows, then it will create ANOTHER VM in addition, where it is running (So at one point of time u can be having 2 VMs, WSL2 + Desktop VM). 2 VM usages.
So, to summarize, tools like Minikube included with the k8s toolset on Windows will create a Linux VM to run anyway, so I should use WSL2 instead of trying to run it natively on Windows?
Minikube at native linux creates kubernetes cluster through Docker containers. it does not create VMs at linux
erghh....
it has different running engines though according to documentation
Docker is default but using VMs is possible too
So yeah, if u will use Minikube at Windows outside of WSL2, it will potentially create VMs
and if u use inside WSL2, it will potentially just reuse current Linux kernel and run via docker containers
u could make things way simpler with just switching to development from Linux straightly 😁
0 VM usages. add zram, even more ram. Simple networking/volume(filesystem) situation since everything on same host.
Fully compatible with all devops tools natively.
i like using Kubuntu LTS versions. Comfortable GUI to former windows people. High community support and everything work related is easy to install
yeah, I'll use WSL2 entirely. I already know enough Linux commands. But, using a barebone Linux is still not preferable to me since not many games support linux.
u could run it at Dual Boot, for having ability switch back to windows.
And u can just choose game that support Linux playing.
Plenty of game in steam with support
Optionally windows only games can be played through wine in addition, but that requires some extra learning. Only now some person showed me how simple stuff to run through Lutris/Wine
Why can't my django connect to the database, my database is in my virtual machine, I can use other tools to connect but the startup project shows Error to connect to the local database
django==4.2 mysql==8.0.2
I could be off base here but it seems weird that the error message says "localhost" when your config is an IP. Are you certain that the config you have pictured is the one your app is actually reading?
"RuntimeError: Numpy is not available" i did pip install numpy still didnt fix
how does one use redis on AWS? The Django commands do not work as usual?
Did you install redis on your EC2?
yes, that does appear to be the issue
now I am trying to connect my cache
does endpoint has to be some number from the actual cache?
Are you following some specific guide like https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/GettingStarted.AuthorizeAccess.html ?
In any case, it's telling you reddis-cli isn't a valid command
Authorize an Amazon EC2 instance access to your cluster.
I am not following a guide, but thank you for letting me know
wait why in step 2 does it say something different?
I was also suspicious of this problem, so I started a new django project and still had the same problem that I had searched for in the documentation for a long time with no solution
whats a good python code visualizer beside python tutor
Thonny has a decent one, might be worth looking in to: https://thonny.org/
It's more of a beginner focused IDE/editor
But I love it
Has anyone played around with uv? Wasn't sure if anyone had any opinions on it yet. https://github.com/astral-sh/uv
I'm hoping to use uv with something like PDM. Does seem like they're working on it, at least. https://github.com/pdm-project/pdm/issues/2693
Is your feature/enhancement proposal related to a problem? Please describe. uv https://github.com/astral-sh/uv is extremely fast to install pip libs, it would be nice if pdm (install/sync) can opti...
I forgot that rye exists. Ignore me
An Experimental Package Management Solution for Python
how do I download modules, pip install channels did not work?
To me it looks like you installed channels successfully inside your venv, but when you call the daphne CLI, that's looking for it in your system installation.
Call daphne directly in your venv if you can. Otherwise you need to install channels in your primary system
daphne appears not to work. how do i install channels? python install channels? sudo install channels?
What OS? It looks like they have install scripts like this https://github.com/daphne-eu/daphne/blob/main/install-ubuntu-packages.sh
AL2023?
Which commands from the daphne packages do I use based on this information?
If you can't find an install script that works for AWS Linux then I'd point you back to my earlier suggestion ,(either call daphne from Python inside your venv, or pip install channels outside the venv)
I'm also personally inclined to just use docker instead, there's probably a working image
i have tried docker but decided not to go with it for various reasons
curious problem:
how is debug-toolbar already installed but it still is not downloaded in the venv?
Skill issue 😔
Did u copy local Venv to inside by some chance?
Venv is depended on the absolute path where it was created
If u move it to anywhere... It will break
Also usage of venv inside docker is in general pointless and not needed in 99.99% usage cases. Just install to global inside docker
Agree with the venv since it's an isolated thing already and normally runs one main software, 90% of cases maybe...
But i guess you normally still want to set user permissions @rapid sparrow ?
what stops u from setting user permissions without venv?
no i mean within dockerfile @rapid sparrow
Trying to set up automount on my Linux server, facing some issues, would like help on the fstab line item I wrote:
root@SakiUser:~# ls
Saki snap
//123.456.78.90/Saki /Saki cifs credentials=/root/.smbServer,uid=0 0 0
root@SakiUser:~# sudo mount -a
Couldn't chdir to /Saki: No such file or directory
have you done sudo mkdir /Saki yet? If not, try that
I dont want the name of the folder to have a backslash
yes
Got an error:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Alright
can someone please help me with develoyment for django-react web app(no database) on AWS.
AWS S3 for frontend code and AWS EC2 for backend code.
How would I verify this?
docker run --rm -it imagename bash for debian based docker images, then ls
docker run --rm -it imagename sh for alpine based images
docker compose run --rm service_name bash for compose (docker compose down ensure to run in advance, so u would not enter already existing ones)
docker exec -it container_id_or_name bash to enter already existing ones
.dockerignore file is useful for prevent copying not intended stuff
these are the docker commands, are you suggesting I download docker within AWS?
ah. You are doing it in baremetal way at ec2? I saw AWS... and did not even imagine to think you are deploying without docker 😅
certainly u should use docker https://www.amazon.com/Docker-Deep-Dive-Nigel-Poulton/dp/1916585256 for deploy to real prod (and for pet projects too) . but since u are struggling with baremetal way, may be a point to learn baremetal first.
installing docker is not necessary at AWS to use, i just raise instances that has already have docker installed. Ergh... we deploy at aws with ECS optimized ami images (with ECS means through terraform)
i would recommend learning docker and deploying as a start just with docker-compose i guess
i prefer to run my pet projects at Hetzner with terraform docker provider used for deployment (it helps me avoiding needing to write any linux commands, interacting with OS is pretty much abstracted away for me)
https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs
thanks but can we learn the AWS "baremetal way" first?
Sure. Do learn AWS baremetal way first then. that's... just a point to consider later
Also I want to connect this elastic ip to the server, is there anything I should change first?
🤷♂️ if it will work, then okay, if not, then u can be having issues like no public IP at server
and optionally your AWS Security group can be not permitting traffic to server from specified IP range and ports (kind of cloud level firewall)
there is an array of its own possible failures if u will have custom networking configured 😅
Since u are at AWS baremetal way, i will recommend you as soon as possible learning actually dealing with AWS through opentofu
https://www.oreilly.com/library/view/terraform-up-and/9781098116736/
AWS is too bloated to manage manually. Infrastructure as a code for the win to control it
I am of opinion simple baremetal without iac should be used in Hetzner or DigitalOcean, but not with AWS.
AWS requires IaC for sanity
ok I just want to know what is not completely insecure and also what I should make the private ip, I want it to say "ww..mywebsite.org" for example
u will need AWS Route53 or some other external service for DNS records then. 😉
and then u can be needing Certificates...
...using AWS certificates that it provides... or installing self hosted ones through letsencrypt
pairing it with elastic ip sure, good idea
I have bought a Domain using NameCheap, now which part do I add to the private ip address?
The private IP of the instance you want to expose
does this involve adding a redirect domain?
where do I add certificates, is that through NameCheap or AWS?
Let's Encrypt is probably the most common
do we care about shell versus not shell access? how do i start?
just create A record to your public IP if u wish at namecheap.
If u wish more complicated scenario, u need to redirect nameservers to AWS for its control and setting up then things in AWS route 53
we ❤️ letsencrypt
Probably the easiest way: https://certbot.eff.org/
Tagline
Debian or CentOS is probably close enough to Amazon Linux
Probably doesn't matter
Probably not. What web server are you using on your EC2?
AL2023?
That's your OS.
are one of these the web serers?
That's still your OS. Did you install Nginx or Apache, or how does your web app work?
the web app is Django REST api
You need to set up a web server. If you were using Docker you could try this: https://medium.com/@akshatgadodia/deploying-a-django-application-with-docker-nginx-and-certbot-eaf576463f19
Otherwise you'll need to set up something similar in a manual way
Deploying a Django application with Docker, Nginx, and Certbot is a robust and secure way to make your application available on the…
will this be set up in docker or deployed in the AWS terminal?
That's up to you. There's also Lightsail, maybe that's easier if you've never touched Docker before. https://ozantellioglu.medium.com/django-on-aws-lightsail-a8895821b8a
Here is my docker pseudo-code, where do I run it?
`
Dockerfile
Use an official Python runtime as a parent image
FROM python:3.11.4-slim-bullseye AS base
Set environment variables
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
Set the working directory in the container
WORKDIR /app
Install system dependencies
RUN apt-get update && apt-get install -y
gcc
default-libmysqlclient-dev
pkg-config
curl
Install Python dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
Remove unnecessary packages and clean up
RUN apt-get remove -y gcc pkg-config &&
rm -rf /var/lib/apt/lists/*
Copy the application code into the container
COPY . .
Expose port 8000
EXPOSE 8000
docker-compose.yml
version: '3'
services:
backend:
build: .
command: sh -c "python manage.py makemigrations && python manage.py migrate --noinput && python manage.py collectstatic --noinput && gunicorn --config gunicorn_config.py your_project.wsgi:application"
restart: always
expose:
- "8000"
volumes:
- ./:/app
- /var/www/static/:/var/www/static/
- /var/certbot/conf:/etc/letsencrypt/:ro
env_file:
- .env
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /var/www/static/:/var/www/static/
- ./nginx/conf.d/:/etc/nginx/conf.d/
depends_on:
- backend
certbot:
image: certbot/certbot
volumes:
- /var/certbot/conf:/etc/letsencrypt
- /var/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
depends_on:
- nginx
`
when you do things with docker you have at minimum two basic options for beginners level
- you just clone git repo to host.
docker compose buildbuild at host, anddocker compose up -dlaunch in background. Building at host option and running at same host right away - more advanced choice with docker,
docker buildyour image,docker pushto docker hub (or AWS docker registry) and then at host you only rundocker run/docker-compose upcommand. This choice has benefit of ability to rollback to previous version as docker registry saves them. and also running same app version a year later without rebuilding it. This option allows exact copy running at multiple servers easily.
thanks, lets do option 2, where can i find the notation in AWS to set this up?
@heavy knot you could try following these instructions on your existing EC2 starting from the "Apache HTTP Setup" section, but no promises it will tell you everything you need
- there is a choice in between. how to augment first choice: You can set env variable
DOCKER_HOST=ssh://root@darklab:22with ssh access to your host.
then docker compose build and up u will do at your dev machine, will be actually acomplished at target host 🙂
I use this approach with Terraform Docker provider for pet project somewhat. (plus saving to docker registry)
Docker is not a pip package. I would guess you need to install it with yum
u can create AMI image with already installed docker https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html (like this one)
It will be already installed there then. probably easiest choice
Amazon ECS provides Linux Amazon ECS-optimized AMIs that are preconfigured with the requirements and recommendations to run your container workloads.
https://docs.docker.com/engine/install/ optionally possible installing manually
you are supposed to have Dockerfile in your project folder with instruction how to build your project. then building happens like... docker build --tag test .
Thank you for the recommendations, could you order them in the order I should do them I what microtasks I should do to complete them?
-
get docker to your dev machine.
If linux then install as https://docs.docker.com/engine/install/
if windows, then install wsl2 and install docker with same instruction as above inside wsl2 linux -
create Dockerfile for your project, install gunicorn there to run your Django project?
docker build --tag test .it, and then try to rundocker run -it -p 8000:8000 test
if u will have correct Dockerfile, your project will be launchable locally and visible at 8000 port.
u need to have stuff like inside like
FROM python:3.10.5-slim-buster as base
# This flag is important to output python logs correctly in docker!
ENV PYTHONUNBUFFERED 1
# Flag to optimize container size a bit by removing runtime python cache
ENV PYTHONDONTWRITEBYTECODE 1
WORKDIR /code
COPY requirements.txt constraints.txt ./
RUN pip install -r requirements.txt -c constraints.txt
COPY src src
RUN gunicorn src.core.wsgi -b 0.0.0.0:8000 --workers 2
-
create account at docker hub for example https://hub.docker.com/
build image with corret name like account/repo_name, or usedocker tagto retag already existing one to the correct repo address
usedocker pushto push to it (after authorized) -
create AWS server with docker already preinstalled https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html (simple choice)
or install manually to some server https://docs.docker.com/engine/install/ -
just run
docker run -it -p 8000:8000 -d docker_hub_account/repo_name:tag_nameat machine, to run your web app in background
(optionally run it from dev machine by prefixing command withDOCKER_HOST=ssh://root@darklab:22 docker run -it -p 8000:8000 -d docker_hub_account/repo_name:tag_namelike this. it will run at target machine, ifdarklabis your host configuration in ~/.ssh/config for auth with rsa and etc androotusername of machine
(Optionally simplify step 2 and 5, by usingdocker-compose. it will make the commands shortened)
to just docker compose build and docker compose up (optionally with flag -d for sending running in background)
I assume the SSL certificate and domain propagating happens after this?
also my dev machine is AWS which is linux? or is it my local computer which is windows?
yeah
dev machine is PC from which you work, local computer. if it is windows then windows
install WSL2, then u will have linux sub system
allowing you to use in a sane way docker locally
and having development pretty much with mostly...full linux compatibility locally
there are alternative choices for windows users, but i don't like them to recommend
unpacking files is taking forever
you have done so much Darkwind The Dark Duck, if you need to bid farewell do so. But your potent friendship and education shall not be forgotten
😉 the first step with installing wsl2 can make your prepared by checking how stuff works locally without AWS too.
wsl2 is close enough to be almost fully fledged linux.
checking stuff working locally is always more simple than doing it at remote hosts after all
default wsl2 is ubuntu though, but default AWS Linux i think Rhel stuff
you would have easier time if your distros match at local and remote target
if using ubuntu locally, then makes sense using ubuntu at remote servers. to simplify repeatability
I know about half of this! I am not a novice lets go
thank frick it done
wait the docker will not open!
how do I screen shot task manager
I am trying to figure out why docker is not running properly, should I redownload?
we here
can i continue without signing in?
Yes. Click "Continue without signing in"
I linked u specifically docker engine
https://docs.docker.com/engine/install/
Don't use docker desktop
It is cursed and extra problems. Instead of working natively at Linux by grabbing kernel, and working at same host...
Desktop creates another VM and does god awful things
Desktop app was made for dummies without Linux
If u have wsl2 at least, u can avoid its usage
what am I missing, why does docker engine have the downloads for docker desktop? is there a separate docker engine download menu?
houstin we have a problem
should i type:
http://harmonyapp.org/
or
harmonyapp.org
yes
You didn't change the default port
change the bind port in the django launch command
Are you using gunicorn or uwsgi?
apache/mod_wsgi?
how do i check?
If you need to check, you're probably using the builtin server
no.
heck
How did you launch django?
no, what command did you run?
no, that installed django
what did you use to launch it?
run python manage.py check --deploy
That means your app is not ready to be deployed.
but it seems to work when i run the server no?
Do you understand why you're getting those warnings?
https://docs.docker.com/engine/install/ubuntu/ for example here
default WSL2 should be ubuntu
Docker Desktop is half paid product (+cursed in addition), that's why they put it first everywhere they can
Docker Engine is completely free on another hand ;]
Try podman desktop instead.
(requires podman engine)
It's written in electron https://github.com/containers/podman-desktop
and looks like vscode (that makes it cursed)
idk, the article has many reasons and idk which one, here are the list of possible problems:
`
-
security.W004: SECURE_HSTS_SECONDS
Set a value for theSECURE_HSTS_SECONDSsetting.
HTTP Strict Transport Security (HSTS) is a security feature that instructs browsers to only connect to your site over HTTPS. SettingSECURE_HSTS_SECONDSensures that this feature is enabled and specifies the duration (in seconds) for which browsers should enforce HTTPS after visiting your site once over HTTPS. -
security.W008: SECURE_SSL_REDIRECT
SECURE_SSL_REDIRECTsetting is not set toTrue. -
security.W009: SECRET_KEY
SECRET_KEYhas less than 50 characters or is prefixed with'django-insecure-'.
Generate a strong, randomSECRET_KEYand replace the default one in Django settings:
SECRET_KEY = 'your_generated_secret_key'
Ensure key is kept secret and not exposed in version control.
-
security.W012: SESSION_COOKIE_SECURE
SESSION_COOKIE_SECUREis not set toTrue.
This setting ensures that session cookies are only sent over HTTPS, protecting them from being intercepted by attackers. -
security.W016: CSRF_COOKIE_SECURE
django.middleware.csrf.CsrfViewMiddlewareinMIDDLEWARE, butCSRF_COOKIE_SECUREis not set toTrue.
CSRF (Cross-Site Request Forgery) attacks can be mitigated by ensuring that CSRF cookies are only sent over HTTPS. -
security.W018: DEBUG
DEBUGis set toTruein deployment.
DEBUGmode in Django should not be enabled in production as it can leak sensitive information and expose vulnerabilities.
`
this is all in your settings.py file
I know where that is
the heck are we changing in settings gamers?
so DEBUG should = false?
among other things?
yes
ideally you replace this file entirely in production.
don't commit your security key or database url
nothing changed?
increase the number to 64
still nothing
you need to copy the text it prints and use it as the secret key in settings.py
and don't share it.
clear the screen after you copy it
Hey everyone, Ive made the Code Quality Aromatherapy Assistant (CQAA), a tool that combines a code analysis and also with aromatherapy-inspired feedback based on your code. Could someone please test my tool and provide feedback? https://github.com/doudol/Code-Quality-Aromatherapy-Assistant Thank you so much for your help!
Don't ask to ask, just ask
dunno. Looks like some web server isn't responding, or isn't responding correctly. There are a lot of moving parts in between your conda create call, and that web server; you need to figure out which one(s) are at fault.
hey guys. i recently got a mesh router system right, however on top of that, i got a new pc upgrade, so ever since then, my docker has been crashing due to errors that never arose before these changes, does docker depend on a static local ip?
What errors? You'll need to investigate those
They spammed their post across several channels
They already got help in pygen
FYI
Hey anyone know how I can use Github Actions as trigger for firebase database. If anyone know please help me.
trigger to do what?
He said a little more over in #databases already but it's still not clear
why does it keep giving me a https error when I am using http?
Could be hsts or a permanent redirect
What does curl say?
interesting. I'd open the browser's developer tools, in order to see a list of all the requests; I'd expect to see a redirect to https:
or curl, ya
$ curl -I http://harmonyapp.org:8000/
HTTP/1.1 301 Moved Permanently
Date: Mon, 22 Jul 2024 17:40:34 GMT
Server: WSGIServer/0.2 CPython/3.9.16
Content-Type: text/html; charset=utf-8
Location: https://harmonyapp.org:8000/
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin
Vary: origin
It's a permanent redirect
It looks like you're running runserver in production though - you should use gunicorn or waitress instead
And use elastic load balancer for tls
perks up
I'm always looking for an easier way to do TLS. Is ELB easy? Yeah, I know: "Compared to what?"
If you're on AWS anyway, it is probably the way to go. If not, maybe not
Elsewhere this is what I've been doing mostly: https://paregov.net/nginx-proxy-manager-and-lets-encrypt-certificates/
In my previous for Nginx and Nginx Proxy Manager (NPM), I wrote on how to install NPM, but didn't configure any certificates. Out of the box Nginx Proxy Manager supports Let's Encrypt SSL auto creation and renewal. There is one limitation - you can create certificates only for specific domains/subdomains directly. If you want to
i ran pip install gunicorn and pip install app, what packages might i be missing?
Why did you run pip install app?
it gave me this error:
ModuleNotFoundError: No module named 'app'
That's no reason to pip install app
what would the alternative be if it has all these 'app' problems?
I'm looking for some help with release management/versioning in git/github. I recently came across a discussion of it in a book, but can't find the reading again now that I actually need to put it to use. If anyone can recommend some references I'd much appreciate it.
My specific situation is that I'm working in a student team and there's a lot of variation in experience and conventions. Much of the files have orphaned code, large blocks commented out but saved for someone's reference, comments that don't apply to current functionality, etc.
I'm trying to introduce the idea of official releases so that we can have, among other things, a designated clean-up phase in our development cycle (because we sure don't use our linter.)
Thank you. This does help, as github kind of bewilders me. I didn't express it well initially, but I'm also looking for more abstract discussion if any comes to mind.
Perhaps that part of the matter would be better suited to the architecture channel?
Hello, do you know any docker service that can be called through API calls and make openoffice or msoffice tasks (e.g. convert from pdf to html, doc's or docx's to pdfs...)?
Thanks
I see a few pandoc APIs you could look into, but I haven't tried them
thanks im gonna give it a try
I keep on getting this error but i set up my security groups correctly, what do i try next?
[23/Jul/2024 13:35:09] code 400, message Bad request version ('\x02h2\x08http/1.1Di\x00\x05\x00\x03\x02h2\x00-\x00\x02\x01\x01\x00\x17\x00\x00\x00\x12\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x003\x04ï\x04í') [23/Jul/2024 13:35:09] You're accessing the development server over HTTPS, but it only supports HTTP. ^C(thought_sync_django-channels) [ec2-user@ip-172-31-19-47 thought_sync_django-channels]$
has nothing to do with security groups -- your request is getting through to your instance
You're accessing the development server over HTTPS, but it only supports HTTP. is the money quote
have you tried this? #tools-and-devops message
if you're running a reverse proxy, I'd carefully check how it's configured. Perhaps it's somehow proxying the request without decrypting it, although I can't imagine how that could be
what are the browser's developers tools? this?
yep
if you click "network" you can see the requests and resposnes.
where am i looking?
I suspect they'll be normal -- i.e., not https -- but who knows
those look fine -- they got 200 responses
if you clidk on one of the names, I think it will expand and show you
and it got a 200, so that part is working ...
is 204 bad?
probably not
this is 204
wait so maybe that is what we have to redirect?
no idea honestly
again, take a look at your reverse proxy config -- and its logs, too
where are those? also maybe this is a clue, there is no http?
"reverse proxy" is a web server that sits between the public internet, and your "real" web server (django/gunicorn, flask, whatever). It's there to do the TLS magic, and perhaps protect your real web server from DOS attacks
it's often nginx, but I hear some people use apache, and some use traefik
do i have to add it or does it already exist somewhere?
you already have it, or its equivalent.
since clearly you're doing SSL mostly right.
maybe you're using some Amazon service like ELB; who knows
so if i want to test which system i am using (lets say apache)
what do i add to this to make the command to modify the configurations?
/etc/apache2/apache2.conf
sorry, I didn't understand that at all
you're saying you don't know how your web site is handling TLS?
if that's the case, then poke around very carefully in your AWS console
unfortunately AWS' UI is terrible, and their docs are bad too
yes, i think it is ec2 or ubuntu but idk
Hello. We have a set of programs, each one relying on their own virtual environments (when finished, that is). Is there a way to specify that environment each time each program runs, in the program itself? Or does that need to be added to a script to start the program?
Your words have meaning separately, but i failed to comrehend them when u joined them together
could u explain somehow... on code/script/file examples what is happening for you
This is basically a continuation of my previous issue you helped me with. We ended up selecting Poetry to create our projects, and each project has it's own virtual environment. The projects will run when a user selects an appropriate item from a menu program (text UI). Currently, programs start by the menu, which is written in COBOL (for now), matches the command with a line in a script to start the python program.
What I want to figure out ahead of time, for every use that selects a menu item, do I need to specify a programs's specific virtual environment in the starting script? Or is there a way to specify it in program.
I'm not very good at putting things into words, so I apologize ahead of time.
python programs can be invoked in several ways
python3 path_to_script.py# you invoke with whatever global default pythonpython3.10 path_to_script.py# with specific python version
.venv/bin/python3 path_to_script.py# you invoke your program with venv environment located at relative .venv address. you can specify absolute address if u wishsource .venv/bin/activateand thenpython3 path_to_script.py# covinient hack for dev comfort. that makes .venv/bin/python3 environment automatically activated and invoking all scripts with it- probably there are poetry specific commands to run script with its current env
I'll look into these, and see if poetry has something like that.
Thanks.
I didn't know if you could set the environment and start the program in the same line.
can you access through http?
exploring the tcp ports may hint what's running.
ss -lt | grep apache
-l: listening
-t: tcp
no
nothing seems to happen?
poetry features are mostly intended for development environment and for deployment to linux servers 🤔
other options i mentioned are mostly intended for dev users (easy modifying capabilities are preserved) or for deployment to linux servers too
if u aim to deploy as desktop application, u can wrap python app with pyinstaller or its alternatives
Do you have an http(s) server listening on a port at all ?
You can also check ss -lt and see whether something interesting shows up
you can also check access from within i.e wget 127.0.0.1 (or a similar command) if there is a listener
new error? I have never seen this before. this is different than can not connect?
what are we looking for chief?
my app looks different when i run it locally, how do fix this?
Yes, that suggests connectivity but a problem with your app or request
we got the website working but weird up top with these settings = to false but can not connect with them equal to true, thoughts?
i am trying to fix it with nginx, why is sudo yum install make not working?
SECURE_SSL_REDIRECT redirects your incoming traffic to use the HTTPS protocol. The clients expects your server to present a certificate which can be used to encrypt the connection, but it doesn't look like your server presents a certificate.
We are deploying to a central Linux server. Each user uses PuTTY to access the menu, and then selects menu options that will run the programs. The menu options activate a script that activates the appropriate program. My concern is this, though. Can a single server handle multiple different virtual environments at the same time?
Can a single server handle Multiprocessing? Yes. For you invoking scripts is the same as multi processing. Same limitations apply onto hardware resources.
Beware that virtual environments aren't allowed to be moved in terms of "Absolute Path" from where they were created. Otherwise they will break.
Since u use Linux server, could be smart idea to use Docker containers then. They pack scripts/apps to a better than level than venvs.
If script has system level dependency (some apt library or smth), docker is able to pack this dependency inside its artifact too
on another hand..
...using venvs i think will have easier for you development environment. Easier to modify different venvs and run stuff again
so keep venvs 😉
For dev, yes. The only reason for the virtual environments for production is that we have some very specific dependencies for a few very specific programs. But that limits us to Python 3.9.
Otherwise I'd just use a production environment.
u mentioned before it is all run by COBOL? 🤯 that is shocking tbh.
i thought it not run anywhere but at US banking
It's in transition. Currently, the majority of programs, and the main menu system are written in COBOL. But we are slowly transitioning to Python.
I think it's because when the programs were first being built, they were being built for the accounting department.
We make cardboard boxes.
I'm not sure why python, honestly, but job security 😂
it is common to go for Java last 20 years for accounting 😅
what is a simple way to set up a certificate?